Plot a animated streamline with a stream function

3 ビュー (過去 30 日間)
Ali Kareem
Ali Kareem 2016 年 2 月 21 日
編集済み: Ali Kareem 2016 年 2 月 22 日
Hi,
I am trying to plot animated streamline with a stream function. I used below code and its work and plot the function but I need to make it animate
% syms R r Y y a a_bar pi Gamma;
k=((4*r*R)/((y-Y)^2+(r+R)^2));
k_bar=((4*r*R)/((y+Y)^2+(r+R)^2));
[K1,E1]=ellipke(k);
[K2,E2]=ellipke(k_bar);
U=Gamma*(((R*r)^(1/2)/(2*pi*(sqrt(k))))*(((2-k)*(K1))-(2*E1))-((R*r)^(1/2)/(2*pi*sqrt(k_bar)))*(((2-k_bar)*(K2))-(2*E2)));
Ur=(1/r)*(diff(U,y));
Uy=(-1/r)*(diff(U,r));
Gamma = 1 ;
R= 1;
Y= 1;
pi= 4.*atan(1.);
[r,y] = meshgrid(0:0.2:2.5,0:0.2:2.5);
u = eval(Ur);
v = eval(Uy);
figure
startx = 0:0.2:2.5;
starty = 0:0.2:2.5;
streamline(r,y,u,v,startx,starty)
xlabel('r')
ylabel('y')
Thanks

回答 (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