Skip to content

Commit 29be805

Browse files
committed
doc: add link for details on the two kind of defects
1 parent 300fd93 commit 29be805

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

src/controller/transcription.jl

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ order hold) between the samples, but linear interpolation will be added soon.
7575
7676
This transcription computes the predictions by calling the continuous-time model in the
7777
equality constraint function and by using the implicit trapezoidal rule. It can handle
78-
moderately stiff systems and is A-stable. However, it may not be as efficient as more
79-
advanced collocation methods for highly stiff systems. Note that the built-in [`StateEstimator`](@ref)
78+
moderately stiff systems and is A-stable. Note that the built-in [`StateEstimator`](@ref)
8079
will still use the `solver` provided at the construction of the [`NonLinModel`](@ref) to
8180
estimate the plant states, not the trapezoidal rule (see `supersample` option of
8281
[`RungeKutta`](@ref) for stiff systems). See Extended Help for more details.
@@ -89,7 +88,8 @@ transcription method.
8988
Note that the stochastic model of the unmeasured disturbances is strictly discrete-time,
9089
as described in [`ModelPredictiveControl.init_estimstoch`](@ref). Collocation methods
9190
require continuous-time dynamics. Because of this, the stochastic states are transcribed
92-
separately using a [`MultipleShooting`](@ref) method.
91+
separately using a [`MultipleShooting`](@ref) method. See [`con_nonlinprogeq!`](@ref)
92+
for more details.
9393
"""
9494
struct TrapezoidalCollocation <: CollocationMethod
9595
nc::Int
@@ -1149,7 +1149,13 @@ end
11491149
Compute vectors if `model` is a [`NonLinModel`](@ref) and for [`SingleShooting`](@ref).
11501150
11511151
The method mutates `Ŷ0`, `x̂0end`, `X̂0`, `Û0` and `K0` arguments. The augmented model of
1152-
[`f̂!`](@ref) and [`ĥ!`](@ref) is called recursively in a `for` loop:
1152+
[`f̂!`](@ref) and [`ĥ!`](@ref) functions is called recursively in a `for` loop:
1153+
```math
1154+
\begin{aligned}
1155+
\mathbf{x̂_0}(k+1) &= \mathbf{f̂}\Big(\mathbf{x̂_0}(k), \mathbf{u_0}(k), \mathbf{d_0}(k) \Big) \\
1156+
\mathbf{ŷ_0}(k) &= \mathbf{ĥ}\Big(\mathbf{x̂_0}(k), \mathbf{d_0}(k) \Big)
1157+
\end{aligned}
1158+
```
11531159
"""
11541160
function predict!(
11551161
Ŷ0, x̂0end, X̂0, Û0, K0,
@@ -1185,8 +1191,12 @@ end
11851191
11861192
Compute vectors if `model` is a [`NonLinModel`](@ref) and other [`TranscriptionMethod`](@ref).
11871193
1188-
The method mutates `Ŷ0` and `x̂0end` arguments. The states `X̂0` are extracted from the
1189-
decisions variables `Z̃` and the augmented output function [`ĥ!`](@ref) is applied on them.
1194+
The method mutates `Ŷ0` and `x̂0end` arguments. The augmented output function [`ĥ!`](@ref)
1195+
is called multiple times in a `for` loop:
1196+
```math
1197+
\mathbf{ŷ_0}(k) = \mathbf{ĥ}\Big(\mathbf{x̂_0^†}(k+j), \mathbf{d_0}(k) \Big)
1198+
```
1199+
in which ``\mathbf{x̂_0^†}`` is the augmented state extracted from the decision variable `Z̃`.
11901200
"""
11911201
function predict!(
11921202
Ŷ0, x̂0end, _, _, _,
@@ -1303,7 +1313,7 @@ end
13031313
Nonlinear equality constrains for [`NonLinModel`](@ref) and [`MultipleShooting`](@ref).
13041314
13051315
The method mutates the `geq`, `X̂0`, `Û0` and `K0` vectors in argument. The nonlinear
1306-
equality constraints `geq` only includes the state defects, computed with:
1316+
equality constraints `geq` only includes the augmented state defects, computed with:
13071317
```math
13081318
\mathbf{ŝ}(k+1) = \mathbf{f̂}\Big(\mathbf{x̂_0}(k), \mathbf{u_0}(k), \mathbf{d_0}(k)\Big)
13091319
- \mathbf{x̂_0^†}(k+1)

0 commit comments

Comments
 (0)