diff --git a/docs/src/manual/linmpc.md b/docs/src/manual/linmpc.md index 84dc94c7..bc1ef860 100644 --- a/docs/src/manual/linmpc.md +++ b/docs/src/manual/linmpc.md @@ -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) diff --git a/docs/src/manual/nonlinmpc.md b/docs/src/manual/nonlinmpc.md index 0185554e..b097daa7 100644 --- a/docs/src/manual/nonlinmpc.md +++ b/docs/src/manual/nonlinmpc.md @@ -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]) diff --git a/docs/src/public/plot_sim.md b/docs/src/public/plot_sim.md index d77e3c41..405131f6 100644 --- a/docs/src/public/plot_sim.md +++ b/docs/src/public/plot_sim.md @@ -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 ```