|
| 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_type > | do_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_type & | current_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_type & | previous_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...
|
|
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
-
State | The state type. |
Value | The value type. |
Deriv | The type representing the time derivative of the state. |
Time | The time representing the independent variable - the time. |
Algebra | The algebra type. |
Operations | The operations type. |
Resizer | The resizer policy 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>
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_abs | Absolute tolerance level. |
eps_rel | Relative tolerance level. |
factor_x | Factor for the weight of the state. |
factor_dxdt | Factor for the weight of the derivative. |
control_interpolation | Set true to additionally control the error of the interpolation. |
References BOOST_USING_STD_MAX, BOOST_USING_STD_MIN, and boost::multiprecision::backends::i.
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 >
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 >
Calculates the solution at an intermediate point within the last step.
- Parameters
-
t | The time at which the solution should be calculated, has to be in the current time interval. |
x | The 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>
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>
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>
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 >
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
-
system | The 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 >
Initializes the dense output stepper.
- Parameters
-
x0 | The initial state. |
t0 | The initial time. |
dt0 | The 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>
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>
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>
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
-
system | The system function to solve, hence the r.h.s. of the ODE. It must fulfill the Simple System concept. |
in | The state of the ODE which should be solved. |
dxdt | The derivative of state. |
t | The value of the time. Updated if the step is successful. |
out | Used to store the result of the step. |
dt | The 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().