Skip to content

Commit c88e90c

Browse files
committed
doc: minor correction
1 parent 6e797fb commit c88e90c

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

src/controller/nonlinmpc.jl

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -131,17 +131,16 @@ include the manipulated inputs, predicted outputs and measured disturbances, ext
131131
\mathbf{Ŷ_e} = \begin{bmatrix} \mathbf{ŷ}(k) \\ \mathbf{Ŷ} \end{bmatrix} , \quad
132132
\mathbf{D̂_e} = \begin{bmatrix} \mathbf{d}(k) \\ \mathbf{D̂} \end{bmatrix}
133133
```
134-
since ``H_c ≤ H_p`` implies that ``\mathbf{Δu}(k+H_p) = \mathbf{0}`` or ``\mathbf{u}(k+H_p)=
135-
\mathbf{u}(k+H_p-1)``. The vector ``\mathbf{D̂}`` comprises the measured disturbance
136-
predictions over ``H_p``. The argument ``\mathbf{p}`` is a custom parameter object of any
137-
type, but use a mutable one if you want to modify it later e.g.: a vector.
134+
The vector ``\mathbf{D̂}`` comprises the measured disturbance predictions over ``H_p``. The
135+
argument ``\mathbf{p}`` is a custom parameter object of any type, but use a mutable one if
136+
you want to modify it later e.g.: a vector.
138137
139138
!!! tip
140139
Replace any of the arguments of ``J_E`` and ``\mathbf{g_c}`` functions with `_` if not
141140
needed (see e.g. the default value of `JE` below).
142141
143-
See [`LinMPC`](@ref) for the definition of the other variables. This method uses the default
144-
state estimator :
142+
See [`LinMPC`](@ref) Extended Help for the definition of the other variables. This method
143+
uses the default state estimator :
145144
146145
- if `model` is a [`LinModel`](@ref), a [`SteadyKalmanFilter`](@ref) with default arguments;
147146
- else, an [`UnscentedKalmanFilter`](@ref) with default arguments.
@@ -199,10 +198,12 @@ NonLinMPC controller with a sample time Ts = 10.0 s, Ipopt optimizer, UnscentedK
199198
200199
The economic cost ``J_E`` and custom constraint ``\mathbf{g_c}`` functions receive the
201200
extended vectors ``\mathbf{U_e}`` (`nu*Hp+nu` elements), ``\mathbf{Ŷ_e}`` (`ny+ny*Hp`
202-
elements) and ``\mathbf{D̂_e}`` (`nd+nd*Hp` elements) as arguments. If `LHS` represents
203-
the result of the left-hand side in the inequality ``\mathbf{g_c}(\mathbf{U_e},
204-
\mathbf{Ŷ_e}, \mathbf{D̂_e}, \mathbf{p}, ϵ) ≤ \mathbf{0}``, the function `gc` can be
205-
implemented in two possible ways:
201+
elements) and ``\mathbf{D̂_e}`` (`nd+nd*Hp` elements) as arguments. The last two time
202+
steps in ``\mathbf{U_e}`` are forced to be equal, that is ``\mathbf{u}(k+H_p) =
203+
\mathbf{u}(k+H_p-1)``, since ``H_c ≤ H_p`` implies that ``\mathbf{Δu}(k+H_p) =
204+
\mathbf{0}``. If `LHS` represents the result of the left-hand side in the inequality
205+
``\mathbf{g_c}(\mathbf{U_e}, \mathbf{Ŷ_e}, \mathbf{D̂_e}, \mathbf{p}, ϵ) ≤ \mathbf{0}``,
206+
the function `gc` can be implemented in two possible ways:
206207
207208
1. **Non-mutating function** (out-of-place): define it as `gc(Ue, Ŷe, D̂e, p, ϵ) -> LHS`.
208209
This syntax is simple and intuitive but it allocates more memory.

0 commit comments

Comments
 (0)