Skip to content

Commit 2913c73

Browse files
author
Documenter.jl
committed
build based on 8daa441
1 parent 907416c commit 2913c73

35 files changed

+1528
-1525
lines changed

dev/.documenter-siteinfo.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"documenter":{"julia_version":"1.11.7","generation_timestamp":"2025-09-22T20:47:15","documenter_version":"1.14.1"}}
1+
{"documenter":{"julia_version":"1.11.7","generation_timestamp":"2025-09-23T20:57:56","documenter_version":"1.14.1"}}

dev/func_index/index.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

dev/index.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

dev/internals/predictive_control/index.html

Lines changed: 30 additions & 27 deletions
Large diffs are not rendered by default.

dev/internals/sim_model/index.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

dev/internals/state_estim/index.html

Lines changed: 23 additions & 23 deletions
Large diffs are not rendered by default.

dev/manual/installation/index.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

dev/manual/linmpc/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,4 +153,4 @@
153153
u, y, d = model.uop, model(), mpc_d.estim.model.dop
154154
initstate!(mpc_d, u, y, d)
155155
u_data, y_data, ry_data = test_mpc_d(mpc_d, model)
156-
plot_data(t_data, u_data, y_data, ry_data)</code></pre><p><img src="../plot4_LinMPC.svg" alt="plot4_LinMPC"/></p><p>Note that measured disturbances are assumed constant in the future by default but custom <span>$\mathbf{D̂}$</span> predictions are possible. The same applies for the setpoint predictions <span>$\mathbf{R̂_y}$</span>.</p><section class="footnotes is-size-7"><ul><li class="footnote" id="footnote-1"><a class="tag is-link" href="#citeref-1">1</a>As an alternative to state observer, we could have use an <a href="../../public/state_estim/#InternalModel"><code>InternalModel</code></a> structure with <code>mpc = LinMPC(InternalModel(model), Hp=15, Hc=2, Mwt=[1, 1], Nwt=[0.1, 0.1])</code>. It was tested on the example of this page and it gave similar results.</li></ul></section></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../installation/">« Installation</a><a class="docs-footer-nextpage" href="../nonlinmpc/">Nonlinear Design »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.14.1 on <span class="colophon-date" title="Monday 22 September 2025 20:47">Monday 22 September 2025</span>. Using Julia version 1.11.7.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
156+
plot_data(t_data, u_data, y_data, ry_data)</code></pre><p><img src="../plot4_LinMPC.svg" alt="plot4_LinMPC"/></p><p>Note that measured disturbances are assumed constant in the future by default but custom <span>$\mathbf{D̂}$</span> predictions are possible. The same applies for the setpoint predictions <span>$\mathbf{R̂_y}$</span>.</p><section class="footnotes is-size-7"><ul><li class="footnote" id="footnote-1"><a class="tag is-link" href="#citeref-1">1</a>As an alternative to state observer, we could have use an <a href="../../public/state_estim/#InternalModel"><code>InternalModel</code></a> structure with <code>mpc = LinMPC(InternalModel(model), Hp=15, Hc=2, Mwt=[1, 1], Nwt=[0.1, 0.1])</code>. It was tested on the example of this page and it gave similar results.</li></ul></section></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../installation/">« Installation</a><a class="docs-footer-nextpage" href="../nonlinmpc/">Nonlinear Design »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.14.1 on <span class="colophon-date" title="Tuesday 23 September 2025 20:57">Tuesday 23 September 2025</span>. Using Julia version 1.11.7.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>

