@@ -100,10 +100,11 @@ The function should be called after calling [`moveinput!`](@ref). It returns the
100100- `:R̂y` or *`:Rhaty`* : predicted output setpoint over ``H_p``, ``\m athbf{R̂_y}``
101101- `:R̂u` or *`:Rhatu`* : predicted manipulated input setpoint over ``H_p``, ``\m athbf{R̂_u}``
102102- `:x̂end` or *`:xhatend`* : optimal terminal states, ``\m athbf{x̂}_i(k+H_p)``
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)``
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)``
107108
108109For [`LinMPC`](@ref) and [`NonLinMPC`](@ref), the following fields are also available:
109110
@@ -161,20 +162,21 @@ function getinfo(mpc::PredictiveController{NT}) where NT<:Real
161162 J = obj_nonlinprog! (Ŷ0, U0, mpc, Ue, Ŷe, ΔŨ)
162163 Ŷs = similar (mpc. Yop)
163164 predictstoch! (Ŷs, mpc, mpc. estim)
164- info[:ΔU ] = Z̃[1 : mpc. Hc* model. nu]
165- info[:ϵ ] = getϵ (mpc, Z̃)
166- info[:J ] = J
167- info[:U ] = U
168- info[:u ] = info[:U ][1 : model. nu]
169- info[:d ] = mpc. d0 + model. dop
170- info[:D̂ ] = D̂
171- info[:x̂ ] = mpc. estim. x̂0 .+ mpc. estim. x̂op
172- info[:ŷ ] = mpc. ŷ
173- info[:Ŷ ] = Ŷ
174- info[:x̂end ] = x̂0end + mpc. estim. x̂op
175- info[:Ŷs ] = Ŷs
176- info[:R̂y ] = mpc. R̂y
177- 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
178180 # --- non-Unicode fields ---
179181 info[:DeltaU ] = info[:ΔU ]
180182 info[:epsilon ] = info[:ϵ ]
0 commit comments