DAE Solvers

DAE Solvers

Recomended Methods

For medium to low accuracy DAEs in mass matrix form, the Rodas4 and Rodas42 methods are good choices which will get good efficiency. The OrdinaryDiffEq.jl methods are also the only methods which allow for Julia-defined number types. For high accuracy (error <1e-7) on problems of Vector{Float64} defined in mass matrix form, radau is an efficient method.

If the problem cannot be defined in mass matrix form, the recommended method for performance is IDA from the Sundials.jl package if you are solving problems with Float64. It's a very well-optimized method, and allows you to have a little bit of control over the linear solver to better tailor it to your problem. A similar algorithm is daskr. Which one is more efficient is problem-dependent.

Full List of Methods


These methods require the DAE to be an ODEProblem in mass matrix form. For extra options for the solvers, see the ODE solver page.

Rosenbrock Methods

Rosenbrock-W Methods

SDIRK Methods

SDIRK Methods


Note that this setup is not automatically included with DifferentialEquations.jl. To use the following algorithms, you must install and use Sundials.jl:

]add Sundials
using Sundials

Note that the constructors for the Sundials algorithms take a main argument:


IDA() # Newton + Dense solver
IDA(linear_solver=:Band,jac_upper=3,jac_lower=3) # Banded solver with nonzero diagonals 3 up and 3 down
IDA(linear_solver=:BCG) # Biconjugate gradient method                                   

All of the additional options are available. The constructor is:

    max_order = 5,
    max_error_test_failures = 7,
    max_nonlinear_iters = 3,
    nonlinear_convergence_coefficient = 0.33,
    nonlinear_convergence_coefficient_ic = 0.0033,
    max_num_steps_ic = 5,
    max_num_jacs_ic = 4,
    max_num_iters_ic = 10,
    max_num_backs_ic = 100,
    use_linesearch_ic = true,
    max_convergence_failures = 10,
    init_all = false,
    prec = nothing, psetup = nothing, prec_side = 0)

See the Sundials manual for details on the additional options. The option init_all controls the initial condition consistency routine. If the initial conditions are inconsistant (i.e. they do not satisfy the implicit equation), init_all=false means that the algebraic variables and derivatives will be modified in order to satisfy the DAE. If init_all=true, all initial conditions will be modified to satify the DAE.

Note that here prec is a preconditioner function prec(z,r,p,t,y,fy,gamma,delta,lr) where:

and psetup is the preconditioner setup function for pre-computing Jacobian information. Where:

psetup is optional when prec is set.


DASKR.jl is not automatically included by DifferentialEquations.jl. To use this algorithm, you will need to install and use the package:

]add DASKR
using DASKR

All additional options are available. The constructor is:

function daskr(;linear_solver=:Dense,
                  jac_upper=0,jac_lower=0,max_order = 5,
                  non_negativity_enforcement = 0,
                  non_negativity_enforcement_array = nothing,
                  max_krylov_iters = nothing,
                  num_krylov_vectors = nothing,
                  max_number_krylov_restarts = 5,
                  krylov_convergence_test_constant = 0.05,
                  exclude_algebraic_errors = false)

Choices for the linear solver are:



These methods require the DAE to be an ODEProblem in mass matrix form. For extra options for the solvers, see the ODE solver page.