Plot a animated streamline with a stream function

조회 수: 4 (최근 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 CenterFile Exchange에서 Vector Fields에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by