Calculating the circulation given specific parameters

I am trying to calculate the circulation using the following code. Although the code works, the calculated data doesn't make sense as I get a linear plot. I would also like to create a image plot, if possible. Any help would be greatful!
close all;
clear all;
clc;
h = 200; % height of stack in meters
z = (0:10); % average wind in the vertical
mr = 2.5; % mean mixing ratio
sigmaz = z*mr; %vertical mixing
dt = (24:72)*60*60; %change in time
for i = 1:length(z)
for j = 1:length(dt)
c = exp(-(z+h).^2.)/((2*sigmaz.^2))./dt;
end
end
plot((1:numel(dt)),(1:numel(c)))

4 件のコメント

Torsten
Torsten 2023 年 11 月 14 日
編集済み: Torsten 2023 年 11 月 14 日
What's the definition of "circulation" in this context ?
And your plot command
plot((1:numel(dt)),(1:numel(c)))
means that you plot (1:49) against (1:49) without using the values calculated for c. This doesn't make sense.
madhan ravi
madhan ravi 2023 年 11 月 14 日
are you sure of the c formula? exp(- larger number) is closer to zero
Jonathon Klepatzki
Jonathon Klepatzki 2023 年 11 月 15 日
You were correct, I made an error.
However, perhaps you can help me. I changed the equation to include either:
C = (2./pi).^1/2.*(Q./sigmaz.*meanu.*W.*dt) or C = Q./meanu.*h.*W.*sigmaz.*dt
and the surf plot provided by Matt J doesn't work. Any ideas?
Jonathon Klepatzki
Jonathon Klepatzki 2023 年 11 月 15 日
Never mind, I figured out what I did wrong.

サインインしてコメントする。

 採用された回答

Matt J
Matt J 2023 年 11 月 14 日
編集済み: Matt J 2023 年 11 月 14 日

1 投票

Perhaps this is what you meant. The expression for c looks like it's supposed to be Gaussian, and the double for-loop suggests this is supposed to be a surface plot.
h = 200; % height of stack in meters
z = (0:10); % average wind in the vertical
mr = 2.5; % mean mixing ratio
sigmaz = z*mr; %vertical mixing
dt = (24:72)'*60*60; %change in time
c = exp( -0.5 * ( (z+h)./sigmaz).^2 )./dt;
surf(z,dt,c)

3 件のコメント

madhan ravi
madhan ravi 2023 年 11 月 14 日
+1 like always, awesome interpration and like the way you used vector expansion without the use of meshgrid()
Jonathon Klepatzki
Jonathon Klepatzki 2023 年 11 月 14 日
編集済み: Jonathon Klepatzki 2023 年 11 月 14 日
@Matt J it is indeed Gaussian. I narrowed down the equation that spoke of dispersion to only account for the upper-levels insteand of the surface. This is an attempt for me to conduct a study of aerosols in the upper-levels at a given depth in the arctic (Master's degree) when significant snow fall events are taking place.
I like your plots btw! And thank you.
Jonathon Klepatzki
Jonathon Klepatzki 2023 年 11 月 15 日
@Matt J, quick question. I had to change the equation to include the full dispersion (mathematicl error) and noticed that when I changed the variable "mr" to either 1 or 3, it gives me a linear plot once again. Could this be an issue with the dimensions?

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

製品

リリース

R2023a

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by