Skip to content

Commit e265c8f

Browse files
committed
added: drastically improve LinMPC performance with new JuMP batch update methods
1 parent e833f67 commit e265c8f

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"
1919
ControlSystemsBase = "1.9"
2020
ForwardDiff = "0.10"
2121
Ipopt = "1"
22-
JuMP = "1"
22+
JuMP = "1.21"
2323
LinearAlgebra = "1.6"
2424
OSQP = "0.8"
2525
PreallocationTools = "0.4"

src/controller/execute.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ function linconstraint!(mpc::PredictiveController, model::LinModel)
279279
n += nx̂
280280
mpc.con.b[(n+1):(n+nx̂)] .= @. +mpc.con.x̂max - fx̂
281281
lincon = mpc.optim[:linconstraint]
282-
set_normalized_rhs.(lincon, mpc.con.b[mpc.con.i_b])
282+
set_normalized_rhs(lincon, mpc.con.b[mpc.con.i_b])
283283
end
284284

285285
"Set `b` excluding predicted output constraints when `model` is not a [`LinModel`](@ref)."

src/controller/linmpc.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,6 @@ end
254254

255255
"For [`LinMPC`](@ref), set the QP linear coefficient `q̃` just before optimization."
256256
function set_objective_linear_coef!(mpc::LinMPC, ΔŨvar)
257-
set_objective_coefficient.(mpc.optim, ΔŨvar, mpc.q̃)
257+
set_objective_coefficient(mpc.optim, ΔŨvar, mpc.q̃)
258258
return nothing
259259
end

0 commit comments

Comments
 (0)