Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::numeric::odeint::controlled_runge_kutta< ErrorStepper, ErrorChecker, Resizer, explicit_error_stepper_tag > Class Template Reference

Implements step size control for Runge-Kutta steppers with error estimation. More...

#include <controlled_runge_kutta.hpp>

Public Types

typedef ErrorStepper stepper_type
 
typedef stepper_type::state_type state_type
 
typedef stepper_type::value_type value_type
 
typedef stepper_type::deriv_type deriv_type
 
typedef stepper_type::time_type time_type
 
typedef stepper_type::algebra_type algebra_type
 
typedef
stepper_type::operations_type 
operations_type
 
typedef Resizer resizer_type
 
typedef ErrorChecker error_checker_type
 
typedef
explicit_controlled_stepper_tag 
stepper_category
 
typedef
stepper_type::wrapped_state_type 
wrapped_state_type
 
typedef
stepper_type::wrapped_deriv_type 
wrapped_deriv_type
 
typedef controlled_runge_kutta
< ErrorStepper, ErrorChecker,
Resizer,
explicit_error_stepper_tag
controlled_stepper_type
 

Public Member Functions

 controlled_runge_kutta (const error_checker_type &error_checker=error_checker_type(), const stepper_type &stepper=stepper_type())
 Constructs the controlled Runge-Kutta stepper. More...
 
template<class System , class StateInOut >
controlled_step_result try_step (System system, StateInOut &x, time_type &t, time_type &dt)
 Tries to perform one step. More...
 
template<class System , class StateInOut >
controlled_step_result try_step (System system, const StateInOut &x, time_type &t, time_type &dt)
 Tries to perform one step. More...
 
template<class System , class StateInOut , class DerivIn >
controlled_step_result try_step (System system, StateInOut &x, const DerivIn &dxdt, time_type &t, time_type &dt)
 Tries to perform one step. More...
 
template<class System , class StateIn , class StateOut >
boost::disable_if
< boost::is_same< StateIn,
time_type >
, controlled_step_result >
::type 
try_step (System system, const StateIn &in, time_type &t, StateOut &out, time_type &dt)
 Tries to perform one step. More...
 
template<class System , class StateIn , class DerivIn , class StateOut >
controlled_step_result try_step (System system, const StateIn &in, const DerivIn &dxdt, time_type &t, StateOut &out, time_type &dt)
 Tries to perform one step. More...
 
value_type last_error (void) const
 Returns the error of the last step. More...
 
template<class StateType >
void adjust_size (const StateType &x)
 Adjust the size of all temporaries in the stepper manually. More...
 
stepper_typestepper (void)
 Returns the instance of the underlying stepper. More...
 
const stepper_typestepper (void) const
 Returns the instance of the underlying stepper. More...
 

Detailed Description

template<class ErrorStepper, class ErrorChecker, class Resizer>
class boost::numeric::odeint::controlled_runge_kutta< ErrorStepper, ErrorChecker, Resizer, explicit_error_stepper_tag >

Implements step size control for Runge-Kutta steppers with error estimation.

This class implements the step size control for standard Runge-Kutta steppers with error estimation.

Template Parameters
ErrorStepperThe stepper type with error estimation, has to fulfill the ErrorStepper concept.
ErrorCheckerThe error checker
ResizerThe resizer policy type.

Member Typedef Documentation

