From 69c9d04d5b1532c3131c45dca82a5c164102a5a0 Mon Sep 17 00:00:00 2001 From: franckgaga Date: Thu, 9 May 2024 09:29:50 -0400 Subject: [PATCH 1/4] minor doc correction --- docs/src/manual/nonlinmpc.md | 4 ++-- src/estimator/kalman.jl | 15 ++++++++------- src/plot_sim.jl | 2 -- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/docs/src/manual/nonlinmpc.md b/docs/src/manual/nonlinmpc.md index a9215a72f..c89b8b19f 100644 --- a/docs/src/manual/nonlinmpc.md +++ b/docs/src/manual/nonlinmpc.md @@ -66,8 +66,8 @@ model = setname!(NonLinModel(f, h, Ts, nu, nx, ny); u=vu, x=vx, y=vy) The output function ``\mathbf{h}`` converts the ``θ`` angle to degrees. Note that special characters like ``θ`` can be typed in the Julia REPL or VS Code by typing `\theta` and pressing the `` key. The tuple `par` is constant here to improve the [performance](https://docs.julialang.org/en/v1/manual/performance-tips/#Avoid-untyped-global-variables). -Note that a 4th order [`RungeKutta`](@ref) differential equation solver is used by default. -It is good practice to first simulate `model` using [`sim!`](@ref) as a quick sanity check: +A 4th order [`RungeKutta`](@ref) method solves the differential equations by default. It is +good practice to first simulate `model` using [`sim!`](@ref) as a quick sanity check: ```@example 1 using Plots diff --git a/src/estimator/kalman.jl b/src/estimator/kalman.jl index 1f04ce9e2..454767c42 100644 --- a/src/estimator/kalman.jl +++ b/src/estimator/kalman.jl @@ -451,10 +451,10 @@ is based on the process model : ``` See [`SteadyKalmanFilter`](@ref) for details on ``\mathbf{v}(k), \mathbf{w}(k)`` noises and ``\mathbf{R̂}, \mathbf{Q̂}`` covariances. The functions ``\mathbf{f̂, ĥ}`` are `model` -state-space functions augmented with the stochastic model, which is specified by the numbers -of integrator `nint_u` and `nint_ym` (see Extended Help). The ``\mathbf{ĥ^m}`` function -represents the measured outputs of ``\mathbf{ĥ}`` function (and unmeasured ones, for -``\mathbf{ĥ^u}``). +state-space functions augmented with the stochastic model of the unmeasured disturbances, +which is specified by the numbers of integrator `nint_u` and `nint_ym` (see Extended Help). +The ``\mathbf{ĥ^m}`` function represents the measured outputs of ``\mathbf{ĥ}`` function +(and unmeasured ones, for ``\mathbf{ĥ^u}``). # Arguments !!! info @@ -483,9 +483,10 @@ UnscentedKalmanFilter estimator with a sample time Ts = 10.0 s, NonLinModel and: # Extended Help !!! details "Extended Help" The Extended Help of [`SteadyKalmanFilter`](@ref) details the augmentation with `nint_ym` - and `nint_u` arguments. Note that the constructor does not validate the observability of - the resulting augmented [`NonLinModel`](@ref). In such cases, it is the user's - responsibility to ensure that the augmented model is still observable. + and `nint_u` arguments. The default augmentation scheme is identical, that is `nint_u=0` + and `nint_ym` computed by [`default_nint`](@ref). Note that the constructor does not + validate the observability of the resulting augmented [`NonLinModel`](@ref). In such + cases, it is the user's responsibility to ensure that it is still observable. """ function UnscentedKalmanFilter( model::SM; diff --git a/src/plot_sim.jl b/src/plot_sim.jl index 36d35f300..c4a68f08a 100644 --- a/src/plot_sim.jl +++ b/src/plot_sim.jl @@ -614,8 +614,6 @@ end Plot the simulation results of a [`PredictiveController`](@ref). # Arguments -!!! info - Keyword arguments in *`italic`* are non-Unicode alternatives. - `res::SimResult{<:Real, <:PredictiveController}` : simulation results to plot - `plotry=true` : plot plant output setpoints ``\mathbf{r_y}`` if applicable From 36e054dbb193d4307308ad741bb7b52498acbc17 Mon Sep 17 00:00:00 2001 From: franckgaga Date: Thu, 9 May 2024 09:32:26 -0400 Subject: [PATCH 2/4] added: doc preview cleanup Github workflow --- .github/workflows/DocCleanup.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/DocCleanup.yml diff --git a/.github/workflows/DocCleanup.yml b/.github/workflows/DocCleanup.yml new file mode 100644 index 000000000..156802415 --- /dev/null +++ b/.github/workflows/DocCleanup.yml @@ -0,0 +1,28 @@ +name: Doc Preview Cleanup + +on: + pull_request: + types: [closed] + +jobs: + doc-preview-cleanup: + runs-on: ubuntu-latest + steps: + - name: Checkout gh-pages branch + uses: actions/checkout@v2 + with: + ref: gh-pages + + - name: Delete preview and history + run: | + git config user.name "Documenter.jl" + git config user.email "documenter@juliadocs.github.io" + git rm -rf "previews/PR$PRNUM" + git commit -m "delete preview" + git branch gh-pages-new $(echo "delete history" | git commit-tree HEAD^{tree}) + env: + PRNUM: ${{ github.event.number }} + + - name: Push changes + run: | + git push --force origin gh-pages-new:gh-pages From 7cc2b1edd78e4aafdf2b4665269bac0d72933d7b Mon Sep 17 00:00:00 2001 From: franckgaga Date: Thu, 9 May 2024 13:29:37 -0400 Subject: [PATCH 3/4] doc: added ref to `plot` documentation in manual --- docs/src/manual/nonlinmpc.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/src/manual/nonlinmpc.md b/docs/src/manual/nonlinmpc.md index c89b8b19f..3ce8f5e7e 100644 --- a/docs/src/manual/nonlinmpc.md +++ b/docs/src/manual/nonlinmpc.md @@ -80,7 +80,9 @@ savefig("plot1_NonLinMPC.svg"); nothing # hide ![plot1_NonLinMPC](plot1_NonLinMPC.svg) -The [`setname!`](@ref) function allows customizing the Y-axis labels. +The [`setname!`](@ref) function allows customized Y-axis labels. The available plotting +options are detailed in the documentation of the corresponding [`plot`](@ref ModelPredictiveControl.plot) +method. ## Nonlinear Model Predictive Controller @@ -146,6 +148,8 @@ savefig("plot4_NonLinMPC.svg"); nothing # hide ![plot4_NonLinMPC](plot4_NonLinMPC.svg) +See [`sim!`] documentation for details on the possible simulation scenarios. + ## Economic Model Predictive Controller Economic MPC can achieve the same objective but with lower economical costs. For this case From 5e306165638eb91e47b9d4393c2f030e9f77977b Mon Sep 17 00:00:00 2001 From: franckgaga Date: Thu, 9 May 2024 13:35:16 -0400 Subject: [PATCH 4/4] idem --- docs/src/manual/nonlinmpc.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/manual/nonlinmpc.md b/docs/src/manual/nonlinmpc.md index 3ce8f5e7e..dab7dd060 100644 --- a/docs/src/manual/nonlinmpc.md +++ b/docs/src/manual/nonlinmpc.md @@ -148,7 +148,7 @@ savefig("plot4_NonLinMPC.svg"); nothing # hide ![plot4_NonLinMPC](plot4_NonLinMPC.svg) -See [`sim!`] documentation for details on the possible simulation scenarios. +See [`sim!`](@ref) documentation for details on the possible simulation scenarios. ## Economic Model Predictive Controller