Skip error message in solving multiple ODEs in a loop

2 次查看(过去 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 个)

类别

Help CenterFile Exchange 中查找有关 Ordinary Differential Equations 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by