Matrices HELP for Air Pollution Modelling!!!

8 views (last 30 days)
Tom Beasley
Tom Beasley on 23 Mar 2015
Commented: Tom Beasley on 15 Apr 2015
Hi,
I am trying to build a model for air pollution. Not that it matters much but if you are interested I am using the Gaussian plume model with reflection on the ground which calculates the concentration level of a pollutant at a given x,y coordinate.
I have 3 stacks (chimneys) located in different locations on an industrial site and I want to plot a contour graph that will give a value for a concentration level at any point.
To give you a better idea of what it looks have a look at the attached image.
I believe that I will need to create three matrices which are the same size as the length of the x and y axes, but my problem is, i need the origin of each matrix to start at different points. They will each need to start calculating the concentration levels at each stacks geographical location point.
Could someone help with how I would do this.
In simple terms, is there a way you can create a matrix of values where the surrounding points of the starting point of calculation are found by their geographical location in relation to the respective starting point?

Answers (1)

dpb
dpb on 23 Mar 2015
It is simply a superposition of the three with an origin translation. IOW, just create a grid for the full site and create a plume from a zero origin. Then scale by the amplitude and translate to each stack location. One simple way conceptually would be three planes hold each plume and then sum them at the expense of memory. The other is to use the translated coordinates for each and build the components in place.
  1 Comment
