Skip to content

Commit 8382790

Browse files
committed
removed: mpc.buffer.R̂y
Useless buffer. We can use `mpc.buffer.Ŷ` instead
1 parent 21d69cb commit 8382790

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/controller/execute.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ function moveinput!(
5353
mpc::PredictiveController,
5454
ry::Vector = mpc.estim.model.yop,
5555
d ::Vector = mpc.buffer.empty;
56-
Dhat ::Vector = repeat!(mpc.buffer.D̂, d, mpc.Hp),
57-
Rhaty::Vector = repeat!(mpc.buffer.R̂y, ry, mpc.Hp),
56+
Dhat ::Vector = repeat!(mpc.buffer.D̂, d, mpc.Hp),
57+
Rhaty::Vector = repeat!(mpc.buffer., ry, mpc.Hp),
5858
Rhatu::Vector = mpc.Uop,
5959
= Dhat,
6060
R̂y = Rhaty,
@@ -323,7 +323,7 @@ function linconstraint!(mpc::PredictiveController, ::SimModel)
323323
mpc.con.b[(n+1):(n+nΔŨ)] .= @. +mpc.con.ΔŨmax
324324
if any(mpc.con.i_b)
325325
lincon = mpc.optim[:linconstraint]
326-
JuMP.set_normalized_rhs(lincon, mpc.con.b[mpc.con.i_b])
326+
@views JuMP.set_normalized_rhs(lincon, mpc.con.b[mpc.con.i_b])
327327
end
328328
return nothing
329329
end

src/predictive_control.jl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ abstract type PredictiveController{NT<:Real} end
2121

2222
struct PredictiveControllerBuffer{NT<:Real}
2323
u ::Vector{NT}
24-
R̂y::Vector{NT}
2524
::Vector{NT}
2625
::Vector{NT}
2726
U ::Vector{NT}
@@ -41,14 +40,13 @@ function PredictiveControllerBuffer{NT}(
4140
nu::Int, ny::Int, nd::Int, Hp::Int, Hc::Int, nϵ::Int
4241
) where NT <: Real
4342
u = Vector{NT}(undef, nu)
44-
R̂y = Vector{NT}(undef, ny*Hp)
4543
= Vector{NT}(undef, nd*Hp)
4644
= Vector{NT}(undef, ny*Hp)
4745
U = Vector{NT}(undef, nu*Hp)
4846
= Matrix{NT}(undef, ny*Hp, nu*Hc + nϵ)
4947
= Matrix{NT}(undef, nu*Hp, nu*Hc + nϵ)
5048
empty = Vector{NT}(undef, 0)
51-
return PredictiveControllerBuffer{NT}(u, R̂y, D̂, Ŷ, U, Ẽ, S̃, empty)
49+
return PredictiveControllerBuffer{NT}(u, D̂, Ŷ, U, Ẽ, S̃, empty)
5250
end
5351

5452
include("controller/construct.jl")

0 commit comments

Comments
 (0)