@@ -1397,7 +1397,7 @@ deterministic and stochastic states extracted from the decision variables `Z̃`.
13971397\e nd{aligned}
13981398```
13991399in which ``h`` is the hold order `transcription.h` and the disturbed input ``\m athbf{û_0}``
1400- is defined in [`f̂_input !`](@ref).
1400+ is defined in [`f̂ !`](@ref) documentation .
14011401"""
14021402function con_nonlinprogeq! (
14031403 geq, X̂0, Û0, K̇,
@@ -1412,11 +1412,7 @@ function con_nonlinprogeq!(
14121412 nk = get_nk (model, transcription)
14131413 D̂0 = mpc. D̂0
14141414 X̂0_Z̃ = @views Z̃[(nΔU+ 1 ): (nΔU+ nX̂)]
1415- for j= 0 : Hp- 1 # prefilling Û0 to avoid race-condition (both û0 and û0next are needed):
1416- x̂0_Z̃ = @views j < 1 ? mpc. estim. x̂0[1 : nx̂] : X̂0_Z̃[(1 + nx̂* (j- 1 )): (nx̂* j)]
1417- u0, û0 = @views U0[(1 + nu* j): (nu* (j+ 1 ))], Û0[(1 + nu* j): (nu* (j+ 1 ))]
1418- f̂_input! (û0, mpc. estim, model, x̂0_Z̃, u0)
1419- end
1415+ disturbedinput! (Û0, mpc, estim, U0, X̂0_Z̃)
14201416 @threadsif f_threads for j= 1 : Hp
14211417 if j < 2
14221418 x̂0_Z̃ = @views mpc. estim. x̂0[1 : nx̂]
@@ -1503,9 +1499,9 @@ and disturbances are piecewise constant or linear:
15031499\m athbf{d̂}_i(k+j) &= (1-τ_i)\m athbf{d̂_0}(k+j) + τ_i\m athbf{d̂_0}(k+j+1)
15041500\e nd{aligned}
15051501```
1506- The disturbed input ``\m athbf{û_0}(k+j) `` is defined in [`f̂_input !`](@ref). The defects for
1507- the stochastic states ``\m athbf{s_s}`` are computed as the [`TrapezoidalCollocation`](@ref)
1508- method, and the ones for the continuity constraint of the deterministic states are:
1502+ The disturbed input ``\m athbf{û_0}`` is defined in [`f̂ !`](@ref). The stochastic state
1503+ defects ``\m athbf{s_s}`` are computed as the [`TrapezoidalCollocation`](@ref) method, and
1504+ the ones for the continuity constraint of the deterministic states are:
15091505```math
15101506\m athbf{s_c}(k+j+1)
15111507 = \m athbf{C_o} \b egin{bmatrix}
@@ -1535,11 +1531,7 @@ function con_nonlinprogeq!(
15351531 D̂0 = mpc. D̂0
15361532 X̂0_Z̃, K_Z̃ = @views Z̃[(nΔU+ 1 ): (nΔU+ nX̂)], Z̃[(nΔU+ nX̂+ 1 ): (nΔU+ nX̂+ nk* Hp)]
15371533 D̂temp = mpc. buffer. D̂
1538- for j= 0 : Hp- 1 # prefilling Û0 to avoid race-condition (both û0 and û0next are needed):
1539- x̂0_Z̃ = @views j < 1 ? mpc. estim. x̂0[1 : nx̂] : X̂0_Z̃[(1 + nx̂* (j- 1 )): (nx̂* j)]
1540- u0, û0 = @views U0[(1 + nu* j): (nu* (j+ 1 ))], Û0[(1 + nu* j): (nu* (j+ 1 ))]
1541- f̂_input! (û0, mpc. estim, model, x̂0_Z̃, u0)
1542- end
1534+ disturbedinput! (Û0, mpc, estim, U0, X̂0_Z̃)
15431535 @threadsif f_threads for j= 1 : Hp
15441536 if j < 2
15451537 x̂0_Z̃ = @views mpc. estim. x̂0[1 : nx̂]
0 commit comments