# Is there a package for fractional calculus?

**URL:** <https://discourse.julialang.org/t/is-there-a-package-for-fractional-calculus/19702>\
**Category:** Numerics\
**Created:** [January 16, 2019, 2:48pm UTC](https://discourse.julialang.org/t/is-there-a-package-for-fractional-calculus/19702 "2019-01-16T14:48:56Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![phelipe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/phelipe/32/14643_2.png) [@phelipe](https://discourse.julialang.org/u/phelipe)\
**Post date:** [January 16, 2019, 2:48pm UTC](https://discourse.julialang.org/t/is-there-a-package-for-fractional-calculus/19702/1 "2019-01-16T14:48:56Z")

</div>

Is there any package for fractional derivatives?

---

<div class="post-metadata">

**Author:** ![jlapeyre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jlapeyre/32/4514_2.png) [@jlapeyre](https://discourse.julialang.org/u/jlapeyre)\
**Post date:** [January 16, 2019, 2:56pm UTC](https://discourse.julialang.org/t/is-there-a-package-for-fractional-calculus/19702/2 "2019-01-16T14:56:13Z")

</div>

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 ?

---

<div class="post-metadata">

**Author:** ![dlfivefifty](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlfivefifty/32/1959_2.png) [@dlfivefifty](https://discourse.julialang.org/u/dlfivefifty)\
**Post date:** [January 16, 2019, 2:59pm UTC](https://discourse.julialang.org/t/is-there-a-package-for-fractional-calculus/19702/3 "2019-01-16T14:59:10Z")

</div>

Depending on your needs you can use ApproxFun: [ApproxFunExamples/Fractional Integral Equations.ipynb at master · JuliaApproximation/ApproxFunExamples · GitHub](https://github.com/JuliaApproximation/ApproxFunExamples/blob/master/Extras/Fractional%20Integral%20Equations.ipynb)

---

<div class="post-metadata">

**Author:** ![phelipe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/phelipe/32/14643_2.png) [@phelipe](https://discourse.julialang.org/u/phelipe)\
**Post date:** [January 16, 2019, 5:43pm UTC](https://discourse.julialang.org/t/is-there-a-package-for-fractional-calculus/19702/4 "2019-01-16T17:43:32Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![chakravala](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chakravala/32/6832_2.png) [@chakravala](https://discourse.julialang.org/u/chakravala)\
**Post date:** [January 16, 2019, 6:14pm UTC](https://discourse.julialang.org/t/is-there-a-package-for-fractional-calculus/19702/5 "2019-01-16T18:14:56Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jlapeyre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jlapeyre/32/4514_2.png) [@jlapeyre](https://discourse.julialang.org/u/jlapeyre)\
**Post date:** [January 16, 2019, 7:04pm UTC](https://discourse.julialang.org/t/is-there-a-package-for-fractional-calculus/19702/6 "2019-01-16T19:04:01Z")

</div>

I don’t know of a Julia package for this. Maybe this: [GitHub - JuliaControl/ControlSystems.jl: A Control Systems Toolbox for Julia](https://github.com/JuliaControl/ControlSystems.jl) could be useful.

---

<div class="post-metadata">

**Author:** ![dlfivefifty](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlfivefifty/32/1959_2.png) [@dlfivefifty](https://discourse.julialang.org/u/dlfivefifty)\
**Post date:** [January 17, 2019, 2:56pm UTC](https://discourse.julialang.org/t/is-there-a-package-for-fractional-calculus/19702/7 "2019-01-17T14:56:03Z")

</div>

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

```julia
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](https://global.discourse-cdn.com/julialang/original/3X/8/b/8bd1f724f955426ae5c58dc897853e52514dc25f.png)

---

<div class="post-metadata">

**Author:** ![phelipe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/phelipe/32/14643_2.png) [@phelipe](https://discourse.julialang.org/u/phelipe)\
**Post date:** [January 17, 2019, 11:53pm UTC](https://discourse.julialang.org/t/is-there-a-package-for-fractional-calculus/19702/8 "2019-01-17T23:53:38Z")

</div>

Thank you very much, it will be very useful.

---

<div class="post-metadata">

**Author:** ![Giulio\_Benedetti](https://avatars.discourse-cdn.com/v4/letter/g/f0a364/32.png) [@Giulio\_Benedetti](https://discourse.julialang.org/u/Giulio_Benedetti)\
**Post date:** [September 30, 2021, 2:02pm UTC](https://discourse.julialang.org/t/is-there-a-package-for-fractional-calculus/19702/9 "2021-09-30T14:02:27Z")

</div>

Hi!

Recently, a Julia package for fractional calculus was released: [FdeSolver.jl](https://github.com/JuliaTurkuDataScience/FdeSolver.jl)

The package provides an FDE solver, which implements the Caputo derivative and the Predictor-Corrector method for the numerical solution of systems or single equations. Originally, it was aiming at applications in the study of [biological systems](https://www.sciencedirect.com/science/article/pii/S1369527418300092?via%3Dihub) where memory plays a role.

At the moment, my supervisor and I are the main contributors of this young package. Since we are planning to improve the current solver and expand to other numerical methods, we happily seek for new collaborations, feedback and ideas, either by getting in touch or simply by pull request.

---

<div class="post-metadata">

**Author:** ![ErikQQY](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/erikqqy/32/23074_2.png) [@ErikQQY](https://discourse.julialang.org/u/ErikQQY)\
**Post date:** [October 4, 2021, 12:23am UTC](https://discourse.julialang.org/t/is-there-a-package-for-fractional-calculus/19702/10 "2021-10-04T00:23:26Z")

</div>

@Giulio_Benedetti This package is pretty awesome!

I also made a package mainly focus on fractional derivative and integral: [https://github.com/ErikQQY/FractionalCalculus.jl](https://github.com/ErikQQY/FractionalCalculus.jl)

Advice and suggestions are welcomed!

---

<div class="post-metadata">

**Author:** ![StevenSiew](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevensiew/32/218393_2.png) [@StevenSiew](https://discourse.julialang.org/u/StevenSiew)\
**Post date:** [October 4, 2021, 5:46am UTC](https://discourse.julialang.org/t/is-there-a-package-for-fractional-calculus/19702/11 "2021-10-04T05:46:20Z")

</div>

Wow this thing blows my mind!

Half a differentiation. Quarter of an Integral. I found a gentle introduction to fractional calculus

> **[What is Fractional Calculus?](https://www.cantorsparadise.com/fractional-calculus-48192f4e9c9f)**
>
> “A paradox from which one day useful consequences will be drawn.” ~Gottfried Leibniz

Thanks for bring this to my attention.
