matlab a a graph plot

1 visualizzazione (ultimi 30 giorni)
NAS
NAS il 2 Giu 2020
Modificato: NAS il 26 Set 2020
as

Risposta accettata

KSSV
KSSV il 2 Giu 2020
%wava tank problem
clc; %clear workspace command window
%input
a=0.5;
rho=1030;
g=9.81;
l=30;
L=5.216;
d=2;
T=2;
w=2*pi/T;
k=2*pi/L;
Nx=80;
Nz=80;
Nt=5;
Lx=30;
Lt=4;
%end
x=linspace(0,L,Nx); %mesh
z=linspace(0,-d,Nz); %mesh
t=linspace(0,Lt,Nt); %mesh
[X,Y] = meshgrid(x,z) ;
dphix = zeros(size(X)) ;
dphiy = zeros(size(Y)) ;
for i = 1:length(t)
dphix = a*w/k*exp(k*Y).*cos(k*X-w*t(i)) ;
dphiy = a*w*exp(k*Y).*sin(k*X-w*t(i)) ;
quiver(X,Y,dphix,dphiy)
axis tight
drawnow
end

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by