From d22abba15de05f93cfc31a131b7348930283f975 Mon Sep 17 00:00:00 2001 From: franckgaga Date: Wed, 21 Oct 2026 09:54:26 -0400 Subject: [PATCH 1/9] removed: deprecated `CompatHelper` --- .github/workflows/CompatHelper.yml | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 .github/workflows/CompatHelper.yml diff --git a/.github/workflows/CompatHelper.yml b/.github/workflows/CompatHelper.yml deleted file mode 100644 index cba9134c6..000000000 --- a/.github/workflows/CompatHelper.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: CompatHelper -on: - schedule: - - cron: 0 0 * * * - workflow_dispatch: -jobs: - CompatHelper: - runs-on: ubuntu-latest - steps: - - name: Pkg.add("CompatHelper") - run: julia -e 'using Pkg; Pkg.add("CompatHelper")' - - name: CompatHelper.main() - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }} - run: julia -e 'using CompatHelper; CompatHelper.main()' From 74a016bd99ab5c52ad19db5c6acdb65c0b4069ef Mon Sep 17 00:00:00 2001 From: franckgaga Date: Wed, 21 Oct 2026 09:54:59 -0400 Subject: [PATCH 2/9] added: all dirs for `dependabot` --- .github/dependabot.yml | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 3db320924..1b9e119b0 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,15 +1,11 @@ # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates version: 2 updates: - - package-ecosystem: "github-actions" - directory: "/" # Location of package manifests - schedule: - interval: "weekly" - package-ecosystem: "julia" - directory: "/" + directories: # Location of Julia projects + - "/" + - "/docs" + - "/test" + - "/benchmark" schedule: - interval: "weekly" - # groups: # uncomment to group all julia package updates into a single PR - # all-julia-packages: - # patterns: - # - "*" \ No newline at end of file + interval: "weekly" \ No newline at end of file From d05670e7963e6d0d085d3a7bc03fec43908d89e8 Mon Sep 17 00:00:00 2001 From: franckgaga Date: Wed, 21 Oct 2026 10:01:43 -0400 Subject: [PATCH 3/9] doc: new hidden `display` call at each block It ease running the blocks in VS Code --- docs/src/manual/nonlinmpc1.md | 60 +++++++++++++++++++++-------------- 1 file changed, 36 insertions(+), 24 deletions(-) diff --git a/docs/src/manual/nonlinmpc1.md b/docs/src/manual/nonlinmpc1.md index 730164fae..dde5a181b 100644 --- a/docs/src/manual/nonlinmpc1.md +++ b/docs/src/manual/nonlinmpc1.md @@ -73,8 +73,9 @@ using Plots u = [0.5] N = 35 res = sim!(model, N, u) -plot(res, plotu=false) -savefig("plot1_NonLinMPC.svg"); nothing # hide +p1 = plot(res, plotu=false) +savefig("plot1_NonLinMPC.svg") # hide +display(p1) # hide ``` ![plot1_NonLinMPC](plot1_NonLinMPC.svg) @@ -104,8 +105,9 @@ p_plant = copy(p_model) p_plant[3] = 1.25*p_model[3] plant = setname!(NonLinModel(f, h, Ts, nu, nx, ny; p=p_plant); u=vu, x=vx, y=vy) res = sim!(estim, N, [0.5], plant=plant, y_noise=[0.5]) -plot(res, plotu=false, plotxwithx̂=true) -savefig("plot2_NonLinMPC.svg"); nothing # hide +p2 = plot(res, plotu=false, plotxwithx̂=true) +savefig("plot2_NonLinMPC.svg") # hide +display(p2) # hide ``` ![plot2_NonLinMPC](plot2_NonLinMPC.svg) @@ -132,8 +134,9 @@ The option `Cwt=Inf` disables the slack variable `ϵ` for constraint softening. using JuMP; unset_time_limit_sec(nmpc.optim) # hide ry = [180.0] res_ry = sim!(nmpc, N, ry, plant=plant, x_0=[0, 0], x̂_0=[0, 0, 0]) -plot(res_ry) -savefig("plot3_NonLinMPC.svg"); nothing # hide +p3 = plot(res_ry) +savefig("plot3_NonLinMPC.svg") # hide +display(p3) # hide ``` ![plot3_NonLinMPC](plot3_NonLinMPC.svg) @@ -144,8 +147,9 @@ satisfactory: ```@example man_nonlin res_yd = sim!(nmpc, N, ry, plant=plant, x_0=[π, 0], x̂_0=[π, 0, 0], y_step=[10]) -plot(res_yd) -savefig("plot4_NonLinMPC.svg"); nothing # hide +p4 = plot(res_yd) +savefig("plot4_NonLinMPC.svg") # hide +display(p4) # hide ``` ![plot4_NonLinMPC](plot4_NonLinMPC.svg) @@ -217,8 +221,9 @@ setpoint is similar: unset_time_limit_sec(empc.optim) # hide ry = [180.0, 0] res2_ry = sim!(empc, N, ry, plant=plant2, x_0=[0, 0], x̂_0=[0, 0, 0]) -plot(res2_ry, ploty=[1]) -savefig("plot5_NonLinMPC.svg"); nothing # hide +p5 = plot(res2_ry, ploty=[1]) +savefig("plot5_NonLinMPC.svg") # hide +display(p5) # hide ``` ![plot5_NonLinMPC](plot5_NonLinMPC.svg) @@ -237,8 +242,9 @@ Also, for a 10° step disturbance: ```@example man_nonlin res2_yd = sim!(empc, N, ry; plant=plant2, x_0=[π, 0], x̂_0=[π, 0, 0], y_step=[10, 0]) -plot(res2_yd, ploty=[1]) -savefig("plot6_NonLinMPC.svg"); nothing # hide +p6 = plot(res2_yd, ploty=[1]) +savefig("plot6_NonLinMPC.svg") # hide +display(p6) # hide ``` ![plot6_NonLinMPC](plot6_NonLinMPC.svg) @@ -324,8 +330,9 @@ function plotWithPower(res, Pmax) plot!(plt2, t, Pmax, label=raw"$P_\mathrm{max}$", linestyle=:dot, linewidth=1.5) return plot(plt1, plt2, layout=(2,1)) end -plotWithPower(res3_ry, Pmax) -savefig("plot7_NonLinMPC.svg"); nothing # hide +p7 = plotWithPower(res3_ry, Pmax) +savefig("plot7_NonLinMPC.svg") # hide +display(p7) # hide ``` ![plot7_NonLinMPC](plot7_NonLinMPC.svg) @@ -359,8 +366,9 @@ The linear controller satisfactorily rejects the 10° step disturbance: ```@example man_nonlin ry = [180.0] res_lin = sim!(mpc, N, ry; plant, x_0=[π, 0], y_step=[10]) -plot(res_lin) -savefig("plot9_NonLinMPC.svg"); nothing # hide +p9 = plot(res_lin) +savefig("plot9_NonLinMPC.svg") # hide +display(p9) # hide ``` ![plot9_NonLinMPC](plot9_NonLinMPC.svg) @@ -398,8 +406,9 @@ does slightly improve the rejection of the step disturbance: ```@example man_nonlin res_lin2 = sim!(mpc2, N, ry; plant, x_0=[π, 0], y_step=[10]) -plot(res_lin2) -savefig("plot10_NonLinMPC.svg"); nothing # hide +p10 = plot(res_lin2) +savefig("plot10_NonLinMPC.svg") # hide +display(p10) # hide ``` ![plot10_NonLinMPC](plot10_NonLinMPC.svg) @@ -418,8 +427,9 @@ results: ```@example man_nonlin res_ms = sim!(mpc_ms, N, ry; plant, x_0=[π, 0], y_step=[10]) -plot!(res_ms) -savefig("plot10b_NonLinMPC.svg"); nothing # hide +plot!(p10, res_ms) +savefig("plot10b_NonLinMPC.svg") # hide +display(p10) # hide ``` ![plot10b_NonLinMPC](plot10b_NonLinMPC.svg) @@ -490,8 +500,9 @@ operating point. The [`SimResult`](@ref) object is for plotting purposes only. T ```@example man_nonlin x_0 = [0, 0]; x̂_0 = [0, 0, 0]; res_slin = sim_adapt!(mpc3, model, N, ry, plant, x_0, x̂_0) -plot(res_slin) -savefig("plot12_NonLinMPC.svg"); nothing # hide +p12 = plot(res_slin) +savefig("plot12_NonLinMPC.svg") # hide +display(p12) # hide ``` ![plot12_NonLinMPC](plot12_NonLinMPC.svg) @@ -501,8 +512,9 @@ and the 10° step disturbance: ```@example man_nonlin x_0 = [π, 0]; x̂_0 = [π, 0, 0]; y_step = [10] res_slin = sim_adapt!(mpc3, model, N, ry, plant, x_0, x̂_0, y_step) -plot(res_slin) -savefig("plot13_NonLinMPC.svg"); nothing # hide +p13 = plot(res_slin) +savefig("plot13_NonLinMPC.svg") # hide +display(p13) # hide ``` ![plot13_NonLinMPC](plot13_NonLinMPC.svg) From 92f8ebb48d8f589031d7f584585c0be475d62361 Mon Sep 17 00:00:00 2001 From: franckgaga Date: Wed, 21 Oct 2026 10:18:06 -0400 Subject: [PATCH 4/9] doc: similar for pH tutorial --- docs/src/manual/nonlinmpc2.md | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/docs/src/manual/nonlinmpc2.md b/docs/src/manual/nonlinmpc2.md index a48e7d8e9..442833411 100644 --- a/docs/src/manual/nonlinmpc2.md +++ b/docs/src/manual/nonlinmpc2.md @@ -240,8 +240,9 @@ We can now plot the result: ```@example 1 using Plots -plot(res, plotu=true, plotd=true) -savefig("plot1_DAEpH.svg"); nothing # hide +p1 = plot(res, plotu=true, plotd=true) +savefig(p1, "plot1_DAEpH.svg") # hide +display(p1) # hide ``` ![plot1_DAEpH](plot1_DAEpH.svg) @@ -348,9 +349,9 @@ function simMHE(mhe, plant, N; x_0, x̂_0) end x̂_0 = [0.025, 0.025, c_Ain] res = simMHE(mhe, plant, N; x_0, x̂_0) -p = plot(res, plotd=false, plotu=false, plotxwithx̂=true, plotx̂min=false) -savefig(p, "plot2_DAEpH.svg"); nothing # hide -display(p) # hide +p2 = plot(res, plotd=false, plotu=false, plotxwithx̂=true, plotx̂min=false) +savefig(p2, "plot2_DAEpH.svg") # hide +display(p2) # hide ``` ![plot2_DAEpH](plot2_DAEpH.svg) @@ -424,12 +425,12 @@ function simNMPC(nmpc, plant, N, ry; x_0, x̂_0, noise=false) end N2, ry = 61, [7.0] using Logging # hide -res2 = with_logger(ConsoleLogger(stderr, Error)) do # hide -res2 = simNMPC(nmpc, plant, N2, ry; x_0=[0.07, 0.04], x̂_0) +res = with_logger(ConsoleLogger(stderr, Error)) do # hide +res = simNMPC(nmpc, plant, N2, ry; x_0=[0.07, 0.04], x̂_0) end # hide -p = plot(res2, plotd=false, plotxwithx̂=true, plotx̂min=false, plotŷ=true) -savefig(p, "plot3_DAEpH.svg"); nothing # hide -display(p) # hide +p3 = plot(res, plotd=false, plotxwithx̂=true, plotx̂min=false, plotŷ=true) +savefig(p3, "plot3_DAEpH.svg") # hide +display(p3) # hide ``` ![plot3_DAEpH](plot3_DAEpH.svg) @@ -440,12 +441,12 @@ measurement noise, the pH constraints are occasionally violated briefly, but the law responds quickly and returns the effluent pH to the specified range: ```@example 1 -res3 = with_logger(ConsoleLogger(stderr, Error)) do # hide -res3 = simNMPC(nmpc, plant, N2, ry; x_0=[0.07, 0.04], x̂_0, noise=true) +res = with_logger(ConsoleLogger(stderr, Error)) do # hide +res = simNMPC(nmpc, plant, N2, ry; x_0=[0.07, 0.04], x̂_0, noise=true) end # hide -p = plot(res3, plotd=false, plotxwithx̂=true, plotx̂min=false, plotŷ=true) -savefig(p, "plot4_DAEpH.svg"); nothing # hide -display(p) # hide +p4 = plot(res, plotd=false, plotxwithx̂=true, plotx̂min=false, plotŷ=true) +savefig(p4, "plot4_DAEpH.svg") # hide +display(p4) # hide ``` ![plot4_DAEpH](plot4_DAEpH.svg) From 771c585d1b4f13ef075bb5a924fd860c9b091a51 Mon Sep 17 00:00:00 2001 From: franckgaga Date: Wed, 21 Oct 2026 12:00:23 -0400 Subject: [PATCH 5/9] doc: similar for MTK tutorial --- docs/src/manual/mtk.md | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/docs/src/manual/mtk.md b/docs/src/manual/mtk.md index 1f942cf2a..6e51fbe84 100644 --- a/docs/src/manual/mtk.md +++ b/docs/src/manual/mtk.md @@ -4,11 +4,6 @@ Pages = ["mtk.md"] ``` -```@setup 1 -using Logging; errlogger = ConsoleLogger(stderr, Error); -old_logger = global_logger(); global_logger(errlogger); -``` - ## Pendulum Model This example integrates the simple pendulum model of the [penultimate section](@ref man_nonlin) @@ -150,9 +145,13 @@ The 180° setpoint response is identical: using Plots N = 35 using JuMP; unset_time_limit_sec(nmpc.optim) # hide +using Logging # hide +res_ry = with_logger(ConsoleLogger(stderr, Error)) do # hide res_ry = sim!(nmpc, N, [180.0], plant=plant, x_0=[0, 0], x̂_0=[0, 0, 0]) -plot(res_ry) -savefig("plot1_MTK.svg"); nothing # hide +end # +p1 = plot(res_ry) +savefig("plot1_MTK.svg") # hide +display(p1) # hide ``` ![plot1_MTK](plot1_MTK.svg) @@ -160,9 +159,12 @@ savefig("plot1_MTK.svg"); nothing # hide and also the output disturbance rejection: ```@example 1 +res_yd = with_logger(ConsoleLogger(stderr, Error)) do # hide res_yd = sim!(nmpc, N, [180.0], plant=plant, x_0=[0, π], x̂_0=[0, π, 0], y_step=[10]) -plot(res_yd) -savefig("plot2_MTK.svg"); nothing # hide +end # hide +p2 = plot(res_yd) +savefig("plot2_MTK.svg") # hide +display(p2) # hide ``` ![plot2_MTK](plot2_MTK.svg) @@ -170,7 +172,3 @@ savefig("plot2_MTK.svg"); nothing # hide ## Acknowledgement Authored by `1-Bart-1` and `baggepinnen`, thanks for the contribution. - -```@setup 1 -global_logger(old_logger); -``` From e36137fe7b4fc5e32cf7990a7072fb8d785dd82b Mon Sep 17 00:00:00 2001 From: franckgaga Date: Wed, 21 Oct 2026 12:20:23 -0400 Subject: [PATCH 6/9] doc: removed useless plot number in var name --- docs/src/manual/mtk.md | 12 +++--- docs/src/manual/nonlinmpc1.md | 72 +++++++++++++++++------------------ docs/src/manual/nonlinmpc2.md | 24 ++++++------ 3 files changed, 54 insertions(+), 54 deletions(-) diff --git a/docs/src/manual/mtk.md b/docs/src/manual/mtk.md index 6e51fbe84..4508a65b6 100644 --- a/docs/src/manual/mtk.md +++ b/docs/src/manual/mtk.md @@ -149,9 +149,9 @@ using Logging # hide res_ry = with_logger(ConsoleLogger(stderr, Error)) do # hide res_ry = sim!(nmpc, N, [180.0], plant=plant, x_0=[0, 0], x̂_0=[0, 0, 0]) end # -p1 = plot(res_ry) -savefig("plot1_MTK.svg") # hide -display(p1) # hide +p = plot(res_ry) +savefig(p, "plot1_MTK.svg") # hide +display(p) # hide ``` ![plot1_MTK](plot1_MTK.svg) @@ -162,9 +162,9 @@ and also the output disturbance rejection: res_yd = with_logger(ConsoleLogger(stderr, Error)) do # hide res_yd = sim!(nmpc, N, [180.0], plant=plant, x_0=[0, π], x̂_0=[0, π, 0], y_step=[10]) end # hide -p2 = plot(res_yd) -savefig("plot2_MTK.svg") # hide -display(p2) # hide +p = plot(res_yd) +savefig(p, "plot2_MTK.svg") # hide +display(p) # hide ``` ![plot2_MTK](plot2_MTK.svg) diff --git a/docs/src/manual/nonlinmpc1.md b/docs/src/manual/nonlinmpc1.md index dde5a181b..1db045a24 100644 --- a/docs/src/manual/nonlinmpc1.md +++ b/docs/src/manual/nonlinmpc1.md @@ -73,9 +73,9 @@ using Plots u = [0.5] N = 35 res = sim!(model, N, u) -p1 = plot(res, plotu=false) -savefig("plot1_NonLinMPC.svg") # hide -display(p1) # hide +p = plot(res, plotu=false) +savefig(p, "plot1_NonLinMPC.svg") # hide +display(p) # hide ``` ![plot1_NonLinMPC](plot1_NonLinMPC.svg) @@ -105,9 +105,9 @@ p_plant = copy(p_model) p_plant[3] = 1.25*p_model[3] plant = setname!(NonLinModel(f, h, Ts, nu, nx, ny; p=p_plant); u=vu, x=vx, y=vy) res = sim!(estim, N, [0.5], plant=plant, y_noise=[0.5]) -p2 = plot(res, plotu=false, plotxwithx̂=true) -savefig("plot2_NonLinMPC.svg") # hide -display(p2) # hide +p = plot(res, plotu=false, plotxwithx̂=true) +savefig(p, "plot2_NonLinMPC.svg") # hide +display(p) # hide ``` ![plot2_NonLinMPC](plot2_NonLinMPC.svg) @@ -134,9 +134,9 @@ The option `Cwt=Inf` disables the slack variable `ϵ` for constraint softening. using JuMP; unset_time_limit_sec(nmpc.optim) # hide ry = [180.0] res_ry = sim!(nmpc, N, ry, plant=plant, x_0=[0, 0], x̂_0=[0, 0, 0]) -p3 = plot(res_ry) -savefig("plot3_NonLinMPC.svg") # hide -display(p3) # hide +p = plot(res_ry) +savefig(p, "plot3_NonLinMPC.svg") # hide +display(p) # hide ``` ![plot3_NonLinMPC](plot3_NonLinMPC.svg) @@ -147,9 +147,9 @@ satisfactory: ```@example man_nonlin res_yd = sim!(nmpc, N, ry, plant=plant, x_0=[π, 0], x̂_0=[π, 0, 0], y_step=[10]) -p4 = plot(res_yd) -savefig("plot4_NonLinMPC.svg") # hide -display(p4) # hide +p = plot(res_yd) +savefig(p, "plot4_NonLinMPC.svg") # hide +display(p) # hide ``` ![plot4_NonLinMPC](plot4_NonLinMPC.svg) @@ -221,9 +221,9 @@ setpoint is similar: unset_time_limit_sec(empc.optim) # hide ry = [180.0, 0] res2_ry = sim!(empc, N, ry, plant=plant2, x_0=[0, 0], x̂_0=[0, 0, 0]) -p5 = plot(res2_ry, ploty=[1]) -savefig("plot5_NonLinMPC.svg") # hide -display(p5) # hide +p = plot(res2_ry, ploty=[1]) +savefig(p, "plot5_NonLinMPC.svg") # hide +display(p) # hide ``` ![plot5_NonLinMPC](plot5_NonLinMPC.svg) @@ -242,9 +242,9 @@ Also, for a 10° step disturbance: ```@example man_nonlin res2_yd = sim!(empc, N, ry; plant=plant2, x_0=[π, 0], x̂_0=[π, 0, 0], y_step=[10, 0]) -p6 = plot(res2_yd, ploty=[1]) -savefig("plot6_NonLinMPC.svg") # hide -display(p6) # hide +p = plot(res2_yd, ploty=[1]) +savefig(p, "plot6_NonLinMPC.svg") # hide +display(p) # hide ``` ![plot6_NonLinMPC](plot6_NonLinMPC.svg) @@ -330,9 +330,9 @@ function plotWithPower(res, Pmax) plot!(plt2, t, Pmax, label=raw"$P_\mathrm{max}$", linestyle=:dot, linewidth=1.5) return plot(plt1, plt2, layout=(2,1)) end -p7 = plotWithPower(res3_ry, Pmax) -savefig("plot7_NonLinMPC.svg") # hide -display(p7) # hide +p = plotWithPower(res3_ry, Pmax) +savefig(p, "plot7_NonLinMPC.svg") # hide +display(p) # hide ``` ![plot7_NonLinMPC](plot7_NonLinMPC.svg) @@ -366,9 +366,9 @@ The linear controller satisfactorily rejects the 10° step disturbance: ```@example man_nonlin ry = [180.0] res_lin = sim!(mpc, N, ry; plant, x_0=[π, 0], y_step=[10]) -p9 = plot(res_lin) -savefig("plot9_NonLinMPC.svg") # hide -display(p9) # hide +p = plot(res_lin) +savefig(p, "plot9_NonLinMPC.svg") # hide +display(p) # hide ``` ![plot9_NonLinMPC](plot9_NonLinMPC.svg) @@ -406,9 +406,9 @@ does slightly improve the rejection of the step disturbance: ```@example man_nonlin res_lin2 = sim!(mpc2, N, ry; plant, x_0=[π, 0], y_step=[10]) -p10 = plot(res_lin2) -savefig("plot10_NonLinMPC.svg") # hide -display(p10) # hide +p = plot(res_lin2) +savefig(p, "plot10_NonLinMPC.svg") # hide +display(p) # hide ``` ![plot10_NonLinMPC](plot10_NonLinMPC.svg) @@ -427,9 +427,9 @@ results: ```@example man_nonlin res_ms = sim!(mpc_ms, N, ry; plant, x_0=[π, 0], y_step=[10]) -plot!(p10, res_ms) -savefig("plot10b_NonLinMPC.svg") # hide -display(p10) # hide +plot!(p, res_ms) +savefig(p, "plot10b_NonLinMPC.svg") # hide +display(p) # hide ``` ![plot10b_NonLinMPC](plot10b_NonLinMPC.svg) @@ -500,9 +500,9 @@ operating point. The [`SimResult`](@ref) object is for plotting purposes only. T ```@example man_nonlin x_0 = [0, 0]; x̂_0 = [0, 0, 0]; res_slin = sim_adapt!(mpc3, model, N, ry, plant, x_0, x̂_0) -p12 = plot(res_slin) -savefig("plot12_NonLinMPC.svg") # hide -display(p12) # hide +p = plot(res_slin) +savefig(p, "plot12_NonLinMPC.svg") # hide +display(p) # hide ``` ![plot12_NonLinMPC](plot12_NonLinMPC.svg) @@ -512,9 +512,9 @@ and the 10° step disturbance: ```@example man_nonlin x_0 = [π, 0]; x̂_0 = [π, 0, 0]; y_step = [10] res_slin = sim_adapt!(mpc3, model, N, ry, plant, x_0, x̂_0, y_step) -p13 = plot(res_slin) -savefig("plot13_NonLinMPC.svg") # hide -display(p13) # hide +p = plot(res_slin) +savefig(p, "plot13_NonLinMPC.svg") # hide +display(p) # hide ``` ![plot13_NonLinMPC](plot13_NonLinMPC.svg) diff --git a/docs/src/manual/nonlinmpc2.md b/docs/src/manual/nonlinmpc2.md index 442833411..291278041 100644 --- a/docs/src/manual/nonlinmpc2.md +++ b/docs/src/manual/nonlinmpc2.md @@ -240,9 +240,9 @@ We can now plot the result: ```@example 1 using Plots -p1 = plot(res, plotu=true, plotd=true) -savefig(p1, "plot1_DAEpH.svg") # hide -display(p1) # hide +p = plot(res, plotu=true, plotd=true) +savefig(p, "plot1_DAEpH.svg") # hide +display(p) # hide ``` ![plot1_DAEpH](plot1_DAEpH.svg) @@ -349,9 +349,9 @@ function simMHE(mhe, plant, N; x_0, x̂_0) end x̂_0 = [0.025, 0.025, c_Ain] res = simMHE(mhe, plant, N; x_0, x̂_0) -p2 = plot(res, plotd=false, plotu=false, plotxwithx̂=true, plotx̂min=false) -savefig(p2, "plot2_DAEpH.svg") # hide -display(p2) # hide +p = plot(res, plotd=false, plotu=false, plotxwithx̂=true, plotx̂min=false) +savefig(p, "plot2_DAEpH.svg") # hide +display(p) # hide ``` ![plot2_DAEpH](plot2_DAEpH.svg) @@ -428,9 +428,9 @@ using Logging # hide res = with_logger(ConsoleLogger(stderr, Error)) do # hide res = simNMPC(nmpc, plant, N2, ry; x_0=[0.07, 0.04], x̂_0) end # hide -p3 = plot(res, plotd=false, plotxwithx̂=true, plotx̂min=false, plotŷ=true) -savefig(p3, "plot3_DAEpH.svg") # hide -display(p3) # hide +p = plot(res, plotd=false, plotxwithx̂=true, plotx̂min=false, plotŷ=true) +savefig(p, "plot3_DAEpH.svg") # hide +display(p) # hide ``` ![plot3_DAEpH](plot3_DAEpH.svg) @@ -444,9 +444,9 @@ law responds quickly and returns the effluent pH to the specified range: res = with_logger(ConsoleLogger(stderr, Error)) do # hide res = simNMPC(nmpc, plant, N2, ry; x_0=[0.07, 0.04], x̂_0, noise=true) end # hide -p4 = plot(res, plotd=false, plotxwithx̂=true, plotx̂min=false, plotŷ=true) -savefig(p4, "plot4_DAEpH.svg") # hide -display(p4) # hide +p = plot(res, plotd=false, plotxwithx̂=true, plotx̂min=false, plotŷ=true) +savefig(p, "plot4_DAEpH.svg") # hide +display(p) # hide ``` ![plot4_DAEpH](plot4_DAEpH.svg) From a88f803d2ceac1e0b23dfd80e92ea5db3e3882c5 Mon Sep 17 00:00:00 2001 From: franckgaga Date: Wed, 21 Oct 2026 12:20:57 -0400 Subject: [PATCH 7/9] bump --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 3157d3759..458c2d761 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "ModelPredictiveControl" uuid = "61f9bdb8-6ae4-484a-811f-bbf86720c31c" -version = "2.15.0" +version = "2.15.1" authors = ["Francis Gagnon"] [deps] From 0642cfe69eeb2eaf00935fb1e7de2e137593160d Mon Sep 17 00:00:00 2001 From: franckgaga Date: Wed, 21 Oct 2026 13:43:00 -0400 Subject: [PATCH 8/9] doc: adding `seed!` call when needed (hidden) It will help for reproducibility of the doc deployment. --- docs/src/manual/nonlinmpc1.md | 1 + docs/src/manual/nonlinmpc2.md | 2 ++ 2 files changed, 3 insertions(+) diff --git a/docs/src/manual/nonlinmpc1.md b/docs/src/manual/nonlinmpc1.md index 1db045a24..89c0bef5b 100644 --- a/docs/src/manual/nonlinmpc1.md +++ b/docs/src/manual/nonlinmpc1.md @@ -104,6 +104,7 @@ estimator tuning is tested on a plant with a 25 % larger friction coefficient `` p_plant = copy(p_model) p_plant[3] = 1.25*p_model[3] plant = setname!(NonLinModel(f, h, Ts, nu, nx, ny; p=p_plant); u=vu, x=vx, y=vy) +using Random; Random.seed!(2944) # hide res = sim!(estim, N, [0.5], plant=plant, y_noise=[0.5]) p = plot(res, plotu=false, plotxwithx̂=true) savefig(p, "plot2_NonLinMPC.svg") # hide diff --git a/docs/src/manual/nonlinmpc2.md b/docs/src/manual/nonlinmpc2.md index 291278041..0c6aca2ec 100644 --- a/docs/src/manual/nonlinmpc2.md +++ b/docs/src/manual/nonlinmpc2.md @@ -315,6 +315,7 @@ performs under pH and flow rate measurement noise: ```@example 1 using Random +Random.seed!(1123) # hide function simMHE(mhe, plant, N; x_0, x̂_0) ny, ny, nd, nx, nx̂ = plant.ny, plant.ny, plant.nd, plant.nx, mhe.nx̂ Y_data, U_data, D_data = zeros(ny, N), zeros(nu, N), zeros(nd, N) @@ -442,6 +443,7 @@ law responds quickly and returns the effluent pH to the specified range: ```@example 1 res = with_logger(ConsoleLogger(stderr, Error)) do # hide +Random.seed!(5367) # hide res = simNMPC(nmpc, plant, N2, ry; x_0=[0.07, 0.04], x̂_0, noise=true) end # hide p = plot(res, plotd=false, plotxwithx̂=true, plotx̂min=false, plotŷ=true) From 32e086c677271a84bbec4e0f134752c1f658d226 Mon Sep 17 00:00:00 2001 From: franckgaga Date: Wed, 21 Oct 2026 13:52:10 -0400 Subject: [PATCH 9/9] doc: similar but for the pH tutorial --- docs/src/manual/nonlinmpc2.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/manual/nonlinmpc2.md b/docs/src/manual/nonlinmpc2.md index 0c6aca2ec..413e8a8b8 100644 --- a/docs/src/manual/nonlinmpc2.md +++ b/docs/src/manual/nonlinmpc2.md @@ -443,7 +443,7 @@ law responds quickly and returns the effluent pH to the specified range: ```@example 1 res = with_logger(ConsoleLogger(stderr, Error)) do # hide -Random.seed!(5367) # hide +Random.seed!(5379) # hide res = simNMPC(nmpc, plant, N2, ry; x_0=[0.07, 0.04], x̂_0, noise=true) end # hide p = plot(res, plotd=false, plotxwithx̂=true, plotx̂min=false, plotŷ=true)