template<class ErrorStepper , class ErrorChecker , class Resizer >
typedef stepper_type::algebra_type boost::numeric::odeint::controlled_runge_kutta< ErrorStepper, ErrorChecker, Resizer, explicit_error_stepper_tag >::algebra_type
template<class ErrorStepper , class ErrorChecker , class Resizer >
typedef controlled_runge_kutta< ErrorStepper , ErrorChecker , Resizer , explicit_error_stepper_tag > boost::numeric::odeint::controlled_runge_kutta< ErrorStepper, ErrorChecker, Resizer, explicit_error_stepper_tag >::controlled_stepper_type
template<class ErrorStepper , class ErrorChecker , class Resizer >
typedef stepper_type::deriv_type boost::numeric::odeint::controlled_runge_kutta< ErrorStepper, ErrorChecker, Resizer, explicit_error_stepper_tag >::deriv_type
template<class ErrorStepper , class ErrorChecker , class Resizer >
typedef ErrorChecker boost::numeric::odeint::controlled_runge_kutta< ErrorStepper, ErrorChecker, Resizer, explicit_error_stepper_tag >::error_checker_type
template<class ErrorStepper , class ErrorChecker , class Resizer >
typedef stepper_type::operations_type boost::numeric::odeint::controlled_runge_kutta< ErrorStepper, ErrorChecker, Resizer, explicit_error_stepper_tag >::operations_type
template<class ErrorStepper , class ErrorChecker , class Resizer >
typedef Resizer boost::numeric::odeint::controlled_runge_kutta< ErrorStepper, ErrorChecker, Resizer, explicit_error_stepper_tag >::resizer_type
template<class ErrorStepper , class ErrorChecker , class Resizer >
typedef stepper_type::state_type boost::numeric::odeint::controlled_runge_kutta< ErrorStepper, ErrorChecker, Resizer, explicit_error_stepper_tag >::state_type
template<class ErrorStepper , class ErrorChecker , class Resizer >
typedef explicit_controlled_stepper_tag boost::numeric::odeint::controlled_runge_kutta< ErrorStepper, ErrorChecker, Resizer, explicit_error_stepper_tag >::stepper_category
template<class ErrorStepper , class ErrorChecker , class Resizer >
typedef ErrorStepper boost::numeric::odeint::controlled_runge_kutta< ErrorStepper, ErrorChecker, Resizer, explicit_error_stepper_tag >::stepper_type
template<class ErrorStepper , class ErrorChecker , class Resizer >
typedef stepper_type::time_type boost::numeric::odeint::controlled_runge_kutta< ErrorStepper, ErrorChecker, Resizer, explicit_error_stepper_tag >::time_type
template<class ErrorStepper , class ErrorChecker , class Resizer >
typedef stepper_type::value_type boost::numeric::odeint::controlled_runge_kutta< ErrorStepper, ErrorChecker, Resizer, explicit_error_stepper_tag >::value_type
template<class ErrorStepper , class ErrorChecker , class Resizer >
typedef stepper_type::wrapped_deriv_type boost::numeric::odeint::controlled_runge_kutta< ErrorStepper, ErrorChecker, Resizer, explicit_error_stepper_tag >::wrapped_deriv_type
template<class ErrorStepper , class ErrorChecker , class Resizer >
typedef stepper_type::wrapped_state_type boost::numeric::odeint::controlled_runge_kutta< ErrorStepper, ErrorChecker, Resizer, explicit_error_stepper_tag >::wrapped_state_type

Constructor & Destructor Documentation

template<class ErrorStepper , class ErrorChecker , class Resizer >
boost::numeric::odeint::controlled_runge_kutta< ErrorStepper, ErrorChecker, Resizer, explicit_error_stepper_tag >::controlled_runge_kutta ( const error_checker_type error_checker = error_checker_type( ),
const stepper_type stepper = stepper_type( ) 
)
inline

Constructs the controlled Runge-Kutta stepper.

Parameters
error_checkerAn instance of the error checker.
stepperAn instance of the underlying stepper.

Member Function Documentation

template<class ErrorStepper , class ErrorChecker , class Resizer >
template<class StateType >
void boost::numeric::odeint::controlled_runge_kutta< ErrorStepper, ErrorChecker, Resizer, explicit_error_stepper_tag >::adjust_size ( const StateType &  x)
inline

Adjust the size of all temporaries in the stepper manually.

Parameters
xA state from which the size of the temporaries to be resized is deduced.
template<class ErrorStepper , class ErrorChecker , class Resizer >
value_type boost::numeric::odeint::controlled_runge_kutta< ErrorStepper, ErrorChecker, Resizer, explicit_error_stepper_tag >::last_error ( void  ) const
inline

Returns the error of the last step.

returns The last error of the step.

template<class ErrorStepper , class ErrorChecker , class Resizer >
stepper_type& boost::numeric::odeint::controlled_runge_kutta< ErrorStepper, ErrorChecker, Resizer, explicit_error_stepper_tag >::stepper ( void  )
inline

Returns the instance of the underlying stepper.

Returns
The instance of the underlying stepper.
template<class ErrorStepper , class ErrorChecker , class Resizer >
const stepper_type& boost::numeric::odeint::controlled_runge_kutta< ErrorStepper, ErrorChecker, Resizer, explicit_error_stepper_tag >::stepper ( void  ) const
inline

Returns the instance of the underlying stepper.

Returns
The instance of the underlying stepper.
template<class ErrorStepper , class ErrorChecker , class Resizer >
template<class System , class StateInOut >
controlled_step_result boost::numeric::odeint::controlled_runge_kutta< ErrorStepper, ErrorChecker, Resizer, explicit_error_stepper_tag >::try_step ( System  system,
StateInOut &  x,
time_type t,
time_type dt 
)
inline

Tries to perform one step.

This method tries to do one step with step size dt. If the error estimate is to large, the step is rejected and the method returns fail and the step size dt is reduced. If the error estimate is acceptably small, the step is performed, success is returned and dt might be increased to make the steps as large as possible. This method also updates t if a step is performed.

Parameters
systemThe system function to solve, hence the r.h.s. of the ODE. It must fulfill the Simple System concept.
xThe state of the ODE which should be solved. Overwritten if the step is successful.
tThe value of the time. Updated if the step is successful.
dtThe step size. Updated.
Returns
success if the step was accepted, fail otherwise.
template<class ErrorStepper , class ErrorChecker , class Resizer >
template<class System , class StateInOut >
controlled_step_result boost::numeric::odeint::controlled_runge_kutta< ErrorStepper, ErrorChecker, Resizer, explicit_error_stepper_tag >::try_step ( System  system,
const StateInOut &  x,
time_type t,
time_type dt 
)
inline

