m = 0;
x=linspace(0,1,20);
t=linspace(0,2,5);
sol=pdepe(m,@pdex1pde,@pdex1ic,@pdex1bc,x,t);
u=sol(:,:,1);
沖浪(x,t,u)
我猜的
plot(x,u(end,))
function[c,f,s]=pdex1pde(x,t,u,DuDx)
c=pi^2;
f = DuDx
s=u^2;
函數u0=pdex1ic(x)
u0 = sin(pi * x);
function [pl,ql,pr,qr]=pdex1bc(x1,u1,xr,ur,t)
pl = u 1;
QL = 0;
pr = pi * exp(-t);
QR = 1;