Skip to content

Commit

Permalink
build based on 9ed7210
Browse files Browse the repository at this point in the history
  • Loading branch information
Documenter.jl committed Sep 6, 2024
1 parent d55c5f0 commit 665d63e
Show file tree
Hide file tree
Showing 14 changed files with 499 additions and 499 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.10.5","generation_timestamp":"2024-09-03T07:35:26","documenter_version":"1.6.0"}}
{"documenter":{"julia_version":"1.10.5","generation_timestamp":"2024-09-06T15:13:16","documenter_version":"1.7.0"}}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions dev/application-surface-revolution.html
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
plot!(plt_u; xlabel="t", ylabel="u(t,p₀)", legend=false, ylims=(-2.5, 5))
plot!(plt_phase; xlabel="x(t,p₀)", ylabel="p(t,p₀)", legend=false, xlims=(0, 2), ylims=(-1, 2))

plot(plt_x, plt_p, plt_u, plt_phase; layout=(2, 2), size=(800, 600))</code></pre><img src="application-surface-revolution-4c8f8e95.svg" alt="Example block output"/><p>Here, the shooting equation given by </p><p class="math-container">\[ S({p₀}) = \pi(z(t_f,x_0,{p₀})) - x_f = 0,\]</p><p>with <span>$\pi(x, p) = x$</span>, has two solutions: <span>$p₀ = -0.9851$</span> and <span>$p₀ = 0.5126$</span>.</p><pre><code class="language-julia hljs">π((x, p)) = x
plot(plt_x, plt_p, plt_u, plt_phase; layout=(2, 2), size=(800, 600))</code></pre><img src="application-surface-revolution-76b50bed.svg" alt="Example block output"/><p>Here, the shooting equation given by </p><p class="math-container">\[ S({p₀}) = \pi(z(t_f,x_0,{p₀})) - x_f = 0,\]</p><p>with <span>$\pi(x, p) = x$</span>, has two solutions: <span>$p₀ = -0.9851$</span> and <span>$p₀ = 0.5126$</span>.</p><pre><code class="language-julia hljs">π((x, p)) = x

# Shooting function
S(p0) = (π ∘ ocp_flow)(t0, x0, p0, tf) - xf
Expand Down Expand Up @@ -169,7 +169,7 @@
plot!(plt2_u; xlabel=&quot;t&quot;, ylabel=&quot;u(t,p₀)&quot;, legend=false, ylims=(-6, 5))
plot!(plt2_phase; xlabel=&quot;x(t,p₀)&quot;, ylabel=&quot;p(t,p₀)&quot;, legend=false, xlims=(0, 2.5), ylims=(-1, 5))

plot(plt2_x, plt2_p, plt2_u, plt2_phase; layout=(2, 2), size=(800, 600))</code></pre><img src="application-surface-revolution-8ad7c1f4.svg" alt="Example block output"/><p>Now, we can compute the conjugate points along the two extremals. We have to compute the flow <span>$\delta z(t, p₀)$</span> of the Jacobi equation with the initial condition <span>$\delta z(0) = (0, 1)$</span>. This is given solving</p><p class="math-container">\[ \delta z(t, p₀) = \dfrac{\partial}{\partial p₀}z(t, p₀).\]</p><p>Note that to compute the conjugate points, we only need the first component:</p><p class="math-container">\[ \delta z(t, p₀)_1.\]</p><pre><code class="language-julia hljs">using ForwardDiff
plot(plt2_x, plt2_p, plt2_u, plt2_phase; layout=(2, 2), size=(800, 600))</code></pre><img src="application-surface-revolution-f7c1f6a8.svg" alt="Example block output"/><p>Now, we can compute the conjugate points along the two extremals. We have to compute the flow <span>$\delta z(t, p₀)$</span> of the Jacobi equation with the initial condition <span>$\delta z(0) = (0, 1)$</span>. This is given solving</p><p class="math-container">\[ \delta z(t, p₀) = \dfrac{\partial}{\partial p₀}z(t, p₀).\]</p><p>Note that to compute the conjugate points, we only need the first component:</p><p class="math-container">\[ \delta z(t, p₀)_1.\]</p><pre><code class="language-julia hljs">using ForwardDiff

