Skip to content

Commit 887bcb2

Browse files
committed
changed: rename buffer.Cy and buffer.Cy to buffer.Ŷ and buffer.U, respect.
1 parent 9cd4439 commit 887bcb2

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

src/controller/execute.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,7 @@ They are computed with these equations using in-place operations:
191191
function initpred!(mpc::PredictiveController, model::LinModel, d, D̂, R̂y, R̂u)
192192
mul!(mpc.T_lastu0, mpc.T, mpc.estim.lastu0)
193193
ŷ, F, q̃, r = mpc.ŷ, mpc.F, mpc.q̃, mpc.r
194-
Cy, Cu = mpc.buffer.Cy, mpc.buffer.Cu
195-
M_Hp_Ẽ, L_Hp_S̃ = mpc.buffer.Ẽ, mpc.buffer.
194+
Cy, Cu, M_Hp_Ẽ, L_Hp_S̃ = mpc.buffer.Ŷ, mpc.buffer.U, mpc.buffer.Ẽ, mpc.buffer.
196195
ŷ .= evaloutput(mpc.estim, d)
197196
predictstoch!(mpc, mpc.estim) # init F with Ŷs for InternalModel
198197
F .+= mpc.B # F = F + B

src/predictive_control.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ struct PredictiveControllerBuffer{NT<:Real}
2323
u ::Vector{NT}
2424
R̂y::Vector{NT}
2525
::Vector{NT}
26-
Cy::Vector{NT}
27-
Cu::Vector{NT}
26+
::Vector{NT}
27+
U ::Vector{NT}
2828
::Matrix{NT}
2929
::Matrix{NT}
3030
empty::Vector{NT}
@@ -43,12 +43,12 @@ function PredictiveControllerBuffer{NT}(
4343
u = Vector{NT}(undef, nu)
4444
R̂y = Vector{NT}(undef, ny*Hp)
4545
= Vector{NT}(undef, nd*Hp)
46-
Cy = Vector{NT}(undef, ny*Hp)
47-
Cu = Vector{NT}(undef, nu*Hp)
46+
= Vector{NT}(undef, ny*Hp)
47+
U = Vector{NT}(undef, nu*Hp)
4848
= Matrix{NT}(undef, ny*Hp, nu*Hc + nϵ)
4949
= Matrix{NT}(undef, nu*Hp, nu*Hc + nϵ)
5050
empty = Vector{NT}(undef, 0)
51-
return PredictiveControllerBuffer{NT}(u, R̂y, D̂, Cy, Cu, Ẽ, S̃, empty)
51+
return PredictiveControllerBuffer{NT}(u, R̂y, D̂, Ŷ, U, Ẽ, S̃, empty)
5252
end
5353

5454
include("controller/construct.jl")

0 commit comments

Comments
 (0)