Skip to content

Commit a3fd269

Browse files
committed
changed: using i counter for colloc. points
`o` is misleading with the `λ_o` variable
1 parent fcc824f commit a3fd269

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

src/controller/transcription.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ where ``\mathbf{K}`` encompasses all the intermediate stages of the deterministi
149149
\vdots \\
150150
\mathbf{k}_{n_o}(k+H_p-1) \end{bmatrix}
151151
```
152-
and ``\mathbf{k}_o(k+j)`` is the deterministic state prediction for the ``o``th collocation
152+
and ``\mathbf{k}_i(k+j)`` is the deterministic state prediction for the ``i``th collocation
153153
point at the ``j``th stage/interval/finite element (details in Extended Help). The `roots`
154154
keyword argument is either `:gaussradau` or `:gausslegendre`, for Gauss-Radau or
155155
Gauss-Legendre quadrature, respectively.
@@ -1452,12 +1452,12 @@ are computed by:
14521452
\vdots \\
14531453
\mathbf{k̇}_{n_o}(k+j) \end{bmatrix}
14541454
```
1455-
for ``j = 0, 1, ... , H_p-1``, and knowing that the ``\mathbf{k}_o(k+j)`` vectors are
1455+
for ``j = 0, 1, ... , H_p-1``, and knowing that the ``\mathbf{k}_i(k+j)`` vectors are
14561456
extracted from the decision variable `Z̃`. The ``\mathbf{x_0}`` vectors are the
1457-
deterministic state extracted from `Z̃`. The ``\mathbf{k̇}_o`` derivative for the ``o``th
1457+
deterministic state extracted from `Z̃`. The ``\mathbf{k̇}_i`` derivative for the ``i``th
14581458
collocation point is computed from the continuous-time function `model.f!` and:
14591459
```math
1460-
\mathbf{k̇}_o(k+j) = \mathbf{f}\Big(\mathbf{k}_o(k+j), \mathbf{û_0}(k+j), \mathbf{d̂_0}(k+j), \mathbf{p}\Big)
1460+
\mathbf{k̇}_i(k+j) = \mathbf{f}\Big(\mathbf{k}_i(k+j), \mathbf{û_0}(k+j), \mathbf{d̂_0}(k+j), \mathbf{p}\Big)
14611461
```
14621462
The disturbed input ``\mathbf{û_0}(k+j)`` is defined in [`f̂_input!`](@ref). The defects for
14631463
the stochastic states ``\mathbf{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

Comments
 (0)