Common Solver Options (Solve Keyword Arguments)

CommonSolve.solveMethod
solve(prob::NonlinearProblem, alg::Union{AbstractNonlinearAlgorithm,Nothing}; kwargs...)

Arguments

The only positional argument is alg which is optional. By default, alg = nothing. If alg = nothing, then solve dispatches to the NonlinearSolve.jl automated algorithm selection (if using NonlinearSolve was done, otherwise it will error with a MethodError).

Keyword Arguments

The NonlinearSolve.jl universe has a large set of common arguments available for the solve function. These arguments apply to solve on any problem type and are only limited by limitations of the specific implementations.

Many of the defaults depend on the algorithm or the package the algorithm derives from. Not all of the interface is provided by every algorithm. For more detailed information on the defaults and the available options for specific algorithms / packages, see the manual pages for the solvers of specific problems.

Error Control

  • abstol: Absolute tolerance.
  • reltol: Relative tolerance.

Miscellaneous

  • maxiters: Maximum number of iterations before stopping. Defaults to 1e5.
  • verbose: Toggles whether warnings are thrown when the solver exits early. Defaults to true.

Sensitivity Algorithms (sensealg)

sensealg is used for choosing the way the automatic differentiation is performed. For more information, see the documentation for SciMLSensitivity: https://docs.sciml.ai/SciMLSensitivity/stable/

General Controls

  • alias_u0::Bool: Whether to alias the initial condition or use a copy. Defaults to false.
  • internalnorm::Function: The norm used by the solver. Default depends on algorithm choice.

Iteration Controls

  • maxiters::Int: The maximum number of iterations to perform. Defaults to 1000.
  • maxtime: The maximum time for solving the nonlinear system of equations. Defaults to nothing which means no time limit. Note that setting a time limit does have a small overhead.
  • abstol::Number: The absolute tolerance. Defaults to real(oneunit(T)) * (eps(real(one(T))))^(4 // 5).
  • reltol::Number: The relative tolerance. Defaults to real(oneunit(T)) * (eps(real(one(T))))^(4 // 5).
  • termination_condition: Termination Condition from DiffEqBase. Defaults to AbsSafeBestTerminationMode() for NonlinearSolve.jl and AbsTerminateMode() for SimpleNonlinearSolve.jl.

Tracing Controls

These are exclusively available for native NonlinearSolve.jl solvers.

  • show_trace: Must be Val(true) or Val(false). This controls whether the trace is displayed to the console. (Defaults to Val(false))
  • trace_level: Needs to be one of Trace Objects: TraceMinimal, TraceWithJacobianConditionNumber, or TraceAll. This controls the level of detail of the trace. (Defaults to TraceMinimal())
  • store_trace: Must be Val(true) or Val(false). This controls whether the trace is stored in the solution object. (Defaults to Val(false))