필터 지우기
필터 지우기

Skip error message in solving multiple ODEs in a loop

조회 수: 1 (최근 30일)
Saeid
Saeid 2018년 2월 24일
편집: Saeid 2018년 2월 28일
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