Choosing a method
A method is a quadruplet (discretizer, modeler, solver, parameter). This page maps out what can be combined with what, how a partial description gets completed, and how to inspect any one piece before you commit to it.
The four families
Discretizer: how the continuous problem is transcribed into a finite-dimensional one. Only
:collocationexists today.Modeler: how the resulting NLP is built:
:adnlp(ADNLPModels, automatic differentiation) or:exa(ExaModels, SIMD-friendly and GPU-capable).:exaneeds a problem written with@def, not with the functional API.Solver: which NLP solver runs:
:ipopt,:madnlp,:uno,:madncl,:knitro.Parameter: the execution backend,
:cpuor:gpu.
What is available
using OptimalControl
methods()(:collocation, :adnlp, :ipopt, :cpu)
(:collocation, :adnlp, :madnlp, :cpu)
(:collocation, :adnlp, :uno, :cpu)
(:collocation, :adnlp, :madncl, :cpu)
(:collocation, :adnlp, :knitro, :cpu)
(:collocation, :exa, :ipopt, :cpu)
(:collocation, :exa, :madnlp, :cpu)
(:collocation, :exa, :uno, :cpu)
(:collocation, :exa, :madncl, :cpu)
(:collocation, :exa, :knitro, :cpu)
(:collocation, :exa, :madnlp, :gpu)
(:collocation, :exa, :madncl, :gpu)There are 12 methods: every {adnlp, exa} × {ipopt, madnlp, uno, madncl, knitro} pair on :cpu (10), plus the two GPU-capable combinations :exa × {:madnlp, :madncl} on :gpu (2).
A problem to try them on
Every solve call on this page uses the same problem, the double integrator. Both modelers accept it as written, with the dynamics in vector form:
ocp = @def begin
t ∈ [0, 1], time
x = (q, v) ∈ R², state
u ∈ R, control
x(0) == [-1, 0]
x(1) == [0, 0]
ẋ(t) == [v(t), u(t)]
∫(0.5u(t)^2) → min
endPartial descriptions
solve(ocp, :madnlp) does not need the other three tokens: they are completed for you. Completion walks methods() from top to bottom and returns the first entry containing every token you gave:
solve(ocp, :madnlp) # → (:collocation, :adnlp, :madnlp, :cpu)
solve(ocp, :exa) # → (:collocation, :exa, :ipopt, :cpu)
solve(ocp, :gpu) # → (:collocation, :exa, :madnlp, :gpu)The first line of the display shows the completed method. For instance, with :exa:
using NLPModelsIpopt
sol = solve(ocp, :exa; print_level=0)▫ This is OptimalControl 2.2.1-beta, solving with: collocation → exa → ipopt (cpu)
📦 Configuration:
├─ Discretizer: collocation
├─ Modeler: exa (backend = nothing [cpu-dependent])
└─ Solver: ipopt (print_level = 0)This first-match rule is also why the plain solve(ocp) default is (:collocation, :adnlp, :ipopt, :cpu): it is methods()[1]. All of these are equivalent:
solve(ocp) # empty description → methods()[1]
solve(ocp, :collocation)
solve(ocp, :adnlp)
solve(ocp, :ipopt)
solve(ocp, :cpu)
solve(ocp, :collocation, :adnlp)
solve(ocp, :collocation, :adnlp, :ipopt, :cpu) # the complete descriptionIncompatible tokens
Two tokens of the same family never fit one method: :adnlp and :exa cannot both describe one quadruplet. No method contains both, so solve raises an error rather than silently picking one. It lists the available methods and the closest matches:
julia> solve(ocp, :adnlp, :exa; display=false)
AmbiguousDescription → _complete_description, strategy_builders.jl:260
│
│ cannot find matching description
│
│ Diagnostic No complete match — no description contains all symbols
│ Requested (:adnlp, :exa)
│ Available (:collocation, :adnlp, :ipopt, :cpu)
│ (:collocation, :adnlp, :madnlp, :cpu)
│ (:collocation, :adnlp, :uno, :cpu)
│ (:collocation, :adnlp, :madncl, :cpu)
│ (:collocation, :adnlp, :knitro, :cpu)
│ (:collocation, :exa, :ipopt, :cpu)
│ (:collocation, :exa, :madnlp, :cpu)
│ (:collocation, :exa, :uno, :cpu)
│ (:collocation, :exa, :madncl, :cpu)
│ (:collocation, :exa, :knitro, :cpu)
│ (:collocation, :exa, :madnlp, :gpu)
│ (:collocation, :exa, :madncl, :gpu)
│
│ Context description completion
│ Hint Try one of the closest matches:
│ (:collocation, :exa, :uno, :cpu)
│ (:collocation, :exa, :madnlp, :gpu)
│ (:collocation, :exa, :madnlp, :cpu)
│ (:collocation, :exa, :madncl, :gpu)
│ (:collocation, :exa, :madncl, :cpu)
└─What each solver needs installed
| Solver | Load |
|---|---|
:ipopt | using NLPModelsIpopt |
:madnlp | using MadNLP (CPU) |
:uno | using UnoSolver |
:madncl | using MadNCL and using MadNLP (both) |
:knitro | using NLPModelsKnitro (commercial licence required) |
either on :gpu | using MadNLPGPU, using CUDA and using CUDSS, all three |
Solving without the matching package loaded raises an ExtensionError naming the using statement to add; see Installation and GPU.
Inspecting a strategy
describe prints a strategy: its family, the parameters it supports, and every option with its type, its aliases and its default value:
describe(:collocation)Collocation (strategy)
├─ id: :collocation
├─ hierarchy: Collocation → AbstractDiscretizer → AbstractStrategy
├─ family: AbstractDiscretizer
│
└─ options (3 options):
│
├─ grid_size::Int64 (default: 250)
│ description: Number of time steps for the collocation grid
│
├─ scheme (disc_method)::Symbol (default: midpoint)
│ description: Time integration scheme (:trapeze, :midpoint, :euler (or :euler_explicit, :euler_forward), :euler_implicit (or :euler_backward), :gauss_legendre_2, :gauss_legendre_3)
│
└─ time_grid::Any (default: nothing)
description: Explicit time grid (possibly non uniform) for the collocationUnderstanding default values
(default: NotProvided) means that OptimalControl does not set the option, so the solver or modeler uses its own default. For instance, an Ipopt option shown with (default: NotProvided) takes Ipopt's default value. Only the options with an explicit default, such as (default: 1000) for Ipopt's max_iter, are set by OptimalControl.
The modelers and solvers are described the same way. The solver packages must be loaded first, as for solving:
describe(:adnlp) and describe(:exa)
describe(:adnlp)ADNLP (strategy)
├─ id: :adnlp
├─ hierarchy: ADNLP → AbstractNLPModeler → AbstractStrategy
├─ description: NLP modeler using ADNLPModels with automatic differentiation.
│ See: https://jso.dev/ADNLPModels.jl
├─ family: AbstractNLPModeler
├─ default parameter: CPU
├─ parameters: CPU
│
└─ options (11 options):
│
├─ show_time::Bool (default: NotProvided)
│ description: Whether to show timing information while building the ADNLP model
│
├─ backend (adnlp_backend)::Symbol (default: optimized)
│ description: Automatic differentiation backend used by ADNLPModels.
│ Available: default, generic, enzyme, optimized and manual.
│
├─ matrix_free::Bool (default: NotProvided)
│ description: Enable matrix-free mode (avoids explicit Hessian/Jacobian matrices)
│
├─ name::String (default: NotProvided)
│ description: Name of the optimization model for identification
│
├─ gradient_backend::Union{Nothing, ADNLPModels.ADBackend, Type{<:ADNLPModels.ADBackend}} (default: NotProvided)
│ description: Override backend for gradient computation (advanced users only)
│
├─ hprod_backend::Union{Nothing, ADNLPModels.ADBackend, Type{<:ADNLPModels.ADBackend}} (default: NotProvided)
│ description: Override backend for Hessian-vector product (advanced users only)
│
├─ jprod_backend::Union{Nothing, ADNLPModels.ADBackend, Type{<:ADNLPModels.ADBackend}} (default: NotProvided)
│ description: Override backend for Jacobian-vector product (advanced users only)
│
├─ jtprod_backend::Union{Nothing, ADNLPModels.ADBackend, Type{<:ADNLPModels.ADBackend}} (default: NotProvided)
│ description: Override backend for transpose Jacobian-vector product (advanced users only)
│
├─ jacobian_backend::Union{Nothing, ADNLPModels.ADBackend, Type{<:ADNLPModels.ADBackend}} (default: NotProvided)
│ description: Override backend for Jacobian matrix computation (advanced users only)
│
├─ hessian_backend::Union{Nothing, ADNLPModels.ADBackend, Type{<:ADNLPModels.ADBackend}} (default: NotProvided)
│ description: Override backend for Hessian matrix computation (advanced users only)
│
└─ ghjvprod_backend::Union{Nothing, ADNLPModels.ADBackend, Type{<:ADNLPModels.ADBackend}} (default: NotProvided)
description: Override backend for g^T ∇²c(x)v computation (advanced users only)describe(:exa)Exa (strategy)
├─ id: :exa
├─ hierarchy: Exa → AbstractNLPModeler → AbstractStrategy
├─ description: NLP modeler using ExaModels, supporting CPU and GPU execution.
│ See: https://exanauts.github.io/ExaModels.jl
├─ family: AbstractNLPModeler
├─ default parameter: CPU
├─ parameters: CPU, GPU
│
┌ Warning: CUDA is loaded but not functional. GPU backend may not work properly.
└ @ CTSolversCUDA ~/.julia/packages/CTSolvers/uc2u1/ext/CTSolversCUDA.jl:31
├─ computed options for CPU:
│ └─ backend (exa_backend)::Any (default: nothing [computed])
│ description: Execution backend for ExaModels (CPU, GPU, etc.)
│
├─ computed options for GPU:
│ └─ backend (exa_backend)::Union{Nothing, KernelAbstractions.Backend} (default: CUDACore.CUDAKernels.CUDABackend(false, false) [computed])
│ description: Execution backend for ExaModels (CPU, GPU, etc.)
│
└─ common options (1 option):
└─ base_type::DataType (default: Float64)
description: Base floating-point type used by ExaModelsdescribe(:ipopt)
describe(:ipopt)Ipopt (strategy)
├─ id: :ipopt
├─ hierarchy: Ipopt → AbstractNLPSolver → AbstractStrategy
├─ description: Interior-point NLP solver (COIN-OR Ipopt).
│ See: https://coin-or.github.io/Ipopt/OPTIONS.html
├─ family: AbstractNLPSolver
├─ default parameter: CPU
├─ parameters: CPU
│
└─ options (29 options):
│
├─ tol::Real (default: 1.0e-8)
│ description: Desired convergence tolerance (relative). Determines the convergence tolerance for the algorithm. The algorithm terminates successfully, if the (scaled) NLP error becomes smaller than this value, and if the (absolute) criteria according to dual_inf_tol, constr_viol_tol, and compl_inf_tol are met.
│
├─ max_iter (maxiter, max_iterations, maxit)::Integer (default: 1000)
│ description: Maximum number of iterations. The algorithm terminates with a message if the number of iterations exceeded this number.
│
├─ max_wall_time (maxtime, max_time, time_limit)::Real (default: NotProvided)
│ description: Maximum number of walltime clock seconds. A limit on walltime clock seconds that Ipopt can use to solve one problem.
│
├─ max_cpu_time::Real (default: NotProvided)
│ description: Maximum number of CPU seconds. A limit on CPU seconds that Ipopt can use to solve one problem.
│
├─ dual_inf_tol::Real (default: NotProvided)
│ description: Desired threshold for the dual infeasibility. Absolute tolerance on the dual infeasibility. Successful termination requires that the max-norm of the (unscaled) dual infeasibility is less than this threshold.
│
├─ constr_viol_tol::Real (default: NotProvided)
│ description: Desired threshold for the constraint and variable bound violation. Absolute tolerance on the constraint and variable bound violation.
│
├─ acceptable_tol (acc_tol)::Real (default: NotProvided)
│ description: Acceptable convergence tolerance (relative). Determines which (scaled) optimality error is considered close enough.
│
├─ acceptable_iter::Integer (default: NotProvided)
│ description: Number of "acceptable" iterations required to trigger termination. If the algorithm encounters this many consecutive iterations that are acceptable, it terminates.
│
├─ diverging_iterates_tol::Real (default: NotProvided)
│ description: Threshold for maximal value of primal iterates. If any component of the primal iterates exceeds this value (in absolute terms), the optimization is aborted.
│
├─ derivative_test::String (default: NotProvided)
│ description: Enable derivative check. If enabled, performs a finite difference check of the derivatives.
│
├─ derivative_test_tol::Real (default: NotProvided)
│ description: Threshold for identifying incorrect derivatives. If the relative error of the finite difference approximation exceeds this value, an error is reported.
│
├─ derivative_test_print_all::String (default: NotProvided)
│ description: Indicates whether information for all estimated derivatives should be printed.
│
├─ hessian_approximation::String (default: NotProvided)
│ description: Indicates what Hessian information regarding the Lagrangian function is to be used.
│
├─ limited_memory_update_type::String (default: NotProvided)
│ description: Quasi-Newton update method for the limited memory approximation.
│
├─ warm_start_init_point::String (default: NotProvided)
│ description: Indicates whether specific warm start values should be used for the primal and dual variables.
│
├─ warm_start_bound_push::Real (default: NotProvided)
│ description: Indicates how much the primal variables should be pushed inside the bounds for the warm start.
│
├─ warm_start_mult_bound_push::Real (default: NotProvided)
│ description: Indicates how much the dual variables should be pushed inside the bounds for the warm start.
│
├─ mu_strategy::String (default: adaptive)
│ description: Barrier parameter update strategy
│
├─ mu_init::Real (default: NotProvided)
│ description: Initial value for the barrier parameter.
│
├─ mu_max_fact::Real (default: NotProvided)
│ description: Factor for maximal barrier parameter. This factor determines the upper bound on the barrier parameter.
│
├─ mu_max::Real (default: NotProvided)
│ description: Maximal value for barrier parameter. This option overrides the factor setting.
│
├─ mu_min::Real (default: NotProvided)
│ description: Minimal value for barrier parameter.
│
├─ timing_statistics::String (default: NotProvided)
│ description: Indicates whether to measure time spent in components of Ipopt and NLP evaluation. The overall algorithm time is unaffected by this option.
│
├─ linear_solver::String (default: mumps)
│ description: Linear solver used for step computations. Determines which linear algebra package is to be used for the solution of the augmented linear system (for obtaining the search directions).
│
├─ print_level::Integer (default: 5)
│ description: Ipopt output verbosity (0-12)
│
├─ print_timing_statistics::String (default: NotProvided)
│ description: Switch to print timing statistics. If selected, the program will print the time spent for selected tasks. This implies timing_statistics=yes.
│
├─ print_frequency_iter::Integer (default: NotProvided)
│ description: Determines at which iteration frequency the summarizing iteration output line should be printed. Summarizing iteration output is printed every print_frequency_iter iterations, if at least print_frequency_time seconds have passed since last output.
│
├─ print_frequency_time::Real (default: NotProvided)
│ description: Determines at which time frequency the summarizing iteration output line should be printed. Summarizing iteration output is printed if at least print_frequency_time seconds have passed since last output and the iteration number is a multiple of print_frequency_iter.
│
└─ sb::String (default: yes)
description: Suppress Ipopt banner (yes/no)describe(:madnlp) and describe(:madncl)
using MadNLP
describe(:madnlp)MadNLP (strategy)
├─ id: :madnlp
├─ hierarchy: MadNLP → AbstractNLPSolver → AbstractStrategy
├─ description: Interior-point NLP solver with sparse linear algebra and GPU support.
│ See: https://madsuite.org/MadNLP.jl/stable/options/
├─ family: AbstractNLPSolver
├─ default parameter: CPU
├─ parameters: CPU, GPU
│
├─ computed options for CPU:
│ └─ linear_solver::Type{<:MadNLP.AbstractLinearSolver} (default: MumpsSolver [computed])
│ description: Sparse linear solver for the KKT system. Default is MadNLP.MumpsSolver for CPU, MadNLPGPU.CUDSSSolver for GPU. Other options include MadNLP.UmfpackSolver, MadNLP.LDLSolver, MadNLP.CHOLMODSolver.
│
├─ computed options for GPU:
│ └─ linear_solver::Type{<:MadNLP.AbstractLinearSolver} (default: MadNLPGPUCUDAExt.CUDSSSolver [computed])
│ description: Sparse linear solver for the KKT system. Default is MadNLP.MumpsSolver for CPU, MadNLPGPU.CUDSSSolver for GPU. Other options include MadNLP.UmfpackSolver, MadNLP.LDLSolver, MadNLP.CHOLMODSolver.
│
└─ common options (22 options):
├─ bound_push::Real (default: NotProvided)
│ description: Amount by which the initial point is pushed inside the bounds to ensure strictly interior starting point.
│
├─ acceptable_tol (acc_tol)::Real (default: NotProvided)
│ description: Relaxed tolerance for acceptable solution. If optimality error stays below this for 'acceptable_iter' iterations, algorithm terminates with SOLVED_TO_ACCEPTABLE_LEVEL.
│
├─ bound_fac::Real (default: NotProvided)
│ description: Factor to determine how much the initial point is pushed inside the bounds.
│
├─ mu_init::Real (default: NotProvided)
│ description: Initial value for the barrier parameter mu.
│
├─ equality_treatment::Type{<:MadNLP.AbstractEqualityTreatment} (default: NotProvided)
│ description: Method to handle equality constraints. Options: MadNLP.EnforceEquality, MadNLP.RelaxEquality.
│
├─ nlp_scaling_max_gradient::Real (default: NotProvided)
│ description: Maximum allowed gradient value when scaling the NLP problem. Used to prevent excessive scaling.
│
├─ hessian_approximation::Union{UnionAll, Type{<:MadNLP.AbstractHessian}} (default: NotProvided)
│ description: Hessian approximation method (e.g., MadNLP.ExactHessian, MadNLP.CompactLBFGS, MadNLP.BFGS).
│
├─ max_iter (maxiter, max_iterations, maxit)::Integer (default: 1000)
│ description: Maximum number of interior-point iterations before termination. Set to 0 to evaluate initial point only.
│
├─ tol::Real (default: 1.0e-8)
│ description: Convergence tolerance for optimality conditions. The algorithm terminates when optimality error falls below this threshold.
│
├─ mu_min::Real (default: NotProvided)
│ description: Minimum value for the barrier parameter mu.
│
├─ fixed_variable_treatment::Type{<:MadNLP.AbstractFixedVariableTreatment} (default: NotProvided)
│ description: Method to handle fixed variables. Options: MadNLP.MakeParameter, MadNLP.RelaxBound, MadNLP.NoFixedVariables.
│
├─ max_wall_time (max_time, maxtime, time_limit)::Real (default: NotProvided)
│ description: Maximum wall-clock time limit in seconds. Algorithm terminates with MAXIMUM_WALLTIME_EXCEEDED if exceeded.
│
├─ diverging_iterates_tol::Real (default: NotProvided)
│ description: NLP error threshold above which algorithm is declared diverging. Terminates with DIVERGING_ITERATES status.
│
├─ print_level::MadNLP.LogLevels (default: INFO)
│ description: Logging verbosity level. Valid values: MadNLP.TRACE, DEBUG, INFO (default), NOTICE, WARN, ERROR.
│
├─ nlp_scaling::Bool (default: NotProvided)
│ description: Whether to scale the NLP problem. If true, MadNLP automatically scales the objective and constraints.
│
├─ constr_mult_init_max::Real (default: NotProvided)
│ description: Maximum allowed value for the initial constraint multipliers.
│
├─ kkt_system::Union{UnionAll, Type{<:MadNLP.AbstractKKTSystem}} (default: NotProvided)
│ description: KKT system solver type (e.g., MadNLP.SparseKKTSystem, MadNLP.DenseKKTSystem).
│
├─ tau_min::Real (default: NotProvided)
│ description: Lower bound for the fraction-to-the-boundary parameter tau.
│
├─ acceptable_iter::Integer (default: NotProvided)
│ description: Number of consecutive iterations with acceptable (but not optimal) error required before accepting the solution.
│
├─ inertia_correction_method::Type{<:MadNLP.AbstractInertiaCorrector} (default: NotProvided)
│ description: Method for assumption of inertia correction (e.g., MadNLP.InertiaAuto, MadNLP.InertiaBased).
│
├─ hessian_constant (hessian_cst)::Bool (default: NotProvided)
│ description: Whether the Hessian of the Lagrangian is constant (i.e., quadratic objective with linear constraints). Can improve performance.
│
└─ jacobian_constant (jacobian_cst)::Bool (default: NotProvided)
description: Whether the Jacobian of the constraints is constant (i.e., linear constraints). Can improve performance.using MadNCL
describe(:madncl)MadNCL (strategy)
├─ id: :madncl
├─ hierarchy: MadNCL → AbstractNLPSolver → AbstractStrategy
├─ description: Augmented Lagrangian NLP solver built on MadNLP.
│ See: https://github.com/MadNLP/MadNCL.jl
├─ family: AbstractNLPSolver
├─ default parameter: CPU
├─ parameters: CPU, GPU
│
├─ computed options for CPU:
│ └─ linear_solver::Type{<:MadNLP.AbstractLinearSolver} (default: MumpsSolver [computed])
│ description: Linear solver implementation used inside MadNCL. Default is MadNLP.MumpsSolver for CPU, MadNLPGPU.CUDSSSolver for GPU.
│
├─ computed options for GPU:
│ └─ linear_solver::Type{<:MadNLP.AbstractLinearSolver} (default: MadNLPGPUCUDAExt.CUDSSSolver [computed])
│ description: Linear solver implementation used inside MadNCL. Default is MadNLP.MumpsSolver for CPU, MadNLPGPU.CUDSSSolver for GPU.
│
└─ common options (23 options):
├─ bound_push::Real (default: NotProvided)
│ description: Amount by which the initial point is pushed inside the bounds to ensure strictly interior starting point.
│
├─ acceptable_tol (acc_tol)::Real (default: NotProvided)
│ description: Relaxed tolerance for acceptable solution. If optimality error stays below this for 'acceptable_iter' iterations, algorithm terminates with SOLVED_TO_ACCEPTABLE_LEVEL.
│
├─ bound_fac::Real (default: NotProvided)
│ description: Factor to determine how much the initial point is pushed inside the bounds.
│
├─ ncl_options::MadNCL.NCLOptions (default: MadNCL.NCLOptions{Float64}(true, true, 0.3, true, 1.0, 1.0e-8, 1.0e-8, 0.0001, 100.0, 1.0e12, 20, 0.1, 1.99, 0.2, 1.0e-9))
│ description: Low-level NCLOptions structure controlling the augmented Lagrangian algorithm.
│ Available fields:
│ - `verbose` (Bool): Print convergence logs (default: true)
│ - `scaling` (Bool): Enable scaling (default: false)
│ - `opt_tol` (Float): Optimality tolerance (default: 1e-8)
│ - `feas_tol` (Float): Feasibility tolerance (default: 1e-8)
│ - `rho_init` (Float): Initial Augmented Lagrangian penalty (default: 10.0)
│ - `max_auglag_iter` (Int): Maximum number of outer iterations (default: 30)
│
├─ mu_init::Real (default: NotProvided)
│ description: Initial value for the barrier parameter mu.
│
├─ equality_treatment::Type{<:MadNLP.AbstractEqualityTreatment} (default: NotProvided)
│ description: Method to handle equality constraints. Options: MadNLP.EnforceEquality, MadNLP.RelaxEquality.
│
├─ nlp_scaling_max_gradient::Real (default: NotProvided)
│ description: Maximum allowed gradient value when scaling the NLP problem. Used to prevent excessive scaling.
│
├─ hessian_approximation::Union{UnionAll, Type{<:MadNLP.AbstractHessian}} (default: NotProvided)
│ description: Hessian approximation method (e.g., MadNLP.ExactHessian, MadNLP.CompactLBFGS, MadNLP.BFGS).
│
├─ max_iter (maxiter, max_iterations, maxit)::Integer (default: 1000)
│ description: Maximum number of augmented Lagrangian iterations
│
├─ tol::Real (default: 1.0e-8)
│ description: Optimality tolerance
│
├─ mu_min::Real (default: NotProvided)
│ description: Minimum value for the barrier parameter mu.
│
├─ fixed_variable_treatment::Type{<:MadNLP.AbstractFixedVariableTreatment} (default: NotProvided)
│ description: Method to handle fixed variables. Options: MadNLP.MakeParameter, MadNLP.RelaxBound, MadNLP.NoFixedVariables.
│
├─ max_wall_time (max_time, maxtime, time_limit)::Real (default: NotProvided)
│ description: Maximum wall-clock time limit in seconds. Algorithm terminates with MAXIMUM_WALLTIME_EXCEEDED if exceeded.
│
├─ diverging_iterates_tol::Real (default: NotProvided)
│ description: NLP error threshold above which algorithm is declared diverging. Terminates with DIVERGING_ITERATES status.
│
├─ print_level::MadNLP.LogLevels (default: INFO)
│ description: MadNCL/MadNLP logging level
│
├─ nlp_scaling::Bool (default: NotProvided)
│ description: Whether to scale the NLP problem. If true, MadNLP automatically scales the objective and constraints.
│
├─ constr_mult_init_max::Real (default: NotProvided)
│ description: Maximum allowed value for the initial constraint multipliers.
│
├─ kkt_system::Union{UnionAll, Type{<:MadNLP.AbstractKKTSystem}} (default: NotProvided)
│ description: KKT system solver type (e.g., MadNLP.SparseKKTSystem, MadNLP.DenseKKTSystem).
│
├─ tau_min::Real (default: NotProvided)
│ description: Lower bound for the fraction-to-the-boundary parameter tau.
│
├─ acceptable_iter::Integer (default: NotProvided)
│ description: Number of consecutive iterations with acceptable (but not optimal) error required before accepting the solution.
│
├─ inertia_correction_method::Type{<:MadNLP.AbstractInertiaCorrector} (default: NotProvided)
│ description: Method for assumption of inertia correction (e.g., MadNLP.InertiaAuto, MadNLP.InertiaBased).
│
├─ hessian_constant (hessian_cst)::Bool (default: NotProvided)
│ description: Whether the Hessian of the Lagrangian is constant (i.e., quadratic objective with linear constraints). Can improve performance.
│
└─ jacobian_constant (jacobian_cst)::Bool (default: NotProvided)
description: Whether the Jacobian of the constraints is constant (i.e., linear constraints). Can improve performance.describe(:uno)
using UnoSolver
describe(:uno)Uno (strategy)
├─ id: :uno
├─ hierarchy: Uno → AbstractNLPSolver → AbstractStrategy
├─ description: Unified modular NLP solver combining interior-point, SQP, trust-region and filter strategies.
│ See: https://unosolver.readthedocs.io/en/latest/
├─ family: AbstractNLPSolver
├─ default parameter: CPU
├─ parameters: CPU
│
└─ options (17 options):
│
├─ preset::String (default: ipopt)
│ description: Uno implements presets, that is combinations of ingredients that correspond to existing solvers. At the moment, the available presets are filtersqp (after the trust-region restoration filter SQP solver filterSQP) and ipopt (after the line-search filter restoration infeasible interior-point solver IPOPT).
│
├─ primal_tolerance::Real (default: 1.0e-8)
│ description: Tolerance on constraint violation. Determines the convergence tolerance for primal feasibility.
│
├─ dual_tolerance::Real (default: 1.0e-8)
│ description: Tolerance on stationarity and complementarity. Determines the convergence tolerance for dual feasibility.
│
├─ loose_primal_tolerance::Real (default: NotProvided)
│ description: Loose tolerance on constraint violation. Used for acceptable termination criteria.
│
├─ loose_dual_tolerance::Real (default: NotProvided)
│ description: Loose tolerance on stationarity and complementarity. Used for acceptable termination criteria.
│
├─ loose_tolerance_iteration_threshold::Integer (default: NotProvided)
│ description: Number of iterations for the loose tolerance to apply. If the algorithm encounters this many consecutive iterations that satisfy loose tolerances, it terminates.
│
├─ max_iterations (maxiter, max_iter, maxit)::Integer (default: 1000)
│ description: Maximum number of outer iterations. The algorithm terminates with a message if the number of iterations exceeded this number.
│
├─ time_limit (max_wall_time, maxtime, max_time)::Real (default: NotProvided)
│ description: Time limit in seconds. A limit on walltime clock seconds that Uno can use to solve one problem.
│
├─ print_solution::Bool (default: false)
│ description: Whether the primal-dual solution is printed at termination.
│
├─ unbounded_objective_threshold::Real (default: NotProvided)
│ description: Objective threshold under which the problem is declared unbounded. If the objective value falls below this threshold, the solver terminates with unbounded status.
│
├─ logger::String (default: INFO)
│ description: Verbosity level of the logger. Controls the amount of output during the solve.
│
├─ progress_norm::String (default: NotProvided)
│ description: Norm used for the progress measures. Determines how progress is measured during the solve.
│
├─ residual_norm::String (default: NotProvided)
│ description: Norm used for the residuals. Determines how residuals are measured for convergence.
│
├─ residual_scaling_threshold::Real (default: NotProvided)
│ description: Scaling factor in stationarity and complementarity residuals. Controls how residuals are scaled for convergence checks.
│
├─ protect_actual_reduction_against_roundoff::Bool (default: NotProvided)
│ description: Whether the actual reduction is slightly modified to account for roundoff errors. Can improve numerical stability.
│
├─ protected_actual_reduction_macheps_coefficient::Real (default: NotProvided)
│ description: Coefficient of the machine epsilon in the protected actual reduction. Only used if protect_actual_reduction_against_roundoff is true.
│
└─ print_subproblem::Bool (default: false)
description: Whether the subproblem is printed in DEBUG mode. Useful for debugging subproblem formulations.describe also accepts the parameters, which lists the strategies that support them:
describe(:cpu)CPU (parameter)
├─ id: :cpu
├─ hierarchy: CPU → AbstractStrategyParameter
├─ description: CPU-based computation
│
└─ used by strategies (9):
├─ :adnlp (AbstractNLPModeler) → ADNLP{CPU}
├─ :di (AbstractADBackend) → DifferentiationInterface{O}
├─ :exa (AbstractNLPModeler) → Exa{CPU}
├─ :ipopt (AbstractNLPSolver) → Ipopt{CPU}
├─ :knitro (AbstractNLPSolver) → Knitro{CPU}
├─ :madncl (AbstractNLPSolver) → MadNCL{CPU}
├─ :madnlp (AbstractNLPSolver) → MadNLP{CPU}
├─ :sciml (AbstractIntegrator) → SciML{O, OP, OT}
└─ :uno (AbstractNLPSolver) → Uno{CPU}describe(:gpu)GPU (parameter)
├─ id: :gpu
├─ hierarchy: GPU → AbstractStrategyParameter
├─ description: GPU-based computation
│
└─ used by strategies (5):
├─ :di (AbstractADBackend) → DifferentiationInterface{O}
├─ :exa (AbstractNLPModeler) → Exa{GPU}
├─ :madncl (AbstractNLPSolver) → MadNCL{GPU}
├─ :madnlp (AbstractNLPSolver) → MadNLP{GPU}
└─ :sciml (AbstractIntegrator) → SciML{O, OP, OT}It covers the strategies of the indirect method too: describe(:sciml) for the ODE integrator of flows, and describe(:di) for the automatic differentiation backend (DifferentiationInterface).
Official documentation
For the complete list of each package's options, see:
ADNLPModels: documentation
ExaModels: documentation
Ipopt: options
MadNLP: options
Uno: documentation
MadNCL: repository
Knitro: options
Discretization schemes
:collocation accepts a scheme option (alias disc_method):
| Value | Notes | :adnlp | :exa |
|---|---|---|---|
:trapeze | trapezoidal rule, second-order | ✅ | ✅ |
:midpoint | midpoint rule, second-order, default | ✅ | ✅ |
:euler | explicit Euler, first-order | ✅ | ✅ |
:euler_implicit | implicit Euler, first-order, more stable for stiff problems | ✅ | ✅ |
:euler_explicit, :euler_forward | aliases of :euler | ✅ | ✗ |
:euler_backward | alias of :euler_implicit | ✅ | ✗ |
:gauss_legendre_2 | 2-point Gauss–Legendre collocation, fourth-order | ✅ | ✗ |
:gauss_legendre_3 | 3-point Gauss–Legendre collocation, sixth-order | ✅ | ✗ |
The higher-order Gauss–Legendre schemes are more accurate, at a higher cost per grid step. The grid is set by grid_size (default 250), or, with :adnlp, by an explicit, possibly non-uniform, time_grid (with :exa, time_grid is not supported yet: CTDirect#638).
Under :exa, only the four canonical names work
:exa takes :trapeze, :midpoint, :euler and :euler_implicit, and nothing else. Both Gauss–Legendre schemes are out, and so are the aliases: :euler_forward is rejected where :euler is accepted, though under :adnlp the two name the same scheme (CTParser#355):
julia> solve(ocp, :exa; scheme=:euler_forward, display=false)
IncorrectArgument → macro expansion, choosing-a-method.md:47
│
│ unknown numerical scheme
│
│ Got euler_forward
│ Expected :euler, :euler_implicit, :midpoint or :trapeze
│
│ Hint pass one of the supported schemes to the :exa backend
└─See also
Options: how keyword arguments reach the right strategy.
GPU: the
:gpuparameter in full.API reference: Options and strategies: every symbol on this page, with full signatures.