How to plot to get the figure?
Afficher commentaires plus anciens


%Creation of streamline around the circle
a = 6; % Radius of Circle
V_i =50; % Velocity
G = 20; % Gramma (Circulation)
x=[-a*2:a/3:a*2];
[x]=meshgrid(x);
y=x';
for i=1:length(x);
for k=1:length(x);
if sqrt(x(i,k).^2+y(i,k).^2)<a;
x(i,k)=0;
y(i,k)=0;
end
end
end
r=sqrt(x.^2+y.^2);
% theta=atan2(y,x);
theta =pi-asin(-G/(4*pi*a*V_i));
ur=V_i*cos(theta).*(1-a^2./(r.^2));
ut=-V_i*sin(theta).*(1+a^2./(r.^2))-G./(2*pi*r);
u=ur.*cos(theta)-ut.*sin(theta);
v=ur.*sin(theta)+ut.*cos(theta);
%Creating The Filled Circle
t_r = 0:.1:2*pi;
xxx = a*cos(t_r);
yyy = a*sin(t_r);
%Vectors and Filled Circle plotting
figure(2)
hold on
quiver(x,y,u,v)
fill(xxx,yyy,'y')
axis square
title('streamline')
grid off
2 commentaires
Myo Gyi
le 15 Juin 2020
Réponses (1)
darova
le 16 Juin 2020
I just used these formulas from this page

The code i used
clc,clear
[x,y] = meshgrid(-3:0.2:3);
a = 1; % cylinder radius
U = 1; % flow velocity
G = 2.5*pi; % circulation
xmy = x.^2 - y.^2;
xpy = x.^2 + y.^2;
u = U*(1 - xmy*a^2./xpy.^2) + G/pi*y./xpy; % horizontal velocity
v = -2*U*x.*y*a^2./xpy.^2 - G/pi*x./xpy; % veftical velocity
[xc,yc] = pol2cart(deg2rad(0:10:360),1);
plot(xc,yc,'r','linew',2)
streamline(x,y,u,v,x(:,1),y(:,1))
streamline(x,y,u,v,x(1,:),y(1,:))
Results

1 commentaire
Myo Gyi
le 18 Juin 2020
Catégories
En savoir plus sur Surface and Mesh Plots dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!