contour plot of stream function for a tornado

29 ビュー (過去 30 日間)
Randy Chen
Randy Chen 2020 年 10 月 28 日
編集済み: Alan Stevens 2020 年 10 月 29 日
I have a stream function for a tornado and I watned to plot it using contour function, but it's not working:
m1=-3000;
m2 = 5800;%strength
[r,theta] = meshgrid(-20:1:20,0:0.1:2*pi);
psi = (m1/(2*pi))*theta + (m2/(2*pi))*log(r);
contour(r,theta,psi);
How should I fix it so the plot looks something like this:
I also want to plot a circle in the middle with radius r = a constant value

採用された回答

Alan Stevens
Alan Stevens 2020 年 10 月 28 日
More like this?
m1=-3000;
m2 = 5800;%strength
R = 0:0.1:20;
THETA = linspace(0,2*pi,numel(R));
[r,theta] = meshgrid(R,THETA);
psi = m1/(2*pi)*theta + (m2/(2*pi))*log(r);
contour(r.*cos(theta),r.*sin(theta),psi,20,'b--');
  2 件のコメント
Randy Chen
Randy Chen 2020 年 10 月 28 日
yes that's great!
by the way how should I add a circle with a constant radius? should I still use contour? i'm not sure how to do that
Alan Stevens
Alan Stevens 2020 年 10 月 28 日
編集済み: Alan Stevens 2020 年 10 月 29 日
Like so
m1=-3000;
m2 = 5800;%strength
R = 0:0.1:20;
THETA = linspace(0,2*pi,numel(R));
[r,theta] = meshgrid(R,THETA);
psi = m1/(2*pi)*theta + (m2/(2*pi))*log(r);
contour(r.*cos(theta),r.*sin(theta),psi,20,'b--');
hold on
rc = 10;
plot(rc*cos(THETA), rc*sin(THETA),'k')
axis equal

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeContour Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by