Skip to content

minor doc additions #88

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
```
Loading