@@ -104,9 +104,12 @@ The function should be called after calling [`moveinput!`](@ref). It returns the
104104- `:u` : current optimal manipulated input, ``\m athbf{u}(k)``
105105- `:d` : current measured disturbance, ``\m athbf{d}(k)``
106106
107- For [`LinMPC`](@ref) and [`NonLinMPC`](@ref), the field `:sol` also contains the optimizer
108- solution summary that can be printed. Lastly, for [`NonLinMPC`](@ref), the following fields
109- are also available:
107+ For [`LinMPC`](@ref) and [`NonLinMPC`](@ref), the following fields are also available:
108+
109+ - `:W` : custom linear inequality constraint vector at the optimum, ``\m athbf{W}``.
110+ - `:sol` : a [solution summary](@extref JuMP solution_summary) that can be printed.
111+
112+ Lastly, the following fields are also available for [`NonLinMPC`](@ref) only:
110113
111114- `:JE`: economic cost value at the optimum, ``J_E``
112115- `:gc`: custom nonlinear constraints values at the optimum, ``\m athbf{g_c}``
194197"""
195198 addinfo!(info, mpc::PredictiveController) -> info
196199
197- By default, add the solution summary `:sol` that can be printed to `info`.
200+ By default, add the custom linear inrquality vector `W` and the solution summary `:sol` that
201+ can be printed to `info`.
198202"""
199- function addinfo! (info, mpc:: PredictiveController )
203+ function addinfo! (info, mpc:: PredictiveController{NT} ) where NT<: Real
204+ nW = mpc. con. nw* (mpc. Hp+ 1 )
205+ W = Vector {NT} (undef, nW)
206+ W .= mul! (W, mpc. con. Ẽw, mpc. Z̃) .+ mpc. con. Fw
207+ info[:W ] = W
200208 info[:sol ] = JuMP. solution_summary (mpc. optim, verbose= true )
201209 return info
202210end
0 commit comments