Skip to content

selah_lmm ​

SELAH, L0: linear multistep schemes: their coefficients, their order and their stability bounds.

A k-step linear multistep scheme advances u' = R(t, u) by

u^{n+1} = sum_{j=1..k} a_j u^{n+1-j} + dt sum_{j=0..k} b_j R^{n+1-j}, R^m = R(t^m, u^m),

explicit when b_0 = 0. lmm_coefficients holds k, a(1:k) and b(0:k); it is the L0 data of every multistep family: Adams–Bashforth, LMM-SSP, Adams–Moulton, Adams–Bashforth–Moulton (the corrector's) and BDF; the implicit ones (b_0 /= 0) run by fixed-point stages (selah_stepper), whose step's bounds are fixed_point_*_axis_bound. Its characteristic polynomials are rho(zeta) = zeta^k - sum_j a_j zeta^{k-j} and sigma(zeta) = sum_j b_j zeta^{k-j}.

Order. lmm_order(c) is the largest p for which the scheme is exact on the polynomials of degree <= p (u = t^q, q = 0..p, with exact history), checked in R8P with the time origin at the middle of the k levels and each condition scaled by the sum of the magnitudes of its terms: a condition holds when that relative residual is below 1e3 eps(R_P) (the coefficients are R_P values). The order of an explicit k-step Adams–Bashforth scheme is k.

Stability. On u' = mu u, z = mu dt, the scheme is stable when every root of rho(zeta) - z sigma(zeta) has |zeta| <= 1: lmm_roots (Aberth–Ehrlich iterations in complex R8P), and from them lmm_imag_axis_bound (the largest beta with z = i y stable for 0 <= y <= beta) and lmm_real_axis_bound (z = -x). Each is a scan by 1e-4 up to 1e-2, by 1e-3 up to 3 and by 1e-2 up to 100 (100 means "at least 100"), ended by bisection to round-off at the first crossing. Near z = 0 the principal root, zeta_1 = e^z (1 + delta) with delta ~ C z^{p+1}, leaves the unit circle by far less than round-off (AB6: |zeta_1| - 1 ~ y^8 on the imaginary axis), so it is computed apart: Newton on delta, with rho(e^z) - z sigma(e^z) summed as its Taylor series in z, whose terms of degree <= p (the order conditions) are exactly zero and are dropped, and ln|zeta_1| = Re z + Re log(1 + delta) evaluated without cancellation; it counts as stable when ln|zeta_1| <= 64 times the rounding bound of delta. The others count as stable when |zeta| <= 1 + 64 eps. Computed in R8P in every build, as the Runge–Kutta bounds (selah_tableaux).

SchemekOrderReal-axis boundImaginary-axis bound
ab-1 (explicit Euler)1120
ab-22210
ab-3336/110.7236
ab-<k>, k <= 16kklmm_real_axis_boundlmm_imag_axis_bound
am-<k>, k <= 15 (implicit)max(k, 1)k + 1100 (k <= 1), 6, 3, 1.8367, ...100 (k <= 1), ...
abm-<k>, k <= 16 (am-<k-1> corrects ab-<k>)kkthe corrector'sthe corrector's
bdf-<k>, k <= 6 (implicit)kk100100, 100, 0, 0, 0.7108, 0.8431

The Adams–Bashforth coefficients b_j (a_1 = 1, the other a_j = 0, b_0 = 0) are exact rationals, solved from the polynomial-exactness conditions in rational arithmetic and typed with 40 digits (notes/foodie-port-check.py prints and checks them). The leapfrog, u^{n+1} = u^{n-1} + 2 dt R^n, is the 2-step scheme a = (0, 1), b = (0, 2, 0): lmm('leapfrog'), whose bounds are those of selah_leapfrog without its filter (1 and 0).

Source: src/lib/selah_lmm.F90

Dependencies

Contents ​

Variables ​

NameTypeAttributesDescription
AB_MAX_STEPSinteger(kind=I4P)parameterThe largest Adams–Bashforth step count (FOODIE's).
AM_MAX_STEPSinteger(kind=I4P)parameterThe largest Adams–Moulton step count (FOODIE's am-0 .. am-15).
ABM_MAX_STEPSinteger(kind=I4P)parameterThe largest Adams–Bashforth–Moulton step count (FOODIE's).
BDF_MAX_STEPSinteger(kind=I4P)parameterThe largest BDF step count (FOODIE's; past 6 BDF is not zero-stable).
SCHEME_LMM_SSP_32character(len=*)parameterSSP LMM, 3 steps, order 2, C = 1/2.
SCHEME_LMM_SSP_43character(len=*)parameterSSP LMM, 4 steps, order 3, C = 1/3.
SCHEME_LMM_SSP_53character(len=*)parameterSSP LMM, 5 steps, order 3, C = 1/2.
SCHEME_LMM_SSP_VSS_22character(len=*)parameterVariable-step SSP LMM, 2 steps, order 2.
SCHEME_LMM_SSP_VSS_32character(len=*)parameterVariable-step SSP LMM, 3 steps, order 2.
SCHEME_LMM_SSP_VSS_33character(len=*)parameterVariable-step SSP LMM, 3 steps, order 3.
SCHEME_LMM_SSP_VSS_43character(len=*)parameterVariable-step SSP LMM, 4 steps, order 3.
SCHEME_LMM_SSP_VSS_53character(len=*)parameterVariable-step SSP LMM, 5 steps, order 3.
LMM_SSP_SCHEMEScharacter(len=SCHEME_NAME_LEN)parameterThe SSP linear multistep schemes.
SCHEME_MSRK_SSP_223character(len=*)parameterMultistep-multistage SSP RK: 2 steps, 2 stages, order 3.
SCHEME_MSRK_SSP_323character(len=*)parameter3 steps, 2 stages, order 3.
SCHEME_MSRK_SSP_458character(len=*)parameter4 steps, 5 stages, order 8.
MSRK_SSP_SCHEMEScharacter(len=SCHEME_NAME_LEN)parameterAll.

Derived Types ​

msrk_coefficients ​

A multistep-multistage Runge–Kutta scheme (Bresten et al. 2017), its levels j = 0 (U^n) .. steps - 1: Y_1 = U^n; Y_k = sum_j d(k,j) U^{n-j} + dt sum_{j>=1} ah(k,j) R^{n-j} + dt sum_{l<k} a(k,l) R(Y_l); U^{n+1} = sum_j q(j) U^{n-j} + dt sum_{j>=1} bh(j) R^{n-j} + dt sum_l b(l) R(Y_l). R^{n-j} is the residual of U^{n-j}: the first stage's residual of step n - j, kept (FOODIE evaluated it again, its defect F4).

Components

NameTypeAttributesDescription
stepsinteger(kind=I4P)Steps (levels), 0 for an unknown scheme.
stagesinteger(kind=I4P)Stages.
orderinteger(kind=I4P)Order.
dreal(kind=R_P)allocatableSolution weights of the stages [stages, 0:steps-1].
ahreal(kind=R_P)allocatablePast residual weights of the stages [stages, 1:steps-1].
areal(kind=R_P)allocatableStage residual weights [stages, stages].
qreal(kind=R_P)allocatableSolution weights of the update [0:steps-1].
bhreal(kind=R_P)allocatablePast residual weights of the update [1:steps-1].
breal(kind=R_P)allocatableStage residual weights of the update [stages].
creal(kind=R_P)allocatableAbscissae: sum_j -j d(k,j) + sum_j ah(k,j) + sum_l a(k,l).
sspreal(kind=R_P)SSP coefficient (Spijker's criterion, notes/foodie-port-check.py).
real_boundreal(kind=R_P)Real-axis bound (60 digits, notes/foodie-port-check.py).
imag_boundreal(kind=R_P)Imaginary-axis bound (60 digits, notes/foodie-port-check.py).

lmm_coefficients ​

A k-step linear multistep scheme: u^{n+1} = sum_{j=1..k} a(j) u^{n+1-j} + dt sum_{j=0..k} b(j) R^{n+1-j}.

Components

NameTypeAttributesDescription
kinteger(kind=I4P)Steps (levels of history); 0 for an unknown scheme.
areal(kind=R_P)allocatableSolution weights [1:k].
breal(kind=R_P)allocatableResidual weights [0:k]; b(0) the implicit one.

Subroutines ​

lmm_ssp_family ​

The steps, order and variable-step flag of an SSP linear multistep name (LMM_SSP_SCHEMES); k = 0 for any other.

Attributes: pure

fortran
subroutine lmm_ssp_family(scheme, k, p, vss)

Arguments

NameTypeIntentAttributesDescription
schemecharacter(len=*)inScheme name.
kinteger(kind=I4P)outSteps, 0 if not an SSP LMM.
pinteger(kind=I4P)outOrder.
vsslogicaloutVariable step.

Call graph

lmm_history ​

The history a step of the scheme reads besides U^n and R^n: the solution levels U^{n-1} .. U^{n-ms} (ms, the last j with a(j+1) /= 0) and the residual levels R^{n-1} .. R^{n-mr} (mr, the last j with b(j+1) /= 0).

Attributes: pure

fortran
subroutine lmm_history(c, ms, mr)

Arguments

NameTypeIntentAttributesDescription
ctype(lmm_coefficients)inCoefficients.
msinteger(kind=I4P)outSolution levels.
mrinteger(kind=I4P)outResidual levels.

msrk_history ​

The history a step of a multistep-multistage scheme reads besides U^n and R^n: ms solution levels (the last j with d(:,j) or q(j) /= 0) and mr residual levels (the last j with ah(:,j) or bh(j) /= 0).

Attributes: pure

fortran
subroutine msrk_history(m, ms, mr)

Arguments

NameTypeIntentAttributesDescription
mtype(msrk_coefficients)inCoefficients.
msinteger(kind=I4P)outSolution levels.
mrinteger(kind=I4P)outResidual levels.

Call graph

lmm_roots ​

The k roots of rho(zeta) - z sigma(zeta) (Aberth–Ehrlich iterations, complex R8P); a root at infinity (an implicit scheme with z b_0 = 1) is returned as huge. guess, the roots at a nearby z, starts the iterations (unless two of its values coincide: a multiple root, from which Aberth's iterations cannot separate them).

Attributes: pure

fortran
subroutine lmm_roots(c, z, roots, guess)

Arguments

NameTypeIntentAttributesDescription
ctype(lmm_coefficients)inCoefficients.
zcomplex(kind=RB)inmu dt.
rootscomplex(kind=RB)outRoots.
guesscomplex(kind=RB)inoptionalStarting values.

Call graph

Functions ​

ab_name ​

The name of the k-step Adams–Bashforth scheme, ab-<k>.

Attributes: pure

Returns: character(len=:)

fortran
function ab_name(k) result(name)

Arguments

NameTypeIntentAttributesDescription
kinteger(kind=I4P)inSteps.

Call graph

ab_steps ​

The step count of an Adams–Bashforth name (ab-<k>, 1 <= k <= AB_MAX_STEPS), 0 for any other name.

Attributes: pure

Returns: integer(kind=I4P)

fortran
function ab_steps(scheme) result(k)

Arguments

NameTypeIntentAttributesDescription
schemecharacter(len=*)inScheme name.

Call graph

am_name ​

The name of the k-step Adams–Moulton scheme, am-<k> (order k + 1; am-0 is backward Euler, am-1 the trapezoid).

Attributes: pure

Returns: character(len=:)

fortran
function am_name(k) result(name)

Arguments

NameTypeIntentAttributesDescription
kinteger(kind=I4P)inSteps.

Call graph

am_steps ​

The step count of an Adams–Moulton name (am-<k>, 0 <= k <= AM_MAX_STEPS), -1 for any other name.

Attributes: pure

Returns: integer(kind=I4P)

fortran
function am_steps(scheme) result(k)

Arguments

NameTypeIntentAttributesDescription
schemecharacter(len=*)inScheme name.

Call graph

abm_name ​

The name of the k-step Adams–Bashforth–Moulton predictor-corrector, abm-<k> (ab-<k> predicts, am-<k-1> corrects; order k).

Attributes: pure

Returns: character(len=:)

fortran
function abm_name(k) result(name)

Arguments

NameTypeIntentAttributesDescription
kinteger(kind=I4P)inSteps.

abm_steps ​

The step count of an Adams–Bashforth–Moulton name (abm-<k>, 1 <= k <= ABM_MAX_STEPS), 0 for any other name.

Attributes: pure

Returns: integer(kind=I4P)

fortran
function abm_steps(scheme) result(k)

Arguments

NameTypeIntentAttributesDescription
schemecharacter(len=*)inScheme name.

Call graph

bdf_name ​

The name of the k-step backward differentiation formula, bdf-<k> (order k).

Attributes: pure

Returns: character(len=:)

fortran
function bdf_name(k) result(name)

Arguments

NameTypeIntentAttributesDescription
kinteger(kind=I4P)inSteps.

Call graph

bdf_steps ​

The step count of a BDF name (bdf-<k>, 1 <= k <= BDF_MAX_STEPS), 0 for any other name.

Attributes: pure

Returns: integer(kind=I4P)

fortran
function bdf_steps(scheme) result(k)

Arguments

NameTypeIntentAttributesDescription
schemecharacter(len=*)inScheme name.

Call graph

lmm_ssp_vss ​

The SSP linear multistep scheme of k steps and order p (2 or 3) at the step ratio sum omega = sum_{j=1..k-1} dt_{n-j} / dt_n (Hadjimichael, Ketcheson, Loczi & Nemeth 2016, SIAM J. Numer. Anal. 54, 2799), with the increment dt_n of the step being taken:

p = 2: u^{n+1} = (omega^2 - 1)/omega^2 u^n + 1/omega^2 u^{n-k+1} + dt_n (omega + 1)/omega R^n; p = 3: u^{n+1} = (omega + 1)^2 (omega - 2)/omega^3 u^n + (3 omega + 2)/omega^3 u^{n-k+1} + dt_n (omega + 1)^2/omega^2 R^n + dt_n (omega + 1)/omega^2 R^{n-k+1}.

At a constant step omega = k - 1, and these are the fixed-step schemes, each coefficient computed with one rounding of the literal (3/4, 1/4, 3/2; 16/27, 11/27, 16/9, 4/9; 25/32, 7/32, 25/16, 5/16).

Attributes: pure

Returns: type(lmm_coefficients)

fortran
function lmm_ssp_vss(k, p, omega) result(c)

Arguments

NameTypeIntentAttributesDescription
kinteger(kind=I4P)inSteps.
pinteger(kind=I4P)inOrder, 2 or 3.
omegareal(kind=R_P)inSum of the step ratios.

Call graph

lmm_ssp_coefficient ​

The SSP coefficient of an explicit linear multistep scheme: min_j a_j / b_j over b_j > 0, every a_j and b_j non-negative and a_j > 0 where b_j > 0; 0 otherwise (not SSP).

Attributes: pure

Returns: real(kind=R_P)

fortran
function lmm_ssp_coefficient(c) result(cssp)

Arguments

NameTypeIntentAttributesDescription
ctype(lmm_coefficients)inCoefficients.

lmm ​

The coefficients of a linear multistep scheme (the SSP ones at a constant step); k = 0 if the name is unknown.

Attributes: pure

Returns: type(lmm_coefficients)

fortran
function lmm(scheme) result(c)

Arguments

NameTypeIntentAttributesDescription
schemecharacter(len=*)inScheme name.

Call graph

multistep_registers ​

The registers of a multistep scheme in the stepper's multistep form (selah_storage, FORM_MULTISTEP): the stage registers of its start-up scheme (a stage state and s - 1 stage residuals, none for a one-stage start-up), the residual ring (R^n and the mr residual levels) and the solution ring (the ms solution levels); -1 for a name that is no multistep scheme of that form.

Attributes: pure

Returns: integer(kind=I4P)

fortran
function multistep_registers(scheme) result(n)

Arguments

NameTypeIntentAttributesDescription
schemecharacter(len=*)inScheme name.

Call graph

multistep_predictor ​

The predictor of an implicit multistep scheme run by fixed-point stages: the explicit scheme whose step is the first iterate (k = 0: none, the iterations start from U^n).

Attributes: pure

Returns: type(lmm_coefficients)

fortran
function multistep_predictor(scheme) result(cp)

Arguments

NameTypeIntentAttributesDescription
schemecharacter(len=*)inScheme name.

Call graph

multistep_iterations ​

The default fixed-point iterations of an implicit multistep scheme (0 for an explicit one): the fewest that keep its order. From U^n each iteration gains one order (the iterate's error is O(dt) times the previous one's): am-<k> (order k + 1) needs k + 1, bdf-<k> (order k) k; abm-<k> starts from its predictor, ab-<k>, which has the order: 1 (PEC). FOODIE's default is 1 for every family (iterations=1 reproduces it).

Attributes: pure

Returns: integer(kind=I4P)

fortran
function multistep_iterations(scheme) result(m)

Arguments

NameTypeIntentAttributesDescription
schemecharacter(len=*)inScheme name.

Call graph

multistep_order ​

The order of a multistep scheme of the stepper's multistep form; 0 for any other name.

Attributes: pure

Returns: integer(kind=I4P)

fortran
function multistep_order(scheme) result(p)

Arguments

NameTypeIntentAttributesDescription
schemecharacter(len=*)inScheme name.

Call graph

multistep_starter ​

The built-in start-up of a multistep scheme of order p (D8 of #10): starter_for_order(max(p - 1, 1), ssp), ssp when the scheme is SSP (the LMM_SSP_SCHEMES); '' when the catalogue has no explicit Runge–Kutta scheme of that order (p > 11): the caller writes the history.

Attributes: pure

Returns: character(len=:)

fortran
function multistep_starter(scheme) result(name)

Arguments

NameTypeIntentAttributesDescription
schemecharacter(len=*)inScheme name.

Call graph

starter_for_order ​

The catalogue's explicit Runge–Kutta scheme of fewest stages with order >= r: euler, ssp-22, ssp-33, rk4 (ssp: ssp-54), cash-karp-54, calvo-65, feagin-108 (orders 7 to 10); '' for r > 10. No explicit Runge–Kutta scheme is SSP past order 4: ssp asks for the SSP one up to order 4 and is ignored beyond.

Attributes: pure

Returns: character(len=:)

fortran
function starter_for_order(r, ssp) result(name)

Arguments

NameTypeIntentAttributesDescription
rinteger(kind=I4P)inOrder needed.
ssplogicalinStrong stability preserving, if the order allows.

Call graph

msrk ​

The coefficients of a multistep-multistage SSP Runge–Kutta scheme; steps = 0 for any other name. From FOODIE (Bresten, Gottlieb, Grant, Higgs, Ketcheson & Nemeth 2017), through notes/foodie-port-check.py (decision D5 of #10): msrk-ssp-223 and -323 refined onto their order conditions in 60 digits (changes <= 3.7e-16), FOODIE's entries below 1e-18 taken as the zeros they are (its optimiser's residues: 223's ah(2,1) = -1.1e-19, 323's d(2,1) and q(1), 1e-24); msrk-ssp-458 as FOODIE types it (the nearest exact set is 9.5e-15 away, beyond the published digits; its conditions hold to 2.5e-16 relative to their terms).

Attributes: pure

Returns: type(msrk_coefficients)

fortran
function msrk(scheme) result(m)

Arguments

NameTypeIntentAttributesDescription
schemecharacter(len=*)inScheme name.

Call graph

lmm_order ​

The order of the scheme by polynomial exactness (see "Order" above); -1 if it is not even consistent with constants (sum a_j /= 1).

Attributes: pure

Returns: integer(kind=I4P)

fortran
function lmm_order(c) result(p)

Arguments

NameTypeIntentAttributesDescription
ctype(lmm_coefficients)inCoefficients.

Call graph

fixed_point_real_axis_bound ​

The real-axis bound of the step m fixed-point iterations make of the implicit scheme c from the predictor cp (cp%k = 0: from U^n): what a stepper running it has (fixed_point_poly); the converged scheme's is lmm_real_axis_bound(c), reached only where the iterations contract, |z b_0| < 1.

Attributes: pure

Returns: real(kind=R_P)

fortran
function fixed_point_real_axis_bound(c, cp, m) result(beta)

Arguments

NameTypeIntentAttributesDescription
ctype(lmm_coefficients)inThe implicit scheme.
cptype(lmm_coefficients)inThe predictor (k = 0: none).
minteger(kind=I4P)inIterations, >= 1.

Call graph

fixed_point_imag_axis_bound ​

The imaginary-axis bound of the step m fixed-point iterations make of the implicit scheme c (as fixed_point_real_axis_bound).

Attributes: pure

Returns: real(kind=R_P)

fortran
function fixed_point_imag_axis_bound(c, cp, m) result(beta)

Arguments

NameTypeIntentAttributesDescription
ctype(lmm_coefficients)inThe implicit scheme.
cptype(lmm_coefficients)inThe predictor (k = 0: none).
minteger(kind=I4P)inIterations, >= 1.

Call graph

lmm_imag_axis_bound ​

The largest beta with every root |zeta| <= 1 for z = i y, 0 <= y <= beta (see "Stability" above).

Attributes: pure

Returns: real(kind=R_P)

fortran
function lmm_imag_axis_bound(c) result(beta)

Arguments

NameTypeIntentAttributesDescription
ctype(lmm_coefficients)inCoefficients.

Call graph

lmm_real_axis_bound ​

The largest beta with every root |zeta| <= 1 for z = -x, 0 <= x <= beta (see "Stability" above).

Attributes: pure

Returns: real(kind=R_P)

fortran
function lmm_real_axis_bound(c) result(beta)

Arguments

NameTypeIntentAttributesDescription
ctype(lmm_coefficients)inCoefficients.

Call graph