Tries to perform one step.

Solves the forwarding problem and allows for using boost range as state_type.

This method tries to do one step with step size dt. If the error estimate is to large, the step is rejected and the method returns fail and the step size dt is reduced. If the error estimate is acceptably small, the step is performed, success is returned and dt might be increased to make the steps as large as possible. This method also updates t if a step is performed.

Parameters
systemThe system function to solve, hence the r.h.s. of the ODE. It must fulfill the Simple System concept.
xThe state of the ODE which should be solved. Overwritten if the step is successful. Can be a boost range.
tThe value of the time. Updated if the step is successful.
dtThe step size. Updated.
Returns
success if the step was accepted, fail otherwise.
template<class ErrorStepper , class ErrorChecker , class Resizer >
template<class System , class StateInOut , class DerivIn >
controlled_step_result boost::numeric::odeint::controlled_runge_kutta< ErrorStepper, ErrorChecker, Resizer, explicit_error_stepper_tag >::try_step ( System  system,
StateInOut &  x,
const DerivIn &  dxdt,
time_type t,
time_type dt 
)
inline

Tries to perform one step.

This method tries to do one step with step size dt. If the error estimate is to large, the step is rejected and the method returns fail and the step size dt is reduced. If the error estimate is acceptably small, the step is performed, success is returned and dt might be increased to make the steps as large as possible. This method also updates t if a step is performed.

Parameters
systemThe system function to solve, hence the r.h.s. of the ODE. It must fulfill the Simple System concept.
xThe state of the ODE which should be solved. Overwritten if the step is successful.
dxdtThe derivative of state.
tThe value of the time. Updated if the step is successful.
dtThe step size. Updated.
Returns
success if the step was accepted, fail otherwise.

References boost::numeric::odeint::detail::_1, boost::bind(), boost::numeric::odeint::copy(), boost::ref(), boost::numeric::odeint::success, and template.

template<class ErrorStepper , class ErrorChecker , class Resizer >
template<class System , class StateIn , class StateOut >
boost::disable_if< boost::is_same< StateIn , time_type > , controlled_step_result >::type boost::numeric::odeint::controlled_runge_kutta< ErrorStepper, ErrorChecker, Resizer, explicit_error_stepper_tag >::try_step ( System  system,
const StateIn &  in,
time_type t,
StateOut &  out,
time_type dt 
)
inline

Tries to perform one step.

Note
This method is disabled if state_type=time_type to avoid ambiguity.

This method tries to do one step with step size dt. If the error estimate is to large, the step is rejected and the method returns fail and the step size dt is reduced. If the error estimate is acceptably small, the step is performed, success is returned and dt might be increased to make the steps as large as possible. This method also updates t if a step is performed.

Parameters
systemThe system function to solve, hence the r.h.s. of the ODE. It must fulfill the Simple System concept.
inThe state of the ODE which should be solved.
tThe value of the time. Updated if the step is successful.
outUsed to store the result of the step.
dtThe step size. Updated.
Returns
success if the step was accepted, fail otherwise.

References boost::numeric::odeint::detail::_1, boost::bind(), boost::ref(), template, and boost::detail::type.

template<class ErrorStepper , class ErrorChecker , class Resizer >
template<class System , class StateIn , class DerivIn , class StateOut >
controlled_step_result boost::numeric::odeint::controlled_runge_kutta< ErrorStepper, ErrorChecker, Resizer, explicit_error_stepper_tag >::try_step ( System  system,
const StateIn &  in,
const DerivIn &  dxdt,
time_type t,
StateOut &  out,
time_type dt 
)
inline

Tries to perform one step.

This method tries to do one step with step size dt. If the error estimate is to large, the step is rejected and the method returns fail and the step size dt is reduced. If the error estimate is acceptably small, the step is performed, success is returned and dt might be increased to make the steps as large as possible. This method also updates t if a step is performed.

Parameters
systemThe system function to solve, hence the r.h.s. of the ODE. It must fulfill the Simple System concept.
inThe state of the ODE which should be solved.
dxdtThe derivative of state.
tThe value of the time. Updated if the step is successful.
outUsed to store the result of the step.
dtThe step size. Updated.
Returns
success if the step was accepted, fail otherwise.

References boost::numeric::odeint::detail::_1, boost::bind(), boost::numeric::BOOST_PREVENT_MACRO_SUBSTITUTION(), BOOST_USING_STD_MAX, BOOST_USING_STD_MIN, boost::numeric::odeint::fail, boost::numeric::in(), boost::accumulators::extract::max, boost::numeric::pow(), pow(), boost::ref(), boost::numeric::odeint::success, and template.


The documentation for this class was generated from the following file: