Skip error message in solving multiple ODEs in a loop
1 回表示 (過去 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!