
vector< double > obs_times = { 0.0 , 0.1 , 0.2 , 0.3 , 0.4 , 0.5 , 0.6 , 0.7 , 0.8 , 0.9 , 1.0 }; double step_size = 0.02; // now it is really the initial step size integrate_times( make_controlled< stepper >( abs_err , rel_err ) , model2 , x , step_size , times.begin() , times.end() , Print_observer );
I used integrate_times as you described above but it also froze after the .1 step. After having waited for a very long time I eventually get this error message """ terminate called after throwing an instance of 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<std::overflow_error> >' what(): Integrate adaptive : Maximal number of iterations reached. A step size could not be found. """
Might it be possible that you reached something like a singular point? If the stepper does not find a step size it usually hints to some problems with the ODE. Can you show me roughly your equations?
If you system is stiff you should also look at the Rosenbrock method. It is much better suited for stiff problems. But its needs to calculate the Jacobian.
The biggest issue is that the Jacobian is too complicated to calculate, it depends on some population dynamics and higher order interpolation.
Is there no other way to solve stiff systems. I've read about other methods such as CVODE and LSODA, but couldn't figure out how to get those to work.
These methods exists but not within odeint and there are currently not reachable from odeint. You might have a look at here: https://computation.llnl.gov/casc/sundials/description/description.html