@@ -299,7 +299,7 @@ function setconstraint!(
299299 i_Ymin, i_Ymax = .! isinf .(con. Ymin), .! isinf .(con. Ymax)
300300 i_x̂min, i_x̂max = .! isinf .(con. x̂min), .! isinf .(con. x̂max)
301301 if notSolvedYet
302- con. i_b[:], con. i_g[:], con. A[:] = init_matconstraint (model,
302+ con. i_b[:], con. i_g[:], con. A[:] = init_matconstraint_mpc (model,
303303 i_Umin, i_Umax, i_ΔŨmin, i_ΔŨmax,
304304 i_Ymin, i_Ymax, i_x̂min, i_x̂max,
305305 con. A_Umin, con. A_Umax, con. A_ΔŨmin, con. A_ΔŨmax,
@@ -313,7 +313,7 @@ function setconstraint!(
313313 @constraint (optim, linconstraint, A* ΔŨvar .≤ b)
314314 setnonlincon! (mpc, model)
315315 else
316- i_b, i_g = init_matconstraint (model,
316+ i_b, i_g = init_matconstraint_mpc (model,
317317 i_Umin, i_Umax, i_ΔŨmin, i_ΔŨmax,
318318 i_Ymin, i_Ymax, i_x̂min, i_x̂max
319319 )
545545
546546Init linear model prediction matrices `F, q̃, p` and current estimated output `ŷ`.
547547
548- See [`init_predmat`](@ref) and [`init_quadprog_mpc `](@ref) for the definition of the matrices.
548+ See [`init_predmat`](@ref) and [`init_quadprog `](@ref) for the definition of the matrices.
549549"""
550550function initpred! (mpc:: PredictiveController , model:: LinModel , d, ym, D̂, R̂y, R̂u)
551551 mpc. ŷ[:] = evalŷ (mpc. estim, ym, d)
@@ -908,7 +908,7 @@ function init_predmat(estim::StateEstimator{NT}, model::SimModel, Hp, Hc) where
908908end
909909
910910@doc raw """
911- init_quadprog_mpc (model::LinModel, Ẽ, S, M_Hp, N_Hc, L_Hp) -> H̃, q̃, p
911+ init_quadprog (model::LinModel, Ẽ, S, M_Hp, N_Hc, L_Hp) -> H̃, q̃, p
912912
913913Init the quadratic programming optimization matrix `H̃` and `q̃` for MPC.
914914
@@ -921,14 +921,14 @@ vector ``\mathbf{q̃}`` and scalar ``p`` need recalculation each control period
921921[`initpred!`](@ref) method). ``p`` does not impact the minima position. It is thus
922922useless at optimization but required to evaluate the minimal ``J`` value.
923923"""
924- function init_quadprog_mpc (:: LinModel{NT} , Ẽ, S̃, M_Hp, Ñ_Hc, L_Hp) where {NT<: Real }
924+ function init_quadprog (:: LinModel{NT} , Ẽ, S̃, M_Hp, Ñ_Hc, L_Hp) where {NT<: Real }
925925 H̃ = Hermitian (convert (Matrix{NT}, 2 * (Ẽ' * M_Hp* Ẽ + Ñ_Hc + S̃' * L_Hp* S̃)), :L )
926926 q̃ = zeros (NT, size (H̃, 1 )) # dummy value (updated just before optimization)
927927 p = zeros (NT, 1 ) # dummy value (updated just before optimization)
928928 return H̃, q̃, p
929929end
930930" Return empty matrices if `model` is not a [`LinModel`](@ref)."
931- function init_quadprog_mpc (:: SimModel{NT} , Ẽ, S̃, M_Hp, Ñ_Hc, L_Hp) where {NT<: Real }
931+ function init_quadprog (:: SimModel{NT} , Ẽ, S̃, M_Hp, Ñ_Hc, L_Hp) where {NT<: Real }
932932 H̃ = Hermitian (zeros (NT, 0 , 0 ))
933933 q̃ = zeros (NT, 0 )
934934 p = zeros (NT, 1 ) # dummy value (updated just before optimization)
@@ -1026,7 +1026,7 @@ function init_defaultcon_mpc(
10261026 i_ΔŨmin, i_ΔŨmax = .! isinf .(ΔŨmin), .! isinf .(ΔŨmax)
10271027 i_Ymin, i_Ymax = .! isinf .(Ymin), .! isinf .(Ymax)
10281028 i_x̂min, i_x̂max = .! isinf .(x̂min), .! isinf .(x̂max)
1029- i_b, i_g, A = init_matconstraint (
1029+ i_b, i_g, A = init_matconstraint_mpc (
10301030 model,
10311031 i_Umin, i_Umax, i_ΔŨmin, i_ΔŨmax, i_Ymin, i_Ymax, i_x̂min, i_x̂max,
10321032 A_Umin, A_Umax, A_ΔŨmin, A_ΔŨmax, A_Ymin, A_Ymax, A_x̂max, A_x̂min
@@ -1246,7 +1246,7 @@ function init_stochpred(estim::StateEstimator{NT}, _ ) where NT<:Real
12461246end
12471247
12481248@doc raw """
1249- init_matconstraint (model::LinModel,
1249+ init_matconstraint_mpc (model::LinModel,
12501250 i_Umin, i_Umax, i_ΔŨmin, i_ΔŨmax, i_Ymin, i_Ymax, i_x̂min, i_x̂max, args...
12511251 ) -> i_b, i_g, A
12521252
@@ -1265,7 +1265,7 @@ The linear and nonlinear inequality constraints are respectively defined as:
12651265provided. In such a case, `args` needs to contain all the inequality constraint matrices:
12661266`A_Umin, A_Umax, A_ΔŨmin, A_ΔŨmax, A_Ymin, A_Ymax, A_x̂min, A_x̂max`.
12671267"""
1268- function init_matconstraint (:: LinModel{NT} ,
1268+ function init_matconstraint_mpc (:: LinModel{NT} ,
12691269 i_Umin, i_Umax, i_ΔŨmin, i_ΔŨmax, i_Ymin, i_Ymax, i_x̂min, i_x̂max, args...
12701270) where {NT<: Real }
12711271 i_b = [i_Umin; i_Umax; i_ΔŨmin; i_ΔŨmax; i_Ymin; i_Ymax; i_x̂min; i_x̂max]
@@ -1280,7 +1280,7 @@ function init_matconstraint(::LinModel{NT},
12801280end
12811281
12821282" Init `i_b, A` without outputs and terminal constraints if `model` is not a [`LinModel`](@ref)."
1283- function init_matconstraint (:: SimModel{NT} ,
1283+ function init_matconstraint_mpc (:: SimModel{NT} ,
12841284 i_Umin, i_Umax, i_ΔŨmin, i_ΔŨmax, i_Ymin, i_Ymax, i_x̂min, i_x̂max, args...
12851285) where {NT<: Real }
12861286 i_b = [i_Umin; i_Umax; i_ΔŨmin; i_ΔŨmax]
0 commit comments