Plot a animated streamline with a stream function
1 次查看(过去 30 天)
显示 更早的评论
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
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/155537/image.jpeg)
% 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 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Vector Fields 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!