I’d like to announce a package for solving differential equations (and systems) with fractional derivatives (in the sense of Caputo).
Fractional derivatives are suitable tools for modeling memory effects in complex systems, such as microbial communities.
The core function is FDEsolver, which includes a numerical solution based on predictor - corrector methods (the number of correction steps is customisable).
Here’s how FDEsolver can be used to solve a generalised Lotka-Volterra model with memory:
using FdeSolver
using Plots
# Inputs
tSpan = [0, 25] # [intial time, final time]
y0 = [34, 6] # initial values
β = [0.98, 0.99] # order of derivatives
par = [0.55, 0.028, 0.84, 0.026] # model parameters
# ODE Model
function F(t, y, par)
α1 = par[1] # growth rate of the prey population
β1 = par[2] # rate of shrinkage relative to the product of the population sizes
γ = par[3] # shrinkage rate of the predator population
δ = par[4] # growth rate of the predator population as a factor of the product
# of the population sizes
u = y[1] # population size of the prey species at time t[n]
v = y[2] # population size of the predator species at time t[n]
F1 = α1 .* u .- β1 .* u .* v
F2 = - γ .* v .+ δ .* u .* v
[F1, F2]
end
## Solution
t, Yapp = FDEsolver(F, tSpan, y0, β, par)
# Plot
plot(t, Yapp, linewidth = 5, title = "Solution to LV model with 2 FDEs",
xaxis = "Time (t)", yaxis = "y(t)", label = ["Prey" "Predator"])
plot!(legendtitle = "Population of")
In the future, we would like to add the following features:
- Support solutions for FDEs with multiterm fractional derivatives in each equation;
- Improve the efficiency (accuracy and speed) of the current solver;
- Expand to other numerical methods.
We happily seek new collaborations, feedback, and ideas, either by getting in touch or simply by opening an issue or pull request in FdeSolver.jl.
This FDE solver is based on some of the MATLAB solvers provided by R. Garrappa (FDE_PI2_Im and FDE_PI12_PC).
For additional examples and information on the solver, check out its documentation or the readme.