@@ -149,7 +149,7 @@ where ``\mathbf{K}`` encompasses all the intermediate stages of the deterministi
149149 \v dots \\
150150 \m athbf{k}_{n_o}(k+H_p-1) \e nd{bmatrix}
151151```
152- and ``\m athbf{k}_o (k+j)`` is the deterministic state prediction for the ``o ``th collocation
152+ and ``\m athbf{k}_i (k+j)`` is the deterministic state prediction for the ``i ``th collocation
153153point at the ``j``th stage/interval/finite element (details in Extended Help). The `roots`
154154keyword argument is either `:gaussradau` or `:gausslegendre`, for Gauss-Radau or
155155Gauss-Legendre quadrature, respectively.
@@ -1452,12 +1452,12 @@ are computed by:
14521452 \v dots \\
14531453 \m athbf{k̇}_{n_o}(k+j) \e nd{bmatrix}
14541454```
1455- for ``j = 0, 1, ... , H_p-1``, and knowing that the ``\m athbf{k}_o (k+j)`` vectors are
1455+ for ``j = 0, 1, ... , H_p-1``, and knowing that the ``\m athbf{k}_i (k+j)`` vectors are
14561456extracted from the decision variable `Z̃`. The ``\m athbf{x_0}`` vectors are the
1457- deterministic state extracted from `Z̃`. The ``\m athbf{k̇}_o `` derivative for the ``o ``th
1457+ deterministic state extracted from `Z̃`. The ``\m athbf{k̇}_i `` derivative for the ``i ``th
14581458collocation point is computed from the continuous-time function `model.f!` and:
14591459```math
1460- \m athbf{k̇}_o (k+j) = \m athbf{f}\B ig(\m athbf{k}_o (k+j), \m athbf{û_0}(k+j), \m athbf{d̂_0}(k+j), \m athbf{p}\B ig)
1460+ \m athbf{k̇}_i (k+j) = \m athbf{f}\B ig(\m athbf{k}_i (k+j), \m athbf{û_0}(k+j), \m athbf{d̂_0}(k+j), \m athbf{p}\B ig)
14611461```
14621462The disturbed input ``\m athbf{û_0}(k+j)`` is defined in [`f̂_input!`](@ref). The defects for
14631463the stochastic states ``\m athbf{s_s}`` are computed
@@ -1512,10 +1512,10 @@ function con_nonlinprogeq!(
15121512 u0 = @views U0[(1 + nu* (j- 1 )): (nu* j)]
15131513 û0 = @views Û0[(1 + nu* (j- 1 )): (nu* j)]
15141514 f̂_input! (û0, mpc. estim, model, x̂0_Z̃, u0)
1515- for o = 1 : no
1516- k̇o = @views k̇[(1 + (o - 1 )* nx): (o * nx)]
1517- Δko = @views Δk[(1 + (o - 1 )* nx): (o * nx)]
1518- ko_Z̃ = @views k_Z̃[(1 + (o - 1 )* nx): (o * nx)]
1515+ for i = 1 : no
1516+ k̇o = @views k̇[(1 + (i - 1 )* nx): (i * nx)]
1517+ Δko = @views Δk[(1 + (i - 1 )* nx): (i * nx)]
1518+ ko_Z̃ = @views k_Z̃[(1 + (i - 1 )* nx): (i * nx)]
15191519 Δko .= @. ko_Z̃ - x0_Z̃
15201520 model. f! (k̇o, ko_Z̃, û0, d̂0, p)
15211521 end
0 commit comments