Skip to content

Commit

Permalink
build based on ce8f0d4
Browse files Browse the repository at this point in the history
  • Loading branch information
Documenter.jl committed Aug 28, 2024
1 parent 9349424 commit 44d56ca
Show file tree
Hide file tree
Showing 8 changed files with 494 additions and 493 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-08-26T20:59:58","documenter_version":"1.6.0"}}
{"documenter":{"julia_version":"1.10.5","generation_timestamp":"2024-08-28T08:15:42","documenter_version":"1.6.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-7800c474.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-81fca9df.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-9c3d3030.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-b297d154.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-d2172716.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-ddf5c0e7.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-4089ddba.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-81f3567f.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-4cd4cd6f.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="Monday 26 August 2024 20:59">Monday 26 August 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-7a44c073.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="Wednesday 28 August 2024 08:15">Wednesday 28 August 2024</span>. Using Julia version 1.10.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
7 changes: 4 additions & 3 deletions dev/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@
[33922b39] CalculusOfVariations v0.1.3 `~/work/calculus_of_variations/calculus_of_variations`
[e30172f5] Documenter v1.6.0
[f6369f11] ForwardDiff v0.10.36
[5f98b655] OptimalControl v0.11.4
[1dea7af3] OrdinaryDiffEq v6.88.1
[5f98b655] OptimalControl v0.11.4
[1dea7af3] OrdinaryDiffEq v6.89.0
[91a5bcdd] Plots v1.40.7
[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="Monday 26 August 2024 20:59">Monday 26 August 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.8
Info Packages marked with ⌅ have new versions available but compatibility constraints restrict them from upgrading. To see why use `status --outdated`</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="Wednesday 28 August 2024 08:15">Wednesday 28 August 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 44d56ca

Please sign in to comment.