LSODA.jl
Introduction
LSODA.jl is a Julia package that interfaces to the liblsoda library, developed by Simon Frost (@sdwfrost), thereby providing a way to use the LSODA algorithm from Linda Petzold and Alan Hindmarsh from Julia. Clang.jl has been used to write the library and Sundials.jl was a inspiring source.
Installation
To install this package, run the command add LSODA
.
Simplified Functions
To solve an ODE, one can call the simplified solver:
function rhs!(t, x, ydot, data)
ydot[1]=1.0E4 * x[2] * x[3]  .04E0 * x[1]
ydot[3]=3.0E7 * x[2] * x[2]
ydot[2]=ydot[1]  ydot[3]
nothing
end
y0 = [1.,0.,0.]
tspan = [0., 0.4]
res = lsoda(rhs!, y0, tspan, reltol= 1e4, abstol = Vector([1.e6,1.e10,1.e6]))
To reproduce the test example from liblsoda, on can use:
lsoda_0(rhs!, y0, tspan, reltol= 1e4, abstol = Vector([1.e6,1.e10,1.e6]))
This should give the following.
at t = 4.0000e01 y= 9.851712e01 3.386380e05 1.479493e02
at t = 4.0000e+00 y= 9.055333e01 2.240655e05 9.444430e02
at t = 4.0000e+01 y= 7.158403e01 9.186334e06 2.841505e01
at t = 4.0000e+02 y= 4.505250e01 3.222964e06 5.494717e01
at t = 4.0000e+03 y= 1.831976e01 8.941774e07 8.168016e01
at t = 4.0000e+04 y= 3.898729e02 1.621940e07 9.610125e01
at t = 4.0000e+05 y= 4.936362e03 1.984221e08 9.950636e01
at t = 4.0000e+06 y= 5.161832e04 2.065786e09 9.994838e01
at t = 4.0000e+07 y= 5.179811e05 2.072030e10 9.999482e01
at t = 4.0000e+08 y= 5.283524e06 2.113420e11 9.999947e01
at t = 4.0000e+09 y= 4.658945e07 1.863579e12 9.999995e01
at t = 4.0000e+10 y= 1.423392e08 5.693574e14 1.000000e+00
JuliaDiffEq Common Interface
The functionality of LSODA.jl can be accessed through the JuliaDiffEq common interface. To do this, you build a problem object for like:
using LSODA, DiffEqBase
function rhs!(du, u, p, t)
du[1]=1.0E4 * u[2] * u[3]  .04E0 * u[1]
du[3]=3.0E7 * u[2] * u[2]
du[2]=du[1]  du[3]
nothing
end
y0 = [1.,0.,0.]
tspan = (0., 0.4)
prob = ODEProblem(rhs!,y0,tspan)
This problem is solved by LSODA by using the lsoda() algorithm in the common solve
command as follows:
sol = solve(prob,lsoda())
Many keyword arguments can be used to control the solver, its tolerances, and its output formats. For more information, please see the DifferentialEquations.jl documentation.
Citing
If using the algorithm through the DifferentialEquations.jl common interface, please cite:
@article{rackauckas2017differentialequations,
title={Differentialequations. jla performant and featurerich ecosystem for solving differential equations in julia},
author={Rackauckas, Christopher and Nie, Qing},
journal={Journal of Open Research Software},
volume={5},
number={1},
year={2017},
publisher={Ubiquity Press}
}
For the original algorithm, please cite:

Alan Hindmarsh, ODEPACK, a Systematized Collection of ODE Solvers, in Scientific Computing, edited by Robert Stepleman, Elsevier, 1983, ISBN13: 9780444866073, LC: Q172.S35.

K Radhakrishnan, Alan Hindmarsh, Description and Use of LSODE, the Livermore Solver for Ordinary Differential Equations, Technical report UCRLID113855, Lawrence Livermore National Laboratory, December 1993.

Linda Petzold, Automatic Selection of Methods for Solving Stiff and Nonstiff Systems of Ordinary Differential Equations, SIAM J. Sci. and Stat. Comput., 4(1), 136–148.