Plot a animated streamline with a stream function

4 visualizaciones (últimos 30 días)
Ali Kareem
Ali Kareem el 21 de Feb. de 2016
Editada: Ali Kareem el 22 de Feb. de 2016
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

Respuestas (0)

Categorías

Más información sobre Vector Fields en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by