Concrete Solution Types

Concrete solution types store solver results and implement the array and field contracts described by the SciML solution interface. Constructors for these types are primarily used by solver packages through build_solution.

Algebraic Solutions

SciMLBase.LinearSolutionType
struct LinearSolution{T, N, uType, R, A, C, S} <: SciMLBase.AbstractLinearSolution{T, N}

Representation of the solution to an linear system Ax=b defined by a LinearProblem

Fields

  • u: the representation of the linear solve's solution.
  • resid: the residual of the solver, if the method is an iterative method. Returns a mutable type, thus if scalar it is wrapped in a Ref.
  • alg: the algorithm type used by the solver.
  • iters: the number of iterations used to solve the equation, if the method is an iterative method.
  • retcode: the return code from the solver. Used to determine whether the solver solved successfully or whether it exited due to an error. For more details, see the return code documentation.
  • cache: the LinearCache object containing the solver's internal cached variables. This is given to allow continuation of solver usage, for example, solving Ax=b with the same A and a new b without refactorizing A. See the caching interface tutorial for details on how to use the cache effectively: https://docs.sciml.ai/LinearSolve/stable/tutorials/caching_interface
  • stats: statistics of the solver, such as the number of function evaluations required.
source
SciMLBase.EigenvalueSolutionType
struct EigenvalueSolution{T, N, U, V, P, A, R, S} <: SciMLBase.AbstractEigenvalueSolution{T, N}

Representation of the solution to an eigenvalue problem defined by an EigenvalueProblem.

Fields

  • u: the computed eigenvalues.
  • vectors: the corresponding eigenvectors, stored as the columns of a matrix.
  • prob: the EigenvalueProblem that was solved.
  • alg: the algorithm type used by the solver.
  • retcode: the return code from the solver. Used to determine whether the solver solved successfully or whether it exited due to an error. For more details, see the return code documentation.
  • resid: the residual(s) of the computed eigenpairs, if provided by the solver.
  • stats: statistics of the solver, if provided.
source
SciMLBase.NonlinearSolutionType
struct NonlinearSolution{T, N, uType, R, P, A, O, uType2, S, Tr} <: SciMLBase.AbstractNonlinearSolution{T, N}

Representation of the solution to a nonlinear equation defined by a NonlinearProblem, or the steady state solution to a differential equation defined by a SteadyStateProblem.

Fields

  • u: the representation of the nonlinear equation's solution.
  • resid: the residual of the solution.
  • prob: the original NonlinearProblem/SteadyStateProblem that was solved.
  • alg: the algorithm type used by the solver.
  • original: if the solver is wrapped from an alternative solver ecosystem, such as NLsolve.jl, then this is the original return from said solver library.
  • retcode: the return code from the solver. Used to determine whether the solver solved successfully or whether it exited due to an error. For more details, see the return code documentation.
  • left: if the solver is bracketing method, this is the final left bracket value.
  • right: if the solver is bracketing method, this is the final right bracket value.
  • stats: statistics of the solver, such as the number of function evaluations required.
source
SciMLBase.IntegralSolutionType
struct IntegralSolution{T, N, uType, R, P, A, C, S} <: SciMLBase.AbstractIntegralSolution{T, N}

Representation of the solution to an quadrature integral_lb^ub f(x) dx defined by a IntegralProblem

Fields

  • u: the representation of the optimization's solution.
  • resid: the residual of the solver.
  • alg: the algorithm type used by the solver.
  • retcode: the return code from the solver. Used to determine whether the solver solved successfully or whether it exited due to an error. For more details, see the return code documentation.
  • chi: the variance estimate of the estimator from Monte Carlo quadrature methods.
  • stats: statistics of the solver, such as the number of function evaluations required.
source
SciMLBase.OptimizationSolutionType
struct OptimizationSolution{T, N, uType, C<:SciMLBase.AbstractOptimizationCache, A, OV, O, ST, DType} <: SciMLBase.AbstractOptimizationSolution{T, N}

Representation of the solution to a non-linear optimization defined by an OptimizationProblem.

Fields

  • u: the representation of the optimization's solution.
  • alg: the algorithm type used by the solver.
  • objective: Objective value of the solution
  • retcode: the return code from the solver. Used to determine whether the solver solved successfully or whether it exited due to an error. For more details, see the return code documentation.
  • original: if the solver is wrapped from a external solver, e.g. Optim.jl, then this is the original return from said solver library.
  • stats: statistics of the solver, such as the number of function evaluations required.
  • dual: dual multipliers, one vector per constraint in constraint order, or nothing. General OptimizationProblem solves leave this nothing; a ConvexOptimizationProblem solved by a conic backend populates it as the optimality certificate. Its type is fixed at solve time by the calculate_dual keyword (Val(true)/Val(false)/Val(nothing)) so switching problem types stays type-stable — see default_calculate_dual.

Internal Fields

  • cache::AbstractOptimizationCache: the optimization cache that was solved.

