Skip to content

Commit

Permalink
build based on ffec864
Browse files Browse the repository at this point in the history
  • Loading branch information
Documenter.jl committed Oct 18, 2023
1 parent 00dde45 commit d94f17f
Show file tree
Hide file tree
Showing 22 changed files with 684 additions and 726 deletions.
2 changes: 1 addition & 1 deletion dev/.documenter-siteinfo.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"documenter":{"julia_version":"1.9.3","generation_timestamp":"2023-10-15T20:34:05","documenter_version":"1.1.1"}}
{"documenter":{"julia_version":"1.9.3","generation_timestamp":"2023-10-18T18:25:09","documenter_version":"1.1.1"}}
2 changes: 1 addition & 1 deletion dev/func_index/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dev/index.html

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions dev/internals/predictive_control/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dev/internals/sim_model/index.html

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions dev/internals/state_estim/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dev/manual/installation/index.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dev/manual/linmpc/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
2 manipulated inputs u
2 states x
2 outputs y
0 measured disturbances d</code></pre><p>The <code>model</code> object will be used for two purposes : to construct our controller, and as a plant simulator to test the design.</p><h2 id="Linear-Model-Predictive-Controller"><a class="docs-heading-anchor" href="#Linear-Model-Predictive-Controller">Linear Model Predictive Controller</a><a id="Linear-Model-Predictive-Controller-1"></a><a class="docs-heading-anchor-permalink" href="#Linear-Model-Predictive-Controller" title="Permalink"></a></h2><p>A linear model predictive controller (MPC) will control both the water level <span>$y_L$</span> and temperature <span>$y_T$</span> in the tank, at a sampling time of 2 s. The tank level should also never fall below 45:</p><p class="math-container">\[y_L ≥ 45\]</p><p>We design our <a href="../../public/predictive_control/#ModelPredictiveControl.LinMPC"><code>LinMPC</code></a> controllers by including the linear level constraint with <a href="../../public/predictive_control/#ModelPredictiveControl.setconstraint!"><code>setconstraint!</code></a> (<code>±Inf</code> values should be used when there is no bound):</p><pre><code class="language-julia hljs">mpc = LinMPC(model, Hp=15, Hc=2, Mwt=[1, 1], Nwt=[0.1, 0.1])
0 measured disturbances d</code></pre><p>The <code>model</code> object will be used for two purposes : to construct our controller, and as a plant simulator to test the design. Its sampling time is 2 s thus the control period will be 2 s as well.</p><h2 id="Linear-Model-Predictive-Controller"><a class="docs-heading-anchor" href="#Linear-Model-Predictive-Controller">Linear Model Predictive Controller</a><a id="Linear-Model-Predictive-Controller-1"></a><a class="docs-heading-anchor-permalink" href="#Linear-Model-Predictive-Controller" title="Permalink"></a></h2><p>A linear model predictive controller (MPC) will control both the water level <span>$y_L$</span> and temperature <span>$y_T$</span> in the tank. The tank level should also never fall below 45:</p><p class="math-container">\[y_L ≥ 45\]</p><p>We design our <a href="../../public/predictive_control/#ModelPredictiveControl.LinMPC"><code>LinMPC</code></a> controllers by including the linear level constraint with <a href="../../public/predictive_control/#ModelPredictiveControl.setconstraint!"><code>setconstraint!</code></a> (<code>±Inf</code> values should be used when there is no bound):</p><pre><code class="language-julia hljs">mpc = LinMPC(model, Hp=15, Hc=2, Mwt=[1, 1], Nwt=[0.1, 0.1])
mpc = setconstraint!(mpc, ymin=[45, -Inf])</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">LinMPC controller with a sample time Ts = 2.0 s, OSQP optimizer, SteadyKalmanFilter estimator and:
15 prediction steps Hp
2 control steps Hc
Expand Down Expand Up @@ -124,4 +124,4 @@
u, y, d = model.uop, model(), mpc_ff.estim.model.dop
initstate!(mpc_ff, u, y, d)
u_data, y_data, ry_data = test_mpc_ff(mpc_ff, model)
plot_data(t_data, u_data, y_data, ry_data)</code></pre><p><img src="../plot3_LinMPC.svg" alt="plot3_LinMPC"/></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/#ModelPredictiveControl.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 gives 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="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.1.1 on <span class="colophon-date" title="Sunday 15 October 2023 20:34">Sunday 15 October 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
plot_data(t_data, u_data, y_data, ry_data)</code></pre><p><img src="../plot3_LinMPC.svg" alt="plot3_LinMPC"/></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/#ModelPredictiveControl.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 gives 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="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.1.1 on <span class="colophon-date" title="Wednesday 18 October 2023 18:25">Wednesday 18 October 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
5 changes: 2 additions & 3 deletions dev/manual/nonlinmpc/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,5 @@
1 measured outputs ym (1 integrating states)
0 unmeasured outputs yu
0 measured disturbances d</code></pre><p>We test <code>mpc</code> performance on <code>plant</code> by imposing an angular setpoint of 180° (inverted position):</p><pre><code class="language-julia hljs">res = sim!(mpc, 60, [180.0], plant=plant, x0=zeros(plant.nx), x̂0=zeros(mpc.estim.nx̂))
plot(res)</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">┌ Warning: MPC termination status not OPTIMAL or LOCALLY_SOLVED (ALMOST_LOCALLY_SOLVED)
└ @ ModelPredictiveControl ~/work/ModelPredictiveControl.jl/ModelPredictiveControl.jl/src/predictive_control.jl:708</code></pre><p><img src="../plot3_NonLinMPC.svg" alt="plot3_NonLinMPC"/></p><p>The controller seems robust enough to variations on <span>$K$</span> coefficient. Starting from this inverted position, the closed-loop response to a step disturbances of 10° is also satisfactory:</p><pre><code class="language-julia hljs">res = sim!(mpc, 60, [180.0], plant=plant, x0=[π, 0], x̂0=[π, 0, 0], y_step=[10])
plot(res)</code></pre><p><img src="../plot4_NonLinMPC.svg" alt="plot4_NonLinMPC"/></p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../linmpc/">« Linear 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="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.1.1 on <span class="colophon-date" title="Sunday 15 October 2023 20:34">Sunday 15 October 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
plot(res)</code></pre><p><img src="../plot3_NonLinMPC.svg" alt="plot3_NonLinMPC"/></p><p>The controller seems robust enough to variations on <span>$K$</span> coefficient. Starting from this inverted position, the closed-loop response to a step disturbances of 10° is also satisfactory:</p><pre><code class="language-julia hljs">res = sim!(mpc, 60, [180.0], plant=plant, x0=[π, 0], x̂0=[π, 0, 0], y_step=[10])
plot(res)</code></pre><p><img src="../plot4_NonLinMPC.svg" alt="plot4_NonLinMPC"/></p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../linmpc/">« Linear 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="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.1.1 on <span class="colophon-date" title="Wednesday 18 October 2023 18:25">Wednesday 18 October 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
Loading

0 comments on commit d94f17f

Please sign in to comment.