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::bulirsch_stoer< State, Value, Deriv, Time, Algebra, Operations, Resizer > Class Template Reference

The Bulirsch-Stoer algorithm. More...

#include <bulirsch_stoer.hpp>

Collaboration diagram for boost::numeric::odeint::bulirsch_stoer< State, Value, Deriv, Time, Algebra, Operations, Resizer >:

Public Types

typedef State state_type
 
typedef Value value_type
 
typedef Deriv deriv_type
 
typedef Time time_type
 
typedef Algebra algebra_type
 
typedef Operations operations_type
 
typedef Resizer resizer_type
 
typedef state_wrapper< state_typewrapped_state_type
 
typedef state_wrapper< deriv_typewrapped_deriv_type
 
typedef controlled_stepper_tag stepper_category
 
typedef bulirsch_stoer< State,
Value, Deriv, Time, Algebra,
Operations, Resizer > 
controlled_error_bs_type
 
typedef inverse_time
< time_type >::type 
inv_time_type
 
typedef std::vector< value_typevalue_vector
 
typedef std::vector< time_typetime_vector
 
typedef std::vector
< inv_time_type
inv_time_vector
 
typedef std::vector< value_vectorvalue_matrix
 
typedef std::vector< size_tint_vector
 
typedef std::vector
< wrapped_state_type
state_table_type
 

Public Member Functions

 bulirsch_stoer (value_type eps_abs=1E-6, value_type eps_rel=1E-6, value_type factor_x=1.0, value_type factor_dxdt=1.0)
 Constructs the bulirsch_stoer class, including initialization of the error bounds. 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)
 Second version to solve the forwarding problem, can be used with Boost.Range as StateInOut. 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...
 
void reset ()
 Resets the internal state of the stepper. More...
 
template<class StateIn >
void adjust_size (const StateIn &x)
 Adjust the size of all temporaries in the stepper manually. More...
 

Static Public Attributes

static const size_t m_k_max = 8
 

Detailed Description

template<class State, class Value = double, class Deriv = State, class Time = Value, class Algebra = typename algebra_dispatcher< State >::algebra_type, class Operations = typename operations_dispatcher< State >::operations_type, class Resizer = initially_resizer>
class boost::numeric::odeint::bulirsch_stoer< State, Value, Deriv, Time, Algebra, Operations, Resizer >

The Bulirsch-Stoer algorithm.

The Bulirsch-Stoer is a controlled stepper that adjusts both step size and order of the method. The algorithm uses the modified midpoint and a polynomial extrapolation compute the solution.

Template Parameters
StateThe state type.
ValueThe value type.
DerivThe type representing the time derivative of the state.
TimeThe time representing the independent variable - the time.
AlgebraThe algebra type.
OperationsThe operations type.
ResizerThe resizer policy type.

Member Typedef Documentation

