OptimizationSystem

System Constructors

ModelingToolkit.OptimizationSystemType
struct OptimizationSystem <: AbstractTimeIndependentSystem

A scalar equation for optimization.

Fields

  • op

    Objective function of the system.

  • states

    Unknown variables.

  • ps

    Parameters.

  • var_to_name

    Array variables.

  • observed

  • constraints

    List of constraint equations of the system.

  • name

    The unique name of the system.

  • systems

    The internal systems.

  • defaults

    The default values to use when initial guess and/or parameters are not supplied in OptimizationProblem.

  • metadata

    metadata: metadata for the system, to be used by downstream packages.

Examples

@variables x y z
@parameters a b c

op = a*(y-x) + x*(b-z)-y + x*y - c*z
@named os = OptimizationSystem(op, [x,y,z], [a,b,c])
source

Composition and Accessor Functions

  • get_eqs(sys) or equations(sys): The equation to be minimized.
  • get_states(sys) or states(sys): The set of states for the optimization.
  • get_ps(sys) or parameters(sys): The parameters for the optimization.

Transformations

Analyses

Applicable Calculation and Generation Functions

calculate_gradient
calculate_hessian
generate_gradient
generate_hessian
hessian_sparsity

Problem Constructors

SciMLBase.OptimizationProblemMethod
function DiffEqBase.OptimizationProblem{iip}(sys::OptimizationSystem,u0map,
                                          parammap=DiffEqBase.NullParameters();
                                          lb=nothing, ub=nothing,
                                          grad = false,
                                          hess = false, sparse = false,
                                          checkbounds = false,
                                          linenumbers = true, parallel=nothing,
                                          kwargs...) where iip

Generates an OptimizationProblem from an OptimizationSystem and allows for automatically symbolically calculating numerical enhancements.

source

Expression Constructors

ModelingToolkit.OptimizationProblemExprType
function DiffEqBase.OptimizationProblemExpr{iip}(sys::OptimizationSystem,
                                          parammap=DiffEqBase.NullParameters();
                                          u0=nothing, lb=nothing, ub=nothing,
                                          grad = false,
                                          hes = false, sparse = false,
                                          checkbounds = false,
                                          linenumbers = true, parallel=nothing,
                                          kwargs...) where iip

Generates a Julia expression for an OptimizationProblem from an OptimizationSystem and allows for automatically symbolically calculating numerical enhancements.

source