【问题标题】:MATLAB: ode15s, end if integration tolerance not metMATLAB:ode15s,如果不满足积分容差则结束
【发布时间】:2017-10-22 20:25:17
【问题描述】:

我有一个过程使用 ode15s 数千次来求解具有各种初始条件的微分方程组,但是,偶尔我会收到如下错误:“警告:在 t=5.054301e+02 时失败。无法在不减小步长以下最小的情况下满足集成容差 在时间 t 允许的值 (9.094947e-13)。”。不幸的是,这使程序停止运行,因此,我想知道是否有办法捕获此类错误并强制 ode15s 结束其处理,以便程序可以继续运行。有这样的功能吗?

【问题讨论】:

    标签: matlab ode


    【解决方案1】:

    考虑使用 try/catch 语句,如

    try 
         % put your ode15s process here
    catch
         % put statement to handle errors like 
         fprintf('Error found.')
         % or skip the error one, then run the next process
    end
    

    【讨论】:

    • 嗯,它似乎无法捕捉到警告,除了将我的 ode15s 代码放入 try 部分之外,我还应该做些什么吗?
    • 如果您能提供该过程的一些基本步骤以便重现该问题,那就太好了。
    猜你喜欢
    • 2015-07-28
    • 1970-01-01
    • 2015-12-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-09-11
    • 1970-01-01
    相关资源
    最近更新 更多