0
votes

I have a process that uses ode15s thousands of times to solve a system of differential equations with various initial conditions, however, occasionally I get an error such as the following: "Warning: Failure at t=5.054301e+02. Unable to meet integration tolerances without reducing the step size below the smallest value allowed (9.094947e-13) at time t.". This unfortunately brings the program to a halt, and as such, I was wondering if there is a way to catch such an error and force ode15s to end its processing so that the program can continue on. Does such a function exist?

1

1 Answers

1
votes

Consider to use try/catch statement like

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