function jacobi_flow(t, p0)
x(t, p0) = (π ∘ ocp_flow)(t0, x0, p0, t)
Expand Down Expand Up @@ -198,11 +198,11 @@

#
plt_conj = plot(plt_conj1, plt_conj2;
layout=(1, 2), size=(800, 300), leftmargin=25px, bottommargin=15px)</code></pre><img src="application-surface-revolution-81eb31f1.svg" alt="Example block output"/><p>We compute the first conjugate point along the first extremal and add it to the plot.</p><pre><code class="language-julia hljs">tau0 = Roots.find_zero(tau -&gt; jacobi_flow(tau, sol1_p0), (0.4, 0.6))
layout=(1, 2), size=(800, 300), leftmargin=25px, bottommargin=15px)</code></pre><img src="application-surface-revolution-ac4764e9.svg" alt="Example block output"/><p>We compute the first conjugate point along the first extremal and add it to the plot.</p><pre><code class="language-julia hljs">tau0 = Roots.find_zero(tau -&gt; jacobi_flow(tau, sol1_p0), (0.4, 0.6))

println(&quot;For p0 = &quot;, sol1_p0, &quot; tau_0 = &quot;, tau0)

plot!(plt_conj[1], [tau0], [jacobi_flow(tau0, sol1_p0)]; seriestype=:scatter)</code></pre><img src="application-surface-revolution-62741d8d.svg" alt="Example block output"/><p>To conclude on this example, we compute the conjugate locus by using a path following algorithm. Define <span>$F(\tau,p₀) = \delta x(\tau,p₀)$</span> and suppose that the partial derivative <span>$\partial_\tau F(\tau,p₀)$</span> is invertible, then, by the implicit function theorem the conjugate time is a function of <span>$p₀$</span>. So, since here <span>$p₀\in\R$</span>, we can compute them by solving the initial value problem for <span>$p₀ \in [\alpha, \beta]$</span>:</p><p class="math-container">\[ \dot{\tau}(p₀) = -\dfrac{\partial F}{\partial \tau}(\tau(p₀),p₀)^{-1}\,
plot!(plt_conj[1], [tau0], [jacobi_flow(tau0, sol1_p0)]; seriestype=:scatter)</code></pre><img src="application-surface-revolution-2e3f5803.svg" alt="Example block output"/><p>To conclude on this example, we compute the conjugate locus by using a path following algorithm. Define <span>$F(\tau,p₀) = \delta x(\tau,p₀)$</span> and suppose that the partial derivative <span>$\partial_\tau F(\tau,p₀)$</span> is invertible, then, by the implicit function theorem the conjugate time is a function of <span>$p₀$</span>. So, since here <span>$p₀\in\R$</span>, we can compute them by solving the initial value problem for <span>$p₀ \in [\alpha, \beta]$</span>:</p><p class="math-container">\[ \dot{\tau}(p₀) = -\dfrac{\partial F}{\partial \tau}(\tau(p₀),p₀)^{-1}\,
\dfrac{\partial F}{\partial p₀}(\tau(p₀),p₀), \quad
\tau(\alpha) = \tau_0.\]</p><p>For the numerical experiment, we set <span>$\alpha = -0.9995$</span>, <span>$\beta = -0.5$</span>.</p><pre><code class="language-julia hljs">function conjugate_times_rhs_path(tau, p0)
dF = ForwardDiff.gradient(y -&gt; jacobi_flow(y...), [tau, p0])
Expand Down Expand Up @@ -236,4 +236,4 @@

#
plot(plt_x, plt_conj_times;
layout=(1,2), legend=false, size=(800,300), leftmargin=25px, bottommargin=15px)</code></pre><img src="application-surface-revolution-4c54583c.svg" alt="Example block output"/><section class="footnotes is-size-7"><ul><li class="footnote" id="footnote-1"><a class="tag is-link" href="#citeref-1">1</a>H. Schättler &amp; U. Ledzewicz, <em>Geometric optimal control: theory, methods and examples</em>, vol~<strong>38</strong> of <em>Interdisciplinary applied mathematics</em>, Springer Science &amp; Business Media, New York (2012), xiv+640.</li><li class="footnote" id="footnote-2"><a class="tag is-link" href="#citeref-2">2</a>D. Liberzon, <em>Calculus ov Variations and Optimal Control Theory</em>, Princeton University Press (2012).</li></ul></section></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="index.html">« Introduction</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.6.0 on <span class="colophon-date" title="Tuesday 3 September 2024 07:35">Tuesday 3 September 2024</span>. Using Julia version 1.10.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
layout=(1,2), legend=false, size=(800,300), leftmargin=25px, bottommargin=15px)</code></pre><img src="application-surface-revolution-36c4d774.svg" alt="Example block output"/><section class="footnotes is-size-7"><ul><li class="footnote" id="footnote-1"><a class="tag is-link" href="#citeref-1">1</a>H. Schättler &amp; U. Ledzewicz, <em>Geometric optimal control: theory, methods and examples</em>, vol~<strong>38</strong> of <em>Interdisciplinary applied mathematics</em>, Springer Science &amp; Business Media, New York (2012), xiv+640.</li><li class="footnote" id="footnote-2"><a class="tag is-link" href="#citeref-2">2</a>D. Liberzon, <em>Calculus ov Variations and Optimal Control Theory</em>, Princeton University Press (2012).</li></ul></section></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="index.html">« Introduction</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.7.0 on <span class="colophon-date" title="Friday 6 September 2024 15:13">Friday 6 September 2024</span>. Using Julia version 1.10.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
2 changes: 1 addition & 1 deletion dev/assets/themes/catppuccin-frappe.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dev/assets/themes/catppuccin-latte.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dev/assets/themes/catppuccin-macchiato.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dev/assets/themes/catppuccin-mocha.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dev/assets/themes/documenter-dark.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dev/assets/themes/documenter-light.css

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dev/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
\right. \]</p><p>with a slight abuse of notations since from the optimal control point of view, the cost depends generally on the state <span>$x$</span> and the control <span>$u$</span>.</p><p>You may find an example of such a problem <a href="application-surface-revolution.html#catenoid">here</a>.</p><h2 id="Dependencies"><a class="docs-heading-anchor" href="#Dependencies">Dependencies</a><a id="Dependencies-1"></a><a class="docs-heading-anchor-permalink" href="#Dependencies" title="Permalink"></a></h2><p>All the numerical simulations to generate this documentation are performed with the following packages.</p><pre><code class="language-julia hljs">using Pkg
Pkg.status()</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">Status `~/work/calculus_of_variations/calculus_of_variations/docs/Project.toml`
[33922b39] CalculusOfVariations v0.1.3 `~/work/calculus_of_variations/calculus_of_variations`
[e30172f5] Documenter v1.6.0
[e30172f5] Documenter v1.7.0
[f6369f11] ForwardDiff v0.10.36
[5f98b655] OptimalControl v0.12.2
[1dea7af3] OrdinaryDiffEq v6.89.0
[91a5bcdd] Plots v1.40.8
[f2b01f46] Roots v2.1.7
[fd094767] Suppressor v0.2.8</code></pre></article><nav class="docs-footer"><a class="docs-footer-nextpage" href="application-surface-revolution.html">Catenoid solution »</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.6.0 on <span class="colophon-date" title="Tuesday 3 September 2024 07:35">Tuesday 3 September 2024</span>. Using Julia version 1.10.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
[f2b01f46] Roots v2.1.8
[fd094767] Suppressor v0.2.8</code></pre></article><nav class="docs-footer"><a class="docs-footer-nextpage" href="application-surface-revolution.html">Catenoid solution »</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.7.0 on <span class="colophon-date" title="Friday 6 September 2024 15:13">Friday 6 September 2024</span>. Using Julia version 1.10.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>

0 comments on commit 665d63e

Please sign in to comment.