Fractional derivative API

FractionalCalculus.jl has a disciplinary type system, by specifying which type you want to use, you can use the relating algorithm to compute fractional differentiation and fractional integral.

This page contains all of the existing API we can use for computing fractional derivative.

FractionalCalculus.fracdiffFunction
fracdiff(f, α, point, h, FracDiffAlg())

fracdiff is the general function for computing fractional derivative.

Example

julia> fracdiff(x->x^2, 0.5, 1, 0.001, RLDiff_Approx())
1.5044908143658473

There are many algorithms can be used to computing fractional derivative, please refer to our manual for more details: http://scifracx.org/FractionalCalculus.jl/dev/Derivative/derivativeapi/.

source

Caputo Sense fractional derivative

FractionalCalculus.CaputoDirectType

Caputo sense fractional derivative.

fracdiff(f::Function, α, start_point, end_point, step_size, ::Caputo)

Example:

julia> fracdiff(x->x^5, 0.5, 0, 2.5, 0.0001, CaputoDirect())

Returns a tuple (result, error), which means the value of this derivative is 141.59714979764541, and the error estimate is 1.1532243848672914e-6.

Refer to Caputo derivative

Note

Caputo Direct algorithms belong to direct computing, precise are ensured, but maybe cause more memory allocation and take more compilation time.

Using the direct mathematic expression:

\[^CD_t^α=\frac{1}{\Gamma(n-α)}\int_0^t\frac{f^{(n)}(τ)}{(t-τ)^{α+1-n}}\]

As for the derivative inside the integral, we use the Complex Step Differentiation to obtain a more accurate value.

source
FractionalCalculus.CaputoPiecewiseType

Caputo sense Piecewise algorithm

fracdiff(f, α, end_point, h, CaputoPiecewise())

Using piecewise linear interpolation function to approximate input function and combining Caputo derivative then implement summation.

Example

julia> fracdiff(x->x^5, 0.5, 2.5, 0.001, CaputoPiecewise())

Return the fractional derivative of $f(x)=x^5$ at point $x=2.5$.

@article{LI20113352,
title = {Numerical approaches to fractional calculus and fractional ordinary differential equation},
author = {Changpin Li and An Chen and Junjie Ye},
}
source
FractionalCalculus.CaputoDiethelmType

Caputo sense Diethelm computation

fracdiff(f, α, end_point, h, CaputoDiethelm())

Using quadrature weights(derived from product trapezoidal rule) to approximate the derivative.

Example

julia> fracdiff(x->x, 0.5, 1, 0.007, CaputoDiethelm())
1.128378318687192
Scope

0 < α < 1

Diethelm's method for computingn Caputo sense fractional derivative using product trapezoidal rule and Richardsin extrapolation

@article{10.1093/imanum/17.3.479,
author = {DIETTELM, KAI},
title = "{Generalized compound quadrature formulae for finite-part integrals}",
journal = {IMA Journal of Numerical Analysis},
doi = {10.1093/imanum/17.3.479},
}
source
FractionalCalculus.CaputoHighPrecisionType

Caputo sense fractioal derivative with p-th order precision.

fracdiff(f, α, t, p, CaputoHighPrecision())

Use the high precision algorithm to compute the Caputo sense fractional derivative.

The p here is the grade of precision.

source
FractionalCalculus.CaputoHighOrderType

Caputo sense fractional derivative high order approximation.

Info

By using CaputoHighOrder method, we can set $0<\alpha<2$

Example

julia> fracdiff(x->x, 0.5, 1, 0.01, 2, CaputoHighOrder())
1.1283791670955123
@article{Li2017HighOrderAT,
  title={High-Order Approximation to Caputo Derivatives and Caputo-type Advection–Diffusion Equations: Revisited},
  author={Changpin Li and Minhao Cai},
  journal={Numerical Functional Analysis and Optimization},
  year={2017},
  volume={38},
  pages={861 - 890}
}
source