template<class State , class Value = double, class Deriv = State, class Time = Value, class Algebra = typename algebra_dispatcher< State >::algebra_type, class Operations = typename operations_dispatcher< State >::operations_type, class Resizer = initially_resizer>
typedef Algebra boost::numeric::odeint::bulirsch_stoer< State, Value, Deriv, Time, Algebra, Operations, Resizer >::algebra_type
template<class State , class Value = double, class Deriv = State, class Time = Value, class Algebra = typename algebra_dispatcher< State >::algebra_type, class Operations = typename operations_dispatcher< State >::operations_type, class Resizer = initially_resizer>
typedef bulirsch_stoer< State , Value , Deriv , Time , Algebra , Operations , Resizer > boost::numeric::odeint::bulirsch_stoer< State, Value, Deriv, Time, Algebra, Operations, Resizer >::controlled_error_bs_type
template<class State , class Value = double, class Deriv = State, class Time = Value, class Algebra = typename algebra_dispatcher< State >::algebra_type, class Operations = typename operations_dispatcher< State >::operations_type, class Resizer = initially_resizer>
typedef Deriv boost::numeric::odeint::bulirsch_stoer< State, Value, Deriv, Time, Algebra, Operations, Resizer >::deriv_type
template<class State , class Value = double, class Deriv = State, class Time = Value, class Algebra = typename algebra_dispatcher< State >::algebra_type, class Operations = typename operations_dispatcher< State >::operations_type, class Resizer = initially_resizer>
typedef std::vector< size_t > boost::numeric::odeint::bulirsch_stoer< State, Value, Deriv, Time, Algebra, Operations, Resizer >::int_vector
template<class State , class Value = double, class Deriv = State, class Time = Value, class Algebra = typename algebra_dispatcher< State >::algebra_type, class Operations = typename operations_dispatcher< State >::operations_type, class Resizer = initially_resizer>
typedef inverse_time< time_type >::type boost::numeric::odeint::bulirsch_stoer< State, Value, Deriv, Time, Algebra, Operations, Resizer >::inv_time_type
template<class State , class Value = double, class Deriv = State, class Time = Value, class Algebra = typename algebra_dispatcher< State >::algebra_type, class Operations = typename operations_dispatcher< State >::operations_type, class Resizer = initially_resizer>
typedef std::vector< inv_time_type > boost::numeric::odeint::bulirsch_stoer< State, Value, Deriv, Time, Algebra, Operations, Resizer >::inv_time_vector
template<class State , class Value = double, class Deriv = State, class Time = Value, class Algebra = typename algebra_dispatcher< State >::algebra_type, class Operations = typename operations_dispatcher< State >::operations_type, class Resizer = initially_resizer>
typedef Operations boost::numeric::odeint::bulirsch_stoer< State, Value, Deriv, Time, Algebra, Operations, Resizer >::operations_type
template<class State , class Value = double, class Deriv = State, class Time = Value, class Algebra = typename algebra_dispatcher< State >::algebra_type, class Operations = typename operations_dispatcher< State >::operations_type, class Resizer = initially_resizer>
typedef Resizer boost::numeric::odeint::bulirsch_stoer< State, Value, Deriv, Time, Algebra, Operations, Resizer >::resizer_type
template<class State , class Value = double, class Deriv = State, class Time = Value, class Algebra = typename algebra_dispatcher< State >::algebra_type, class Operations = typename operations_dispatcher< State >::operations_type, class Resizer = initially_resizer>
typedef std::vector< wrapped_state_type > boost::numeric::odeint::bulirsch_stoer< State, Value, Deriv, Time, Algebra, Operations, Resizer >::state_table_type
template<class State , class Value = double, class Deriv = State, class Time = Value, class Algebra = typename algebra_dispatcher< State >::algebra_type, class Operations = typename operations_dispatcher< State >::operations_type, class Resizer = initially_resizer>
typedef State boost::numeric::odeint::bulirsch_stoer< State, Value, Deriv, Time, Algebra, Operations, Resizer >::state_type
template<class State , class Value = double, class Deriv = State, class Time = Value, class Algebra = typename algebra_dispatcher< State >::algebra_type, class Operations = typename operations_dispatcher< State >::operations_type, class Resizer = initially_resizer>
typedef controlled_stepper_tag boost::numeric::odeint::bulirsch_stoer< State, Value, Deriv, Time, Algebra, Operations, Resizer >::stepper_category
template<class State , class Value = double, class Deriv = State, class Time = Value, class Algebra = typename algebra_dispatcher< State >::algebra_type, class Operations = typename operations_dispatcher< State >::operations_type, class Resizer = initially_resizer>
typedef Time boost::numeric::odeint::bulirsch_stoer< State, Value, Deriv, Time, Algebra, Operations, Resizer >::time_type
template<class State , class Value = double, class Deriv = State, class Time = Value, class Algebra = typename algebra_dispatcher< State >::algebra_type, class Operations = typename operations_dispatcher< State >::operations_type, class Resizer = initially_resizer>
typedef std::vector< time_type > boost::numeric::odeint::bulirsch_stoer< State, Value, Deriv, Time, Algebra, Operations, Resizer >::time_vector
template<class State , class Value = double, class Deriv = State, class Time = Value, class Algebra = typename algebra_dispatcher< State >::algebra_type, class Operations = typename operations_dispatcher< State >::operations_type, class Resizer = initially_resizer>
typedef std::vector< value_vector > boost::numeric::odeint::bulirsch_stoer< State, Value, Deriv, Time, Algebra, Operations, Resizer >::value_matrix
template<class State , class Value = double, class Deriv = State, class Time = Value, class Algebra = typename algebra_dispatcher< State >::algebra_type, class Operations = typename operations_dispatcher< State >::operations_type, class Resizer = initially_resizer>
typedef Value boost::numeric::odeint::bulirsch_stoer< State, Value, Deriv, Time, Algebra, Operations, Resizer >::value_type
template<class State , class Value = double, class Deriv = State, class Time = Value, class Algebra = typename algebra_dispatcher< State >::algebra_type, class Operations = typename operations_dispatcher< State >::operations_type, class Resizer = initially_resizer>
typedef std::vector< value_type > boost::numeric::odeint::bulirsch_stoer< State, Value, Deriv, Time, Algebra, Operations, Resizer >::value_vector
template<class State , class Value = double, class Deriv = State, class Time = Value, class Algebra = typename algebra_dispatcher< State >::algebra_type, class Operations = typename operations_dispatcher< State >::operations_type, class Resizer = initially_resizer>
typedef state_wrapper< deriv_type > boost::numeric::odeint::bulirsch_stoer< State, Value, Deriv, Time, Algebra, Operations, Resizer >::wrapped_deriv_type
template<class State , class Value = double, class Deriv = State, class Time = Value, class Algebra = typename algebra_dispatcher< State >::algebra_type, class Operations = typename operations_dispatcher< State >::operations_type, class Resizer = initially_resizer>
typedef state_wrapper< state_type > boost::numeric::odeint::bulirsch_stoer< State, Value, Deriv, Time, Algebra, Operations, Resizer >::wrapped_state_type

