Skip to content

Commit

Permalink
minor doc additions
Browse files Browse the repository at this point in the history
  • Loading branch information
franckgaga committed Jul 11, 2024
1 parent d42dc75 commit 86404e2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
10 changes: 6 additions & 4 deletions docs/src/manual/linmpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,12 @@ automatically added to the model outputs by default if observability is preserve
structure with `mpc = LinMPC(InternalModel(model), Hp=15, Hc=2, Mwt=[1, 1], Nwt=[0.1, 0.1])`.
It was tested on the example of this page and it gave similar results.

Before closing the loop, we call [`initstate!`](@ref) with the actual plant inputs and
measurements to ensure a bumpless transfer. Since `model` simulates our plant here, its
output will initialize the states. [`LinModel`](@ref) objects are callable for this purpose
(an alias for [`evaloutput`](@ref)):
Before closing the loop, the actual plant input ``\mathbf{u}`` and measurement ``\mathbf{y}``
should initialize the estimates ``\mathbf{x̂}`` at the steady-state solution that leads to
``\mathbf{ŷ}(0) = \mathbf{y}(0)``. This approach results in a bumpless transfer. The
[`initstate!`](@ref) function finds this solution for [`LinModel`](@ref). Since `model`
simulates our plant here, its output will initialize the states. [`LinModel`](@ref) objects
are callable for this purpose (an alias for [`evaloutput`](@ref)):

```@example 1
u, y = model.uop, model() # or equivalently : y = evaloutput(model)
Expand Down
7 changes: 4 additions & 3 deletions docs/src/manual/nonlinmpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -371,9 +371,10 @@ nothing # hide
```

The [`setmodel!`](@ref) method must be called after solving the optimization problem with
[`moveinput!`](@ref), and before updating the state estimate with [`updatestate!`](@ref).
The [`SimResult`](@ref) object is for plotting purposes only. The adaptive [`LinMPC`](@ref)
performances are similar to the nonlinear MPC, both for the 180° setpoint:
[`moveinput!`](@ref) and before updating the state estimate with [`updatestate!`](@ref),
that is, when both ``\mathbf{u}(k)`` and ``\mathbf{x̂}_{k-1}(k)`` are available as the new
operating point. The [`SimResult`](@ref) object is for plotting purposes only. The adaptive
[`LinMPC`](@ref) performances are similar to the nonlinear MPC, both for the 180° setpoint:

```@example 1
res_slin = test_slmpc(model, mpc3, [180], plant, x_0=[0, 0])
Expand Down
3 changes: 3 additions & 0 deletions docs/src/public/plot_sim.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ SimResult

## Plotting Results

The `plot` methods are based on [`Plots.jl`](https://github.com/JuliaPlots/Plots.jl) package.
To install it run `using Pkg; Pkg.add("Plots")` in the Julia REPL.

```@docs
ModelPredictiveControl.plot
```

0 comments on commit 86404e2

Please sign in to comment.