Grunwald Letnikov sense fractional derivative

FractionalCalculus.GLDirectType

Grünwald–Letnikov sense fractional dervivative.

fracdiff(f, α, start_point, end_point, GLDirect())

Example:

julia> fracdiff(x->x^5, 0, 0.5, GLDirect())
Scope

Please note Grunwald-Letnikov sense fracdiff only support $0 < \alpha < 1$.

Please refer to Grünwald–Letnikov derivative for more details.

Grunwald Letnikov direct compute method to obtain fractional derivative, precision are guaranteed but cause more memory allocation and compilation time.

source
FractionalCalculus.GLFiniteDifferenceType

Grünwald Letnikov sense finite difference approximation

fracdiff(f::Union{Function, Number}, α::AbstractArray, end_point, h, ::GLFiniteDifference)::Vector

Use finite difference method to obtain Grünwald Letnikov sense fractional derivative.

Example

julia> fracdiff(x->x, 0.5, 1, 0.01, GLFiniteDifference())
1.1269695801851276
source
FractionalCalculus.GLMultiplicativeAdditiveType

Grünwald Letnikov sense Multiplicative and Addtive approximation

fracdiff(f, α, end_point, h, GLMultiplicativeAdditive())

Grünwald–Letnikov multiplication-addition-multiplication-addition··· method to approximate fractional derivative.

Example

julia> fracdiff(x->x, 0.5, 1, 0.007, GLMultiplicativeAdditive())
1.127403405642918
@book{oldham_spanier_1984,
title={The fractional calculus: Theory and applications of differentiation and integration to arbitrary order},
author={Oldham, Keith B. and Spanier, Jerome},
year={1984}} 
source
FractionalCalculus.GLLagrangeThreePointInterpType

Grünwald Letnikov sense three point interpolation

fracdiff(f, α, end_point, h, GLLagrangeThreePointInterp())

Using Lagrange three poitns interpolation to approximate the fractional derivative.

Example

julia> fracdiff(x->x, 0.5, 1, 0.006, GLLagrangeThreePointInterp())
1.1261297605404632
source

Riemann Liouville sense fractional derivative

FractionalCalculus.RLDiffApproxType

Riemann Liouville sense derivative approximation

fracdiff(f, α, end_point, h, RLDiffApprox())

Using Linear interpolation to approximate fractional derivative in Riemann Liouville fractional derivative sense.

Example

julia> fracdiff(x->x^5, 0.5, 2.5, 0.0001, RLDiffApprox())
141.59707906952633
Warning

The RLDiffApprox algorithm only support for 0 < α < 1.

source
FractionalCalculus.RLDiffMatrixType

Riemann Liouville sense derivative using Triangular Strip Matrix to discrete and compute.

fracdiff(f, α, end_point, h, RLDiffMatrix())

Using Triangular Strip Matrix to approximate fractional derivative.

Example

julia> fracdiff(x->x^5, 0.5, 2.5, 0.0001, RLInt_Matrix())
Info

Triangular Strip Matrix method returns the derivative in the interval $[0, T]$ in Vector

@article{2009,
title={Matrix approach to discrete fractional calculus II: Partial fractional differential equations},
DOI={10.1016/j.jcp.2009.01.014},
author={Podlubny, Igor and Chechkin, Aleksei and Skovranek, Tomas and Chen, YangQuan and Vinagre Jara, Blas M.},
}
source
FractionalCalculus.RLG1Type

Riemann Liouville sense G1 scheme

fracdiff(f, α, start_point, end_point, h, RLG1())

Remove the limit symbol in the definition of Grunwald-Letnikov fractional derivative, thereby leading to a discretization scheme in form of truncated series.

Tip
**RLG1** also can be used to compute fractional integral~
``+\alpha`` for fractional derivative and ``-\alpha`` for fractional integral.
@inproceedings{Guo2015FractionalPD,
  title={Fractional Partial Differential Equations and their Numerical Solutions},
  author={Boling Guo and Xueke Pu and Feng-Hui Huang},
  year={2015}
}
source
FractionalCalculus.RLDType

