필터 지우기
필터 지우기

Change of surface in a rectangular tank

조회 수: 3 (최근 30일)
MOUNIBA REDAH
MOUNIBA REDAH 2019년 6월 29일
답변: darova 2019년 6월 30일
I am plotting a change of surface in terms of beta
The thing is I see no change in the figure when I change the values of beta
Can you help me please
here is the code
clear
x=pi
x0=0.05;
omega=3;
beta0=0.1;
g=10;
z0=(1-(beta0*g)*omega^(-2))^0.5;
h=1;
b=4*(omega^(2))*x0*(g*pi)^(-1)
h=1;
g=10 ;
N=2;
syms t x z0
z0=0;
for n=0:N;
Z=((2*n+1)^(-2))*cos((2*n+1)*x)*cosh(z0*(2*n+1)*((cosh((2*n+1)*z0*h)-g*(2*n+1)*sinh((2*n+1)*z0*h)*(pi^(2)*z0)^(-1))^(-1)))*sin(t);
Zf=z0+Z;
end
Z=simplify(Zf);
Z1=subs(Z,x,pi);
t=0:0.02:20;
x=0:0.02:pi;
[T,X]=meshgrid (t,x);
for n=0:N;
Z=((2*n+1)^(-2))*cos((2*n+1).*X)*cosh(z0*(2*n+1)*((cosh((2*n+1)*z0*h)-g*(2*n+1)*sinh((2*n+1*z0)*h)*(pi^(2)*z0)^(-1))^(-1))).*sin(T);
Zf=z0+Z;
end
a=(omega^(2))*x0*(X-0.5*pi)*g^(-1);
Z=a.*sin(T)+b*Z;
mesh(T,X,Z)
grid on
title('evolution spaciotemporelle de la surface libre');

채택된 답변

darova
darova 2019년 6월 30일
I suggest you to clarify your code. There are some errors i think
x=pi
x0=0.05;
omega=3;
beta0=0.1;
g=10;
z0=(1-(beta0*g)*omega^(-2))^0.5;
h=1;
b=4*(omega^(2))*x0*(g*pi)^(-1)
h=1; % again
g=10 ; % declaring the same variable
N=2;
syms t x z0 % declaring symbolic variable
% and re-write them?
z0=0; % re-write z0? It's symbolic
for n=0:N;
Z=((2*n+1)^(-2))*cos((2*n+1)*x)*cosh(z0*(2*n+1)*((cosh((2*n+1)*z0*h)-g*(2*n+1)*sinh((2*n+1)*z0*h)*(pi^(2)*z0)^(-1))^(-1)))*sin(t);
Zf=z0+Z; % you mean Zf=Zf+Z ?
end
Z=simplify(Zf);
Z1=subs(Z,x,pi); % substitute only x variable (t remains)
t=0:0.02:20;
x=0:0.02:pi;
[T,X]=meshgrid (t,x);
for n=0:N;
% overwrite Z variable? Z has some value already
Z=((2*n+1)^(-2))*cos((2*n+1).*X)*cosh(z0*(2*n+1)*((cosh((2*n+1)*z0*h)-g*(2*n+1)*sinh((2*n+1*z0)*h)*(pi^(2)*z0)^(-1))^(-1))).*sin(T);
Zf=z0+Z;
end
Pay attention to warnings
Untitled.png

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Calculus에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by