dev/manual/mtk/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,4 +118,4 @@
118118
N = 35
119119
res_ry = sim!(nmpc, N, [180.0], plant=plant, x_0=[0, 0], x̂_0=[0, 0, 0])
120120
plot(res_ry)</code></pre><p><img src="../plot1_MTK.svg" alt="plot1_MTK"/></p><p>and also the output disturbance rejection:</p><pre><code class="language-julia hljs">res_yd = sim!(nmpc, N, [180.0], plant=plant, x_0=[0, π], x̂_0=[0, π, 0], y_step=[10])
121-
plot(res_yd)</code></pre><p><img src="../plot2_MTK.svg" alt="plot2_MTK"/></p><h2 id="Acknowledgement"><a class="docs-heading-anchor" href="#Acknowledgement">Acknowledgement</a><a id="Acknowledgement-1"></a><a class="docs-heading-anchor-permalink" href="#Acknowledgement" title="Permalink"></a></h2><p>Authored by <code>1-Bart-1</code> and <code>baggepinnen</code>, thanks for the contribution.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../nonlinmpc/">« Nonlinear Design</a><a class="docs-footer-nextpage" href="../../public/sim_model/">Plant Models »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.14.1 on <span class="colophon-date" title="Monday 22 September 2025 20:47">Monday 22 September 2025</span>. Using Julia version 1.11.7.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
121+
plot(res_yd)</code></pre><p><img src="../plot2_MTK.svg" alt="plot2_MTK"/></p><h2 id="Acknowledgement"><a class="docs-heading-anchor" href="#Acknowledgement">Acknowledgement</a><a id="Acknowledgement-1"></a><a class="docs-heading-anchor-permalink" href="#Acknowledgement" title="Permalink"></a></h2><p>Authored by <code>1-Bart-1</code> and <code>baggepinnen</code>, thanks for the contribution.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../nonlinmpc/">« Nonlinear Design</a><a class="docs-footer-nextpage" href="../../public/sim_model/">Plant Models »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.14.1 on <span class="colophon-date" title="Tuesday 23 September 2025 20:57">Tuesday 23 September 2025</span>. Using Julia version 1.11.7.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>

