Skip to content

Commit 6e1feb9

Browse files
author
Dutto
committed
add Compat and list
1 parent 08d9775 commit 6e1feb9

File tree

3 files changed

+43
-4
lines changed

3 files changed

+43
-4
lines changed

docs/Project.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,10 @@ OptimalControl = "5f98b655-cc9a-415a-b60e-744165666948"
77
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
88

99
[compat]
10-
MINPACK = "1.3"
10+
DifferentialEquations = "7.13.0"
11+
Documenter = "1.5.0"
12+
ForwardDiff = "0.10.36"
13+
MINPACK = "1.3.0"
14+
OptimalControl = "0.11.0"
15+
Plots = "1.40.5"
1116
julia = "1.10"

docs/src/2D-preconditioner.md

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,13 @@ where $r$ and $s$ correspond respectively to the rotation and the scale matrix,
194194

195195
and where $\beta_0 = \arctan \left(\frac{a \sin(\theta)}{b \cos(\theta)} \right)$.
196196

197-
```@example main
198-
function fit_ellipse(x, y)
197+
```@raw html
198+
<article class="docstring">
199+
<header>
200+
<a class="docstring-article-toggle-button fa-solid fa-chevron-right" href="javascript:;" title="Expand docstring"> </a>
201+
<code>fit_ellipse</code> — <span class="docstring-category">Function</span>
202+
</header>
203+
<section style="display: none;"><div><pre><code class="language-julia hljs">function fit_ellipse(x, y)
199204
M = hcat(x.^2, x.*y, y.^2, x, y) # quadratic form of ellipse
200205
p = M\ones(length(x)) # fit parameters for the ellipse
201206
A, B, C, D, E = p
@@ -208,9 +213,28 @@ function fit_ellipse(x, y)
208213
θ = atan(-B, C-A)/2
209214
c = [(2*C*D - B*E)/Δ, (2*A*E - B*D)/Δ]
210215
return a, b, -θ+Base.π/2, c
211-
end
216+
end</code><button class="copy-button fa-solid fa-copy" aria-label="Copy this code ;opblock" title="Copy"></button></pre></div>
217+
</section>
218+
</article>
219+
```
220+
221+
```@example main
222+
function fit_ellipse(x, y) # hide
223+
M = hcat(x.^2, x.*y, y.^2, x, y) # hide
224+
p = M\ones(length(x)) # hide
225+
A, B, C, D, E = p # hide
226+
F = -1.0 # hide
227+
Δ = B^2 - 4*A*C # hide
228+
Λ = (A-C)^2 + B^2 # hide
229+
b, a = [-sqrt(clamp( 2*(A*E^2 + C*D^2 - B*D*E + Δ*F) * ( (A+C) + op(sqrt(Λ)) ), 0, Inf)) / Δ for op in (+, -)] # hide
230+
θ = atan(-B, C-A)/2 # hide
231+
c = [(2*C*D - B*E)/Δ, (2*A*E - B*D)/Δ] # hide
232+
return a, b, -θ+Base.π/2, c # hide
233+
end # hide
234+
nothing # hide
212235
```
213236

237+
214238
```@example main
215239
n = 15 # number of points for fit : 2n
216240
n_ = 100 # number of points for plot: 2n_

docs/src/index.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,13 @@ We consider the following optimal control problem
1212
```
1313

1414
with $x_0$, $t_0$, $x_f$ and $t_f$ fixed. This problem is simple, and can be analytically solve without the use of numerical method. However, the goal is to solve this problem by indirect shooting.
15+
16+
# Dependencies
17+
18+
All the numerical simulations to generate this documentation from `MRI.jl` are performed with
19+
the following packages.
20+
21+
```@example
22+
using Pkg
23+
Pkg.status()
24+
```

0 commit comments

Comments
 (0)