Solving equation to model air pollution from traffic over time

12 views (last 30 days)
Im trying to write some code to solve the below equation over a grid over time, where im only interested in the diffuse and decay terms.
The context is i have a stretch of road which i will model into a grid, there will be a car at some point in the grid releasing a fixed amount of pollution. The position of the car will be updated across the grid over time and i want to be able to calculate the concentration of pollution across the grid over time. (eventually ill be adding terms for wind etc but want to keep it simple for now)
Im unsure how exactly to construct the equations so any help would be appreciated.
  2 Comments
Ross Thompson
Ross Thompson on 8 Feb 2022
%% Grid properties
xmin = 0; xmax = 10; % x-axis interval
ymin = 0; ymax = 50;
dt = 0.02;% y-axis interval
%% Constants
diff_const = 1; %Diffusion constant
decay_const = 1; %Decay constant
car_emission = 0.5;
number_of_cars = 1;
car_loction = ......% starting coordinates of car
%% Equations
diffusion =
decay =
pollution_release = number_of_vehicles*release_const + Q %constant added to the pollutant concentration for each time step at the positions where there are cars
wind = %transports pollution in one direction
Q(t+dt) = Q + pollution_release + diffusion - decay;
[x,y] = meshgrid (linspace(xmin,xmax,1),linspace(ymin,ymax,1));
end
Ross Thompson
Ross Thompson on 8 Feb 2022
Here is what i have got so far, just a bit unsure how to write out the diffusion and decay terms and then how to solve over time and space.

Sign in to comment.

Answers (1)

Benjamin Thompson
Benjamin Thompson on 8 Feb 2022
That is a partial differential equation, so you could look at the pdeval function or the Partial Differential Equations Toolbox to see what capabilities are offered to solve your problem. Try something then ask specific questions about problems you run into.
  3 Comments
Ross Thompson
Ross Thompson on 8 Feb 2022
Could you please give me and example for how the diffusion term could be written?
Benjamin Thompson
Benjamin Thompson on 8 Feb 2022
I have little experience with PDEs, but if you post the whole equation and then maybe review the examples with the PDE Toolbox and try something out yourself, then the Community will have more information to offer help.

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!