Skip to content

Commit affb5db

Browse files
committed
wip: multiple shooting transcription
1 parent 303c018 commit affb5db

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

src/controller/construct.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ function init_quadprog(::LinModel, weights::ControllerWeights, Ẽ, P̃, S̃)
495495
return
496496
end
497497
"Return empty matrix if `model` is not a [`LinModel`](@ref)."
498-
function init_quadprog(::SimModel{NT}, weights::ControllerWeights, _, _) where {NT<:Real}
498+
function init_quadprog(::SimModel{NT}, weights::ControllerWeights, _, _, _) where {NT<:Real}
499499
= Hermitian(zeros(NT, 0, 0), :L)
500500
return
501501
end

src/controller/linmpc.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,9 @@ function init_optimization!(mpc::LinMPC, model::LinModel, optim)
274274
A = con.A[con.i_b, :]
275275
b = con.b[con.i_b]
276276
@constraint(optim, linconstraint, A*ΔŨvar .≤ b)
277+
Aeq = con.A
278+
beq = con.b
279+
@constraint(optim, lineqconstraint, Aeq*ΔŨvar .== beq)
277280
set_objective_hessian!(mpc, ΔŨvar)
278281
return nothing
279282
end

src/controller/nonlinmpc.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,9 @@ function init_optimization!(mpc::NonLinMPC, model::SimModel, optim)
492492
A = con.A[con.i_b, :]
493493
b = con.b[con.i_b]
494494
@constraint(optim, linconstraint, A*ΔŨvar .≤ b)
495+
Aeq = con.A
496+
beq = con.b
497+
@constraint(optim, lineqconstraint, Aeq*ΔŨvar .== beq)
495498
# --- nonlinear optimization init ---
496499
if mpc.== 1 && JuMP.solver_name(optim) == "Ipopt"
497500
C = mpc.weights.Ñ_Hc[end]

0 commit comments

Comments
 (0)