Constructor & Destructor Documentation

template<class State , class Value = double, class Deriv = State, class Time = Value, class Algebra = typename algebra_dispatcher< State >::algebra_type, class Operations = typename operations_dispatcher< State >::operations_type, class Resizer = initially_resizer>
boost::numeric::odeint::bulirsch_stoer< State, Value, Deriv, Time, Algebra, Operations, Resizer >::bulirsch_stoer ( value_type  eps_abs = 1E-6,
value_type  eps_rel = 1E-6,
value_type  factor_x = 1.0,
value_type  factor_dxdt = 1.0 
)
inline

Constructs the bulirsch_stoer class, including initialization of the error bounds.

Parameters
eps_absAbsolute tolerance level.
eps_relRelative tolerance level.
factor_xFactor for the weight of the state.
factor_dxdtFactor for the weight of the derivative.

References BOOST_USING_STD_MAX, BOOST_USING_STD_MIN, and boost::multiprecision::backends::i.

Member Function Documentation

template<class State , class Value = double, class Deriv = State, class Time = Value, class Algebra = typename algebra_dispatcher< State >::algebra_type, class Operations = typename operations_dispatcher< State >::operations_type, class Resizer = initially_resizer>
template<class StateIn >
boost::numeric::odeint::bulirsch_stoer< State, Value, Deriv, Time, Algebra, Operations, Resizer >::adjust_size ( const StateIn &  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.

References boost::numeric::odeint::modified_midpoint< State, Value, Deriv, Time, Algebra, Operations, Resizer >::adjust_size().

template<class State , class Value = double, class Deriv = State, class Time = Value, class Algebra = typename algebra_dispatcher< State >::algebra_type, class Operations = typename operations_dispatcher< State >::operations_type, class Resizer = initially_resizer>
void boost::numeric::odeint::bulirsch_stoer< State, Value, Deriv, Time, Algebra, Operations, Resizer >::reset ( void  )
inline
template<class State , class Value = double, class Deriv = State, class Time = Value, class Algebra = typename algebra_dispatcher< State >::algebra_type, class Operations = typename operations_dispatcher< State >::operations_type, class Resizer = initially_resizer>
template<class System , class StateInOut >
boost::numeric::odeint::bulirsch_stoer< State, Value, Deriv, Time, Algebra, Operations, Resizer >::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. Also, the internal order of the stepper is adjusted if required.

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.

Referenced by boost::numeric::odeint::bulirsch_stoer< State, Value, Deriv, Time, Algebra, Operations, Resizer >::try_step().

template<class State , class Value = double, class Deriv = State, class Time = Value, class Algebra = typename algebra_dispatcher< State >::algebra_type, class Operations = typename operations_dispatcher< State >::operations_type, class Resizer = initially_resizer>
template<class System , class StateInOut >
controlled_step_result boost::numeric::odeint::bulirsch_stoer< State, Value, Deriv, Time, Algebra, Operations, Resizer >::try_step ( System  system,
const StateInOut &  x,
time_type t,
time_type dt 
)
inline

Second version to solve the forwarding problem, can be used with Boost.Range as StateInOut.

template<class State , class Value = double, class Deriv = State, class Time = Value, class Algebra = typename algebra_dispatcher< State >::algebra_type, class Operations = typename operations_dispatcher< State >::operations_type, class Resizer = initially_resizer>
template<class System , class StateInOut , class DerivIn >
boost::numeric::odeint::bulirsch_stoer< State, Value, Deriv, Time, Algebra, Operations, Resizer >::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. Also, the internal order of the stepper is adjusted if required.

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::numeric::odeint::state_wrapper< V, Enabler >::m_v, boost::ref(), boost::numeric::odeint::success, template, and boost::numeric::odeint::bulirsch_stoer< State, Value, Deriv, Time, Algebra, Operations, Resizer >::try_step().

template<class State , class Value = double, class Deriv = State, class Time = Value, class Algebra = typename algebra_dispatcher< State >::algebra_type, class Operations = typename operations_dispatcher< State >::operations_type, class Resizer = initially_resizer>
template<class System , class StateIn , class StateOut >
boost::numeric::odeint::bulirsch_stoer< State, Value, Deriv, Time, Algebra, Operations, Resizer >::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. Also, the internal order of the stepper is adjusted if required.

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::numeric::odeint::state_wrapper< V, Enabler >::m_v, boost::ref(), template, boost::numeric::odeint::bulirsch_stoer< State, Value, Deriv, Time, Algebra, Operations, Resizer >::try_step(), and boost::detail::type.

template<class State , class Value = double, class Deriv = State, class Time = Value, class Algebra = typename algebra_dispatcher< State >::algebra_type, class Operations = typename operations_dispatcher< State >::operations_type, class Resizer = initially_resizer>
template<class System , class StateIn , class DerivIn , class StateOut >
boost::numeric::odeint::bulirsch_stoer< State, Value, Deriv, Time, Algebra, Operations, Resizer >::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. Also, the internal order of the stepper is adjusted if required.

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::explicit_stepper_base< Stepper, Order, State, Value, Deriv, Time, Algebra, Operations, Resizer >::do_step(), boost::sinks::event_log::error, boost::numeric::odeint::default_error_checker< Value, Algebra, Operations >::error(), boost::numeric::odeint::fail, boost::numeric::odeint::state_wrapper< V, Enabler >::m_v, boost::accumulators::extract::max, boost::accumulators::extract::min, boost::ref(), boost::numeric::odeint::bulirsch_stoer< State, Value, Deriv, Time, Algebra, Operations, Resizer >::reset(), boost::numeric::odeint::modified_midpoint< State, Value, Deriv, Time, Algebra, Operations, Resizer >::set_steps(), boost::numeric::odeint::success, template, and boost::detail::type.

Member Data Documentation

template<class State , class Value = double, class Deriv = State, class Time = Value, class Algebra = typename algebra_dispatcher< State >::algebra_type, class Operations = typename operations_dispatcher< State >::operations_type, class Resizer = initially_resizer>
const size_t boost::numeric::odeint::bulirsch_stoer< State, Value, Deriv, Time, Algebra, Operations, Resizer >::m_k_max = 8
static

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