...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Home | Libraries | People | FAQ | More |
boost::numeric::odeint::bulirsch_stoer — The Bulirsch-Stoer algorithm.
// In header: <boost/numeric/odeint/stepper/bulirsch_stoer.hpp> template<typename State, typename Value = double, typename Deriv = State, typename Time = Value, typename Algebra = typename algebra_dispatcher< State >::algebra_type, typename Operations = typename operations_dispatcher< State >::operations_type, typename Resizer = initially_resizer> class bulirsch_stoer { 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; // construct/copy/destruct bulirsch_stoer(value_type = 1E-6, value_type = 1E-6, value_type = 1.0, value_type = 1.0, time_type = static_cast< time_type >(0)); // public member functions template<typename System, typename StateInOut> controlled_step_result try_step(System, StateInOut &, time_type &, time_type &); template<typename System, typename StateInOut> controlled_step_result try_step(System, const StateInOut &, time_type &, time_type &); template<typename System, typename StateInOut, typename DerivIn> controlled_step_result try_step(System, StateInOut &, const DerivIn &, time_type &, time_type &); template<typename System, typename StateIn, typename StateOut> boost::disable_if< boost::is_same< StateIn, time_type >, controlled_step_result >::type try_step(System, const StateIn &, time_type &, StateOut &, time_type &); template<typename System, typename StateIn, typename DerivIn, typename StateOut> controlled_step_result try_step(System, const StateIn &, const DerivIn &, time_type &, StateOut &, time_type &); void reset(); template<typename StateIn> void adjust_size(const StateIn &); // private member functions template<typename StateIn> bool resize_m_dxdt(const StateIn &); template<typename StateIn> bool resize_m_xnew(const StateIn &); template<typename StateIn> bool resize_impl(const StateIn &); template<typename System, typename StateInOut> controlled_step_result try_step_v1(System, StateInOut &, time_type &, time_type &); template<typename StateInOut> void extrapolate(size_t, state_table_type &, const value_matrix &, StateInOut &); time_type calc_h_opt(time_type, value_type, size_t) const; controlled_step_result set_k_opt(size_t, const inv_time_vector &, const time_vector &, time_type &); bool in_convergence_window(size_t) const; bool should_reject(value_type, size_t) const; // public data members static const size_t m_k_max; };
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.
typename State
The state type.
typename Value = double
The value type.
typename Deriv = State
The type representing the time derivative of the state.
typename Time = Value
The time representing the independent variable - the time.
typename Algebra = typename algebra_dispatcher< State >::algebra_type
The algebra type.
typename Operations = typename operations_dispatcher< State >::operations_type
The operations type.
typename Resizer = initially_resizer
The resizer policy type.
bulirsch_stoer
public
construct/copy/destructbulirsch_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, time_type max_dt = static_cast< time_type >(0));Constructs the
bulirsch_stoer
class, including initialization of the error bounds.
Parameters: |
|
bulirsch_stoer
public member functionstemplate<typename System, typename StateInOut> controlled_step_result try_step(System system, StateInOut & x, time_type & t, time_type & dt);
template<typename System, typename 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.
template<typename System, typename StateInOut, typename DerivIn> controlled_step_result try_step(System system, StateInOut & x, const DerivIn & dxdt, time_type & t, time_type & dt);
template<typename System, typename StateIn, typename 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);
template<typename System, typename StateIn, typename DerivIn, typename StateOut> controlled_step_result try_step(System system, const StateIn & in, const DerivIn & dxdt, time_type & t, StateOut & out, time_type & dt);
void reset();Resets the internal state of the stepper.
template<typename StateIn> void adjust_size(const StateIn & x);Adjust the size of all temporaries in the stepper manually.
Parameters: |
|
bulirsch_stoer
private member functionstemplate<typename StateIn> bool resize_m_dxdt(const StateIn & x);
template<typename StateIn> bool resize_m_xnew(const StateIn & x);
template<typename StateIn> bool resize_impl(const StateIn & x);
template<typename System, typename StateInOut> controlled_step_result try_step_v1(System system, StateInOut & x, time_type & t, time_type & dt);
template<typename StateInOut> void extrapolate(size_t k, state_table_type & table, const value_matrix & coeff, StateInOut & xest);
time_type calc_h_opt(time_type h, value_type error, size_t k) const;
controlled_step_result set_k_opt(size_t k, const inv_time_vector & work, const time_vector & h_opt, time_type & dt);
bool in_convergence_window(size_t k) const;
bool should_reject(value_type error, size_t k) const;