Basic steppers execute one timestep of a specific order with a given stepsize.
They usually allocate internal memory to store intermediate function call
results. If state types with variable size are used (e.g. vector),
it has to be assured that the stepper gets informed about any change of the
state size by calling its adjust_size
method.
Associated Types
|
Description |
||
|---|---|---|
|
Time |
Stepper::time_type |
Type of the time variable, e.g. |
|
Container |
Stepper::container_type |
Type of the system state, e.g. |
|
Value |
Stepper::value_type |
Value type of the state, e.g. |
|
Order Type |
Stepper::order_type |
Type of the order parameter, usually |
Methods
Stepper()
Constructor.
Stepper(
container_type &x )
Constructor that allocates internal memory to store intermediate results
of the same size as x.
void do_step( DynamicalSystem
&system
, container_type
&x
, time_type
t ,
time_type dt
)
Executes one timestep with the given parameters:
|
Parameter |
Type |
Description |
|---|---|---|
|
system |
DynamicalSystem |
Function (callable object) that computes the rhs of the ode |
|
x |
container_type |
The current state of the system x(t) |
|
t |
time_type |
The current time t |
|
dt |
time_type |
Length of the timestep to be executed |
The result of this method is the (approximate) state of the system x(t+dt) and is stored in the variable x (in-place). Note, that the time t is not automatically increased by this
method.
void do_step( DynamicalSystem
&system
, container_type
&x
, const
container_type &dxdt , time_type t
, time_type
dt )
The same as above but with the additional parameter dxdt
that represents the derivative x'(t) = f(x,t)
at the time t.
void adjust_size( const container_type &x )
Adjusts the internal memory to store intermediate results of the same
size as x. This function
must be called whenever the system size changes
during the integration.
order_type order_step() Returns the order of the algorithm.
If n is the order of a method, then
the result of one iteration with the timestep dt
is accurate up to dt^n. That means the
error made by the time discretization is of order dt^(n+1).
Stepper that model this concept
stepper_euler
stepper_rk4
stepper_rk78_fehlberg