ParameterizedFunctions.jl is a component of the SciML ecosystem which allows for easily defining parameterized ODE models in a simple syntax.
For information on using the package, see the stable documentation. Use the in-development documentation for the version of the documentation, which contains the unreleased features.
The following are valid ODE definitions.
using DifferentialEquations, ParameterizedFunctions
# Non-Stiff ODE
lotka_volterra = @ode_def begin
d๐ = ฮฑ * ๐ - ฮฒ * ๐ * ๐
d๐ = -ฮณ * ๐ + ฮด * ๐ * ๐
end ฮฑ ฮฒ ฮณ ฮด
p = [1.5, 1.0, 3.0, 1.0];
u0 = [1.0; 1.0];
prob = ODEProblem(lotka_volterra, u0, (0.0, 10.0), p)
sol = solve(prob, Tsit5(), reltol = 1e-6, abstol = 1e-6)
# Stiff ODE
rober = @ode_def begin
dyโ = -kโ * yโ + kโ * yโ * yโ
dyโ = kโ * yโ - kโ * yโ^2 - kโ * yโ * yโ
dyโ = kโ * yโ^2
end kโ kโ kโ
prob = ODEProblem(rober, [1.0, 0.0, 0.0], (0.0, 1e5), [0.04, 3e7, 1e4])
sol = solve(prob)