Skip error message in solving multiple ODEs in a loop
3 次查看(过去 30 天)
显示 更早的评论
I am trying to solve a number of differential equations having the same form but varying parameters. E.g.:
for n=1:np % np= number of parameters & equations to be solved
[x(n),y(n)] = ode45(@dy/dx,xrange,[x0],foptions) %
end
function dy/dx
dy/dx=f(x,y,parameter(n))
end
whereas in each loop the value of parameter(n) changes. Now if Matlab ODE solver encounters an error in each step n, the program stops to work, although the previous solutions have been caluclated. Is there a way to recognize that an erros is occuring and skip that one specific step where the solver fails and go to the next step n+1 with parameter(n+1), and so on until the end?
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Ordinary Differential Equations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!