Common Solver Options (Solve Keyword Arguments)
CommonSolve.solve
— Methodsolve(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 tofalse
.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 to1000
.maxtime
: The maximum time for solving the nonlinear system of equations. Defaults tonothing
which means no time limit. Note that setting a time limit does have a small overhead.abstol::Number
: The absolute tolerance. Defaults toreal(oneunit(T)) * (eps(real(one(T))))^(4 // 5)
.reltol::Number
: The relative tolerance. Defaults toreal(oneunit(T)) * (eps(real(one(T))))^(4 // 5)
.termination_condition
: Termination Condition from DiffEqBase. Defaults toAbsSafeBestTerminationMode()
forNonlinearSolve.jl
andAbsTerminateMode()
forSimpleNonlinearSolve.jl
.
Tracing Controls
These are exclusively available for native NonlinearSolve.jl
solvers.
show_trace
: Must beVal(true)
orVal(false)
. This controls whether the trace is displayed to the console. (Defaults toVal(false)
)trace_level
: Needs to be one of Trace Objects:TraceMinimal
,TraceWithJacobianConditionNumber
, orTraceAll
. This controls the level of detail of the trace. (Defaults toTraceMinimal()
)store_trace
: Must beVal(true)
orVal(false)
. This controls whether the trace is stored in the solution object. (Defaults toVal(false)
)