ParameterizedFunctions.jl

A simple domain-specific language (DSL) for defining differential equations for use in scientific machine learning (SciML) and other applications
Popularity
77 Stars
Updated Last
4 Months Ago
Started In
September 2016

ParameterizedFunctions.jl

Join the chat at https://julialang.zulipchat.com #sciml-bridged Global Docs

codecov Build Status

ColPrac: Contributor's Guide on Collaborative Practices for Community Packages SciML Code Style

ParameterizedFunctions.jl is a component of the SciML ecosystem which allows for easily defining parameterized ODE models in a simple syntax.

Tutorials and Documentation

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.

Example

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)