This project uses the available code from Matlab for the UAV Package Delivery. We inserted a new block, 'Monitoring,' in the Simulink file UAV package delivery (cf. Fig. 1, violet block) to simulate the measurement of CO2 emissions while the drone is flying.
Figure 1: Simulink project scheme, where the monitoring block is in violet color.
The Simulink file directly opens by double-clicking on the file 'uavPackageDelivery.prj'. When running the Simulink project, it will display in plots the drone trajectory as depicted in Fig. 2 and the distance to the source of CO2 emission with time as shown in Fig.3.
Figure 2: Drone path trayectory.
Figure 3: Measured CO2 concentration level and distance to the source.
The 'Monitoring' block in Fig. 1 evaluates the concentration level using Fick's 2nd Law. Its evaluation requires the current drone location, CO2 source location, the total of released molecules, and the diffusion coefficient of CO2 molecules. The CO2 source location is set to zero in this example, but it is editable in the corresponding blocks in the CO2_source block. This value is accessible when double-clicking in the block Fick's 2nd Law in the Simulink project.
The drone flights according to circular trajectory as depicted in Fig. 2. This is selected in the Simulink project following the blocks Ground Control Station -> Get Flight Mission -> noQGC. Other trajectories can be determined from this block.
The project operates with the parameters defined in the 'init_fcn.m' file (located in the folder work), where
- The stop time is set to 300 seconds.
- The CO2 diffusion is set to 10^(-3) to speed up the simulator (the correct value is 1.48 *10^-5; when the Temperetarue is 8.9 celsius with air-CO2).
- The total molecules are set to 200, as illustrated in [1, Fig. 4] for industrial parks.
Outputs of this project are related to plots displaying the drone path (cf. Fig. 2) and the total of sensed CO2 molecules (cf. Fig. 3). Fig. 3 is produced by the 'stop_fcn.mlx' file located in the work folder.
 Kuo–Ying Wang, Jia–Lin Wang, Wen–Tzu Liu, "Ambient carbon dioxide concentrations in industrial park areas: A monitoring and modeling study," Atmospheric Pollution Research, Volume 5, Issue 2, 2014, Pages 179-188, ISSN 1309-1042, https://doi.org/10.5094/APR.2014.022