diff --git a/include/boost/numeric/odeint/integrate/detail/integrate_times.hpp b/include/boost/numeric/odeint/integrate/detail/integrate_times.hpp index d5446ba5..2388f7cf 100644 --- a/include/boost/numeric/odeint/integrate/detail/integrate_times.hpp +++ b/include/boost/numeric/odeint/integrate/detail/integrate_times.hpp @@ -99,6 +99,8 @@ size_t integrate_times( if( st.try_step( system , start_state , current_time , current_dt ) == success ) { ++steps; + // successful step -> reset the fail counter, see #173 + fail_steps = 0; // continue with the original step size if dt was reduced due to observation dt = max_abs( dt , current_dt ); } diff --git a/include/boost/numeric/odeint/stepper/dense_output_runge_kutta.hpp b/include/boost/numeric/odeint/stepper/dense_output_runge_kutta.hpp index b685d92b..04195573 100644 --- a/include/boost/numeric/odeint/stepper/dense_output_runge_kutta.hpp +++ b/include/boost/numeric/odeint/stepper/dense_output_runge_kutta.hpp @@ -329,7 +329,7 @@ public: res = m_stepper.try_step( system , get_current_state() , get_current_deriv() , m_t , get_old_state() , get_old_deriv() , m_dt ); if( count++ == max_count ) - BOOST_THROW_EXCEPTION( std::overflow_error( "dense_output_controlled_explicit : too much iterations!") ); + BOOST_THROW_EXCEPTION( std::overflow_error( "dense_output_controlled_explicit : too many iterations!") ); } while( res == fail ); toggle_current_state();