How to 2D plot using the equation of fi and zi?

2 ビュー (過去 30 日間)
Myo Gyi
Myo Gyi 2019 年 9 月 5 日
コメント済み: darova 2019 年 9 月 5 日
fig1.jpg
fig.jpg
  3 件のコメント
Myo Gyi
Myo Gyi 2019 年 9 月 5 日
Somebody help me please.
Myo Gyi
Myo Gyi 2019 年 9 月 5 日
n = 2;
A = 1;
r=linspace(-1,1,21);
theta = 45;
phi = A.*r^n*(cos(n*theta));
psi = A.*r^n*(sin(n*theta));
plot (phi,psi)
grid on

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

採用された回答

Bruno Luong
Bruno Luong 2019 年 9 月 5 日
編集済み: Bruno Luong 2019 年 9 月 5 日
The wikipedia page plots only the polar sector 2*pi/(2*n) of the stream lines / potential
The second plot is the full picture.
n = 3/2;
A = 1;
x=linspace(-1,1,21);
y=linspace(-1,1,21);
[X,Y]=ndgrid(x,y);
Z=X+1i*Y;
W = A*Z.^n;
phi = real(W);
psi = imag(W);
close all
subplot(2,1,1);
hold on
plot(phi,psi,'b');
plot(phi.',psi.','g');
axis equal
subplot(2,1,2);
hold on
contour(x,y,phi.',20,'b');
contour(x,y,psi.',20,'g');
axis equal
toto.png
  2 件のコメント
Myo Gyi
Myo Gyi 2019 年 9 月 5 日
Thank you very much sir...
If I don`t want to use complex potential, how can I do it sir..
Just only the value of phi and psi
darova
darova 2019 年 9 月 5 日
Use polar system of coordinates then:
n = -1.5;
A = 1;
r = linspace(0,2,30);
th = linspace(0,2*pi,100);
[R, TH] = meshgrid(r,th);
fi = A*R.^n.*cos(n*TH);
zi = A*R.^n.*sin(n*TH);
[X,Y] = pol2cart(TH,R);
contour(X,Y,fi,'g')
hold on
contour(X,Y,zi,'b')
hold off

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSpecial Functions についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by