Skip to content

Commit e833f67

Browse files
committed
minor modification
1 parent 4aa95de commit e833f67

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/controller/execute.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -173,16 +173,16 @@ function initpred!(mpc::PredictiveController, model::LinModel, d, ym, D̂, R̂y,
173173
mul!(F, mpc.J, mpc.D̂0, 1, 1)
174174
end
175175
mpc.R̂y .= R̂y
176-
C_y = F .- mpc.R̂y
176+
Cy = F .- mpc.R̂y
177177
M_Hp_Ẽ = mpc.M_Hp*mpc.
178-
mul!(q̃, M_Hp_Ẽ', C_y)
179-
p .= dot(C_y, mpc.M_Hp, C_y)
178+
mul!(q̃, M_Hp_Ẽ', Cy)
179+
p .= dot(Cy, mpc.M_Hp, Cy)
180180
if ~mpc.noR̂u
181181
mpc.R̂u .= R̂u
182-
C_u = mpc.T_lastu .- mpc.R̂u
182+
Cu = mpc.T_lastu .- mpc.R̂u
183183
L_Hp_S̃ = mpc.L_Hp*mpc.
184-
mul!(q̃, L_Hp_S̃', C_u, 1, 1)
185-
p .+= dot(C_u, mpc.L_Hp, C_u)
184+
mul!(q̃, L_Hp_S̃', Cu, 1, 1)
185+
p .+= dot(Cu, mpc.L_Hp, Cu)
186186
end
187187
lmul!(2, q̃)
188188
return nothing

src/estimator/kalman.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,7 @@ function update_estimate_kf!(estim::StateEstimator{NT}, u, ym, d, Â, Ĉm, P̂
818818
Q̂, R̂, M̂, K̂ = estim.Q̂, estim.R̂, estim.M̂, estim.
819819
nx̂, nu, ny = estim.nx̂, estim.model.nu, estim.model.ny
820820
x̂next, û, ŷ = Vector{NT}(undef, nx̂), Vector{NT}(undef, nu), Vector{NT}(undef, ny)
821-
mul!(M̂, P̂.data, Ĉm') # the ".data" weirdly remove a type instability in mul!
821+
mul!(M̂, P̂.data, Ĉm') # the ".data" weirdly removes a type instability in mul!
822822
rdiv!(M̂, cholesky!(Hermitian(Ĉm ** Ĉm' .+ R̂)))
823823
mul!(K̂, Â, M̂)
824824
ĥ!(ŷ, estim, estim.model, x̂, d)

0 commit comments

Comments
 (0)