Table of Contents

Class FractionalAdams<T>

Namespace
NanoQL.Numerics
Assembly
NanoQL.dll

The fractional Adams-Bashforth-Moulton predictor-corrector scheme for the fractional initial value problem D^α y(t) = f(t, y(t)), y(0) = y₀, α in (0, 1], D^α the Caputo derivative; at α = 1, the classical one-step Adams-Bashforth-Moulton method.

public sealed class FractionalAdams<T> where T : INumberBase<T>

Type Parameters

T

The solution's type: double, or Complex for a complex equation.

Inheritance
FractionalAdams<T>
Inherited Members

Remarks

QuantLib's real weights multiply the values componentwise, as C++ multiplies a std::complex by a real. The kernel's memory makes the cost O(N²) in the number of steps.

Immutable and thread-safe: it holds only its order, and each solve works on its own arrays.

Reference: K. Diethelm, N. J. Ford, A. D. Freed, A Predictor-Corrector Approach for the Numerical Solution of Fractional Differential Equations, Nonlinear Dynamics 29, 3-22 (2002).

Constructors

FractionalAdams(double)

Initializes a new instance of the FractionalAdams<T> class.

public FractionalAdams(double alpha)

Parameters

alpha double

The fractional order, in (0, 1].

Exceptions

ArgumentException

alpha isn't in (0, 1].

Methods

Solve(Func<double, T, T>, T, double, int)

The solution's values on the uniform grid {0, Δt, …, t_max}.

public T[] Solve(Func<double, T, T> ode, T y0, double tMax, int steps)

Parameters

ode Func<double, T, T>

The right-hand side f(t, y).

y0 T

The initial value.

tMax double

The grid's end.

steps int

The number of steps.

Returns

T[]

The steps + 1 values.

Exceptions

ArgumentNullException

ode is null.

ArgumentException

tMax or steps isn't positive.