Is there a package for fractional calculus?


#1

Is there any package for fractional derivatives?


#2

I don’t think so. I more or less use fractional derivatives in my research. There are some related things in Julia.

Can you give more details on what you are looking for ?


#3

Depending on your needs you can use ApproxFun: https://github.com/JuliaApproximation/ApproxFunExamples/blob/master/Extras/Fractional%20Integral%20Equations.ipynb


#4

I have a data vector and I try to make the derivative of this data (I want to use it on a fractional controller.), I was developing a code using the Caputo derivative and power series but I decided to look for some package that already does that.


#5

Few weeks ago I programmed the Grunwald-Letnikov fractional derivative for the analytic continuation of the Riemann zeta function. While there is a complex fractional differentiation recurrence relation I discovered which is generally applicable to any analytic function, the actual evaluations of this GL fractional derivative rather specific to the Hurwitz zeta function and requires the use of non-central Stirling numbers and MacLaurin summation… which is a specific formulation and is not universal.


#6

I don’t know of a Julia package for this. Maybe this: https://github.com/JuliaControl/ControlSystems.jl could be useful.


#7

Here’s how to do it in ApproxFun, assuming the data is smooth:

S = Legendre()

n = 50; # number of data points
p = range(-1,stop=1,length=n);   # a non-default grid

v = exp.(p);           # values at the non-default grid
m = 20   # number of basis functions
V = Array{Float64}(undef,n,m); # Create a Vandermonde matrix by evaluating the basis at the grid
for k = 1:size(V,2)
   V[:,k] = Fun(S,[zeros(k-1);1]).(p)
end
f = Fun(S,V\v); # least squares fit to data

f_rl = LeftDerivative(0.5)*f # RL left half-derivative
f_cap = LeftIntegral(0.5)*Fun(f', S) # Caputo left half-derivative


using Plots
plot(f_rl;ylims=(0,3),legend=:bottomright,label="RL")
plot!(f_cap; label="Caputo")

RLvCaputo


#8

Thank you very much, it will be very useful.