⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 test11.asv

📁 matlab中PDE工具箱的帮助文件pde.pdf的例子全部用代码实现,花了我一个月的时间,有限元应用程序
💻 ASV
字号:
%       We solve the standard wave equation
%        d2u/dt2-div(grad(u))=0
%       on a square.
%       Problem definition
g='squareg'; % The unit square
b='squareb3'; % 0 on the left and right boundaries and
%               0 normal derivative on the top and bottom boundaries.
c=1;
a=0;
f=0;
d=1;

%       Mesh
[p,e,t]=initmesh('squareg');
pause % Strike any key to continue.
[p,e,t]=initmesh('squareg');
x=p(1,:)'; y=p(2,:)';
u0=atan(cos(pi/2*x));
ut0=3*sin(pi*x).*exp(sin(pi/2*y));
n=31;
tlist=linspace(0,5,n); % list of times
uu=hyperbolic(u0,ut0,tlist,'squareb3',p,e,t,1,0,0,1);
%       To speed up the plotting, we interpolate to a rectangular grid.
delta= -1:0.1:1;
[uxy,tn,a2,a3]=tri2grid(p,t,uu(:,1),delta,delta);
gp=[tn;a2;a3];
umax=max(max(uu));
umin=min(min(uu));
%       Make the animation
newplot
M=moviein(n);
for i=1:n,
pdeplot(p,e,t,'xydata',uu(:,i),'zdata',uu(:,i),...
'mesh','off','xygrid','on','gridparam',gp,...
'colorbar','off','zstyle','continuous');
axis([-1 1 -1 1 umin umax]); caxis([umin umax]);
M(:,i)=getframe;
end
movie(M,10);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -