Labfans是一个针对大学生、工程师和科研工作者的技术社区。 论坛首页 | 联系我们(Contact Us)
MATLAB爱好者论坛-LabFans.com
返回   MATLAB爱好者论坛-LabFans.com > 工程数学软件 > MATLAB论坛
MATLAB论坛 一切MATLAB相关问题在此讨论。
 
 
主题工具 显示模式
旧 2009-04-06, 11:03   #1
WFFF
初级会员
 
注册日期: 2009-04-06
年龄: 46
帖子: 1
声望力: 0
WFFF 正向着好的方向发展
难过 [求助]用pdepe求解偏微分方程时遇到分段边界条件的问题

用Matlab中的pdepe函数求解偏微分方程时,左边界条件是一个分段函数。左边界开始的时候是1,在t时刻后,左边界突变为0。在写左边界的时候,试着用if语句来分段,但是运行程序的时候,出错。

整个边界条件函数如下:
function [pl,ql,pr,qr] = pdeadbc(xl,ul,xr,ur,t)
global tphase2
if t <= tphase2
u0 = 1;
end
if t > tphase2
u0 = 0;
end
pl = ul-u0;
ql = 0;
pr = 0;
qr = 1;

出错信息如下:

>> Warning: Failure at t=9.000000e+002 (该时刻是分段点). Unable to meet integration tolerances without reducing the step size below the smallest value allowed (3.197442e-012) at time t.
(Type "warning off MATLABde15s:IntegrationTolNotMet" to suppress this warning.)
> In C:\MATLAB7.0\toolbox\matlab\funfun\ode15s.m at line 743
In C:\MATLAB7.0\toolbox\matlab\funfun\pdepe.m at line 287
In C:\-
??? Subscripted assignment dimension mismatch.

Error in ==> C:\MATLAB7.0\toolbox\matlab\funfun\pdepe.m
On line 291 ==> sol(:,:,i) = y(:,i:npde:end);

Error in ==> C:\---
On line 22 ==> sol = pdepe(0,@pdead,@pdeadic,@pdeadbc,x,t); % ad

后来我看了ode15s和pdepe两个函数的编码 感觉好像是ode15s的编码需要进行修改 解决掉Unable to meet integration tolerances 这个问题

论坛上的高手们能不能帮忙给点意见 帮我解决掉这个难题 多谢了
WFFF 当前离线   回复时引用此帖
 

主题工具
显示模式

发帖规则
不可以发表新主题
不可以发表回复
不可以上传附件
不可以编辑自己的帖子

启用 BB 代码
论坛启用 表情符号
论坛启用 [IMG] 代码
论坛禁用 HTML 代码


相似的主题
主题 主题作者 版面 回复 最后发表
[求助]关于全景图像拼接的MATLAB程序 namazebi MATLAB论坛 1 2008-12-08 21:49


所有时间均为北京时间。现在的时间是 15:45


Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.