Skip to content

Commit 369cad9

Browse files
committed
changed: renamed d0 to d̂0 (more rigorous)
Since future measured disturbances are typically unknown, the best we can have generally a forecast or similar
1 parent 0c1cf4a commit 369cad9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/controller/transcription.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1171,15 +1171,15 @@ function predict!(
11711171
nu, nx̂, ny, nd, nk, Hp = model.nu, mpc.estim.nx̂, model.ny, model.nd, model.nk, mpc.Hp
11721172
D̂0 = mpc.D̂0
11731173
x̂0 = @views mpc.estim.x̂0[1:nx̂]
1174-
d0 = @views mpc.d0[1:nd]
1174+
d̂0 = @views mpc.d0[1:nd]
11751175
for j=1:Hp
11761176
u0 = @views U0[(1 + nu*(j-1)):(nu*j)]
11771177
û0 = @views Û0[(1 + nu*(j-1)):(nu*j)]
11781178
k0 = @views K0[(1 + nk*(j-1)):(nk*j)]
11791179
x̂0next = @views X̂0[(1 + nx̂*(j-1)):(nx̂*j)]
11801180
f̂!(x̂0next, û0, k0, mpc.estim, model, x̂0, u0, d0)
11811181
x̂0 = @views X̂0[(1 + nx̂*(j-1)):(nx̂*j)]
1182-
d0 = @views D̂0[(1 + nd*(j-1)):(nd*j)]
1182+
d̂0 = @views D̂0[(1 + nd*(j-1)):(nd*j)]
11831183
ŷ0 = @views Ŷ0[(1 + ny*(j-1)):(ny*j)]
11841184
ĥ!(ŷ0, mpc.estim, model, x̂0, d0)
11851185
end
@@ -1215,7 +1215,7 @@ function predict!(
12151215
local x̂0
12161216
for j=1:Hp
12171217
x̂0 = @views X̂0[(1 + nx̂*(j-1)):(nx̂*j)]
1218-
d0 = @views D̂0[(1 + nd*(j-1)):(nd*j)]
1218+
d̂0 = @views D̂0[(1 + nd*(j-1)):(nd*j)]
12191219
ŷ0 = @views Ŷ0[(1 + ny*(j-1)):(ny*j)]
12201220
ĥ!(ŷ0, mpc.estim, model, x̂0, d0)
12211221
end
@@ -1406,7 +1406,7 @@ function con_nonlinprogeq!(
14061406
D̂0 = mpc.D̂0
14071407
X̂0_Z̃ = @views Z̃[(nΔU+1):(nΔU+nX̂)]
14081408
x̂0 = @views mpc.estim.x̂0[1:nx̂]
1409-
d0 = @views mpc.d0[1:nd]
1409+
d̂0 = @views mpc.d0[1:nd]
14101410
if !iszero(h)
14111411
k1, u0, û0 = @views K0[1:nx], U0[1:nu], Û0[1:nu]
14121412
x0, xs = @views x̂0[1:nx], x̂0[nx+1:end]
@@ -1450,7 +1450,7 @@ function con_nonlinprogeq!(
14501450
end
14511451
sdnext .= @. x0 - x0next_Z̃ + 0.5*Ts*(k1 + k2)
14521452
x̂0 = x̂0next_Z̃ # using states in Z̃ for next iteration (allow parallel for)
1453-
d0 = d0next
1453+
d̂0 = d0next
14541454
end
14551455
if !iszero(h)
14561456
# j = Hp special case: u(k+Hp-1) = u(k+Hp) since Hc ≤ Hp implies Δu(k+Hp)=0

0 commit comments

Comments
 (0)