Tom Beasley
Tom Beasley on 15 Apr 2015
Hi,
Thanks for your answer.
Would you be able to go into more detail about how I translate to each stack location?
My current matlab status plots a contour plot from the origin for each stack (each stack has different emission rates etc so the values of concentration are not the same).
I need to translate the stacks to start calculating values from their correct x,y co-ordinate and sum all three stacks and plot one contour plot that gives the concentration levels contributed by each stack at any given x,y point.
Not sure if it will help but I have posted my code. I would be hugely grateful if you could help a friend in need!
function [ output_args ] = Gaussianplume(U,z,S) %Gaussianplume Calculates and plots contours of concentration levels %at given a specified wind speed, height above ground and Stability. %Plots each stability and relevant locations of nearby schools, farms and %hospitals. %Q = emission rate g/s %U = wind speed m/s %H = height of release, m %y = crossswind distance, m %z = height above ground, m % Detailed explanation goes here [x,y]=meshgrid(0:1:3000,-300:1:500);
%Chooses Q and H for Stack A i.e. S=1 if(S<2 && S>0) Q=79; H=12; else false; end
%Chooses Q and H for Stack B i.e. S=2 if(S<3 && S>1) Q=207; H=66; else false; end
%Chooses Q and H for Stack C i.e. S=3 if(S<4 && S>2) Q=84; H=29; else false; end
%Chooses Q and H for Proposed Stack i.e. S=4 if(S<5 && S>3) Q=90; H=35; else false; end
%Calculates concentration levels for Stability A for chosen parameters sigmayA=(0.22.*x).*(1+(0.0001.*x)).^-0.5; sigmazA=0.2.*x; CA=(Q./(2.*pi.*U.*sigmayA.*sigmazA)).*(exp((-y.^2)./(2.*(sigmayA.^2)))).*((exp(-((z-H).^2)./(2.*(sigmazA.^2))))+(exp(-((z+H).^2)./(2.*(sigmazA.^2)))));
%Calculates concentration levels for Stability B for chosen parameters sigmayB=(0.16.*x).*(1+(0.0001.*x)).^-0.5; sigmazB=0.12.*x; CB=(Q./(2.*pi.*U.*sigmayB.*sigmazB)).*(exp((-y.^2)./(2.*(sigmayB.^2)))).*((exp(-((z-H).^2)./(2.*(sigmazB.^2))))+(exp(-((z+H).^2)./(2.*(sigmazB.^2)))));
%Calculates concentration levels for Stability C for chosen parameters sigmayC=(0.11.*x).*(1+(0.0001.*x)).^-0.5; sigmazC=(0.08.*x).*(1+(0.0002.*x)).^-0.5; CC=(Q./(2.*pi.*U.*sigmayC.*sigmazC)).*(exp((-y.^2)./(2.*(sigmayC.^2)))).*((exp(-((z-H).^2)./(2.*(sigmazC.^2))))+(exp(-((z+H).^2)./(2.*(sigmazC.^2)))));
%Calculates concentration levels for Stability D for chosen parameters sigmayD=(0.08.*x).*(1+(0.0001.*x)).^-0.5; sigmazD=(0.06.*x).*(1+(0.0015.*x)).^-0.5; CD=(Q./(2.*pi.*U.*sigmayD.*sigmazD)).*(exp((-y.^2)./(2.*(sigmayD.^2)))).*((exp(-((z-H).^2)./(2.*(sigmazD.^2))))+(exp(-((z+H).^2)./(2.*(sigmazD.^2)))));
%Calculates concentration levels for Stability E for chosen parameters sigmayE=(0.06.*x).*(1+(0.0001.*x)).^-0.5; sigmazE=(0.03.*x).*(1+(0.0003.*x)).^-1; CE=(Q./(2.*pi.*U.*sigmayE.*sigmazE)).*(exp((-y.^2)./(2.*(sigmayE.^2)))).*((exp(-((z-H).^2)./(2.*(sigmazE.^2))))+(exp(-((z+H).^2)./(2.*(sigmazE.^2)))));
%Calculates concentration levels for Stability F for chosen parameters sigmayF=(0.04.*x).*(1+(0.0001.*x)).^-0.5; sigmazF=(0.016.*x).*(1+(0.0003.*x)).^-1; CF=(Q./(2.*pi.*U.*sigmayF.*sigmazF)).*(exp((-y.^2)./(2.*(sigmayF.^2)))).*((exp(-((z-H).^2)./(2.*(sigmazF.^2))))+(exp(-((z+H).^2)./(2.*(sigmazF.^2)))));
%Plots contour for Stability A of specified Stack contourf(x,y,CA) colorbar
hold on;
%Plots relevant positons of Farm1, School, Hospital, Farm2 respectively %dependant upon specified Stack
%Plots locations of Farm1,School,Hospital,Farm2 respectively %for Stack A i.e. S=1 if(S<2 && S>0) plot(396,108,'ro'); plot(944,211,'yo'); plot(834,-25,'mo'); plot(1435,259,'co'); else false; end %Plots locations of Farm1,School,Hospital,Farm2 respectively %for Stack B i.e. S=2 if(S<3 && S>1) plot(467,-100,'ro'); plot(1015,3,'yo'); plot(905,-233,'mo'); plot(1506,51,'co'); else false; end
%Plots locations of Farm1,School,Hospital,Farm2 respectively %for Stack C i.e. S=3 if(S<4 && S>2) plot(487,-28,'ro'); plot(1035,75,'yo'); plot(925,-161,'mo'); plot(1526,123,'co'); else false; end
%Plots locations of Farm1,School,Hospital,Farm2 respectively %for Proposed Stack i.e. S=4 if(S<5 && S>3) plot(416,-31,'ro'); plot(964,72,'yo'); plot(854,-164,'mo'); plot(1455,120,'co'); else false; end
%Adds title and axis labels to plot title('Stability A') xlabel('Downwind Distance (m)') ylabel('Crosswind Distance (m)')
hold off;
%Plots contour for Stability B of specified Stack figure contourf(x,y,CB) colorbar
hold on;
%Plots relevant positons of Farm1, School, Hospital, Farm2 respectively %dependant upon specified Stack
%Plots locations of Farm1,School,Hospital,Farm2 respectively %for Stack A i.e. S=1 if(S<2 && S>0) plot(396,108,'ro'); plot(944,211,'yo'); plot(834,-25,'mo'); plot(1435,259,'co'); else false; end %Plots locations of Farm1,School,Hospital,Farm2 respectively %for Stack B i.e. S=2 if(S<3 && S>1) plot(467,-100,'ro'); plot(1015,3,'yo'); plot(905,-233,'mo'); plot(1506,51,'co'); else false; end
%Plots locations of Farm1,School,Hospital,Farm2 respectively %for Stack C i.e. S=3 if(S<4 && S>2) plot(487,-28,'ro'); plot(1035,75,'yo'); plot(925,-161,'mo'); plot(1526,123,'co'); else false; end
%Plots locations of Farm1,School,Hospital,Farm2 respectively %for Proposed Stack i.e. S=4 if(S<5 && S>3) plot(416,-31,'ro'); plot(964,72,'yo'); plot(854,-164,'mo'); plot(1455,120,'co'); else false; end
%Adds title and axis labels to plot title('Stability B') xlabel('Downwind Distance (m)') ylabel('Crosswind Distance (m)')
hold off;
%Plots contour for Stability C of specified Stack figure contourf(x,y,CC) colorbar
hold on;
%Plots relevant positons of Farm1, School, Hospital, Farm2 respectively %dependant upon specified Stack
%Plots locations of Farm1,School,Hospital,Farm2 respectively %for Stack A i.e. S=1 if(S<2 && S>0) plot(396,108,'ro'); plot(944,211,'yo'); plot(834,-25,'mo'); plot(1435,259,'co'); else false; end %Plots locations of Farm1,School,Hospital,Farm2 respectively %for Stack B i.e. S=2 if(S<3 && S>1) plot(467,-100,'ro'); plot(1015,3,'yo'); plot(905,-233,'mo'); plot(1506,51,'co'); else false; end
%Plots locations of Farm1,School,Hospital,Farm2 respectively %for Stack C i.e. S=3 if(S<4 && S>2) plot(487,-28,'ro'); plot(1035,75,'yo'); plot(925,-161,'mo'); plot(1526,123,'co'); else false; end
%Plots locations of Farm1,School,Hospital,Farm2 respectively %for Proposed Stack i.e. S=4 if(S<5 && S>3) plot(416,-31,'ro'); plot(964,72,'yo'); plot(854,-164,'mo'); plot(1455,120,'co'); else false; end
%Adds title and axis labels to plot title('Stability C') xlabel('Downwind Distance (m)') ylabel('Crosswind Distance (m)')
hold off;
%Plots contour for Stability D of specified Stack figure contourf(x,y,CD) colorbar
hold on;
%Plots relevant positons of Farm1, School, Hospital, Farm2 respectively %dependant upon specified Stack
%Plots locations of Farm1,School,Hospital,Farm2 respectively %for Stack A i.e. S=1 if(S<2 && S>0) plot(396,108,'ro'); plot(944,211,'yo'); plot(834,-25,'mo'); plot(1435,259,'co'); else false; end %Plots locations of Farm1,School,Hospital,Farm2 respectively %for Stack B i.e. S=2 if(S<3 && S>1) plot(467,-100,'ro'); plot(1015,3,'yo'); plot(905,-233,'mo'); plot(1506,51,'co'); else false; end
%Plots locations of Farm1,School,Hospital,Farm2 respectively %for Stack C i.e. S=3 if(S<4 && S>2) plot(487,-28,'ro'); plot(1035,75,'yo'); plot(925,-161,'mo'); plot(1526,123,'co'); else false; end
%Plots locations of Farm1,School,Hospital,Farm2 respectively %for Proposed Stack i.e. S=4 if(S<5 && S>3) plot(416,-31,'ro'); plot(964,72,'yo'); plot(854,-164,'mo'); plot(1455,120,'co'); else false; end
%Adds title and axis labels to plot title('Stability D') xlabel('Downwind Distance (m)') ylabel('Crosswind Distance (m)')
hold off;
%Plots contour for Stability E of specified Stack figure contourf(x,y,CE) colorbar
hold on;
%Plots relevant positons of Farm1, School, Hospital, Farm2 respectively %dependant upon specified Stack
%Plots locations of Farm1,School,Hospital,Farm2 respectively %for Stack A i.e. S=1 if(S<2 && S>0) plot(396,108,'ro'); plot(944,211,'yo'); plot(834,-25,'mo'); plot(1435,259,'co'); else false; end %Plots locations of Farm1,School,Hospital,Farm2 respectively %for Stack B i.e. S=2 if(S<3 && S>1) plot(467,-100,'ro'); plot(1015,3,'yo'); plot(905,-233,'mo'); plot(1506,51,'co'); else false; end
%Plots locations of Farm1,School,Hospital,Farm2 respectively %for Stack C i.e. S=3 if(S<4 && S>2) plot(487,-28,'ro'); plot(1035,75,'yo'); plot(925,-161,'mo'); plot(1526,123,'co'); else false; end
%Plots locations of Farm1,School,Hospital,Farm2 respectively %for Proposed Stack i.e. S=4 if(S<5 && S>3) plot(416,-31,'ro'); plot(964,72,'yo'); plot(854,-164,'mo'); plot(1455,120,'co'); else false; end
%Adds title and axis labels to plot title('Stability E') xlabel('Downwind Distance (m)') ylabel('Crosswind Distance (m)')
hold off;
%Plots contour for Stability F of specified Stack figure contourf(x,y,CF) colorbar
hold on;
%Plots relevant positons of Farm1, School, Hospital, Farm2 respectively %dependant upon specified Stack
%Plots locations of Farm1,School,Hospital,Farm2 respectively %for Stack A i.e. S=1 if(S<2 && S>0) plot(396,108,'ro'); plot(944,211,'yo'); plot(834,-25,'mo'); plot(1435,259,'co'); else false; end %Plots locations of Farm1,School,Hospital,Farm2 respectively %for Stack B i.e. S=2 if(S<3 && S>1) plot(467,-100,'ro'); plot(1015,3,'yo'); plot(905,-233,'mo'); plot(1506,51,'co'); else false; end
%Plots locations of Farm1,School,Hospital,Farm2 respectively %for Stack C i.e. S=3 if(S<4 && S>2) plot(487,-28,'ro'); plot(1035,75,'yo'); plot(925,-161,'mo'); plot(1526,123,'co'); else false; end
%Plots locations of Farm1,School,Hospital,Farm2 respectively %for Proposed Stack i.e. S=4 if(S<5 && S>3) plot(416,-31,'ro'); plot(964,72,'yo'); plot(854,-164,'mo'); plot(1455,120,'co'); else false; end
%Adds title and axis labels to plot title('Stability F') xlabel('Downwind Distance (m)') ylabel('Crosswind Distance (m)')
hold off;
end
Help please??

Sign in to comment.

Categories

Find more on Geographic Plots in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!