AdamBashforth#
- class fridom.framework.time_steppers.AdamBashforth(dt: float = 1, order: int = 3, eps: float = 0.01)[source]#
Bases:
TimeStepperAdam Bashforth time stepping up to 4th order.
Parameters#
- dtfloat
Time step size. (default 0.01)
- orderint
Order of the time stepping. (default 3, max 4)
- epsfloat
2nd order bashforth correction. (default 0.01)
Description#
The Adam Bashforth time stepping scheme is a multi-step explicit time stepping scheme. It solves a given PDE
\[\partial_t \boldsymbol{z} = \boldsymbol{F}(\boldsymbol{z}, t)\]by using the following scheme of order \(n\)
\[\boldsymbol{z}^{n+1} = \boldsymbol{z}^n + \Delta t \sum_{j=0}^{n-1} \alpha_j \boldsymbol{F}(\boldsymbol{z}^{n-j}, t^{n-j})\]where \(\alpha_i\) are the Adam Bashforth coefficients, \(\Delta t\) is the time step size, \(\boldsymbol{z}^j\) is the state at time \(t^j = t_0 + j \Delta t\). The coefficients for orders 1 to 4 are given in the table below.
Order
\(\alpha_1\)
\(\alpha_2\)
\(\alpha_3\)
\(\alpha_4\)
1
1
2
3/2 + epsilon
-1/2 - epsilon
3
23/12
-4/3
5/12
4
55/24
-59/24
37/24
-3/8
Stability Analysis#
Let \(\lambda\) be the eigenvalues of the right-hand side of the PDE, e.g:
\[\partial_t \boldsymbol{z} = \boldsymbol{F}(\boldsymbol{z}, t) = -i \lambda \boldsymbol{z}\]Inserting this into the Adam Bashforth scheme gives:
\[\boldsymbol{z}^{n+1} = \sum_{j=0}^{n-1} c_j \boldsymbol{z}^{n-j}\]where
\[\begin{split}c_j = \begin{cases} 1 - i \Delta t \lambda & \text{if } j = 0 \\ -i \Delta t \lambda & \text{if } j > 0 \end{cases}\end{split}\]We now insert the Ansatz:
\[\boldsymbol{z}^n = \boldsymbol{z}_0 e^{-i \omega n \Delta t} = \boldsymbol{z}_0 x^n\]with \(x = e^{-i \omega \Delta t}\). This yields a polynomial equation for \(x\):
\[x^{n+1} = \sum_{j=0}^{n-1} c_j x^{n-j}\]Finally, we find the eigenvalues of the time stepping scheme by solving the polynomial equation for \(x\) numerically and taking the logarithm:
\[\omega = -i \log(x) / \Delta t\]Methods
__init__([dt, order, eps])disable()Disable the module.
enable()Enable the module.
is_enabled()Whether the module is enabled or not.
reset()Stop and start the module.
setup(mset[, setup_mode])Set the module up.
start()Start the module.
stop()Stop the module.
time_discretization_effect(omega)Compute the time discretization effect on a frequency.
update(mz)Update the time stepper.
Upward ramping of Adam-Bashforth coefficients after restart.
Update pointer for Adam-Bashforth time stepping.
Attributes
diff_moduleThe differentiation module to be used by this module.
dtTime step size.
Pointer on the current tendency term.
gridThe grid of the model settings.
Return a dictionary with information about the time stepper.
interp_moduleThe interpolation module to be used by this module.
is_setupWhether the module is set up.
msetThe model settings.
required_haloThe required halo points for this module.
Examples using
fridom.framework.time_steppers.AdamBashforth#- name = 'Adam Bashforth'#
- update(mz: ModelState) ModelState[source]#
Update the time stepper.
- time_discretization_effect(omega: ndarray) ndarray[source]#
Compute the time discretization effect on a frequency.
Parameters#
- omegandarray | float | complex
The frequency of the wave.
Returns#
- ndarray
The frequency of the wave including the time discretization effect.
- property info: dict#
Return a dictionary with information about the time stepper.
Description#
This method should be overridden by the child class to return a dictionary with information about the time stepper. This information is used to print the time stepper in the __repr__ method.
- property dz: VectorField#
Pointer on the current tendency term.