dev/manual/nonlinmpc/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@
140140
plot!(plt2, t, Pmax, label=raw&quot;$P_\mathrm{max}$&quot;, linestyle=:dot, linewidth=1.5)
141141
return plot(plt1, plt2, layout=(2,1))
142142
end
143-
plotWithPower(res3_ry, Pmax)</code></pre><p><img src="../plot7_NonLinMPC.svg" alt="plot7_NonLinMPC"/></p><p>The controller is able to find a solution that does not violate the torque and power constraints.</p><h2 id="Model-Linearization"><a class="docs-heading-anchor" href="#Model-Linearization">Model Linearization</a><a id="Model-Linearization-1"></a><a class="docs-heading-anchor-permalink" href="#Model-Linearization" title="Permalink"></a></h2><p>Nonlinear MPC is more computationally expensive than <a href="../../public/predictive_control/#LinMPC"><code>LinMPC</code></a>. Solving the problem should always be faster than the sampling time <span>$T_s = 0.1$</span> s for real-time operation. This requirement is sometimes hard to meet on electronics or mechanical systems because of the fast dynamics. To ease the design and comparison with <a href="../../public/predictive_control/#LinMPC"><code>LinMPC</code></a>, the <a href="../../public/sim_model/#ModelPredictiveControl.linearize"><code>linearize</code></a> function allows automatic linearization of <a href="../../public/sim_model/#NonLinModel"><code>NonLinModel</code></a> based on <a href="https://juliadiff.org/ForwardDiff.jl/stable/#ForwardDiff"><code>ForwardDiff</code></a>. We first linearize <code>model</code> at the point <span>$θ = π$</span> rad and <span>$ω = τ = 0$</span> (inverted position):</p><pre><code class="language-julia hljs">linmodel = linearize(model, x=[π, 0], u=[0])</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">LinModel with a sample time Ts = 0.1 s:
143+
plotWithPower(res3_ry, Pmax)</code></pre><p><img src="../plot7_NonLinMPC.svg" alt="plot7_NonLinMPC"/></p><p>The controller is able to find a solution that does not violate the torque and power constraints.</p><h2 id="Model-Linearization"><a class="docs-heading-anchor" href="#Model-Linearization">Model Linearization</a><a id="Model-Linearization-1"></a><a class="docs-heading-anchor-permalink" href="#Model-Linearization" title="Permalink"></a></h2><p>Nonlinear MPC is more computationally expensive than <a href="../../public/predictive_control/#LinMPC"><code>LinMPC</code></a>. Solving the problem should always be faster than the sampling time <span>$T_s = 0.1$</span> s for real-time operation. This requirement is sometimes hard to meet on electronics or mechanical systems because of the fast dynamics. To ease the design and comparison with <a href="../../public/predictive_control/#LinMPC"><code>LinMPC</code></a>, the <a href="../../public/sim_model/#ModelPredictiveControl.linearize"><code>linearize</code></a> function allows automatic linearization of <a href="../../public/sim_model/#NonLinModel"><code>NonLinModel</code></a> defaulting to <a href="https://juliadiff.org/ForwardDiff.jl/stable/#ForwardDiff"><code>ForwardDiff</code></a>. We first linearize <code>model</code> at the point <span>$θ = π$</span> rad and <span>$ω = τ = 0$</span> (inverted position):</p><pre><code class="language-julia hljs">linmodel = linearize(model, x=[π, 0], u=[0])</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">LinModel with a sample time Ts = 0.1 s:
144144
└ dimensions:
145145
├ 1 manipulated inputs u
146146
├ 2 states x
@@ -233,4 +233,4 @@
233233
res_slin = sim_adapt!(mpc3, model, N, ry, plant, x_0, x̂_0)
234234
plot(res_slin)</code></pre><p><img src="../plot12_NonLinMPC.svg" alt="plot12_NonLinMPC"/></p><p>and the 10° step disturbance:</p><pre><code class="language-julia hljs">x_0 = [π, 0]; x̂_0 = [π, 0, 0]; y_step = [10]
235235
res_slin = sim_adapt!(mpc3, model, N, ry, plant, x_0, x̂_0, y_step)
236-
plot(res_slin)</code></pre><p><img src="../plot13_NonLinMPC.svg" alt="plot13_NonLinMPC"/></p><p>The computations of the successive linearization MPC are about 75 times faster than the nonlinear MPC on average, an impressive gain for similar closed-loop performances!</p><section class="footnotes is-size-7"><ul><li class="footnote" id="footnote-1"><a class="tag is-link" href="#citeref-1">1</a>Arnström, D., Bemporad, A., and Axehill, D. (2022). A dual active-set solver for embedded quadratic programming using recursive LDLᵀ updates. IEEE Trans. Autom. Contr., 67(8). <a href="https://doi.org/doi:10.1109/TAC.2022.3176430">https://doi.org/doi:10.1109/TAC.2022.3176430</a>.</li></ul></section></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../linmpc/">« Linear Design</a><a class="docs-footer-nextpage" href="../mtk/">ModelingToolkit »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.14.1 on <span class="colophon-date" title="Monday 22 September 2025 20:47">Monday 22 September 2025</span>. Using Julia version 1.11.7.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
236+
plot(res_slin)</code></pre><p><img src="../plot13_NonLinMPC.svg" alt="plot13_NonLinMPC"/></p><p>The computations of the successive linearization MPC are about 75 times faster than the nonlinear MPC on average, an impressive gain for similar closed-loop performances!</p><section class="footnotes is-size-7"><ul><li class="footnote" id="footnote-1"><a class="tag is-link" href="#citeref-1">1</a>Arnström, D., Bemporad, A., and Axehill, D. (2022). A dual active-set solver for embedded quadratic programming using recursive LDLᵀ updates. IEEE Trans. Autom. Contr., 67(8). <a href="https://doi.org/doi:10.1109/TAC.2022.3176430">https://doi.org/doi:10.1109/TAC.2022.3176430</a>.</li></ul></section></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../linmpc/">« Linear Design</a><a class="docs-footer-nextpage" href="../mtk/">ModelingToolkit »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.14.1 on <span class="colophon-date" title="Tuesday 23 September 2025 20:57">Tuesday 23 September 2025</span>. Using Julia version 1.11.7.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>

0 commit comments

Comments
 (0)