[转载]Matlab求解微分方程(2)——偏微分方程的求解

标签:
转载 |
http://s1/mw690/b0ecb51dzx6CubByCS410&690
http://s10/mw690/b0ecb51dzx6CubFfGbf99&690
[pa,qa,pb,qb]=pdebc(x,t,u,du)
http://s15/mw690/b0ecb51dzx6CubJhZBc5e&690
http://s6/mw690/b0ecb51dzx6CubMwOMd95&690
function pde %主函数
x=0:0.05:1;
t=0:0.05:2;
m=0;
sol=pdepe(m,@mpde,@mpic,@mpbc,x,t);
surf(x,t,sol(:,:,1))
figure;
surf(x,t,sol(:,:,2))
function [c,f,s]=mpde(x,t,u,du) %给出偏微分方程的函数描述
c=[1;1];
f=[0.024*du(1);0.17*du(2)];
temp=u(1)-u(2);
s=[-1;1].*(exp(5.73*temp)-exp(-11.46*temp));
function
[pa,qa,pb,qb]=mpbc(xa,ua,xb,ub,t)
pa=[0;ua(2)];
qa=[1;0];
pb=[ub(1)-1;0];
qb=[0;1];
function u0=mpic(x) %初值描述
u0=[1;0];
http://s11/mw690/b0ecb51dzx6CubUE44O9a&690
http://s6/mw690/b0ecb51dzx6CubVggf315&690
http://s14/mw690/b0ecb51dzx6CubYeDz78d&690