フィルターのクリア

If anyone can do it please help me in this regard

1 回表示 (過去 30 日間)
Muhammad Adeel Ahsan Awan
Muhammad Adeel Ahsan Awan 2018 年 12 月 3 日
Stream function is given by:
With the help of MATLAB, plot the streamlines for the following parameters:
  1. V = 1 m/s
  2. a= 0.1 m
  3. Ψ = -0.16 to 0.16 (with a step of 0.02)
  4. 0o < θ < 180 o(with a step of 1o)
Set the limits of plot to -0.4 < x < 0.4 and 0 < y < 0.4
  1. Plot velocity vectors at a few points and comment on their orientation with respect to streamlines.
  9 件のコメント
Muhammad Adeel Ahsan Awan
Muhammad Adeel Ahsan Awan 2018 年 12 月 16 日
okay sir
Muhammad Adeel Ahsan Awan
Muhammad Adeel Ahsan Awan 2018 年 12 月 16 日
a=0.1
v=1
s=-0.16
t=0
while s<0.16 && t<180
r=(-s)+((s*s)+(4*a*a*v*v*sin(t)*sin(t))^(1/2))/(2*v*sin(t))
x=r*cos(t);
y=r*sin(t);
s=s+0.02;
t=t+1;
plot(x,y,'r-')
xlim([-0.4 0.4])
ylim([0 0.4])
end

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

採用された回答

Mark Sherstan
Mark Sherstan 2018 年 12 月 16 日
You were plotting a single point instead of an array of information. Adding the ii term stores the result for each calculation and the plots it. The following code should now work for you:
a=0.1
v=1
s=-0.16
t=0
ii = 1;
while s<0.16 && t<180
r=(-s)+((s*s)+(4*a*a*v*v*sin(t)*sin(t))^(1/2))/(2*v*sin(t))
x(ii)=r*cos(t);
y(ii)=r*sin(t);
s=s+0.02;
t=t+1;
ii = ii + 1;
end
plot(x,y,'r-')
xlim([-0.4 0.4])
ylim([0 0.4])
This is also how you should post code so that people can help you (not just copying and pasting the text). If this solves your original question, please accept the answer so that we can close it, otherwise add further comments below.
  4 件のコメント
madhan ravi
madhan ravi 2018 年 12 月 19 日
deg2rad()
Muhammad Adeel Ahsan Awan
Muhammad Adeel Ahsan Awan 2018 年 12 月 19 日
yes i have done it thanks to all of you

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeVector Fields についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by