ModelingToolkit Integration
This tutorial models the Lotka–Volterra fishing problem with ModelingToolkit.jl. We solve it using single and multiple shooting, as in the numerical fishing example.
Setup
ModelingToolkit defines the dynamics and cost. Corleone constructs the shooting layer, ComponentArrays supplies the optimizer's parameter vector, and ForwardDiff computes derivatives. We solve with Ipopt and plot with CairoMakie.
using Corleone
using ModelingToolkit
using ModelingToolkit: t_nounits as t, D_nounits as D
using OrdinaryDiffEqTsit5
using ComponentArrays, ForwardDiff
using Optimization
using OptimizationMOI, Ipopt
using LuxCore, Random
using CairoMakieModel
The states x and y are prey and predator populations. Their global initial values are fixed because tunable = false. The input u is fishing intensity, bounded between zero and one. Population bounds apply to lifted state values when using multiple shooting; they do not impose continuous path constraints.
@variables begin
x(..) = 0.5, [tunable = false, bounds = (0.0, 5.0)]
y(..) = 0.7, [tunable = false, bounds = (0.0, 5.0)]
u(..) = 0.0, [bounds = (0.0, 1.0), input = true]
end
@constants begin
c₁ = 0.4
c₂ = 0.2
end2-element Vector{Symbolics.Num}:
c₁
c₂Fishing removes both populations at different rates.
eqs = [
D(x(t)) ~ x(t) - x(t) * y(t) - c₁ * u(t) * x(t)
D(y(t)) ~ -y(t) + x(t) * y(t) - c₂ * u(t) * y(t)
]2-element Vector{Symbolics.Equation}:
Differential(t, 1)(x(t)) ~ x(t) - x(t)*y(t) - c₁*u(t)*x(t)
Differential(t, 1)(y(t)) ~ -y(t) + x(t)*y(t) - c₂*u(t)*y(t)Minimize the accumulated squared deviations of both populations from one over the time horizon [0, 12]. Corleone introduces a quadrature state for this integral.
costs = [
Symbolics.Integral(t in (0.0, 12.0))(
(x(t) - 1.0)^2 + (y(t) - 1.0)^2
),
]
@named lotka_volterra = System(eqs, t, costs = costs)Model lotka_volterra:
Equations (2):
2 standard: see equations(lotka_volterra)
Unknowns (3): see unknowns(lotka_volterra)
x(t)
y(t)
u(t)
Parameters (2): see parameters(lotka_volterra)
c₁
c₂Single Shooting
Supply the system, initial-value overrides, and the control schedule. The empty vector keeps the system defaults. The leading zero denotes the first control interval; this grid gives 120 piecewise constant values, one per 0.1 time units. The integral determines the time span, so it need not be specified separately.
dynopt = CorleoneDynamicOptProblem(
lotka_volterra, [],
u(t) => 0.0:0.1:11.9,
algorithm = Tsit5(),
)CorleoneDynamicOptProblem{ShootingLayer{}, Corleone.ParsedTrajectoryExpression{RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(Symbol("##samples#634"),), CorleoneRuntimeGeneratedFunctionsExtension.var"#_RGF_ModTag", CorleoneRuntimeGeneratedFunctionsExtension.var"#_RGF_ModTag", (0xd5820544, 0x546b31d7, 0xdbe3f38b, 0x152b58ca, 0xea796204), Expr}, Vector{Tuple{Symbol, Int64, Union{Nothing, Real}}}, Nothing}, Tuple{}, @NamedTuple{initialcondition::@NamedTuple{initialconditions::@NamedTuple{var"y(t)"::@NamedTuple{}, var"x(t)"::@NamedTuple{}, var"var\"##quadrature#571\"(t)"::@NamedTuple{}}}, parameter::@NamedTuple{parameters::@NamedTuple{c₁::@NamedTuple{lookup::@NamedTuple{}, parameter::@NamedTuple{c₁::@NamedTuple{}, c₂::@NamedTuple{}}}, var"u(t)"::@NamedTuple{lookup::@NamedTuple{}, parameter::@NamedTuple{ps::Vector{Float64}}}}}}, @NamedTuple{initialcondition::@NamedTuple{initialconditions::@NamedTuple{var"y(t)"::@NamedTuple{}, var"x(t)"::@NamedTuple{}, var"var\"##quadrature#571\"(t)"::@NamedTuple{}}, active::Vector{Bool}, permutation::Vector{Int64}}, parameter::@NamedTuple{parameters::@NamedTuple{c₁::@NamedTuple{lookup::@NamedTuple{collection::Nothing, inserted::Vector{Int64}, cache::Nothing}, parameter::@NamedTuple{c₁::@NamedTuple{states::@NamedTuple{}, parameters::@NamedTuple{ps::Vector{Float64}}}, c₂::@NamedTuple{states::@NamedTuple{}, parameters::@NamedTuple{ps::Vector{Float64}}}}}, var"u(t)"::@NamedTuple{lookup::@NamedTuple{collection::Vector{Float64}, inserted::Vector{Int64}, cache::Nothing}, parameter::@NamedTuple{}}}, permutation::Vector{Int64}}, timestops::Vector{Float64}}, Dict{Symbol, Vector{Real}}, Vector{Float64}, Vector{Float64}, Vector{Float64}, Vector{Float64}, Vector{Float64}}(ShootingLayer{}(nothing, SciMLBase.ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, true, Vector{Float64}, SciMLBase.ODEFunction{true, SciMLBase.AutoDespecialize, ModelingToolkitBase.GeneratedFunctionWrapper{Tuple{2, 3, false}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:___mtkunknowns___, :__mtk_arg_2, :__argₛᵧₘ7628082562247908723), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0x8636d3b7, 0xd21a3310, 0xf39a67f1, 0x4d0b1327, 0x41847da1), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__argₛᵧₘ1187374493630987813, :___mtkunknowns___, :__mtk_arg_2, :__argₛᵧₘ7628082562247908723), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0x7cfa6f19, 0x20ae702c, 0x8f0ea66c, 0x0c73f9fe, 0x75dfb097), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ModelingToolkitBase.ObservedFunctionCache{ModelingToolkitBase.System, Nothing}, Nothing, ModelingToolkitBase.System, Union{Nothing, SciMLBase.OverrideInitData}, Union{Nothing, SciMLBase.ODENLStepData}}, Base.Pairs{Symbol, SciMLBase.NoAD, Nothing, @NamedTuple{sensealg::SciMLBase.NoAD}}, SciMLBase.StandardODEProblem}(SciMLBase.ODEFunction{true, SciMLBase.AutoDespecialize, ModelingToolkitBase.GeneratedFunctionWrapper{Tuple{2, 3, false}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:___mtkunknowns___, :__mtk_arg_2, :__argₛᵧₘ7628082562247908723), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0x8636d3b7, 0xd21a3310, 0xf39a67f1, 0x4d0b1327, 0x41847da1), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__argₛᵧₘ1187374493630987813, :___mtkunknowns___, :__mtk_arg_2, :__argₛᵧₘ7628082562247908723), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0x7cfa6f19, 0x20ae702c, 0x8f0ea66c, 0x0c73f9fe, 0x75dfb097), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ModelingToolkitBase.ObservedFunctionCache{ModelingToolkitBase.System, Nothing}, Nothing, ModelingToolkitBase.System, Union{Nothing, SciMLBase.OverrideInitData}, Union{Nothing, SciMLBase.ODENLStepData}}(ModelingToolkitBase.GeneratedFunctionWrapper{Tuple{2, 3, false}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:___mtkunknowns___, :__mtk_arg_2, :__argₛᵧₘ7628082562247908723), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0x8636d3b7, 0xd21a3310, 0xf39a67f1, 0x4d0b1327, 0x41847da1), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__argₛᵧₘ1187374493630987813, :___mtkunknowns___, :__mtk_arg_2, :__argₛᵧₘ7628082562247908723), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0x7cfa6f19, 0x20ae702c, 0x8f0ea66c, 0x0c73f9fe, 0x75dfb097), Nothing}}(RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:___mtkunknowns___, :__mtk_arg_2, :__argₛᵧₘ7628082562247908723), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0x8636d3b7, 0xd21a3310, 0xf39a67f1, 0x4d0b1327, 0x41847da1), Nothing}(nothing), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__argₛᵧₘ1187374493630987813, :___mtkunknowns___, :__mtk_arg_2, :__argₛᵧₘ7628082562247908723), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0x7cfa6f19, 0x20ae702c, 0x8f0ea66c, 0x0c73f9fe, 0x75dfb097), Nothing}(nothing)), LinearAlgebra.UniformScaling{Bool}(true), nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, ModelingToolkitBase.ObservedFunctionCache{ModelingToolkitBase.System, Nothing}(Model lotka_volterra:
Equations (3):
3 standard: see equations(lotka_volterra)
Unknowns (3): see unknowns(lotka_volterra)
y(t)
x(t)
var"##quadrature#571"(t)
Parameters (3): see parameters(lotka_volterra)
c₁
c₂
u(t) [defaults to missing], Dict{Any, Any}(), false, false, ModelingToolkitBase, false, nothing), nothing, Model lotka_volterra:
Equations (3):
3 standard: see equations(lotka_volterra)
Unknowns (3): see unknowns(lotka_volterra)
y(t)
x(t)
var"##quadrature#571"(t)
Parameters (3): see parameters(lotka_volterra)
c₁
c₂
u(t) [defaults to missing], nothing, nothing), [0.7, 0.5, 0.0], (0.0, 12.0), [0.4, 0.2, 0.0], Base.Pairs(:sensealg => SciMLBase.NoAD()), SciMLBase.StandardODEProblem()), OrdinaryDiffEqTsit5.Tsit5{typeof(OrdinaryDiffEqCore.trivial_limiter!), typeof(OrdinaryDiffEqCore.trivial_limiter!), FastBroadcast.Serial}(OrdinaryDiffEqCore.trivial_limiter!, OrdinaryDiffEqCore.trivial_limiter!, FastBroadcast.Serial()), SciMLBase.EnsembleSerial(), InitialConditions{}(nothing, SciMLStructures.ArrayRepack{Vector{Float64}}([0.7, 0.5, 0.0]), (var"y(t)" = PassThrough{}(Symbol("y(t)")), var"x(t)" = PassThrough{}(Symbol("x(t)")), var"var\"##quadrature#571\"(t)" = PassThrough{}(Symbol("var\"##quadrature#571\"(t)"))), ([1], [2], [3])), Parameter{}(nothing, SciMLStructures.ArrayRepack{Vector{Float64}}([0.4, 0.2, 0.0]), (c₁ = PiecewiseConstant{}(:c₁, LookUp{}(nothing, nothing), (c₁ = FixedLayer{}(ParameterCollection{}(Corleone.var"#173#174"{Vector{Float64}}([0.0], Core.Box((-Inf, Inf)), Core.Box(0.4)), 1)), c₂ = FixedLayer{}(ParameterCollection{}(Corleone.var"#173#174"{Vector{Float64}}([0.0], Core.Box((-Inf, Inf)), Core.Box(0.2)), 1)))), var"u(t)" = PiecewiseConstant{}(Symbol("u(t)"), LookUp{}([0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 4.0, 4.1, 4.2, 4.3, 4.4, 4.5, 4.6, 4.7, 4.8, 4.9, 5.0, 5.1, 5.2, 5.3, 5.4, 5.5, 5.6, 5.7, 5.8, 5.9, 6.0, 6.1, 6.2, 6.3, 6.4, 6.5, 6.6, 6.7, 6.8, 6.9, 7.0, 7.1, 7.2, 7.3, 7.4, 7.5, 7.6, 7.7, 7.8, 7.9, 8.0, 8.1, 8.2, 8.3, 8.4, 8.5, 8.6, 8.7, 8.8, 8.9, 9.0, 9.1, 9.2, 9.3, 9.4, 9.5, 9.6, 9.7, 9.8, 9.9, 10.0, 10.1, 10.2, 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 11.0, 11.1, 11.2, 11.3, 11.4, 11.5, 11.6, 11.7, 11.8, 11.9], nothing), ParameterCollection{}(Corleone.var"#173#174"{Vector{Float64}}([0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 4.0, 4.1, 4.2, 4.3, 4.4, 4.5, 4.6, 4.7, 4.8, 4.9, 5.0, 5.1, 5.2, 5.3, 5.4, 5.5, 5.6, 5.7, 5.8, 5.9, 6.0, 6.1, 6.2, 6.3, 6.4, 6.5, 6.6, 6.7, 6.8, 6.9, 7.0, 7.1, 7.2, 7.3, 7.4, 7.5, 7.6, 7.7, 7.8, 7.9, 8.0, 8.1, 8.2, 8.3, 8.4, 8.5, 8.6, 8.7, 8.8, 8.9, 9.0, 9.1, 9.2, 9.3, 9.4, 9.5, 9.6, 9.7, 9.8, 9.9, 10.0, 10.1, 10.2, 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 11.0, 11.1, 11.2, 11.3, 11.4, 11.5, 11.6, 11.7, 11.8, 11.9], Core.Box((0.0, 1.0)), Core.Box(0.0)), 120))), ([1, 2], [3])), ControlSymbolCache{}(Model lotka_volterra:
Equations (3):
3 standard: see equations(lotka_volterra)
Unknowns (3): see unknowns(lotka_volterra)
y(t)
x(t)
var"##quadrature#571"(t)
Parameters (3): see parameters(lotka_volterra)
c₁
c₂
u(t) [defaults to missing], SymbolicUtils.BasicSymbolicImpl.var"typeof(BasicSymbolicImpl)"{SymbolicUtils.SymReal}[u(t)], SymbolicUtils.BasicSymbolicImpl.var"typeof(BasicSymbolicImpl)"{SymbolicUtils.SymReal}[var"##quadrature#571"(t)], Dict{Any, Any}(c₁ => (-Inf, Inf), x(t) => (0.0, 5.0), var"##quadrature#571"(t) => (-Inf, Inf), y(t) => (0.0, 5.0), c₂ => (-Inf, Inf), u(t) => (0.0, 1.0)))), Corleone.ParsedTrajectoryExpression{RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(Symbol("##samples#634"),), CorleoneRuntimeGeneratedFunctionsExtension.var"#_RGF_ModTag", CorleoneRuntimeGeneratedFunctionsExtension.var"#_RGF_ModTag", (0xd5820544, 0x546b31d7, 0xdbe3f38b, 0x152b58ca, 0xea796204), Expr}, Vector{Tuple{Symbol, Int64, Union{Nothing, Real}}}, Nothing}(RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(Symbol("##samples#634"),), CorleoneRuntimeGeneratedFunctionsExtension.var"#_RGF_ModTag", CorleoneRuntimeGeneratedFunctionsExtension.var"#_RGF_ModTag", (0xd5820544, 0x546b31d7, 0xdbe3f38b, 0x152b58ca, 0xea796204), Expr}(:((+)((*)(-1, Base.getindex((var"##samples#634").states, 3, 1)), Base.getindex((var"##samples#634").states, 3, 121)))), Tuple{Symbol, Int64, Union{Nothing, Real}}[(:states, 3, 0.0), (:states, 3, 12.0)], nothing), (), (initialcondition = (initialconditions = (var"y(t)" = NamedTuple(), var"x(t)" = NamedTuple(), var"var\"##quadrature#571\"(t)" = NamedTuple()),), parameter = (parameters = (c₁ = (lookup = NamedTuple(), parameter = (c₁ = NamedTuple(), c₂ = NamedTuple())), var"u(t)" = (lookup = NamedTuple(), parameter = (ps = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],))),)), (initialcondition = (initialconditions = (var"y(t)" = NamedTuple(), var"x(t)" = NamedTuple(), var"var\"##quadrature#571\"(t)" = NamedTuple()), active = Bool[0, 0, 0], permutation = [1, 2, 3]), parameter = (parameters = (c₁ = (lookup = (collection = nothing, inserted = Int64[], cache = nothing), parameter = (c₁ = (states = NamedTuple(), parameters = (ps = [0.4],)), c₂ = (states = NamedTuple(), parameters = (ps = [0.2],)))), var"u(t)" = (lookup = (collection = [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 4.0, 4.1, 4.2, 4.3, 4.4, 4.5, 4.6, 4.7, 4.8, 4.9, 5.0, 5.1, 5.2, 5.3, 5.4, 5.5, 5.6, 5.7, 5.8, 5.9, 6.0, 6.1, 6.2, 6.3, 6.4, 6.5, 6.6, 6.7, 6.8, 6.9, 7.0, 7.1, 7.2, 7.3, 7.4, 7.5, 7.6, 7.7, 7.8, 7.9, 8.0, 8.1, 8.2, 8.3, 8.4, 8.5, 8.6, 8.7, 8.8, 8.9, 9.0, 9.1, 9.2, 9.3, 9.4, 9.5, 9.6, 9.7, 9.8, 9.9, 10.0, 10.1, 10.2, 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 11.0, 11.1, 11.2, 11.3, 11.4, 11.5, 11.6, 11.7, 11.8, 11.9], inserted = Int64[], cache = nothing), parameter = NamedTuple())), permutation = [1, 2, 3]), timestops = [0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 4.0, 4.1, 4.2, 4.3, 4.4, 4.5, 4.6, 4.7, 4.8, 4.9, 5.0, 5.1, 5.2, 5.3, 5.4, 5.5, 5.6, 5.7, 5.8, 5.9, 6.0, 6.1, 6.2, 6.3, 6.4, 6.5, 6.6, 6.7, 6.8, 6.9, 7.0, 7.1, 7.2, 7.3, 7.4, 7.5, 7.6, 7.7, 7.8, 7.9, 8.0, 8.1, 8.2, 8.3, 8.4, 8.5, 8.6, 8.7, 8.8, 8.9, 9.0, 9.1, 9.2, 9.3, 9.4, 9.5, 9.6, 9.7, 9.8, 9.9, 10.0, 10.1, 10.2, 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 11.0, 11.1, 11.2, 11.3, 11.4, 11.5, 11.6, 11.7, 11.8, 11.9, 12.0]), Dict{Symbol, Vector{Real}}(Symbol("var\"##quadrature#571\"(t)") => [0.0, 12.0]), [0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 4.0, 4.1, 4.2, 4.3, 4.4, 4.5, 4.6, 4.7, 4.8, 4.9, 5.0, 5.1, 5.2, 5.3, 5.4, 5.5, 5.6, 5.7, 5.8, 5.9, 6.0, 6.1, 6.2, 6.3, 6.4, 6.5, 6.6, 6.7, 6.8, 6.9, 7.0, 7.1, 7.2, 7.3, 7.4, 7.5, 7.6, 7.7, 7.8, 7.9, 8.0, 8.1, 8.2, 8.3, 8.4, 8.5, 8.6, 8.7, 8.8, 8.9, 9.0, 9.1, 9.2, 9.3, 9.4, 9.5, 9.6, 9.7, 9.8, 9.9, 10.0, 10.1, 10.2, 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 11.0, 11.1, 11.2, 11.3, 11.4, 11.5, 11.6, 11.7, 11.8, 11.9, 12.0], [0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 4.0, 4.1, 4.2, 4.3, 4.4, 4.5, 4.6, 4.7, 4.8, 4.9, 5.0, 5.1, 5.2, 5.3, 5.4, 5.5, 5.6, 5.7, 5.8, 5.9, 6.0, 6.1, 6.2, 6.3, 6.4, 6.5, 6.6, 6.7, 6.8, 6.9, 7.0, 7.1, 7.2, 7.3, 7.4, 7.5, 7.6, 7.7, 7.8, 7.9, 8.0, 8.1, 8.2, 8.3, 8.4, 8.5, 8.6, 8.7, 8.8, 8.9, 9.0, 9.1, 9.2, 9.3, 9.4, 9.5, 9.6, 9.7, 9.8, 9.9, 10.0, 10.1, 10.2, 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 11.0, 11.1, 11.2, 11.3, 11.4, 11.5, 11.6, 11.7, 11.8, 11.9, 12.0], [0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 4.0, 4.1, 4.2, 4.3, 4.4, 4.5, 4.6, 4.7, 4.8, 4.9, 5.0, 5.1, 5.2, 5.3, 5.4, 5.5, 5.6, 5.7, 5.8, 5.9, 6.0, 6.1, 6.2, 6.3, 6.4, 6.5, 6.6, 6.7, 6.8, 6.9, 7.0, 7.1, 7.2, 7.3, 7.4, 7.5, 7.6, 7.7, 7.8, 7.9, 8.0, 8.1, 8.2, 8.3, 8.4, 8.5, 8.6, 8.7, 8.8, 8.9, 9.0, 9.1, 9.2, 9.3, 9.4, 9.5, 9.6, 9.7, 9.8, 9.9, 10.0, 10.1, 10.2, 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 11.0, 11.1, 11.2, 11.3, 11.4, 11.5, 11.6, 11.7, 11.8, 11.9, 12.0], Float64[], Float64[], 0)Construct the optimization problem with the control bounds from the model.
optprob = OptimizationProblem(dynopt, AutoForwardDiff())OptimizationProblem. In-place: true
u0: 120-element Vector{Float64}:
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0Use ForwardDiff derivatives and Ipopt's limited-memory Hessian approximation.
uopt = solve(
optprob, Ipopt.Optimizer(), max_iter = 1000, tol = 5.0e-6,
hessian_approximation = "limited-memory",
print_level = 3
)
@assert successful_retcode(uopt)Total number of variables............................: 120
variables with only lower bounds: 0
variables with lower and upper bounds: 120
variables with only upper bounds: 0
Total number of equality constraints.................: 0
Total number of inequality constraints...............: 0
inequality constraints with only lower bounds: 0
inequality constraints with lower and upper bounds: 0
inequality constraints with only upper bounds: 0
Number of Iterations....: 65
(scaled) (unscaled)
Objective...............: 1.3443372108948126e+00 1.3443372108948126e+00
Dual infeasibility......: 4.9179197543533273e-06 4.9179197543533273e-06
Constraint violation....: 0.0000000000000000e+00 0.0000000000000000e+00
Variable bound violation: 0.0000000000000000e+00 0.0000000000000000e+00
Complementarity.........: 1.8800381310719517e-08 1.8800381310719517e-08
Overall NLP error.......: 4.9179197543533273e-06 4.9179197543533273e-06
Number of objective function evaluations = 216
Number of objective gradient evaluations = 66
Number of equality constraint evaluations = 0
Number of inequality constraint evaluations = 0
Number of equality constraint Jacobian evaluations = 0
Number of inequality constraint Jacobian evaluations = 0
Number of Lagrangian Hessian evaluations = 0
Total seconds in IPOPT = 15.289
EXIT: Optimal Solution Found.
Restore the parameter structure, evaluate the optimized layer, and plot it.
_, reconstruct = pack(default_vectorizer(), dynopt.ps)
optimized_parameters = reconstruct(uopt.u)
optsol, _ = dynopt.layer(nothing, optimized_parameters, optprob.p)
trajectoryplot(optsol)
Multiple Shooting
Use 48 control intervals and lift the states at every interior interval boundary. Interior shooting values remain tunable even though the global initial values are fixed. Continuity equalities connect neighboring segments, including the quadrature state, so the objective still accounts for the whole time horizon. Population bounds now constrain the lifted values at every shooting point; overly restrictive bounds can make this formulation infeasible.
dynopt = CorleoneDynamicOptProblem(
lotka_volterra, [],
u(t) => 0.0:0.25:11.75,
algorithm = Tsit5(),
shooting = collect(0.25:0.25:11.75),
problem_kwargs = (; abstol = 1.0e-9, reltol = 1.0e-9)
)CorleoneDynamicOptProblem{ShootingLayer{}, Corleone.ParsedTrajectoryExpression{RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(Symbol("##samples#784"),), CorleoneRuntimeGeneratedFunctionsExtension.var"#_RGF_ModTag", CorleoneRuntimeGeneratedFunctionsExtension.var"#_RGF_ModTag", (0x525b627d, 0xa8307ef2, 0xa8544a3d, 0x5335cd16, 0xad0d11af), Expr}, Vector{Tuple{Symbol, Int64, Union{Nothing, Real}}}, Nothing}, Tuple{}, @NamedTuple{initialcondition::@NamedTuple{initialconditions::@NamedTuple{var"y(t)"::@NamedTuple{lookup::@NamedTuple{}, parameter::@NamedTuple{var"y(t)"::@NamedTuple{ps::Vector{Float64}}, var"x(t)"::@NamedTuple{ps::Vector{Float64}}, var"var\"##quadrature#747\"(t)"::@NamedTuple{ps::Vector{Float64}}}}}}, parameter::@NamedTuple{parameters::@NamedTuple{c₁::@NamedTuple{lookup::@NamedTuple{}, parameter::@NamedTuple{c₁::@NamedTuple{}, c₂::@NamedTuple{}}}, var"u(t)"::@NamedTuple{lookup::@NamedTuple{}, parameter::@NamedTuple{ps::Vector{Float64}}}}}}, @NamedTuple{initialcondition::@NamedTuple{initialconditions::@NamedTuple{var"y(t)"::@NamedTuple{lookup::@NamedTuple{collection::Dict{Float64, Int64}, inserted::Vector{Int64}, cache::Nothing}, parameter::@NamedTuple{var"y(t)"::@NamedTuple{}, var"x(t)"::@NamedTuple{}, var"var\"##quadrature#747\"(t)"::@NamedTuple{}}, active::Bool}}, active::Vector{Bool}, permutation::Vector{Int64}}, parameter::@NamedTuple{parameters::@NamedTuple{c₁::@NamedTuple{lookup::@NamedTuple{collection::Nothing, inserted::Vector{Int64}, cache::Nothing}, parameter::@NamedTuple{c₁::@NamedTuple{states::@NamedTuple{}, parameters::@NamedTuple{ps::Vector{Float64}}}, c₂::@NamedTuple{states::@NamedTuple{}, parameters::@NamedTuple{ps::Vector{Float64}}}}}, var"u(t)"::@NamedTuple{lookup::@NamedTuple{collection::Vector{Float64}, inserted::Vector{Int64}, cache::Nothing}, parameter::@NamedTuple{}}}, permutation::Vector{Int64}}, timestops::Vector{Float64}}, Dict{Symbol, Vector{Real}}, Vector{Float64}, Vector{Float64}, Vector{Float64}, Vector{Float64}, Vector{Float64}}(ShootingLayer{}(nothing, SciMLBase.ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, true, Vector{Float64}, SciMLBase.ODEFunction{true, SciMLBase.AutoDespecialize, ModelingToolkitBase.GeneratedFunctionWrapper{Tuple{2, 3, false}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:___mtkunknowns___, :__mtk_arg_2, :__argₛᵧₘ7628082562247908723), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0x8636d3b7, 0xd21a3310, 0xf39a67f1, 0x4d0b1327, 0x41847da1), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__argₛᵧₘ1187374493630987813, :___mtkunknowns___, :__mtk_arg_2, :__argₛᵧₘ7628082562247908723), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0x7cfa6f19, 0x20ae702c, 0x8f0ea66c, 0x0c73f9fe, 0x75dfb097), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ModelingToolkitBase.ObservedFunctionCache{ModelingToolkitBase.System, Nothing}, Nothing, ModelingToolkitBase.System, Union{Nothing, SciMLBase.OverrideInitData}, Union{Nothing, SciMLBase.ODENLStepData}}, Base.Pairs{Symbol, Any, Nothing, @NamedTuple{reltol::Float64, sensealg::SciMLBase.NoAD, abstol::Float64}}, SciMLBase.StandardODEProblem}(SciMLBase.ODEFunction{true, SciMLBase.AutoDespecialize, ModelingToolkitBase.GeneratedFunctionWrapper{Tuple{2, 3, false}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:___mtkunknowns___, :__mtk_arg_2, :__argₛᵧₘ7628082562247908723), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0x8636d3b7, 0xd21a3310, 0xf39a67f1, 0x4d0b1327, 0x41847da1), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__argₛᵧₘ1187374493630987813, :___mtkunknowns___, :__mtk_arg_2, :__argₛᵧₘ7628082562247908723), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0x7cfa6f19, 0x20ae702c, 0x8f0ea66c, 0x0c73f9fe, 0x75dfb097), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ModelingToolkitBase.ObservedFunctionCache{ModelingToolkitBase.System, Nothing}, Nothing, ModelingToolkitBase.System, Union{Nothing, SciMLBase.OverrideInitData}, Union{Nothing, SciMLBase.ODENLStepData}}(ModelingToolkitBase.GeneratedFunctionWrapper{Tuple{2, 3, false}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:___mtkunknowns___, :__mtk_arg_2, :__argₛᵧₘ7628082562247908723), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0x8636d3b7, 0xd21a3310, 0xf39a67f1, 0x4d0b1327, 0x41847da1), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__argₛᵧₘ1187374493630987813, :___mtkunknowns___, :__mtk_arg_2, :__argₛᵧₘ7628082562247908723), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0x7cfa6f19, 0x20ae702c, 0x8f0ea66c, 0x0c73f9fe, 0x75dfb097), Nothing}}(RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:___mtkunknowns___, :__mtk_arg_2, :__argₛᵧₘ7628082562247908723), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0x8636d3b7, 0xd21a3310, 0xf39a67f1, 0x4d0b1327, 0x41847da1), Nothing}(nothing), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__argₛᵧₘ1187374493630987813, :___mtkunknowns___, :__mtk_arg_2, :__argₛᵧₘ7628082562247908723), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0x7cfa6f19, 0x20ae702c, 0x8f0ea66c, 0x0c73f9fe, 0x75dfb097), Nothing}(nothing)), LinearAlgebra.UniformScaling{Bool}(true), nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, ModelingToolkitBase.ObservedFunctionCache{ModelingToolkitBase.System, Nothing}(Model lotka_volterra:
Equations (3):
3 standard: see equations(lotka_volterra)
Unknowns (3): see unknowns(lotka_volterra)
y(t)
x(t)
var"##quadrature#747"(t)
Parameters (3): see parameters(lotka_volterra)
c₁
c₂
u(t) [defaults to missing], Dict{Any, Any}(), false, false, ModelingToolkitBase, false, nothing), nothing, Model lotka_volterra:
Equations (3):
3 standard: see equations(lotka_volterra)
Unknowns (3): see unknowns(lotka_volterra)
y(t)
x(t)
var"##quadrature#747"(t)
Parameters (3): see parameters(lotka_volterra)
c₁
c₂
u(t) [defaults to missing], nothing, nothing), [0.7, 0.5, 0.0], (0.0, 12.0), [0.4, 0.2, 0.0], Base.Pairs{Symbol, Any, Nothing, @NamedTuple{reltol::Float64, sensealg::SciMLBase.NoAD, abstol::Float64}}(:reltol => 1.0e-9, :sensealg => SciMLBase.NoAD(), :abstol => 1.0e-9), SciMLBase.StandardODEProblem()), OrdinaryDiffEqTsit5.Tsit5{typeof(OrdinaryDiffEqCore.trivial_limiter!), typeof(OrdinaryDiffEqCore.trivial_limiter!), FastBroadcast.Serial}(OrdinaryDiffEqCore.trivial_limiter!, OrdinaryDiffEqCore.trivial_limiter!, FastBroadcast.Serial()), SciMLBase.EnsembleSerial(), InitialConditions{}(nothing, SciMLStructures.ArrayRepack{Vector{Float64}}([0.7, 0.5, 0.0]), (var"y(t)" = InitialCondition{}(Symbol("y(t)"), LookUp{}(Dict(2.0 => 8, 8.5 => 34, 6.0 => 24, 4.0 => 16, 6.25 => 25, 9.5 => 38, 3.75 => 15, 8.0 => 32, 10.0 => 40, 5.25 => 21, 3.25 => 13, 7.75 => 31, 10.75 => 43, 0.5 => 2, 5.75 => 23, 11.75 => 47, 3.5 => 14, 4.5 => 18, 1.25 => 5, 9.25 => 37, 11.5 => 46, 0.75 => 3, 7.5 => 30, 10.25 => 41, 10.5 => 42, 6.5 => 26, 8.25 => 33, 1.75 => 7, 3.0 => 12, 1.0 => 4, 5.0 => 20, 2.5 => 10, 7.0 => 28, 5.5 => 22, 11.25 => 45, 1.5 => 6, 2.25 => 9, 11.0 => 44, 4.75 => 19, 7.25 => 29, 9.75 => 39, 2.75 => 11, 0.25 => 1, 4.25 => 17, 8.75 => 35, 9.0 => 36, 6.75 => 27), nothing), (var"y(t)" = ParameterCollection{}(Corleone.var"#118#119"{Tuple{Float64, Float64}, Float64}((0.0, 5.0), 0.7, Core.Box([0.25, 0.5, 0.75, 1.0, 1.25, 1.5, 1.75, 2.0, 2.25, 2.5, 2.75, 3.0, 3.25, 3.5, 3.75, 4.0, 4.25, 4.5, 4.75, 5.0, 5.25, 5.5, 5.75, 6.0, 6.25, 6.5, 6.75, 7.0, 7.25, 7.5, 7.75, 8.0, 8.25, 8.5, 8.75, 9.0, 9.25, 9.5, 9.75, 10.0, 10.25, 10.5, 10.75, 11.0, 11.25, 11.5, 11.75])), 47), var"x(t)" = ParameterCollection{}(Corleone.var"#118#119"{Tuple{Float64, Float64}, Float64}((0.0, 5.0), 0.5, Core.Box([0.25, 0.5, 0.75, 1.0, 1.25, 1.5, 1.75, 2.0, 2.25, 2.5, 2.75, 3.0, 3.25, 3.5, 3.75, 4.0, 4.25, 4.5, 4.75, 5.0, 5.25, 5.5, 5.75, 6.0, 6.25, 6.5, 6.75, 7.0, 7.25, 7.5, 7.75, 8.0, 8.25, 8.5, 8.75, 9.0, 9.25, 9.5, 9.75, 10.0, 10.25, 10.5, 10.75, 11.0, 11.25, 11.5, 11.75])), 47), var"var\"##quadrature#747\"(t)" = ParameterCollection{}(Corleone.var"#118#119"{Tuple{Float64, Float64}, Float64}((-Inf, Inf), 0.0, Core.Box([0.25, 0.5, 0.75, 1.0, 1.25, 1.5, 1.75, 2.0, 2.25, 2.5, 2.75, 3.0, 3.25, 3.5, 3.75, 4.0, 4.25, 4.5, 4.75, 5.0, 5.25, 5.5, 5.75, 6.0, 6.25, 6.5, 6.75, 7.0, 7.25, 7.5, 7.75, 8.0, 8.25, 8.5, 8.75, 9.0, 9.25, 9.5, 9.75, 10.0, 10.25, 10.5, 10.75, 11.0, 11.25, 11.5, 11.75])), 47))),), ([1, 2, 3],)), Parameter{}(nothing, SciMLStructures.ArrayRepack{Vector{Float64}}([0.4, 0.2, 0.0]), (c₁ = PiecewiseConstant{}(:c₁, LookUp{}(nothing, nothing), (c₁ = FixedLayer{}(ParameterCollection{}(Corleone.var"#173#174"{Vector{Float64}}([0.0], Core.Box((-Inf, Inf)), Core.Box(0.4)), 1)), c₂ = FixedLayer{}(ParameterCollection{}(Corleone.var"#173#174"{Vector{Float64}}([0.0], Core.Box((-Inf, Inf)), Core.Box(0.2)), 1)))), var"u(t)" = PiecewiseConstant{}(Symbol("u(t)"), LookUp{}([0.25, 0.5, 0.75, 1.0, 1.25, 1.5, 1.75, 2.0, 2.25, 2.5, 2.75, 3.0, 3.25, 3.5, 3.75, 4.0, 4.25, 4.5, 4.75, 5.0, 5.25, 5.5, 5.75, 6.0, 6.25, 6.5, 6.75, 7.0, 7.25, 7.5, 7.75, 8.0, 8.25, 8.5, 8.75, 9.0, 9.25, 9.5, 9.75, 10.0, 10.25, 10.5, 10.75, 11.0, 11.25, 11.5, 11.75], nothing), ParameterCollection{}(Corleone.var"#173#174"{Vector{Float64}}([0.0, 0.25, 0.5, 0.75, 1.0, 1.25, 1.5, 1.75, 2.0, 2.25, 2.5, 2.75, 3.0, 3.25, 3.5, 3.75, 4.0, 4.25, 4.5, 4.75, 5.0, 5.25, 5.5, 5.75, 6.0, 6.25, 6.5, 6.75, 7.0, 7.25, 7.5, 7.75, 8.0, 8.25, 8.5, 8.75, 9.0, 9.25, 9.5, 9.75, 10.0, 10.25, 10.5, 10.75, 11.0, 11.25, 11.5, 11.75], Core.Box((0.0, 1.0)), Core.Box(0.0)), 48))), ([1, 2], [3])), ControlSymbolCache{}(Model lotka_volterra:
Equations (3):
3 standard: see equations(lotka_volterra)
Unknowns (3): see unknowns(lotka_volterra)
y(t)
x(t)
var"##quadrature#747"(t)
Parameters (3): see parameters(lotka_volterra)
c₁
c₂
u(t) [defaults to missing], SymbolicUtils.BasicSymbolicImpl.var"typeof(BasicSymbolicImpl)"{SymbolicUtils.SymReal}[u(t)], SymbolicUtils.BasicSymbolicImpl.var"typeof(BasicSymbolicImpl)"{SymbolicUtils.SymReal}[var"##quadrature#747"(t)], Dict{Any, Any}(var"##quadrature#747"(t) => (-Inf, Inf), c₁ => (-Inf, Inf), x(t) => (0.0, 5.0), y(t) => (0.0, 5.0), c₂ => (-Inf, Inf), u(t) => (0.0, 1.0)))), Corleone.ParsedTrajectoryExpression{RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(Symbol("##samples#784"),), CorleoneRuntimeGeneratedFunctionsExtension.var"#_RGF_ModTag", CorleoneRuntimeGeneratedFunctionsExtension.var"#_RGF_ModTag", (0x525b627d, 0xa8307ef2, 0xa8544a3d, 0x5335cd16, 0xad0d11af), Expr}, Vector{Tuple{Symbol, Int64, Union{Nothing, Real}}}, Nothing}(RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(Symbol("##samples#784"),), CorleoneRuntimeGeneratedFunctionsExtension.var"#_RGF_ModTag", CorleoneRuntimeGeneratedFunctionsExtension.var"#_RGF_ModTag", (0x525b627d, 0xa8307ef2, 0xa8544a3d, 0x5335cd16, 0xad0d11af), Expr}(:((+)((*)(-1, Base.getindex((var"##samples#784").states, 3, 1)), Base.getindex((var"##samples#784").states, 3, 96)))), Tuple{Symbol, Int64, Union{Nothing, Real}}[(:states, 3, 0.0), (:states, 3, 12.0)], nothing), (), (initialcondition = (initialconditions = (var"y(t)" = (lookup = NamedTuple(), parameter = (var"y(t)" = (ps = [0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7],), var"x(t)" = (ps = [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5],), var"var\"##quadrature#747\"(t)" = (ps = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],))),),), parameter = (parameters = (c₁ = (lookup = NamedTuple(), parameter = (c₁ = NamedTuple(), c₂ = NamedTuple())), var"u(t)" = (lookup = NamedTuple(), parameter = (ps = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],))),)), (initialcondition = (initialconditions = (var"y(t)" = (lookup = (collection = Dict(2.0 => 8, 8.5 => 34, 6.0 => 24, 4.0 => 16, 6.25 => 25, 9.5 => 38, 3.75 => 15, 8.0 => 32, 10.0 => 40, 5.25 => 21, 3.25 => 13, 7.75 => 31, 10.75 => 43, 0.5 => 2, 5.75 => 23, 11.75 => 47, 3.5 => 14, 4.5 => 18, 1.25 => 5, 9.25 => 37, 11.5 => 46, 0.75 => 3, 7.5 => 30, 10.25 => 41, 10.5 => 42, 6.5 => 26, 8.25 => 33, 1.75 => 7, 3.0 => 12, 1.0 => 4, 5.0 => 20, 2.5 => 10, 7.0 => 28, 5.5 => 22, 11.25 => 45, 1.5 => 6, 2.25 => 9, 11.0 => 44, 4.75 => 19, 7.25 => 29, 9.75 => 39, 2.75 => 11, 0.25 => 1, 4.25 => 17, 8.75 => 35, 9.0 => 36, 6.75 => 27), inserted = Int64[], cache = nothing), parameter = (var"y(t)" = NamedTuple(), var"x(t)" = NamedTuple(), var"var\"##quadrature#747\"(t)" = NamedTuple()), active = false),), active = Bool[1, 1, 1], permutation = [1, 2, 3]), parameter = (parameters = (c₁ = (lookup = (collection = nothing, inserted = Int64[], cache = nothing), parameter = (c₁ = (states = NamedTuple(), parameters = (ps = [0.4],)), c₂ = (states = NamedTuple(), parameters = (ps = [0.2],)))), var"u(t)" = (lookup = (collection = [0.25, 0.5, 0.75, 1.0, 1.25, 1.5, 1.75, 2.0, 2.25, 2.5, 2.75, 3.0, 3.25, 3.5, 3.75, 4.0, 4.25, 4.5, 4.75, 5.0, 5.25, 5.5, 5.75, 6.0, 6.25, 6.5, 6.75, 7.0, 7.25, 7.5, 7.75, 8.0, 8.25, 8.5, 8.75, 9.0, 9.25, 9.5, 9.75, 10.0, 10.25, 10.5, 10.75, 11.0, 11.25, 11.5, 11.75], inserted = Int64[], cache = nothing), parameter = NamedTuple())), permutation = [1, 2, 3]), timestops = [0.0, 0.25, 0.5, 0.75, 1.0, 1.25, 1.5, 1.75, 2.0, 2.25, 2.5, 2.75, 3.0, 3.25, 3.5, 3.75, 4.0, 4.25, 4.5, 4.75, 5.0, 5.25, 5.5, 5.75, 6.0, 6.25, 6.5, 6.75, 7.0, 7.25, 7.5, 7.75, 8.0, 8.25, 8.5, 8.75, 9.0, 9.25, 9.5, 9.75, 10.0, 10.25, 10.5, 10.75, 11.0, 11.25, 11.5, 11.75, 12.0]), Dict{Symbol, Vector{Real}}(Symbol("var\"##quadrature#747\"(t)") => [0.0, 12.0]), [0.0, 0.25, 0.5, 0.75, 1.0, 1.25, 1.5, 1.75, 2.0, 2.25, 2.5, 2.75, 3.0, 3.25, 3.5, 3.75, 4.0, 4.25, 4.5, 4.75, 5.0, 5.25, 5.5, 5.75, 6.0, 6.25, 6.5, 6.75, 7.0, 7.25, 7.5, 7.75, 8.0, 8.25, 8.5, 8.75, 9.0, 9.25, 9.5, 9.75, 10.0, 10.25, 10.5, 10.75, 11.0, 11.25, 11.5, 11.75, 12.0], [0.0, 0.25, 0.5, 0.75, 1.0, 1.25, 1.5, 1.75, 2.0, 2.25, 2.5, 2.75, 3.0, 3.25, 3.5, 3.75, 4.0, 4.25, 4.5, 4.75, 5.0, 5.25, 5.5, 5.75, 6.0, 6.25, 6.5, 6.75, 7.0, 7.25, 7.5, 7.75, 8.0, 8.25, 8.5, 8.75, 9.0, 9.25, 9.5, 9.75, 10.0, 10.25, 10.5, 10.75, 11.0, 11.25, 11.5, 11.75, 12.0], [0.0, 0.25, 0.25, 0.5, 0.5, 0.75, 0.75, 1.0, 1.0, 1.25, 1.25, 1.5, 1.5, 1.75, 1.75, 2.0, 2.0, 2.25, 2.25, 2.5, 2.5, 2.75, 2.75, 3.0, 3.0, 3.25, 3.25, 3.5, 3.5, 3.75, 3.75, 4.0, 4.0, 4.25, 4.25, 4.5, 4.5, 4.75, 4.75, 5.0, 5.0, 5.25, 5.25, 5.5, 5.5, 5.75, 5.75, 6.0, 6.0, 6.25, 6.25, 6.5, 6.5, 6.75, 6.75, 7.0, 7.0, 7.25, 7.25, 7.5, 7.5, 7.75, 7.75, 8.0, 8.0, 8.25, 8.25, 8.5, 8.5, 8.75, 8.75, 9.0, 9.0, 9.25, 9.25, 9.5, 9.5, 9.75, 9.75, 10.0, 10.0, 10.25, 10.25, 10.5, 10.5, 10.75, 10.75, 11.0, 11.0, 11.25, 11.25, 11.5, 11.5, 11.75, 11.75, 12.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 141)Corleone appends the shooting equalities to the optimization constraints.
optprob = OptimizationProblem(dynopt, AutoForwardDiff())
optsol = solve(
optprob,
Ipopt.Optimizer(),
tol = 1.0e-6,
hessian_approximation = "limited-memory",
max_iter = 300,
print_level = 3
)
@assert successful_retcode(optsol)Total number of variables............................: 189
variables with only lower bounds: 0
variables with lower and upper bounds: 142
variables with only upper bounds: 0
Total number of equality constraints.................: 141
Total number of inequality constraints...............: 0
inequality constraints with only lower bounds: 0
inequality constraints with lower and upper bounds: 0
inequality constraints with only upper bounds: 0
Number of Iterations....: 88
(scaled) (unscaled)
Objective...............: 1.3456313300038718e+00 1.3456313300038718e+00
Dual infeasibility......: 7.4825005806076381e-07 7.4825005806076381e-07
Constraint violation....: 4.4229064855016986e-12 4.4229064855016986e-12
Variable bound violation: 9.9707275672306590e-09 9.9707275672306590e-09
Complementarity.........: 1.0010431179977679e-11 1.0010431179977679e-11
Overall NLP error.......: 7.4825005806076381e-07 7.4825005806076381e-07
Number of objective function evaluations = 90
Number of objective gradient evaluations = 89
Number of equality constraint evaluations = 90
Number of inequality constraint evaluations = 0
Number of equality constraint Jacobian evaluations = 89
Number of inequality constraint Jacobian evaluations = 0
Number of Lagrangian Hessian evaluations = 0
Total seconds in IPOPT = 47.202
EXIT: Optimal Solution Found.
Reconstruct and plot the multiple-shooting solution in the same way.
_, reconstruct_ms = pack(default_vectorizer(), dynopt.ps)
optimized_parameters = reconstruct_ms(optsol.u)
optsol, _ = dynopt.layer(nothing, optimized_parameters, optprob.p)
trajectoryplot(optsol)
Check continuity after optimization. Small residuals connect the lifted physical states and quadrature; integration and optimizer tolerances are separate controls on the numerical result. The two formulations use different control grids, so their objective values are not an exact discretization-to-discretization check.
maximum(abs, shooting_constraints(optsol))4.422906485501699e-12Appendix
This example was built using these direct dependencies,
using Pkg
Pkg.status()Status `~/work/Corleone.jl/Corleone.jl/docs/Project.toml`
[13f3f980] CairoMakie v0.15.17
[b0b7db55] ComponentArrays v0.15.50
[2751e0db] Corleone v2.0.0 `~/work/Corleone.jl/Corleone.jl`
[6590a4b1] CorleoneOED v2.0.0 `../lib/CorleoneOED`
[e30172f5] Documenter v1.19.0
[daee34ce] DocumenterCitations v1.5.0
[f6369f11] ForwardDiff v1.4.6
[b6b21f68] Ipopt v1.16.0
[98b081ad] Literate v2.21.0
[bb33d45b] LuxCore v1.5.4
[961ee093] ModelingToolkit v11.46.1
[d147904a] OptimalControlBenchmarks v0.1.0 `../lib/OptimalControlBenchmarks`
[7f7a1694] Optimization v5.9.1
[22f7324a] OptimizationLBFGSB v1.5.3
[fd9f6733] OptimizationMOI v1.6.1
[b1df2697] OrdinaryDiffEqTsit5 v2.1.5
[2efcf032] SymbolicIndexingInterface v0.3.55
[ddb6d928] YAML v0.4.17
[2a0f44e3] Base64 v1.11.0
[9a3f8284] Random v1.11.0
and using this machine and Julia version.
using InteractiveUtils
InteractiveUtils.versioninfo()Julia Version 1.13.3
Commit 67ac47b9cd8 (2026-10-25 15:28 UTC)
Build Info:
Official https://julialang.org release
Platform Info:
OS: Linux (x86_64-linux-gnu)
CPU: 4 × AMD EPYC 7763 64-Core Processor
WORD_SIZE: 64
LLVM: libLLVM-20.1.8 (ORCJIT, znver3)
GC: Built with stock GC
Threads: 1 default, 1 interactive, 1 GC (on 4 virtual cores)
A more complete overview of all dependencies and their versions is also provided.
using Pkg
Pkg.status(; mode = PKGMODE_MANIFEST)Status `~/work/Corleone.jl/Corleone.jl/docs/Manifest.toml`
[47edcb42] ADTypes v1.24.0
[14f7f29c] AMD v0.5.4
[a4c015fc] ANSIColoredPrinters v0.0.1
[621f4979] AbstractFFTs v1.5.0
[6e696c72] AbstractPlutoDingetjes v1.4.1
[1520ce14] AbstractTrees v0.4.5
[7d9f7c33] Accessors v0.1.46
[79e6a3ab] Adapt v4.7.4
[4f381ef7] AdaptiveArrayPools v0.3.12
[35492f91] AdaptivePredicates v1.2.0
[66dad0bd] AliasTables v1.1.3
[27a7e980] Animations v0.4.2
[ec485272] ArnoldiMethod v0.4.0
[4fba245c] ArrayInterface v7.30.2
[4c555306] ArrayLayouts v1.16.0
[67c07d97] Automa v1.2.0
[13072b0f] AxisAlgorithms v1.1.0
[39de3d68] AxisArrays v0.4.8
[aae01518] BandedMatrices v1.14.0
[198e06fe] BangBang v0.4.9
[18cc8868] BaseDirs v1.4.0
[2027ae74] BibInternal v0.4.0
[13533e5b] BibParser v0.3.0
[f1be7e48] Bibliography v0.4.0
[e2ed5e7c] Bijections v0.2.2
[b2a6c25c] BinaryHeaps v1.1.0
[caf10ac8] BipartiteGraphs v0.1.15
[8e7c35d0] BlockArrays v1.10.3
[70df07ce] BracketingNonlinearSolve v1.12.8
⌅ [fa961155] CEnum v0.5.0
[96374032] CRlibm v1.1.1
[159f3aea] Cairo v1.1.1
[13f3f980] CairoMakie v0.15.17
[d360d2e6] ChainRulesCore v1.26.8
[ae650224] ChunkSplitters v3.2.0
[523fee87] CodecBzip2 v0.8.5
[944b1d66] CodecZlib v0.7.9
[6b39b394] CodecZstd v0.8.7
[a2cac450] ColorBrewer v0.4.2
[35d6a980] ColorSchemes v3.32.0
[3da002f7] ColorTypes v0.12.5
[c3611d14] ColorVectorSpace v0.11.2
[5ae59095] Colors v0.13.4
⌅ [861a8166] Combinatorics v1.0.2
[38540f10] CommonSolve v0.2.14
[bbf7d656] CommonSubexpressions v0.3.1
[f70d9fcc] CommonWorldInvalidations v1.2.2
[34da2185] Compat v4.18.1
[b0b7db55] ComponentArrays v0.15.50
[b152e2b5] CompositeTypes v0.1.4
[a33af91c] CompositionsBase v0.1.2
[95dc2771] ComputePipeline v0.1.9
[2569d6c7] ConcreteStructs v0.2.8
[88cd18e8] ConsoleProgressMonitor v0.1.2
[187b0558] ConstructionBase v1.6.0
[d38c429a] Contour v0.6.3
[b7a15901] CoreMath v0.1.0
[2751e0db] Corleone v2.0.0 `~/work/Corleone.jl/Corleone.jl`
[6590a4b1] CorleoneOED v2.0.0 `../lib/CorleoneOED`
[a8cc5b0e] Crayons v4.2.0
[9a962f9c] DataAPI v1.16.0
[864edb3b] DataStructures v0.19.6
[e2d170a0] DataValueInterfaces v1.0.0
[927a84f5] DelaunayTriangulation v1.7.0
[8bb1440f] DelimitedFiles v1.9.1
[2b5f629d] DiffEqBase v7.21.5
[459566f4] DiffEqCallbacks v4.19.5
[163ba53b] DiffResults v1.1.0
[b552c78f] DiffRules v1.16.0
[a0c0ee7d] DifferentiationInterface v0.7.21
[8d63f2c5] DispatchDoctor v0.4.29
[31c24e10] Distributions v0.25.132
⌅ [ffbed154] DocStringExtensions v0.9.5
[e30172f5] Documenter v1.19.0
[daee34ce] DocumenterCitations v1.5.0
[5b8099bc] DomainSets v0.8.3
⌅ [7c1d4256] DynamicPolynomials v0.6.8
[4e289a0a] EnumX v1.0.7
[f151be2c] EnzymeCore v0.8.26
[429591f6] ExactPredicates v2.2.9
[e2ba6199] ExprTools v0.1.11
[55351af7] ExproniconLite v0.10.14
[b86e33f2] FFTA v0.3.2
[7034ab61] FastBroadcast v1.5.0
[9aa1b823] FastClosures v0.3.2
[9ea80cae] FastInterpolations v0.4.20
[a4df4552] FastPower v1.5.1
[5789e2e9] FileIO v1.20.0
[8fc22ac5] FilePaths v0.9.0
[48062228] FilePathsBase v0.9.24
[1a297f60] FillArrays v1.18.2
[64ca27bc] FindFirstFunctions v3.4.1
[6a86dc24] FiniteDiff v2.33.0
⌅ [53c48c17] FixedPointNumbers v0.8.6
[1fa38f19] Format v1.3.7
[f6369f11] ForwardDiff v1.4.6
[b38be410] FreeType v4.1.1
[663a7486] FreeTypeAbstraction v0.10.8
[a85aefff] FunctionMaps v0.1.2
[069b7b12] FunctionWrappers v1.1.3
[77dc65aa] FunctionWrappersWrappers v1.13.0
[d9f16b24] Functors v0.5.4
[46192b85] GPUArraysCore v0.2.2
[a0844989] Gamma v1.2.0
[5c1252a2] GeometryBasics v0.5.13
[d7ba0133] Git v1.5.0
[a2bd30eb] Graphics v1.1.3
[86223c79] Graphs v1.15.0
[3955a311] GridLayoutBase v0.11.3
[076d061b] HashArrayMappedTries v0.2.0
[5880b2e8] HelpPlots v1.1.0
[34004b35] HypergeometricFunctions v0.3.31
[b5f81e59] IOCapture v1.0.0
[615f187c] IfElse v0.1.1
[2803e5a7] ImageAxes v0.6.12
[c817782e] ImageBase v0.1.7
[a09fc81d] ImageCore v0.10.5
[82e4d734] ImageIO v0.6.10
[bc367c6b] ImageMetadata v0.9.10
[3263718b] ImplicitDiscreteSolve v2.3.0
[9b13fd28] IndirectArrays v1.0.0
[d25df0c9] Inflate v0.1.5
[22cec73e] InitialValues v0.3.1
[18e54dd8] IntegerMathUtils v0.1.4
[a98d9a8b] Interpolations v0.16.3
[d1acc4aa] IntervalArithmetic v1.0.12
[8197267c] IntervalSets v0.7.15
[3587e190] InverseFunctions v0.1.18
[b6b21f68] Ipopt v1.16.0
[92d709cd] IrrationalConstants v0.2.7
[f1662d9f] Isoband v0.1.1
[c8e1da08] IterTools v1.11.0
[82899510] IteratorInterfaceExtensions v1.0.0
[692b3bcd] JLLWrappers v1.8.0
[682c06a0] JSON v1.13.4
[7d188eb4] JSONSchema v1.6.0
[ae98c720] Jieko v0.2.1
[b835a17e] JpegTurbo v0.1.6
[ccbc3e58] JumpProcesses v10.0.1
[5ab0869b] KernelDensity v0.6.12
[ba0b0d4f] Krylov v0.10.12
[5be7bae1] LBFGSB v0.4.1
[2faa5264] LHLFactorization v2.2.2
[b964fa9f] LaTeXStrings v1.4.1
[0e77f7df] LazilyInitializedFields v1.3.0
[8cdb02fc] LazyModules v0.3.1
[1d6d02ad] LeftChildRightSiblingTrees v0.3.0
[87fe0de2] LineSearch v0.1.19
[7ed4a6bd] LinearSolve v5.18.3
[98b081ad] Literate v2.21.0
[2ab3a3ac] LogExpFunctions v1.0.3
[e6f89c97] LoggingExtras v1.2.0
[bb33d45b] LuxCore v1.5.4
[1914dd2f] MacroTools v0.5.16
[ee78f7c6] Makie v0.24.17
[dbb5928d] MappedArrays v0.4.3
[d0879d2d] MarkdownAST v0.1.3
[b8f27783] MathOptInterface v1.54.0
[0a4f8689] MathTeXEngine v0.6.9
[bb5d69b7] MaybeInplace v0.1.8
[e1d29d7a] Missings v1.2.1
[961ee093] ModelingToolkit v11.46.1
[7771a370] ModelingToolkitBase v1.79.0
[6bb917b9] ModelingToolkitTearing v1.20.7
[e94cdb99] MosaicViews v0.3.4
[2e0e35c7] Moshi v0.3.13
[46d2c3a1] MuladdMacro v0.2.7
⌅ [102ac46a] MultivariatePolynomials v0.5.20
[d8a4904e] MutableArithmetics v1.9.3
[77ba4419] NaNMath v1.1.5
[f09324ee] Netpbm v1.1.1
[be0214bd] NonlinearSolveBase v2.55.1
[5959db7a] NonlinearSolveFirstOrder v2.10.0
[510215fc] Observables v0.5.5
[6fe1bfb0] OffsetArrays v1.17.0
[67456a42] OhMyThreads v0.8.9
[52e1d378] OpenEXR v0.3.3
[d147904a] OptimalControlBenchmarks v0.1.0 `../lib/OptimalControlBenchmarks`
[7f7a1694] Optimization v5.9.1
[bca83a33] OptimizationBase v5.10.0
[22f7324a] OptimizationLBFGSB v1.5.3
[fd9f6733] OptimizationMOI v1.6.1
[bac558e1] OrderedCollections v2.0.3
[bbf590c4] OrdinaryDiffEqCore v4.19.1
[b1df2697] OrdinaryDiffEqTsit5 v2.1.5
[90014a1f] PDMats v0.11.41
[f57f5aa1] PNGFiles v0.4.5
[19eb6ba3] Packing v0.5.1
[5432bcbf] PaddedViews v0.5.12
[69de0a69] Parsers v3.0.5
[eebad327] PkgVersion v0.3.3
[995b91a9] PlotUtils v1.5.1
[e409e4f3] PoissonRandom v0.4.14
[647866c9] PolygonOps v0.1.2
[d236fae5] PreallocationTools v1.7.1
[aea7be01] PrecompileTools v1.3.4
[21216c6a] Preferences v1.6.1
[08abe8d2] PrettyTables v3.5.0
[27ebfcd6] Primes v0.5.7
[33c8b6b6] ProgressLogging v0.1.6
[92933f4c] ProgressMeter v1.13.0
[43287f4e] PtrArrays v1.4.0
[0c0d3e7f] PureKLU v1.6.0
[4b34888f] QOI v1.0.2
[1fd47b50] QuadGK v2.11.3
[b3c3ace0] RangeArrays v0.3.2
[c84ed2f1] Ratios v0.4.5
[988b38a3] ReadOnlyArrays v0.2.0
[795d4caa] ReadOnlyDicts v1.0.1
[3cdcf5f2] RecipesBase v1.4.0
[731186ca] RecursiveArrayTools v4.5.6
[189a3867] Reexport v1.2.2
[2792f1a3] RegistryInstances v0.1.0
[05181044] RelocatableFolders v1.0.1
[ae029012] Requires v1.3.1
[9fe22ead] RespecializeParams v1.3.0
[79098fc4] Rmath v0.9.0
[f2b01f46] Roots v3.0.13
[5eaf0fd0] RoundingEmulator v0.2.1
[7e49a35a] RuntimeGeneratedFunctions v0.5.27
[9dfe8606] SCCNonlinearSolve v1.16.0
[fdea26ae] SIMD v3.8.1
[0bca4576] SciMLBase v3.58.0
[19f34311] SciMLJacobianOperators v0.1.20
[a6db7da4] SciMLLogging v2.1.0
[c0aeaf25] SciMLOperators v1.30.4
[431bcebd] SciMLPublic v1.3.0
[53ae85a6] SciMLStructures v1.10.6
[7e506255] ScopedValues v1.6.2
[6c6a2e73] Scratch v1.3.0
[efcf1570] Setfield v1.2.0
[65257c39] ShaderAbstractions v0.5.1
[73760f76] SignedDistanceFields v0.4.1
[727e6d20] SimpleNonlinearSolve v2.14.6
[699a6c99] SimpleTraits v0.9.6
[45858cf5] Sixel v0.1.6
[ed01d8cd] Sobol v1.5.0
[a2af1166] SortingAlgorithms v1.2.3
[a57abbd0] SparseColumnPivotedQR v2.1.8
[9f842d2f] SparseConnectivityTracer v1.2.4
[0a514795] SparseMatrixColorings v0.4.29
[276daf66] SpecialFunctions v2.9.1
[91464d47] StableTasks v0.1.7
[cae243ae] StackViews v0.1.2
⌅ [0c0c59c1] StarAlgebras v0.3.1
[64909d44] StateSelection v1.11.1
[aedffcd0] Static v1.4.6
[0d7ed370] StaticArrayInterface v1.10.0
[90137ffa] StaticArrays v1.9.24
[1e83bf80] StaticArraysCore v1.4.4
[10745b16] Statistics v1.11.5
[82ae8749] StatsAPI v1.8.0
[2913bbd2] StatsBase v0.34.13
[4c63d2b9] StatsFuns v2.2.1
[69024149] StringEncodings v0.3.7
[892a3eda] StringManipulation v0.6.1
[09ab397b] StructArrays v0.7.4
[ec057cc2] StructUtils v2.12.0
[2efcf032] SymbolicIndexingInterface v0.3.55
[19f23fe9] SymbolicLimits v1.2.2
[d1185830] SymbolicUtils v4.54.0
[0c5d862f] Symbolics v7.48.0
[3783bdb8] TableTraits v1.0.1
[bd369af6] Tables v1.14.0
[ed4db957] TaskLocalValues v0.1.3
[62fd8b95] TensorCore v0.1.1
[8ea1fca8] TermInterface v2.0.1
[5d786b92] TerminalLoggers v0.1.8
[1c621080] TestItems v1.1.0
[731e570b] TiffImages v0.11.9
[a759f4b9] TimerOutputs v1.2.2
[3bb67fe8] TranscodingStreams v0.11.3
[981d1d27] TriplotBase v0.1.0
[781d530d] TruncatedStacktraces v1.4.0
[5c2747f8] URIs v1.7.3
[3a884ed6] UnPack v1.0.2
[1cfade01] UnicodeFun v0.4.1
[1986cc42] Unitful v1.29.0
[d30d5f5c] WeakCacheSets v0.1.0
[e3aaa7dc] WebP v0.1.3
[efce3f68] WoodburyMatrices v1.1.0
[ddb6d928] YAML v0.4.17
[ae81ac8f] ASL_jll v0.1.5+0
[6e34b625] Bzip2_jll v1.0.9+0
[4e9b3aee] CRlibm_jll v1.0.1+0
[83423d85] Cairo_jll v1.18.8+1
[a38c48d9] CoreMath_jll v0.1.0+0
⌅ [5ae413db] EarCut_jll v2.2.4+0
[2e619515] Expat_jll v2.10.0+0
[b22a6f82] FFMPEG_jll v9.0.2+0
[a3f928ae] Fontconfig_jll v2.18.3+0
⌅ [d7e528f0] FreeType2_jll v2.14.3+1
[559328eb] FriBidi_jll v1.0.19+0
⌅ [b0724c58] GettextRuntime_jll v0.22.4+0
[59f7168a] Giflib_jll v6.1.3+0
[020c3dae] Git_LFS_jll v3.8.1+0
[f8c6e375] Git_jll v2.56.0+0
[7746bdde] Glib_jll v2.90.1+0
[3b182d85] Graphite2_jll v1.3.16+0
[2e76f6c2] HarfBuzz_jll v100.15000.0+0
[e33a78d0] Hwloc_jll v2.15.0+0
[905a6f67] Imath_jll v3.2.2+0
[1d5cc7b8] IntelOpenMP_jll v2025.2.0+0
⌅ [9cc047cb] Ipopt_jll v300.1400.1902+0
[aacddb02] JpegTurbo_jll v3.2.1+0
[c1c5ebd0] LAME_jll v3.100.3+0
[88015f11] LERC_jll v4.3.0+0
[1d63c593] LLVMOpenMP_jll v23.1.1+0
[81d17ec3] L_BFGS_B_jll v3.0.1+0
⌅ [e9f186c6] Libffi_jll v3.4.7+0
[7e76a0d4] Libglvnd_jll v1.7.1+1
[94ce4f54] Libiconv_jll v1.18.0+0
[4b2f31a3] Libmount_jll v2.42.4+0
[89763e89] Libtiff_jll v4.7.3+0
[38a345b3] Libuuid_jll v2.42.4+0
[d00139f3] METIS_jll v5.1.4+0
[856f044c] MKL_jll v2025.2.0+0
[d7ed1dd3] MUMPS_seq_jll v500.900.100+0
[e7412a2a] Ogg_jll v1.3.6+0
[656ef2d0] OpenBLAS32_jll v0.3.34+1
[6cdc7f73] OpenBLASConsistentFPCSR_jll v0.3.34+0
[18a262bb] OpenEXR_jll v3.5.3+0
⌅ [95196869] OpenJPH_jll v0.32.0+0
[9bd350c2] OpenSSH_jll v10.6.1+0
[efe28fd5] OpenSpecFun_jll v0.5.6+0
[91d4177d] Opus_jll v1.6.1+0
[36c8627f] Pango_jll v1.58.2+0
[30392449] Pixman_jll v0.46.4+0
[f50d1b31] Rmath_jll v0.5.2+0
[319450e9] SPRAL_jll v2025.9.18+1
[02c8fc9c] XML2_jll v2.15.4+0
[ffd25f8a] XZ_jll v5.8.4+0
[4f6342f7] Xorg_libX11_jll v1.8.14+0
[0c0b7dd1] Xorg_libXau_jll v1.0.13+0
[a3789734] Xorg_libXdmcp_jll v1.1.6+0
[1082639a] Xorg_libXext_jll v1.3.8+0
[d091e8ba] Xorg_libXfixes_jll v6.0.2+0
[ea2f1a96] Xorg_libXrender_jll v0.9.13+0
[a65dc6b1] Xorg_libpciaccess_jll v0.19.0+0
[c7cfdc94] Xorg_libxcb_jll v1.17.1+0
[c5fb5394] Xorg_xtrans_jll v1.6.0+0
[9a68df92] isoband_jll v0.2.3+0
[a4ae2306] libaom_jll v3.15.3+0
[0ac62f75] libass_jll v0.17.5+0
[46979653] libdeflate_jll v1.26.0+1
[8e53e030] libdrm_jll v2.4.134+0
⌅ [f638f0a6] libfdk_aac_jll v2.0.4+0
[b53b4c65] libpng_jll v1.6.59+1
[075b6546] libsixel_jll v1.80.702+0
[9a156e7d] libva_jll v2.24.1+0
[f27f6e37] libvorbis_jll v1.3.8+0
[c5f90fcd] libwebp_jll v1.6.1+0
[1317d2d5] oneTBB_jll v2023.1.0+0
⌅ [1270edf5] x264_jll v10164.0.1+0
⌅ [dfaa095f] x265_jll v4.1.0+0
[0dad84c5] ArgTools v1.1.2
[56f22d72] Artifacts v1.11.0
[2a0f44e3] Base64 v1.11.0
[8bf52ea8] CRC32c v1.11.0
[ade2ca70] Dates v1.11.0
[8ba89e20] Distributed v1.11.0
[f43a241f] Downloads v1.7.0
[7b1f6079] FileWatching v1.11.0
[9fa8497b] Future v1.11.0
[b77e0a4c] InteractiveUtils v1.11.0
[ac6e5ff7] JuliaSyntaxHighlighting v1.12.0
[4af54fe1] LazyArtifacts v1.11.0
[b27032c2] LibCURL v1.0.0
[76f85450] LibGit2 v1.11.0
[8f399da3] Libdl v1.11.0
[37e2e46d] LinearAlgebra v1.13.0
[56ddb016] Logging v1.11.0
[d6f4376e] Markdown v1.11.0
[a63ad114] Mmap v1.11.0
[ca575930] NetworkOptions v1.3.0
[44cfe95a] Pkg v1.13.0
[de0858da] Printf v1.11.0
[3fa0cd96] REPL v1.11.0
[9a3f8284] Random v1.11.0
[ea8e919c] SHA v1.0.0
[9e88b42a] Serialization v1.11.0
[1a1011a3] SharedArrays v1.11.0
[6462fe0b] Sockets v1.11.0
[2f01184e] SparseArrays v1.13.0
[f489334b] StyledStrings v1.11.0
[4607b0f0] SuiteSparse
[fa267f1f] TOML v1.0.3
[a4e569a6] Tar v1.10.0
[8dfed614] Test v1.11.0
[cf7118a7] UUIDs v1.11.0
[4ec0a83e] Unicode v1.11.0
[e66e0078] CompilerSupportLibraries_jll v1.5.5+2
[deac9b47] LibCURL_jll v8.22.0+0
[e37daf67] LibGit2_jll v1.9.7+0
[29816b5a] LibSSH2_jll v1.11.104+0
[14a3606d] MozillaCACerts_jll v2026.10.20
[4536629a] OpenBLAS_jll v0.3.30+0
[05823500] OpenLibm_jll v0.8.7+0
[458c3c95] OpenSSL_jll v3.5.8+0
[efcefdf7] PCRE2_jll v10.47.0+0
[bea87d4a] SuiteSparse_jll v7.10.1+0
[83775a58] Zlib_jll v1.3.2+0
[3161d3a3] Zstd_jll v1.5.7+1
[8e850b90] libblastrampoline_jll v5.15.0+0
[8e850ede] nghttp2_jll v1.70.0+0
[3f19e933] p7zip_jll v17.8.3+0
Info Packages marked with ⌅ have new versions available but compatibility constraints restrict them from upgrading. To see why use `status --outdated -m`
This page was generated using Literate.jl.