@@ -93,16 +93,18 @@ The function should be called after calling [`moveinput!`](@ref). It returns the
9393- `:ΔU` or *`:DeltaU`* : optimal manipulated input increments over ``H_c``, ``\m athbf{ΔU}``
9494- `:ϵ` or *`:epsilon`* : optimal slack variable, ``ϵ``
9595- `:D̂` or *`:Dhat`* : predicted measured disturbances over ``H_p``, ``\m athbf{D̂}``
96+ - `:x̂` or *`:xhat`* : current estimated state, ``\m athbf{x̂}_i(k)``
9697- `:ŷ` or *`:yhat`* : current estimated output, ``\m athbf{ŷ}(k)``
9798- `:Ŷ` or *`:Yhat`* : optimal predicted outputs over ``H_p``, ``\m athbf{Ŷ}``
9899- `:Ŷs` or *`:Yhats`* : predicted stochastic output over ``H_p`` of [`InternalModel`](@ref), ``\m athbf{Ŷ_s}``
99100- `:R̂y` or *`:Rhaty`* : predicted output setpoint over ``H_p``, ``\m athbf{R̂_y}``
100101- `:R̂u` or *`:Rhatu`* : predicted manipulated input setpoint over ``H_p``, ``\m athbf{R̂_u}``
101102- `:x̂end` or *`:xhatend`* : optimal terminal states, ``\m athbf{x̂}_i(k+H_p)``
102- - `:J` : objective value optimum, ``J``
103- - `:U` : optimal manipulated inputs over ``H_p``, ``\m athbf{U}``
104- - `:u` : current optimal manipulated input, ``\m athbf{u}(k)``
105- - `:d` : current measured disturbance, ``\m athbf{d}(k)``
103+ - `:J` : objective value optimum, ``J``
104+ - `:U` : optimal manipulated inputs over ``H_p``, ``\m athbf{U}``
105+ - `:u` : current optimal manipulated input, ``\m athbf{u}(k)``
106+ - `:d` : current measured disturbance, ``\m athbf{d}(k)``
107+ - `:lastu` : last manipulated input, ``\m athbf{u}(k-1)``
106108
107109For [`LinMPC`](@ref) and [`NonLinMPC`](@ref), the following fields are also available:
108110
@@ -160,23 +162,26 @@ function getinfo(mpc::PredictiveController{NT}) where NT<:Real
160162 J = obj_nonlinprog! (Ŷ0, U0, mpc, Ue, Ŷe, ΔŨ)
161163 Ŷs = similar (mpc. Yop)
162164 predictstoch! (Ŷs, mpc, mpc. estim)
163- info[:ΔU ] = Z̃[1 : mpc. Hc* model. nu]
164- info[:ϵ ] = getϵ (mpc, Z̃)
165- info[:J ] = J
166- info[:U ] = U
167- info[:u ] = info[:U ][1 : model. nu]
168- info[:d ] = mpc. d0 + model. dop
169- info[:D̂ ] = D̂
170- info[:ŷ ] = mpc. ŷ
171- info[:Ŷ ] = Ŷ
172- info[:x̂end ] = x̂0end + mpc. estim. x̂op
173- info[:Ŷs ] = Ŷs
174- info[:R̂y ] = mpc. R̂y
175- info[:R̂u ] = mpc. R̂u
165+ info[:ΔU ] = Z̃[1 : mpc. Hc* model. nu]
166+ info[:ϵ ] = getϵ (mpc, Z̃)
167+ info[:J ] = J
168+ info[:U ] = U
169+ info[:u ] = info[:U ][1 : model. nu]
170+ info[:lastu ] = mpc. lastu0 .+ model. uop
171+ info[:d ] = mpc. d0 + model. dop
172+ info[:D̂ ] = D̂
173+ info[:x̂ ] = mpc. estim. x̂0 .+ mpc. estim. x̂op
174+ info[:ŷ ] = mpc. ŷ
175+ info[:Ŷ ] = Ŷ
176+ info[:x̂end ] = x̂0end + mpc. estim. x̂op
177+ info[:Ŷs ] = Ŷs
178+ info[:R̂y ] = mpc. R̂y
179+ info[:R̂u ] = mpc. R̂u
176180 # --- non-Unicode fields ---
177181 info[:DeltaU ] = info[:ΔU ]
178182 info[:epsilon ] = info[:ϵ ]
179183 info[:Dhat ] = info[:D̂ ]
184+ info[:xhat ] = info[:x̂ ]
180185 info[:yhat ] = info[:ŷ ]
181186 info[:Yhat ] = info[:Ŷ ]
182187 info[:xhatend ] = info[:x̂end ]
0 commit comments