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

The Bulirsch-Stoer algorithm. More...

#include <bulirsch_stoer_dense_out.hpp>

Collaboration diagram for boost::numeric::odeint::bulirsch_stoer_dense_out< 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 dense_output_stepper_tag stepper_category
 
typedef state_wrapper< state_typewrapped_state_type
 
typedef state_wrapper< deriv_typewrapped_deriv_type
 
typedef
bulirsch_stoer_dense_out
< 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_vector_type
 
typedef std::vector
< wrapped_deriv_type
deriv_vector_type
 
typedef std::vector
< deriv_vector_type
deriv_table_type
 

Public Member Functions

 bulirsch_stoer_dense_out (value_type eps_abs=1E-6, value_type eps_rel=1E-6, value_type factor_x=1.0, value_type factor_dxdt=1.0, bool control_interpolation=false)
 Constructs the bulirsch_stoer class, including initialization of the error bounds. More...
 
template<class System , class StateIn , class DerivIn , class StateOut , class DerivOut >
controlled_step_result try_step (System system, const StateIn &in, const DerivIn &dxdt, time_type &t, StateOut &out, DerivOut &dxdt_new, time_type &dt)
 Tries to perform one step. More...
 
template<class StateType >
void initialize (const StateType &x0, const time_type &t0, const time_type &dt0)
 Initializes the dense output stepper. More...
 
template<class System >
std::pair< time_type, time_typedo_step (System system)
 Does one time step. More...
 
template<class StateOut >
void calc_state (time_type t, StateOut &x) const
 Calculates the solution at an intermediate point within the last step. More...
 
const state_typecurrent_state (void) const
 Returns the current state of the solution. More...
 
time_type current_time (void) const
 Returns the current time of the solution. More...
 
const state_typeprevious_state (void) const
 Returns the last state of the solution. More...
 
time_type previous_time (void) const
 Returns the last time of the solution. More...
 
time_type current_time_step (void) const
 Returns the current step size. 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_dense_out< 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. This class also provides dense output facility.

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_dense_out< 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_dense_out< State , Value , Deriv , Time , Algebra , Operations , Resizer > boost::numeric::odeint::bulirsch_stoer_dense_out< 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 std::vector< deriv_vector_type > boost::numeric::odeint::bulirsch_stoer_dense_out< State, Value, Deriv, Time, Algebra, Operations, Resizer >::deriv_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 Deriv boost::numeric::odeint::bulirsch_stoer_dense_out< 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< wrapped_deriv_type > boost::numeric::odeint::bulirsch_stoer_dense_out< State, Value, Deriv, Time, Algebra, Operations, Resizer >::deriv_vector_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_dense_out< 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_dense_out< 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_dense_out< 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_dense_out< 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_dense_out< 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 State boost::numeric::odeint::bulirsch_stoer_dense_out< 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 std::vector< wrapped_state_type > boost::numeric::odeint::bulirsch_stoer_dense_out< State, Value, Deriv, Time, Algebra, Operations, Resizer >::state_vector_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 dense_output_stepper_tag boost::numeric::odeint::bulirsch_stoer_dense_out< 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_dense_out< 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_dense_out< 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_dense_out< 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_dense_out< 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_dense_out< 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_dense_out< 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_dense_out< 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_dense_out< State, Value, Deriv, Time, Algebra, Operations, Resizer >::bulirsch_stoer_dense_out ( value_type  eps_abs = 1E-6,
value_type  eps_rel = 1E-6,
value_type  factor_x = 1.0,
value_type  factor_dxdt = 1.0,
bool  control_interpolation = false 
)
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.
control_interpolationSet true to additionally control the error of the interpolation.

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_dense_out< 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_dense_out< 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>
template<class StateOut >
boost::numeric::odeint::bulirsch_stoer_dense_out< State, Value, Deriv, Time, Algebra, Operations, Resizer >::calc_state ( time_type  t,
StateOut &  x 
) const
inline

Calculates the solution at an intermediate point within the last step.

Parameters
tThe time at which the solution should be calculated, has to be in the current time interval.
xThe output variable where the result is written into.
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_dense_out< State, Value, Deriv, Time, Algebra, Operations, Resizer >::current_state ( void  ) const
inline

Returns the current state of the solution.

Returns
The current state of the solution x(t).
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_dense_out< State, Value, Deriv, Time, Algebra, Operations, Resizer >::current_time ( void  ) const
inline

Returns the current time of the solution.

Returns
The current time of the solution t.
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_dense_out< State, Value, Deriv, Time, Algebra, Operations, Resizer >::current_time_step ( void  ) const
inline

Returns the current step size.

Returns
The current step 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>
template<class System >
boost::numeric::odeint::bulirsch_stoer_dense_out< State, Value, Deriv, Time, Algebra, Operations, Resizer >::do_step ( System  system)
inline

Does one time step.

This is the main method that should be used to integrate an ODE with this stepper.

Note
initialize has to be called before using this method to set the initial conditions x,t and the stepsize.
Parameters
systemThe system function to solve, hence the r.h.s. of the ordinary differential equation. It must fulfill the Simple System concept.
Returns
Pair with start and end time of the integration step.

References count, boost::numeric::odeint::fail, boost::xpressive::make_pair, boost::numeric::odeint::bulirsch_stoer_dense_out< 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 StateType >
boost::numeric::odeint::bulirsch_stoer_dense_out< State, Value, Deriv, Time, Algebra, Operations, Resizer >::initialize ( const StateType &  x0,
const time_type t0,
const time_type dt0 
)
inline

Initializes the dense output stepper.

Parameters
x0The initial state.
t0The initial time.
dt0The initial time step.

References boost::numeric::odeint::detail::_1, boost::bind(), boost::numeric::odeint::copy(), boost::ref(), boost::numeric::odeint::bulirsch_stoer_dense_out< State, Value, Deriv, Time, Algebra, Operations, Resizer >::reset(), and template.

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_dense_out< State, Value, Deriv, Time, Algebra, Operations, Resizer >::previous_state ( void  ) const
inline

Returns the last state of the solution.

Returns
The last state of the solution x(t-dt).
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_dense_out< State, Value, Deriv, Time, Algebra, Operations, Resizer >::previous_time ( void  ) const
inline

Returns the last time of the solution.

Returns
The last time of the solution t-dt.
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_dense_out< 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 StateIn , class DerivIn , class StateOut , class DerivOut >
boost::numeric::odeint::bulirsch_stoer_dense_out< State, Value, Deriv, Time, Algebra, Operations, Resizer >::try_step ( System  system,
const StateIn &  in,
const DerivIn &  dxdt,
time_type t,
StateOut &  out,
DerivOut &  dxdt_new,
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::BOOST_PREVENT_MACRO_SUBSTITUTION(), BOOST_USING_STD_MAX, BOOST_USING_STD_MIN, boost::numeric::odeint::modified_midpoint_dense_out< 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::numeric::pow(), pow(), boost::numeric::odeint::modified_midpoint_dense_out< State, Value, Deriv, Time, Algebra, Operations, Resizer >::set_steps(), boost::numeric::odeint::success, template, and boost::detail::type.

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

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_dense_out< State, Value, Deriv, Time, Algebra, Operations, Resizer >::m_k_max = 8
static

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