The classical Runge-Kutta stepper of fourth order. More...
#include <runge_kutta4.hpp>
Public Types | |
typedef explicit_generic_rk < 4, 4, State, Value, Deriv, Time, Algebra, Operations, Resizer > | stepper_base_type |
typedef stepper_base_type::state_type | state_type |
typedef stepper_base_type::value_type | value_type |
typedef stepper_base_type::deriv_type | deriv_type |
typedef stepper_base_type::time_type | time_type |
typedef stepper_base_type::algebra_type | algebra_type |
typedef stepper_base_type::operations_type | operations_type |
typedef stepper_base_type::resizer_type | resizer_type |
typedef stepper_base_type::wrapped_state_type | wrapped_state_type |
typedef stepper_base_type::wrapped_deriv_type | wrapped_deriv_type |
typedef stepper_base_type::stepper_type | stepper_type |
typedef detail::generic_rk_algorithm < StageCount, Value, Algebra, Operations > | rk_algorithm_type |
typedef rk_algorithm_type::coef_a_type | coef_a_type |
typedef rk_algorithm_type::coef_b_type | coef_b_type |
typedef rk_algorithm_type::coef_c_type | coef_c_type |
typedef explicit_stepper_base < explicit_generic_rk < StageCount, Order, State, Value, Deriv, Time, Algebra, Operations, Resizer >, Order, State, Value, Deriv, Time, Algebra, Operations, Resizer > | internal_stepper_base_type |
typedef stepper_tag | stepper_category |
typedef algebra_stepper_base < Algebra, Operations > | algebra_stepper_base_type |
typedef unsigned short | order_type |
Public Member Functions | |
runge_kutta4 (const algebra_type &algebra=algebra_type()) | |
Constructs the runge_kutta4 class. More... | |
void | do_step_impl (System system, const StateIn &in, const DerivIn &dxdt, time_type t, StateOut &out, time_type dt) |
This method performs one step. More... | |
void | adjust_size (const StateIn &x) |
Adjust the size of all temporaries in the stepper manually. More... | |
order_type | order (void) const |
void | do_step (System system, StateInOut &x, time_type t, time_type dt) |
This method performs one step. More... | |
void | do_step (System system, const StateInOut &x, time_type t, time_type dt) |
Second version to solve the forwarding problem, can be called with Boost.Range as StateInOut. More... | |
boost::disable_if < boost::is_same< DerivIn, time_type >, void >::type | do_step (System system, StateInOut &x, const DerivIn &dxdt, time_type t, time_type dt) |
The method performs one step. More... | |
void | do_step (System system, const StateIn &in, time_type t, StateOut &out, time_type dt) |
The method performs one step. More... | |
void | do_step (System system, const StateIn &in, const DerivIn &dxdt, time_type t, StateOut &out, time_type dt) |
The method performs one step. More... | |
algebra_type & | algebra () |
const algebra_type & | algebra () const |
Static Public Attributes | |
static const size_t | stage_count |
static const order_type | order_value |
Protected Attributes | |
wrapped_deriv_type | m_dxdt |
algebra_type | m_algebra |
The classical Runge-Kutta stepper of fourth order.
The Runge-Kutta method of fourth order is one standard method for solving ordinary differential equations and is widely used, see also en.wikipedia.org/wiki/Runge-Kutta_methods The method is explicit and fulfills the Stepper concept. Step size control or continuous output are not provided.
This class derives from explicit_stepper_base and inherits its interface via CRTP (current recurring template pattern). Furthermore, it derivs from explicit_generic_rk which is a generic Runge-Kutta algorithm. For more details see explicit_stepper_base and explicit_generic_rk.
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. |
|
inherited |
typedef stepper_base_type::algebra_type boost::numeric::odeint::runge_kutta4< State, Value, Deriv, Time, Algebra, Operations, Resizer >::algebra_type |
|
inherited |
|
inherited |
|
inherited |
typedef stepper_base_type::deriv_type boost::numeric::odeint::runge_kutta4< State, Value, Deriv, Time, Algebra, Operations, Resizer >::deriv_type |
|
inherited |
typedef stepper_base_type::operations_type boost::numeric::odeint::runge_kutta4< State, Value, Deriv, Time, Algebra, Operations, Resizer >::operations_type |
|
inherited |
typedef stepper_base_type::resizer_type boost::numeric::odeint::runge_kutta4< State, Value, Deriv, Time, Algebra, Operations, Resizer >::resizer_type |
|
inherited |
typedef stepper_base_type::state_type boost::numeric::odeint::runge_kutta4< State, Value, Deriv, Time, Algebra, Operations, Resizer >::state_type |
typedef explicit_generic_rk< 4 , 4 , State , Value , Deriv , Time , Algebra , Operations , Resizer > boost::numeric::odeint::runge_kutta4< State, Value, Deriv, Time, Algebra, Operations, Resizer >::stepper_base_type |
|
inherited |
typedef stepper_base_type::stepper_type boost::numeric::odeint::runge_kutta4< State, Value, Deriv, Time, Algebra, Operations, Resizer >::stepper_type |
typedef stepper_base_type::time_type boost::numeric::odeint::runge_kutta4< State, Value, Deriv, Time, Algebra, Operations, Resizer >::time_type |
typedef stepper_base_type::value_type boost::numeric::odeint::runge_kutta4< State, Value, Deriv, Time, Algebra, Operations, Resizer >::value_type |
typedef stepper_base_type::wrapped_deriv_type boost::numeric::odeint::runge_kutta4< State, Value, Deriv, Time, Algebra, Operations, Resizer >::wrapped_deriv_type |
typedef stepper_base_type::wrapped_state_type boost::numeric::odeint::runge_kutta4< State, Value, Deriv, Time, Algebra, Operations, Resizer >::wrapped_state_type |
|
inline |
Constructs the runge_kutta4 class.
This constructor can be used as a default constructor if the algebra has a default constructor.
algebra | A copy of algebra is made and stored inside explicit_stepper_base. |
|
inlineinherited |
Adjust the size of all temporaries in the stepper manually.
x | A state from which the size of the temporaries to be resized is deduced. |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
This method performs one step.
It transforms the result in-place.
system | The system function to solve, hence the r.h.s. of the ordinary differential equation. It must fulfill the Simple System concept. |
x | The state of the ODE which should be solved. After calling do_step the result is updated in x. |
t | The value of the time, at which the step should be performed. |
dt | The step size. |
|
inlineinherited |
Second version to solve the forwarding problem, can be called with Boost.Range as StateInOut.
|
inlineinherited |
The method performs one step.
Additionally to the other method the derivative of x is also passed to this method. It is supposed to be used in the following way:
The result is updated in place in x. This method is disabled if Time and Deriv are of the same type. In this case the method could not be distinguished from other do_step
versions.
system | The system function to solve, hence the r.h.s. of the ODE. It must fulfill the Simple System concept. |
x | The state of the ODE which should be solved. After calling do_step the result is updated in x. |
dxdt | The derivative of x at t. |
t | The value of the time, at which the step should be performed. |
dt | The step size. |
|
inlineinherited |
The method performs one step.
The state of the ODE is updated out-of-place.
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. in is not modified in this method |
t | The value of the time, at which the step should be performed. |
out | The result of the step is written in out. |
dt | The step size. |
|
inlineinherited |
The method performs one step.
The state of the ODE is updated out-of-place. Furthermore, the derivative of x at t is passed to the stepper. It is supposed to be used in the following way:
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. in is not modified in this method |
dxdt | The derivative of x at t. |
t | The value of the time, at which the step should be performed. |
out | The result of the step is written in out. |
dt | The step size. |
|
inlineinherited |
This method performs one step.
The derivative dxdt
of in
at the time t
is passed to the method. The result is updated out of place, hence the input is in in
and the output in out
. Access to this step functionality is provided by explicit_stepper_base and do_step_impl
should not be called directly.
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. in is not modified in this method |
dxdt | The derivative of x at t. |
t | The value of the time, at which the step should be performed. |
out | The result of the step is written in out. |
dt | The step size. |
References boost::numeric::odeint::detail::_1, boost::bind(), boost::numeric::odeint::algebra_stepper_base< Algebra, Operations >::m_algebra, boost::numeric::odeint::state_wrapper< V, Enabler >::m_v, boost::ref(), and template.
|
inlineinherited |
|
protectedinherited |
Referenced by boost::numeric::odeint::algebra_stepper_base< algebra_type, operations_type >::algebra(), boost::numeric::odeint::euler< State, Value, Deriv, Time, Algebra, Operations, Resizer >::calc_state(), boost::numeric::odeint::runge_kutta_dopri5< State, Value, Deriv, Time, Algebra, Operations, Resizer >::calc_state(), boost::numeric::odeint::velocity_verlet< Coor, Velocity, Value, Acceleration, Time, TimeSq, Algebra, Operations, Resizer >::do_step(), boost::numeric::odeint::euler< State, Value, Deriv, Time, Algebra, Operations, Resizer >::do_step_impl(), boost::numeric::odeint::modified_midpoint< state_type, value_type, deriv_type, time_type, algebra_type, operations_type, resizer_type >::do_step_impl(), boost::numeric::odeint::runge_kutta4_classic< State, Value, Deriv, Time, Algebra, Operations, Resizer >::do_step_impl(), boost::numeric::odeint::runge_kutta_dopri5< State, Value, Deriv, Time, Algebra, Operations, Resizer >::do_step_impl(), boost::numeric::odeint::runge_kutta_cash_karp54_classic< State, Value, Deriv, Time, Algebra, Operations, Resizer >::do_step_impl(), boost::numeric::odeint::explicit_error_generic_rk< 6, 5, 5, 4, State, Value, Deriv, Time, Algebra, Operations, Resizer >::do_step_impl(), and boost::numeric::odeint::explicit_generic_rk< 4, 4, State, Value, Deriv, Time, Algebra, Operations, Resizer >::do_step_impl().
|
protectedinherited |
|
staticinherited |
|
staticinherited |