@@ -124,7 +124,7 @@ function getinfo(mpc::PredictiveController{NT}) where NT<:Real
124124 Ŷe, Ue = extended_predictions! (Ŷe, Ue, Ū, mpc, model, Ŷ0, mpc. ΔŨ)
125125 J = obj_nonlinprog! (Ȳ, Ū, mpc, model, Ue, Ŷe, mpc. ΔŨ)
126126 U, Ŷ = Ū, Ȳ
127- U .= mul! (U, mpc. S̃, ΔŨ) .+ mpc. T_lastu
127+ U .= mul! (U, mpc. S̃, mpc . ΔŨ) .+ mpc. T_lastu
128128 Ŷ .= Ŷ0 .+ mpc. Yop
129129 oldF = copy (mpc. F)
130130 F = predictstoch! (mpc, mpc. estim)
@@ -390,14 +390,14 @@ special cases in which `Ŷe`, `Ue` and `Ū` are not mutated:
390390"""
391391function extended_predictions! (Ŷe, Ue, Ū, mpc, model, Ŷ0, ΔŨ)
392392 ny, nu = model. ny, model. nu
393- nocustomfcts = (mpc. weights. iszero_E && mpc. con . nc == 0 )
393+ nocustomfonctions = (mpc. weights. iszero_E && iszero_nc ( mpc) )
394394 # --- extended output predictions Ŷe = [ŷ(k); Ŷ] ---
395- if ! (mpc. weights. iszero_M_Hp[] && nocustomfcts)
395+ if ! (mpc. weights. iszero_M_Hp[] && mpc . nocustomfcts)
396396 Ŷe[1 : ny] .= mpc. ŷ
397397 Ŷe[ny+ 1 : end ] .= Ŷ0 .+ mpc. Yop
398398 end
399399 # --- extended manipulated inputs Ue = [U; u(k+Hp-1)] ---
400- if ! (mpc. weights. iszero_L_Hp[] && nocustomfcts)
400+ if ! (mpc. weights. iszero_L_Hp[] && mpc . nocustomfcts)
401401 U = Ū
402402 U .= mul! (U, mpc. S̃, ΔŨ) .+ mpc. T_lastu
403403 Ue[1 : end - nu] .= U
@@ -407,6 +407,9 @@ function extended_predictions!(Ŷe, Ue, Ū, mpc, model, Ŷ0, ΔŨ)
407407 return Ŷe, Ue
408408end
409409
410+ " Verify if the custom nonlinear constraint has zero elements."
411+ iszero_nc (mpc:: PredictiveController ) = (mpc. con. nc == 0 )
412+
410413"""
411414 obj_nonlinprog!( _ , _ , mpc::PredictiveController, model::LinModel, Ue, Ŷe, ΔŨ)
412415
0 commit comments