Somebody help me for my exercise please.
3 次查看(过去 30 天)
显示 更早的评论
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1183733/image.jpeg)
clc
clear
close all
% %% UNIFORM FLOW
[r,theta] = meshgrid(r,theta) ;
phiflow = -U*r.*sin(theta);
psiflow = U*r.*cos(theta);
W = sqrt(phiflow.^2+psiflow.^2) ;
figure(1)
% pcolor(r,theta,W);
quiver(r,theta,psiflow,phiflow)
grid on
%% SOURCE
phisource= -(Q /((2*pi)*(log (r))));
psisource = Q/(2*pi)*(theta);
W = sqrt(phisource.^2+psisource.^2) ;
figure(2)
% pcolor(r,theta,W);
quiver(r,theta,psisource,phisource)
grid on
%% SINK
phisink= (Q /((2*pi)*(log (r))));
psisink = -(Q/(2*pi)*(theta));
W = sqrt(phisink.^2+psisink.^2) ;
figure(3);
% pcolor(r,theta,W);
quiver(r,theta,psisink,phisink)
grid on
%% DOUBLET
phidoublet= -D/(2*pi)*cos(theta)/r;
psidoublet= -D/(2*pi)*sin(theta)/r;
W = sqrt(phidoublet.^2+psidoublet.^2) ;
figure(4);
% pcolor(r,theta,W);
quiver(r,theta,psidoublet,phidoublet)
grid on
%% VORTEX
phivortex = gamma.*/(2*pi).theta;
psivortex= gamma.*/(2*pi)*log(r);
W = sqrt(phivortex.^2+psivortex.^2) ;
figure(4);
% pcolor(r,theta,W);
quiver(r,theta,psivortex,phivortex)
grid on
0 个评论
采纳的回答
KSSV
2022-11-7
This is how you have to proceed.
U=200; %velocity
gamma=1000; %circulation
Q=14; %volume flux of fluid
D=100; %doublet strenght
theta = 0;
%to create variables r
nx=100;
xin=-5;
xfin=10;
theta = linspace(0,2*pi,nx) ;
r=linspace(xin,xfin,nx);
%to create variables x and y
nx=500000;
xin=-1000;
xfin=1000;
x=linspace(xin,xfin,nx);
ny=500000;
yin=-1000;
yfin=1000;
y=linspace(yin,yfin,ny);
% %% UNIFORM FLOW
[r,theta] = meshgrid(r,theta) ;
phiflow = -U*r.*sin(theta);
psiflow = U*r.*cos(theta);
W = sqrt(phiflow.^2+psiflow.^2) ;
figure(1)
% pcolor(r,theta,W);
quiver(r,theta,psiflow,phiflow)
更多回答(1 个)
VBBV
2022-11-7
clc
clear
close all
U=200; %velocity
gamma=1000; %circulation
Q=14; %volume flux of fluid
D=100; %doublet strenght
theta = linspace(0,360,500)*pi/180
%to create variables r
nx=500;
xin=-5;
xfin=5;
r=linspace(xin,xfin,nx);
%to create variables x and y
nx=500;
xin=-1000;
xfin=1000;
x=linspace(xin,xfin,nx);
ny=500;
yin=-1000;
yfin=1000;
y=linspace(yin,yfin,ny);
% %% UNIFORM FLOW
phiflow = U*r.*sin(theta);
psiflow = U*r.*cos(theta);
figure(1)
plot(phiflow,psiflow,'.-');
hold on
lgd=legend('\psi is green','\phi is blue');
lgd.Title.String = 'UNIFORM FLOW';
lgd.Title.FontSize = 10;
% quiver(x,y,psiflow,phiflow,0.75,'r')
axis equal
grid on
%% SOURCE
phisource= -(Q /(2*pi))*(log (r));
psisource = (Q/(2*pi))*(theta);
figure(2);
plot(phisource,psisource,'.-');
hold on
lgd=legend('\psi is green','\phi is blue');
lgd.Title.String = 'SOURCE FLOW';
lgd.Title.FontSize = 10;
% quiver(x,y,phisource,psisource,0.75,'r')
axis equal
grid on
%% SINK
phisink= (Q /(2*pi))*(log (r));
psisink = -(Q/(2*pi))*(theta);
figure(3);
plot(phisink,psisink,'.-');
hold on
lgd=legend('\psi is green','\phi is blue');
lgd.Title.String = 'SINK FLOW';
lgd.Title.FontSize = 10;
% quiver(x,y,psisink,phisink,0.75,'r')
axis equal
grid on
%% DOUBLET
phidoublet= -(D)*cos(theta)./max(r);
psidoublet= -(D)*sin(theta)./max(r);
figure(4);
plot(phidoublet,psidoublet,'.-');
hold on
lgd=legend('\psi is green','\phi is blue');
lgd.Title.String = 'DOUBLET FLOW';
lgd.Title.FontSize = 10;
% quiver(x,y,phidoublet,psidoublet,0.75,'r')
% axis equal
grid on
%% VORTEX
phivortex = (gamma/(2*pi))*theta;
psivortex= (gamma/(2*pi))*log(r);
figure(5);
plot(phivortex,psivortex,'.-');
hold off
lgd=legend('\psi is green','\phi is blue');
lgd.Title.String = 'VORTEX FLOW';
lgd.Title.FontSize = 10;
% quiver(x,y,phivortex,psivortex,0.75,'r')
% axis equal
grid on
6 个评论
VBBV
2022-11-7
clc
clear
close all
U=200; %velocity
gamma=1000; %circulation
Q=14; %volume flux of fluid
D=100; %doublet strenght
% theta = linspace(0,360,500)*pi/180
%to create variables r
nx=500;
xin=-5;
xfin=5;
r=linspace(xin,xfin,nx);
%to create variables x and y
nx=500;
xin=-1000;
xfin=1000;
x=linspace(xin,xfin,nx);
ny=500;
yin=-1000;
yfin=1000;
y=linspace(yin,yfin,ny);
[X Y] = meshgrid(x,y);
% %% UNIFORM FLOW
phiflow = U*X; %r.*sin(theta);
psiflow = U*Y;%.*cos(theta);
figure(1)
quiver(X(1:50:end,1:50:end),Y(1:50:end,1:50:end),phiflow(1:50:end,1:50:end),psiflow(1:50:end,1:50:end))
hold on
lgd=legend('\psi is green','\phi is blue');
lgd.Title.String = 'UNIFORM FLOW';
lgd.Title.FontSize = 10;
% quiver(x,y,psiflow,phiflow,0.75,'r')
axis equal
grid on
An example how quiver plots can be done are found at https://in.mathworks.com/help/matlab/ref/quiver.html
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Dates and Time 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!