Class FractionalAdams<T>
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
- 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
alphadoubleThe fractional order, in (0, 1].
Exceptions
- ArgumentException
alphaisn'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
odeFunc<double, T, T>The right-hand side f(t, y).
y0TThe initial value.
tMaxdoubleThe grid's end.
stepsintThe number of steps.
Returns
- T[]
The
steps+ 1 values.
Exceptions
- ArgumentNullException
odeis null.- ArgumentException
tMaxorstepsisn't positive.