|
typedef explicit_stepper_base
< euler< State, Value, Deriv,
Time, Algebra, Operations,
Resizer >, 1, 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::stepper_type | stepper_type |
|
typedef
stepper_base_type::wrapped_state_type | wrapped_state_type |
|
typedef
stepper_base_type::wrapped_deriv_type | wrapped_deriv_type |
|
typedef explicit_stepper_base
< euler< 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 |
|
|
| euler (const algebra_type &algebra=algebra_type()) |
| Constructs the euler class. More...
|
|
template<class System , class StateIn , class DerivIn , class StateOut > |
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...
|
|
template<class StateOut , class StateIn1 , class StateIn2 > |
void | calc_state (StateOut &x, time_type t, const StateIn1 &old_state, time_type t_old, const StateIn2 ¤t_state, time_type t_new) const |
| This method is used for continuous output and it calculates the state x at a time t from the knowledge of two states old_state and current_state at time points t_old and t_new . More...
|
|
template<class StateType > |
void | adjust_size (const StateType &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...
|
|
void | adjust_size (const StateIn &x) |
| Adjust the size of all temporaries in the stepper manually. More...
|
|
algebra_type & | algebra () |
|
const algebra_type & | algebra () const |
|
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::euler< State, Value, Deriv, Time, Algebra, Operations, Resizer >
An implementation of the Euler method.
The Euler method is a very simply solver for ordinary differential equations. This method should not be used for real applications. It is only useful for demonstration purposes. Step size control is not provided but trivial continuous output is available.
This class derives from explicit_stepper_base and inherits its interface via CRTP (current recurring template pattern), see explicit_stepper_base
- 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>
Constructs the euler class.
This constructor can be used as a default constructor of the algebra has a default constructor.
- Parameters
-
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 >
Adjust the size of all temporaries in the stepper manually.
- Parameters
-
x | A state from which the size of the temporaries to be resized is deduced. |
References boost::numeric::odeint::explicit_stepper_base< euler< State, Value, Deriv, Time, Algebra, Operations, Resizer >, 1, 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 , class StateIn1 , class StateIn2 >
boost::numeric::odeint::euler< State, Value, Deriv, Time, Algebra, Operations, Resizer >::calc_state |
( |
StateOut & |
x, |
|
|
time_type |
t, |
|
|
const StateIn1 & |
old_state, |
|
|
time_type |
t_old, |
|
|
const StateIn2 & |
current_state, |
|
|
time_type |
t_new |
|
) |
| const |
|
inline |
This method is used for continuous output and it calculates the state x
at a time t
from the knowledge of two states old_state
and current_state
at time points t_old
and t_new
.
References boost::polygon::delta(), boost::numeric::odeint::algebra_stepper_base< Algebra, Operations >::m_algebra, boost::numeric::odeint::explicit_stepper_base< euler< State, Value, Deriv, Time, Algebra, Operations, Resizer >, 1, State, Value, Deriv, Time, Algebra, Operations, Resizer >::m_dxdt, and template.
void boost::numeric::odeint::explicit_stepper_base< euler< State, Value, Deriv, Time, Algebra, Operations, Resizer > , Order, State, Value, Deriv, Time, Algebra, Operations, Resizer >::do_step |
( |
System |
system, |
|
|
const StateIn & |
in, |
|
|
time_type |
t, |
|
|
StateOut & |
out, |
|
|
time_type |
dt |
|
) |
| |
|
inlineinherited |
The method performs one step.
The state of the ODE is updated out-of-place.
- Note
- This method does not solve the forwarding problem.
- 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. 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. |
References boost::numeric::odeint::detail::_1, boost::bind(), boost::numeric::odeint::explicit_stepper_base< Stepper, Order, State, Value, Deriv, Time, Algebra, Operations, Resizer >::m_dxdt, boost::numeric::odeint::state_wrapper< V, Enabler >::m_v, boost::ref(), template, 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::euler< State, Value, Deriv, Time, Algebra, Operations, Resizer >::do_step_impl |
( |
System |
system, |
|
|
const StateIn & |
in, |
|
|
const DerivIn & |
dxdt, |
|
|
time_type |
t, |
|
|
StateOut & |
out, |
|
|
time_type |
dt |
|
) |
| |
|
inline |
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.
- 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. 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::algebra_stepper_base< Algebra, Operations >::m_algebra, and template.