Skip to content

Commit

Permalink
build based on 368f586
Browse files Browse the repository at this point in the history
  • Loading branch information
Documenter.jl committed Jul 16, 2024
1 parent 39216f9 commit 1274b6e
Show file tree
Hide file tree
Showing 8 changed files with 491 additions and 491 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.4","generation_timestamp":"2024-07-16T21:47:15","documenter_version":"1.5.0"}}
{"documenter":{"julia_version":"1.10.4","generation_timestamp":"2024-07-16T22:10:53","documenter_version":"1.5.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 @@ -126,7 +126,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-b177a6a7.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-0babaa0e.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 @@ -171,7 +171,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-02ce5e03.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-edcd8615.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 @@ -200,11 +200,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-9ec02a3e.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-fbad296f.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-b40ef26c.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-59ce891b.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 @@ -238,4 +238,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-944edafc.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.5.0 on <span class="colophon-date" title="Tuesday 16 July 2024 21:47">Tuesday 16 July 2024</span>. Using Julia version 1.10.4.</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-e70d2beb.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.5.0 on <span class="colophon-date" title="Tuesday 16 July 2024 22:10">Tuesday 16 July 2024</span>. Using Julia version 1.10.4.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
2 changes: 1 addition & 1 deletion dev/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
[1dea7af3] OrdinaryDiffEq v6.85.0
[91a5bcdd] Plots v1.40.5
[f2b01f46] Roots v2.1.5
[fd094767] Suppressor v0.2.7</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.5.0 on <span class="colophon-date" title="Tuesday 16 July 2024 21:47">Tuesday 16 July 2024</span>. Using Julia version 1.10.4.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
[fd094767] Suppressor v0.2.7</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.5.0 on <span class="colophon-date" title="Tuesday 16 July 2024 22:10">Tuesday 16 July 2024</span>. Using Julia version 1.10.4.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>

0 comments on commit 1274b6e

Please sign in to comment.