Riemann Liouville sense D scheme

    fracdiff(f, α, point, h, RLD())
@inproceedings{Guo2015FractionalPD,
  title={Fractional Partial Differential Equations and their Numerical Solutions},
  author={Boling Guo and Xueke Pu and Feng-Hui Huang},
  year={2015}
}
source

Hadamard sense fractional derivative

FractionalCalculus.HadamardLRectType

Hadamard sense left rectangular approximating algorithm

fracdiff(f, α, a, x, h, HadamardLRect())

Using finite part integral of left rectangular formula to compute the fractional hadamard derivative.

Example

julia> fracdiff(x->x, 0.5, 0, 1, 0.001, HadamardLRect())
0.9738507879228357
source
FractionalCalculus.HadamardRRectType

Hadamard sense right rectangular approximating algorithm

fracdiff(f, α, a, x, h, HadamardTrap())

Using finite part integral of right rectangular formula to compute the fractional hadamard derivative.

Example

julia> fracdiff(x->x, 0.5, 0, 1, 0.001, HadamardRRect())
0.9738507879228337
source
FractionalCalculus.HadamardTrapType

Hadamard sense trapezoidal approximating algorithm

fracdiff(f, α, a, x, h, HadamardTrap())

Using finite part integral of trapezoidal formula to compute the fractional hadamard derivative.

Example

julia> fracdiff(x->x, 0.5, 0, 1, 0.001, HadamardTrap())
0.9738507879228328
source

Riesz sense fractional derivative

FractionalCalculus.RieszSymmetricType

Riesz sense symmetric fractional derivative algorithm.

fracdiff(f, α, end_point, h, RieszSymmetric())

Compute fractional derivative of Riesz sense using Triangular Strip Matrix algorithm.

Example

julia> fracdiff(x->x, 0.5, 1, 0.01, RieszSymmetric())
source
FractionalCalculus.RieszOrtigueiraType

Riesz sense Ortigueira definition fractional derivative

fracdiff(f, α, end_point, h, RieszOrtigueira())

Ortigueira's definition of the symmetric Riesz derivative via centred differences

Usage

julia> fracdiff(x->x, 0.5, 1, 0.01, RieszOrtigueira())
source

Atangana Baleanu sense fractional derivative

FractionalCalculus.AtanganaSedaType

Atangana Baleanu sense fractional derivative computing using AtanganaSeda(Newton Polynomial) method.

fracdiff(f::Function, α, start_point, end_point, step_size, ::AtanganaSeda)

Example:

julia> fracdiff(x->x^5, 0.5, 2.5, 0.0001, AtanganaSeda())
-91.4589645808849

Reference

Fractional Stochastic Differential Equations
source

Caputo Fabrizio sense fractional derivative

FractionalCalculus.CaputoFabrizioASType

Atangana Seda algorithm for approximating Caputo-Fabrizio fractional Derivatives

fracdiff(f, α, point, h, CaputoFabrizioAS())

Example

julia> fracdiff(x->x, 0.5, 1, 0.001, CaputoFabrizioAS())
0.9893315392351845

Reference

Fractional Stochastic Differential Equations
source
FractionalCalculus.@fracdiffMacro
@fracdiff(f, α, point)

Return the α-order derivative of f at specific point.

julia> @fracdiff(x->x, 0.5, 1)
1.1283791670955188
source

Symbolic fractional differentiation

FractionalCalculus.semidiffFunction

Symbolic fractional differentiation

semidiff(fun)

semidiff uses SymbolicUtils.jl and Symbolics.jl to compute symbolic fractional differentiation.

Example

julia> using SymbolicUtils
julia> @syms x
julia> semidiff(log(x))
log(4x) / sqrt(πx)
source