Skip to content

Commit

Permalink
corrections docs
Browse files Browse the repository at this point in the history
  • Loading branch information
rveltz committed Jul 12, 2024
1 parent 5c21adc commit 373c905
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 24 deletions.
2 changes: 1 addition & 1 deletion docs/src/periodicOrbitCollocation.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ H_{0,0}^1 & H_{0,1}^1 & H_{1,0}^1 & & & & & * \\
& & & & H_{2,0}^0 & H_{2,1}^0 & H_{3,0}^0 & * \\
& & & & H_{2,0}^1 & H_{2,1}^1 & H_{3,0}^1 & * \\
& & & & & & & * \\
I & & & & & & -I & * \\
-I & & & & & & I & * \\
* & * & * & * & * & * & * & *
\end{array}\right)$$

Expand Down
32 changes: 17 additions & 15 deletions docs/src/tutorials/mittelmannGridap.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ with Neumann boundary condition on $\Omega = (0,1)^2$ and where $NL(\lambda,u)\e
We start by installing the package [GridapBifurcationKit.jl](https://github.com/rveltz/GridapBifurcationKit). Then, we can import the different packages:

```julia
using Revise
using Plots, Gridap
using Revise, Plots
using Gridap
using Gridap.FESpaces
using GridapBifurcationKit, BifurcationKit
using GridapBifurcationKit
using BifurcationKit

# custom plot function to deal with Gridap
plotgridap!(x; k...) = (n=isqrt(length(x));heatmap!(reshape(x,n,n); color=:viridis, k...))
Expand Down Expand Up @@ -64,7 +65,11 @@ uh = zero(U)
par_bratu == 0.01,)

# problem definition
prob = GridapBifProblem(res, uh, par_bratu, V, U, (@lens _.λ); jac = jac, d2res = d2res, d3res = d3res, plot_solution = (x,p; k...) -> plotgridap!(x; k...))
prob = GridapBifProblem(res, uh, par_bratu, V, U, (@lens _.λ);
jac = jac,
d2res = d2res,
d3res = d3res,
plot_solution = (x,p; k...) -> plotgridap!(x; k...))
```

We can call then the newton solver:
Expand Down Expand Up @@ -101,22 +106,19 @@ We obtain:

```julia
julia> br
┌─ Number of points: 56
├─ Curve of EquilibriumCont
┌─ Curve type: EquilibriumCont
├─ Number of points: 56
├─ Type of vectors: Vector{Float64}
├─ Parameter λ starts at 0.01, ends at 0.01
├─ Algo: PALC
└─ Special points:

If `br` is the name of the branch,
ind_ev = index of the bifurcating eigenvalue e.g. `br.eig[idx].eigenvals[ind_ev]`

- # 1, bp at λ ≈ +0.36787944 ∈ (+0.36787944, +0.36787944), |δp|=1e-12, [converged], δ = ( 1, 0), step = 13, eigenelements in eig[ 14], ind_ev = 1
- # 2, nd at λ ≈ +0.27234314 ∈ (+0.27234314, +0.27234328), |δp|=1e-07, [converged], δ = ( 2, 0), step = 21, eigenelements in eig[ 22], ind_ev = 3
- # 3, bp at λ ≈ +0.15185452 ∈ (+0.15185452, +0.15185495), |δp|=4e-07, [converged], δ = ( 1, 0), step = 29, eigenelements in eig[ 30], ind_ev = 4
- # 4, nd at λ ≈ +0.03489122 ∈ (+0.03489122, +0.03489170), |δp|=5e-07, [converged], δ = ( 2, 0), step = 44, eigenelements in eig[ 45], ind_ev = 6
- # 5, nd at λ ≈ +0.01558733 ∈ (+0.01558733, +0.01558744), |δp|=1e-07, [converged], δ = ( 2, 0), step = 51, eigenelements in eig[ 52], ind_ev = 8
- # 6, endpoint at λ ≈ +0.01000000, step = 55
- # 1, bp at λ ≈ +0.36787944 ∈ (+0.36787944, +0.36787944), |δp|=1e-12, [converged], δ = ( 1, 0), step = 13
- # 2, nd at λ ≈ +0.27234314 ∈ (+0.27234314, +0.27234328), |δp|=1e-07, [converged], δ = ( 2, 0), step = 21
- # 3, bp at λ ≈ +0.15185452 ∈ (+0.15185452, +0.15185495), |δp|=4e-07, [converged], δ = ( 1, 0), step = 29
- # 4, nd at λ ≈ +0.03489122 ∈ (+0.03489122, +0.03489170), |δp|=5e-07, [converged], δ = ( 2, 0), step = 44
- # 5, nd at λ ≈ +0.01558733 ∈ (+0.01558733, +0.01558744), |δp|=1e-07, [converged], δ = ( 2, 0), step = 51
- # 6, endpoint at λ ≈ +0.01000000,
```

![](fig1gridap.png)
Expand Down
13 changes: 7 additions & 6 deletions docs/src/tutorials/ode/steinmetz.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ end
# group parameters
argspo = (record_from_solution = recordFromSolution,
plot_solution = plotSolution)
plot_solution = plotSolution,
normC = norminf)
nothing #hide
```
Expand All @@ -68,17 +69,17 @@ We obtain some trajectories as seeds for computing periodic orbits.
using DifferentialEquations
alg_ode = Rodas5()
prob_de = ODEProblem(SL!, z0, (0,136.), par_sl)
sol = solve(prob_de, alg_ode)
prob_de = ODEProblem(SL!, sol.u[end], (0,30.), sol.prob.p, reltol = 1e-11, abstol = 1e-13)
sol = solve(prob_de, alg_ode)
plot(sol)
sol_ode = solve(prob_de, alg_ode)
prob_de = ODEProblem(SL!, sol_ode.u[end], (0,30.), sol_ode.prob.p, reltol = 1e-11, abstol = 1e-13)
sol_ode = solve(prob_de, alg_ode)
plot(sol_ode)
```

