24小时热门版块排行榜    

查看: 390  |  回复: 1

zpzgraduate

铁杆木虫 (著名写手)

[求助] matlab求解偏微分方程组遇到的问题求助

求解偏微分方程组时遇到的,请高手指点。
下面是文件和错误提示
function pdex4
m = 0;
x = [0 0.005 0.01 0.05 0.1 0.2 0.5 0.7 0.9 0.95 0.99 0.995 1];
t = [0 0.005 0.01 0.05 0.1 0.5 1 1.5 2];

sol = pdepe(m,@pdex4pde,@pdex4ic,@pdex4bc,x,t);
u1 = sol(:,:,1);
u2 = sol(:,:,2);
u3=sol(:,:,2);

figure
surf(x,t,u1)
title('u1(x,t)')
xlabel('Distance x')
ylabel('Time t')

figure
surf(x,t,u2)
title('u2(x,t)')
xlabel('Distance x')
ylabel('Time t')
figure
surf(x,t,u3)
title('u3(x,t)')
xlabel('Distance x')
ylabel('Time t')
% --------------------------------------------------------------
function [c,f,s] = pdex4pde(x,t,u,DuDx)
c = [1; 1;1];
f = [0; 0;0] .* DuDx;
F = 6*u(3);
s = [-F*u(1); u(2)*F;-20000*u(1)-2-4*u(2)];
% --------------------------------------------------------------
function u0 = pdex4ic(x);
u0 = [0.03;0;0];
% --------------------------------------------------------------
function [pl,ql,pr,qr] = pdex4bc(xl,ul,xr,ur,t)
pl = [0; ul(2)-1;0];
ql = [1; 1;1];
pr = [ur(1)-1; 0;0];
qr = [1;1;1];


错误信息
Warning: Failure at t=1.497828e-002.  Unable to meet integration tolerances
without reducing the step size below the smallest value allowed (2.775558e-017) at
time t.
> In ode15s at 809
  In pdepe at 317
  In pdefun001 at 6
Warning: Time integration has failed. Solution is available at requested time
points up to t=1.000000e-002.
> In pdepe at 323
  In pdefun001 at 6
??? Error using ==> surf at 78
Data dimensions must agree.

Error in ==> pdefun001 at 12
surf(x,t,u1)
回复此楼

» 猜你喜欢

» 本主题相关价值贴推荐,对您同样有帮助:

已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

zpzgraduate

铁杆木虫 (著名写手)

自己顶一下,请高人解答
2楼2013-07-01 05:49:22
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 zpzgraduate 的主题更新
信息提示
请填处理意见