matlab a a graph plot

2 vues (au cours des 30 derniers jours)
NAS
NAS le 2 Juin 2020
Modifié(e) : NAS le 26 Sep 2020
as

Réponse acceptée

KSSV
KSSV le 2 Juin 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
  1 commentaire
NAS
NAS le 2 Juin 2020
Thankyou sir .......

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by