Skip to contents

fractional_to_ordinary(eqs, variables, alphas, epsilon, T) approximates the Caputo fractional equations D^alpha x = eqs by systems of ordinary equations, with the exponential sum quadrature of the fractional kernel accurate to epsilon on [0, T] (as ModelingToolkit). Orders above one use repeated integration. linear_fractional_to_ordinary(degrees, coeffs, rhs, epsilon, T) does the same for the linear equation sum(coeffs * D^degrees x) = rhs. Both return a compiled system. The auxiliary unknowns are named ʐ_i; with matrix = TRUE each fractional term gets one array unknown ʐ_i (a vector, or for orders above one a matrix with one column per integration) whose elements ʐ_i[j] follow the same equations, as the array form of ModelingToolkit.

Usage

fractional_to_ordinary(
  eqs,
  variables,
  alphas,
  epsilon,
  T,
  initials = 0,
  additional_eqs = list(),
  iv = t_nounits,
  matrix = FALSE
)

linear_fractional_to_ordinary(
  degrees,
  coeffs,
  rhs,
  epsilon,
  T,
  initials = 0,
  symbol = "x",
  iv = t_nounits,
  matrix = FALSE
)

Arguments

eqs

Right-hand sides (one per variable).

variables

The fractional variables x(t).

alphas

Fractional orders (not integers).

epsilon

Accuracy of the quadrature.

T

Final time.

initials

Initial values (for orders above one, a vector of initial derivatives per variable).

additional_eqs

Further equations.

iv

The independent variable.

matrix

Use array unknowns for the quadrature states.

degrees

Orders of the derivatives, decreasing, the first the highest.

coeffs

Coefficients of the derivatives.

rhs

Right-hand side expression.

symbol

Prefix of the generated variable names.

Value

A compiled System.

Examples

t <- t_nounits
x <- Variable("x", t)
sys <- fractional_to_ordinary(list(1), list(x), 0.5, 1e-2, 1)
length(unknowns(sys))
#> [1] 15
msys <- fractional_to_ordinary(list(1), list(x), 0.5, 1e-2, 1, matrix = TRUE)
format(unknowns(msys)[[1]])
#> [1] "ʐ_0[15](t)"