Fractional integral 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 contain all of the existing API we can use for computing fractional integral.

FractionalCalculus.fracintFunction

Riemann Liouville sense fractional integral

fracint(f::Function, α, start_point, end_point, h, RL_Direct())

Example:

julia> fracint(x->x^5, 0.5, 0, 2.5, 1e-8, RL_Direct())

Riemann_Liouville fractional integral using complex step differentiation. Returns a tuple (1.1639316474512205, 1.0183453796725215e-8), which contains the value of this derivative is 1.1639316474512205, and the error estimate is 1.0183453796725215e-8

source

Riemann Liouville sense fractional integral with first diff known.

fracint(f, fd, α, start_point, end_point, RL_Direct_First_Diff_Known())

Example

julia> fracint(x->x^5, x->5*x^4, 0.5, 0, 2.5, RL_Direct_First_Diff_Known())

With first order derivative known, we can directly use it in the computation of α order fraction integral

source

Riemann Liouville sense fractional integral using piecewise interpolation.

fracint(f, α, end_point, h, RL_Piecewise())

Example

julia> fracint(x->x^5, 0.5, 2.5, 0.0001, RL_Piecewise())

By deploying Piecewise interpolation to approximate the original function, with small step size, this method is fast and take little memory allocation.

source

Riemann Liouville sense fractional integral approximation.

fracint(f, α, end_point, h, RLInt_Approx())

Example

julia> fracint(x->x^5, 0.5, 2.5, 0.0001, RLInt_Approx())
source

Riemann Liouville sense fractional integral using Linear interpolation.

fracint(f, α, end_point, h, RL_LinearInterp())

Example

julia> fracint(x->x^5, 0.5, 2.5, 0.0001, RL_LinearInterp())

RL_LinearInterp is more complex but more precise.

source

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

fracint(f, α, end_point, h, RLInt_Matrix())

Using Triangular Strip Matrix to approximate fractional integral.

Example

julia> fracint(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

Tip

With the advancing Triangular Strip Matrix method, you can not only compute fractional integrals, integer order, higher order integral is also supported!!

Try to set α as an integer, arbitrary integer of course! I promise you would enjoy it😏

source

Riemann Liouville sense integral using fractional Simpson's formula to approximate.

source

《Numerical methods for fractional calculus》. Using Trapezoidal method to approximate fractional integral

source

Error estimate is $\mathcal{O(h^4)}$, it is determined by the error of the cubic spline interpolation.

Set h as 0.001 or bigger

For some reason, in the RLIntCubicSpline_Interp method, set h as 0.001 would get better result.

source
FractionalCalculus.RLIntType

Riemann-Liouville sense fractional integral algorithms

Note this two algorithms belong to direct compute, precise are ensured, but maybe cause more memory allocation and take more compilation time.

source
FractionalCalculus.RL_DirectType

Using the direct mathematic expression:

\[(J^αf)(t)=\frac{1}{\Gamma(α)} \int_0^t(t-τ)^{α-1}f(τ)dτ\]

By using QuadGK calculate the integration and obtain the value.

source
FractionalCalculus.RL_PiecewiseType

Using piecewise linear interpolation:

\[ y_n(t)=\frac{t-t_{i+1}}{t_i-t_{i+1}}y(t_i)+\frac{t-t_i}{t_{i+1}-t_i}y(t_{i+1})\]

Constitute the original function with the interpolation and implement the summation.

source
FractionalCalculus.@fracintMacro
@fracint(f, α, point)

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

julia> @fracint(x->x, 0.5, 1)
0.7522525439593486
source