Skip to content

Commit 7a48137

Browse files
committed
add MPC var. size to doc
1 parent f5bec2d commit 7a48137

File tree

2 files changed

+21
-15
lines changed

2 files changed

+21
-15
lines changed

docs/src/public/predictive_control.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ designs, an [`InternalModel`](@ref) structure is also available, that assumes by
1111
that the current model mismatch estimation is constant in the future (same approach than
1212
dynamic matrix control, DMC).
1313

14+
!!! info
15+
The nomenclature uses hats for the predictions (or estimations, for the state
16+
estimators) e.g. ``\mathbf{Ŷ}`` encompasses the future model outputs ``\mathbf{y}`` over
17+
the prediction horizon ``H_p``.
18+
1419
## PredictiveController
1520

1621
```@docs

src/controller/linmpc.jl

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -94,20 +94,20 @@ in which the weight matrices are repeated ``H_p`` or ``H_c`` times:
9494
```
9595
and with the following nomenclature:
9696
97-
| VAR. | DESCRIPTION |
98-
| :---------------- | :------------------------------------------------- |
99-
| ``H_p`` | prediction horizon |
100-
| ``H_c`` | control horizon |
101-
| ``\mathbf{ΔU}`` | manipulated input increments over ``H_c`` |
102-
| ``\mathbf{Ŷ}`` | predicted outputs over ``H_p`` |
103-
| ``\mathbf{U}`` | manipulated inputs over ``H_p`` |
104-
| ``\mathbf{R̂_y}`` | predicted output setpoints over ``H_p`` |
105-
| ``\mathbf{R̂_u}`` | predicted manipulated input setpoints over ``H_p`` |
106-
| ``\mathbf{M}`` | output setpoint tracking weights |
107-
| ``\mathbf{N}`` | manipulated input increment weights |
108-
| ``\mathbf{L}`` | manipulated input setpoint tracking weights |
109-
| ``C`` | slack variable weight |
110-
| ``ϵ`` | slack variable for constraint softening |
97+
| VARIABLE | DESCRIPTION | SIZE |
98+
| :--------------- | :------------------------------------------------- | :--------------- |
99+
| ``H_p`` | prediction horizon (integer) | `()` |
100+
| ``H_c`` | control horizon (integer) | `()` |
101+
| ``\mathbf{ΔU}`` | manipulated input increments over ``H_c`` | `(nu*Hc,)` |
102+
| ``\mathbf{Ŷ}`` | predicted outputs over ``H_p`` | `(ny*Hp,)` |
103+
| ``\mathbf{U}`` | manipulated inputs over ``H_p`` | `(nu*Hp,)` |
104+
| ``\mathbf{R̂_y}`` | predicted output setpoints over ``H_p`` | `(ny*Hp,)` |
105+
| ``\mathbf{R̂_u}`` | predicted manipulated input setpoints over ``H_p`` | `(nu*Hp,)` |
106+
| ``\mathbf{M}`` | output setpoint tracking weights | `(ny*Hp, ny*Hp)` |
107+
| ``\mathbf{N}`` | manipulated input increment weights | `(nu*Hc, nu*Hc)` |
108+
| ``\mathbf{L}`` | manipulated input setpoint tracking weights | `(nu*Hp, nu*Hp)` |
109+
| ``C`` | slack variable weight | `()` |
110+
| ``ϵ`` | slack variable for constraint softening | `()` |
111111
112112
The ``\mathbf{ΔU}`` vector includes the manipulated input increments ``\mathbf{Δu}(k+j) =
113113
\mathbf{u}(k+j) - \mathbf{u}(k+j-1)`` from ``j=0`` to ``H_c-1``, the ``\mathbf{Ŷ}`` vector,
@@ -130,7 +130,7 @@ arguments.
130130
- `optim=JuMP.Model(OSQP.MathOptInterfaceOSQP.Optimizer)` : quadratic optimizer used in
131131
the predictive controller, provided as a [`JuMP.Model`](https://jump.dev/JuMP.jl/stable/reference/models/#JuMP.Model)
132132
(default to [`OSQP.jl`](https://osqp.org/docs/parsers/jump.html) optimizer)
133-
133+
``
134134
# Examples
135135
```jldoctest
136136
julia> model = LinModel([tf(3, [30, 1]); tf(-2, [5, 1])], 4);
@@ -172,6 +172,7 @@ LinMPC controller with a sample time Ts = 4.0 s, KalmanFilter estimator and:
172172
0 measured disturbances d
173173
```
174174
"""
175+
175176
function LinMPC(
176177
estim::S;
177178
Hp::Union{Int, Nothing} = nothing,

0 commit comments

Comments
 (0)