DifferentialEquations.jl is a metapackage for solving differential equations in Julia. The basic workflow is:
The API between different types of differential equations is unified through multiple dispatch.
$$\begin{align} x' &= ax - bxy\\ y' &= -cy + dxy \end{align}$$
using DifferentialEquations
# Define a problem
p = (1.0,2.0,1.5,1.25) # a,b,c,d
f = function (du,u,p,t) # Define f as an in-place update into du
a,b,c,d = p
du[1] = a*u[1] - b*u[1]*u[2]
du[2] = -c*u[2]+ d*u[1]*u[2]
end
u0 = [1.0;1.0]; tspan = (0.0,10.0)
prob = ODEProblem(f,u0,tspan,p);
# Solve the problem
sol = solve(prob);
# Plot the solution using the plot recipe
using Plots; gr() # Using the Plotly Backend
plot(sol,title="All Plots.jl Attributes are Available")