## Computation with Shooting
We generate a shooting problem from the computed trajectories and continue the periodic orbits as function of $k_8$

```@example STEINMETZ
probsh, cish = generate_ci_problem( ShootingProblem(M=4), prob, prob_de, sol, 16.; reltol = 1e-10, abstol = 1e-12, parallel = true)
probsh, cish = generate_ci_problem( ShootingProblem(M=4), prob, prob_de, sol_ode, 16.; reltol = 1e-10, abstol = 1e-12, parallel = true)
opts_po_cont = ContinuationPar(p_min = 0., p_max = 20.0, ds = 0.002, dsmax = 0.05, n_inversion = 8, detect_bifurcation = 3, max_bisection_steps = 25, nev = 4, max_steps = 60, save_eigenvectors = true, tol_stability = 1e-3)
@set! opts_po_cont.newton_options.verbose = false
Expand Down
2 changes: 1 addition & 1 deletion docs/src/tutorials/ode/tutorialPP2.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ diagram = bifurcationdiagram(prob, PALC(),
# when computing the bifurcation diagram. It means we allow computing branches of branches of branches
# at most in the present case.
3,
(args...) -> setproperties(opts_br; ds = -0.001, dsmax = 0.01, n_inversion = 8, detect_bifurcation = 3)
ContinuationPar(opts_br; ds = -0.001, dsmax = 0.01, n_inversion = 8, detect_bifurcation = 3)
)
scene = plot(diagram; code = (), title="$(size(diagram)) branches", legend = false)
Expand Down
4 changes: 4 additions & 0 deletions docs/src/tutorials/tutorials.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ See the [tutorials](https://bifurcationkit.github.io/DDEBifurcationKit.jl/dev/tu

## Examples based on ModelingToolkit

`ModelingToolkit` provides a tailored interface to `BifurcationKit` and the user is encouraged to have a look at its specific [documentation](https://docs.sciml.ai/ModelingToolkit/stable/tutorials/bifurcation_diagram_computation/).

We also provide some alternative example(s):

```@contents
Pages = ["ode/NME-MTK.md"]
Depth = 1
Expand Down
2 changes: 1 addition & 1 deletion docs/src/tutorials/tutorials3.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ br_hopf = continuation(br, ind_hopf, (@lens _.β),
optcdim2, verbosity = 2,
# detection of codim 2 bifurcations with bisection
detect_codim2_bifurcation = 2,
# we update the Fold problem at every continuation step
# we update the Hopf problem at every continuation step
update_minaug_every_step = 1,
jacobian_ma = :minaug, # specific to large dimensions
normC = norminf)
Expand Down

0 comments on commit 373c905

Please sign in to comment.