ODEInterfaceDiffEq.jl
ODEInterfaceDiffEq.jl provides a wrapper for classic Fortran ODE solvers from the ODEInterface.jl package into the SciML interface. These include the Hairer and Wanner solvers.
Note that this package is not automatically included with DifferentialEquations.jl. To use the following algorithms, you must install and use ODEInterfaceDiffEq.jl:
using Pkg
Pkg.add("ODEInterfaceDiffEq")
import ODEInterfaceDiffEqThese methods can be used independently of the rest of DifferentialEquations.jl.
ODE Solver APIs
ODEInterfaceDiffEq.dopri5 — Type
dopri5()Hairer's classic implementation of the Dormand-Prince 4/5 method.
An explicit Runge-Kutta method of order 5(4) for non-stiff problems. This is one of the most widely used explicit methods for solving ODEs and is generally efficient for problems where evaluations of the right-hand side are relatively cheap.
Solver Properties
- Order: 5
- Adaptive: Yes
- Type: Explicit Runge-Kutta
- Suitable for: Non-stiff problems
ODEInterfaceDiffEq.dop853 — Type
dop853()Explicit Runge-Kutta 8(5,3) method by Dormand-Prince.
A high-order explicit Runge-Kutta method for non-stiff problems requiring high accuracy. Uses adaptive step size control and is particularly effective when tight tolerances are needed.
Solver Properties
- Order: 8
- Adaptive: Yes
- Type: Explicit Runge-Kutta
- Suitable for: Non-stiff problems requiring high accuracy
ODEInterfaceDiffEq.odex — Type
odex()GBS (Gragg-Bulirsch-Stoer) extrapolation algorithm based on the midpoint rule.
An extrapolation method that can achieve very high accuracy for smooth non-stiff problems. Particularly efficient for problems where high accuracy is required and the solution is smooth.
Solver Properties
- Order: up to 12
- Adaptive: Yes
- Type: Extrapolation
- Suitable for: Smooth non-stiff problems requiring high accuracy
ODEInterfaceDiffEq.seulex — Type
seulex(; jac_lower = nothing, jac_upper = nothing)Extrapolation algorithm based on the linearly implicit Euler method.
An implicit extrapolation method suitable for stiff and differential-algebraic problems. Can handle mildly stiff to stiff systems efficiently with automatic stiffness detection.
Arguments
jac_lower: Lower bandwidth of the Jacobian for banded matricesjac_upper: Upper bandwidth of the Jacobian for banded matrices
Solver Properties
- Order: up to 12
- Adaptive: Yes
- Type: Implicit extrapolation
- Suitable for: Stiff problems and DAEs
ODEInterfaceDiffEq.radau — Type
radau(; jac_lower = nothing, jac_upper = nothing,
M1 = nothing, M2 = nothing,
DIMOFIND1VAR = nothing, DIMOFIND2VAR = nothing, DIMOFIND3VAR = nothing,
massmatrix = nothing)Implicit Runge-Kutta (Radau IIA) method of variable order between 5 and 13.
A high-order implicit Runge-Kutta method particularly well-suited for stiff ODEs and DAEs. The Radau IIA methods have excellent stability properties and can handle very stiff problems efficiently.
Arguments
jac_lower: Lower bandwidth of the Jacobian for banded matricesjac_upper: Upper bandwidth of the Jacobian for banded matricesM1: Number of equations with trivial structurey_i' = y_{i+M2}(block structure)M2: Block size for the M1 trivial equationsDIMOFIND1VAR: Number of index-1 variables (for DAE index information)DIMOFIND2VAR: Number of index-2 variables (for DAE index information)DIMOFIND3VAR: Number of index-3 variables (for DAE index information)massmatrix: Mass matrix for the non-trivial block (overridesprob.f.mass_matrix)
Solver Properties
- Order: 5 to 13 (variable)
- Adaptive: Yes
- Type: Implicit Runge-Kutta (Radau IIA)
- Suitable for: Stiff problems and DAEs
ODEInterfaceDiffEq.radau5 — Type
radau5(; jac_lower = nothing, jac_upper = nothing,
M1 = nothing, M2 = nothing,
DIMOFIND1VAR = nothing, DIMOFIND2VAR = nothing, DIMOFIND3VAR = nothing,
massmatrix = nothing)Implicit Runge-Kutta method (Radau IIA) of order 5.
A robust implicit method for stiff ODEs and DAEs. This is the fixed order 5 version of the Radau method, often preferred when a specific order is desired or for comparison purposes.
Arguments
jac_lower: Lower bandwidth of the Jacobian for banded matricesjac_upper: Upper bandwidth of the Jacobian for banded matricesM1: Number of equations with trivial structurey_i' = y_{i+M2}(block structure)M2: Block size for the M1 trivial equationsDIMOFIND1VAR: Number of index-1 variables (for DAE index information)DIMOFIND2VAR: Number of index-2 variables (for DAE index information)DIMOFIND3VAR: Number of index-3 variables (for DAE index information)massmatrix: Mass matrix for the non-trivial block (overridesprob.f.mass_matrix)
Solver Properties
- Order: 5
- Adaptive: Yes
- Type: Implicit Runge-Kutta (Radau IIA)
- Suitable for: Stiff problems and DAEs
ODEInterfaceDiffEq.rodas — Type
rodas(; jac_lower = nothing, jac_upper = nothing)Rosenbrock method of order 4(3).
A Rosenbrock-type method for stiff ODEs and DAEs. Rosenbrock methods are semi-implicit, using only one LU decomposition per step, which can make them more efficient than fully implicit methods for moderately stiff problems.
Arguments
jac_lower: Lower bandwidth of the Jacobian for banded matricesjac_upper: Upper bandwidth of the Jacobian for banded matrices
Solver Properties
- Order: 4
- Adaptive: Yes
- Type: Rosenbrock
- Suitable for: Stiff problems and DAEs
ODEInterfaceDiffEq.ddeabm — Type
ddeabm()Adams-Bashforth-Moulton predictor-corrector method with variable order (1 to 12).
A multistep method based on Adams formulas, using a predictor-corrector approach. Efficient for smooth non-stiff problems, particularly when many function evaluations are expensive, as it reuses previous function evaluations.
Solver Properties
- Order: 1 to 12 (variable)
- Adaptive: Yes
- Type: Adams-Bashforth-Moulton multistep
- Suitable for: Smooth non-stiff problems
ODEInterfaceDiffEq.ddebdf — Type
ddebdf(; jac_lower = nothing, jac_upper = nothing)Backward Differentiation Formula (BDF) with variable order (1 to 5).
A multistep method particularly effective for stiff ODEs and DAEs. BDF methods are the industry standard for stiff problems in many scientific computing applications.
Arguments
jac_lower: Lower bandwidth of the Jacobian for banded matricesjac_upper: Upper bandwidth of the Jacobian for banded matrices
Solver Properties
- Order: 1 to 5 (variable)
- Adaptive: Yes
- Type: BDF multistep
- Suitable for: Stiff problems and DAEs
BVP Solver APIs
BoundaryValueDiffEq.BVPM2 — Type
BVPM2(;
max_num_subintervals = 3000, method_choice = 4, diagnostic_output = 1,
error_control = 1, singular_term = nothing
)
BVPM2(
max_num_subintervals::Int, method_choice::Int, diagnostic_output::Int,
error_control::Int, singular_term
)Fortran code for solving two-point boundary value problems. For detailed documentation, see ODEInterface.jl.
Keyword Arguments:
max_num_subintervals: Number of maximal subintervals, default as 3000.method_choice: Choice for IVP-solvers, default as Runge-Kutta method of order 4, available choices:2: Runge-Kutta method of order 2.4: Runge-Kutta method of order 4.6: Runge-Kutta method of order 6.
diagnostic_output: Diagnostic output for BVPM2, default as non printout, available choices:-1: Full diagnostic printout.0: Selected printout.1: No printout.
error_control: Determines the error-estimation for which RTOL is used, default as defect control, available choices:1: Defect control.2: Global error control.3: Defect and then global error control.4: Linear combination of defect and global error control.
singular_term:nothingwhen the ODE has no singular term at the left boundary, or a constant(d, d)matrix for that term.
Examples
using BoundaryValueDiffEq, ODEInterface
alg = BVPM2(max_num_subintervals = 5000, method_choice = 4)
sol = solve(prob, alg)BoundaryValueDiffEq.BVPSOL — Type
BVPSOL(; bvpclass = 2, sol_method = 0, odesolver = nothing)
BVPSOL(bvpclass::Int, sol_methods::Int, odesolver)A FORTRAN77 code which solves highly nonlinear two point boundary value problems using a local linear solver (condensing algorithm) or a global sparse linear solver for the solution of the arising linear subproblems, by Peter Deuflhard, Georg Bader, Lutz Weimann. For detailed documentation, see ODEInterface.jl.
Keyword Arguments
bvpclass: Boundary value problem classification, default as highly nonlinear with bad initial data, available choices:0: Linear boundary value problem.1: Nonlinear with good initial data.2: Highly Nonlinear with bad initial data.3: Highly nonlinear with bad initial data and initial rank reduction to separable linear boundary conditions.
sol_method: Switch for solution methods, default as local linear solver with condensing algorithm, available choices:0: Use local linear solver with condensing algorithm.1: Use global sparse linear solver.
odesolver: Eithernothingor ode-solver(dopri5, dop853, seulex, etc.).
Examples
using BoundaryValueDiffEq, ODEInterface
alg = BVPSOL(bvpclass = 1, sol_method = 0)
sol = solve(prob, alg)BoundaryValueDiffEq.COLNEW — Type
COLNEW(;
bvpclass = 1, collocationpts = 7, diagnostic_output = 1,
max_num_subintervals = 3000, bc_func = nothing, dbc_func = nothing,
zeta = nothing
)
COLNEW(
bvpclass::Int, collocationpts::Int, diagnostic_output::Int,
max_num_subintervals::Int, bc_func, dbc_func, zeta::AbstractVector
)Keyword Arguments:
bvpclass: Boundary value problem classification, default as nonlinear and "extra sensitive", available choices:0: Linear boundary value problem.1: Nonlinear and regular.2: Nonlinear and "extra sensitive" (first relax factor is rstart and the nonlinear iteration does not rely on past convergence).3: fail-early: return immediately upon: a) two successive non-convergences. b) after obtaining an error estimate for the first time.
collocationpts: Number of collocation points per subinterval. Require orders[i] ≤ k ≤ 7, default as 7diagnostic_output: Diagnostic output for COLNEW, default as no printout, available choices:-1: Full diagnostic printout.0: Selected printout.1: No printout.
max_num_subintervals: Number of maximal subintervals, default as 3000.bc_func: Boundary condition accepted by ODEInterface.jl, used only for multipoint BVPs.dbc_func: Boundary-condition Jacobian accepted by ODEInterface.jl, used only for multipoint BVPs.zeta: Points in the interval where boundary conditions are specified, used only for multipoint BVPs.
A Fortran77 code solves a multi-points boundary value problems for a mixed order system of ODEs. It incorporates a new basis representation replacing b-splines, and improvements for the linear and nonlinear algebraic equation solvers.
Examples
using BoundaryValueDiffEq, ODEInterface
alg = COLNEW(collocationpts = 7, max_num_subintervals = 5000)
sol = solve(prob, alg)