Interface

OptimizationSolution is a SciMLBase.AbstractNoTimeSolution. For more information on the SciML solution interfaces, check out the SciML Solution Interface documentation page

source
SciMLBase.default_calculate_dualFunction
default_calculate_dual(prob)

Whether solve computes dual multipliers by default for problem prob, returned as a Val: Val(false) for a general OptimizationProblem (a local NLP solve has no duals to report), and Val(true) for a ConvexOptimizationProblem (convex duals are a first-class optimality certificate, so they are on by default). A DCP router that decides convex-vs-NLP at runtime should pass Val(nothing) to get the type-stable Union dual field.

source

Differential Equation Solutions

SciMLBase.ODESolutionType
struct ODESolution{T, N, uType, uType2, DType, tType, rateType, discType, P, A, IType, S, AC<:Union{Nothing, Vector{Int64}}, R, O, V, GE} <: SciMLBase.AbstractODESolution{T, N, uType}

Representation of the solution to an ordinary differential equation defined by an ODEProblem.

DESolution Interface

For more information on interacting with DESolution types, check out the Solution Handling page of the DifferentialEquations.jl documentation.

https://docs.sciml.ai/DiffEqDocs/stable/basics/solution/

Fields

  • u: the representation of the ODE solution. Given as an array of solutions, where u[i] corresponds to the solution at time t[i]. It is recommended in most cases one does not access sol.u directly and instead use the array interface described in the Solution Handling page of the DifferentialEquations.jl documentation.
  • t: the time points corresponding to the saved values of the ODE solution.
  • prob: the original ODEProblem that was solved.
  • alg: the algorithm type used by the solver.
  • stats: statistics of the solver, such as the number of function evaluations required, number of Jacobians computed, and more.
  • retcode: the return code from the solver. Used to determine whether the solver solved successfully, whether it terminated early due to a user-defined callback, or whether it exited due to an error. For more details, see the return code documentation.
  • global_error: an estimate of the global (accumulated) error of the solution, or nothing when the algorithm does not compute one (see has_global_error). When present it is an array matching u, with global_error[i] the estimated global error of u[i] at t[i].
source
SciMLBase.RODESolutionType
struct RODESolution{T, N, uType, uType2, DType, tType, randType, discType, P, A, IType, S, AC<:Union{Nothing, Vector{Int64}}, V} <: SciMLBase.AbstractRODESolution{T, N, uType}

Representation of the solution to an stochastic differential equation defined by an SDEProblem, or of a random ordinary differential equation defined by an RODEProblem.

DESolution Interface

For more information on interacting with DESolution types, check out the Solution Handling page of the DifferentialEquations.jl documentation.

https://docs.sciml.ai/DiffEqDocs/stable/basics/solution

Fields

  • u: the representation of the SDE or RODE solution. Given as an array of solutions, where u[i] corresponds to the solution at time t[i]. It is recommended in most cases one does not access sol.u directly and instead use the array interface described in the Solution Handling page of the DifferentialEquations.jl documentation.
  • t: the time points corresponding to the saved values of the ODE solution.
  • W: the representation of the saved noise process from the solution. See the Noise Processes page of the DifferentialEquations.jl. Note that this noise is only saved in full if save_noise=true in the solver.
  • prob: the original SDEProblem/RODEProblem that was solved.
  • alg: the algorithm type used by the solver.
  • stats: statistics of the solver, such as the number of function evaluations required, number of Jacobians computed, and more.
  • retcode: the return code from the solver. Used to determine whether the solver solved successfully, whether it terminated early due to a user-defined callback, or whether it exited due to an error. For more details, see the return code documentation.
source
SciMLBase.DAESolutionType
struct DAESolution{T, N, uType, duType, uType2, DType, tType, P, A, ID, S, rateType, V} <: SciMLBase.AbstractDAESolution{T, N, uType}

Representation of the solution to an differential-algebraic equation defined by an DAEProblem.

DESolution Interface

For more information on interacting with DESolution types, check out the Solution Handling page of the DifferentialEquations.jl documentation.

https://docs.sciml.ai/DiffEqDocs/stable/basics/solution/

Fields

  • u: the representation of the DAE solution. Given as an array of solutions, where u[i] corresponds to the solution at time t[i]. It is recommended in most cases one does not access sol.u directly and instead use the array interface described in the Solution Handling page of the DifferentialEquations.jl documentation.
  • du: the representation of the derivatives of the DAE solution.
  • t: the time points corresponding to the saved values of the DAE solution.
  • prob: the original DAEProblem that was solved.
  • alg: the algorithm type used by the solver.
  • stats: statistics of the solver, such as the number of function evaluations required, number of Jacobians computed, and more.
  • retcode: the return code from the solver. Used to determine whether the solver solved successfully, whether it terminated early due to a user-defined callback, or whether it exited due to an error. For more details, see the return code documentation.
source