Skip to content

Commit

Permalink
correct docs
Browse files Browse the repository at this point in the history
  • Loading branch information
rveltz committed Jun 2, 2024
1 parent f39fbf5 commit 540dc0a
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ using Pkg
cd(@__DIR__)
pkg" activate ."
pkg" dev AbstractTrees"
pkg" dev BifurcationKit DocumenterMermaid AsymptoticNumericalMethod"
pkg" dev BifurcationKit DocumenterMermaid AsymptoticNumericalMethod BandedMatrices"


using Documenter, BifurcationKit, Setfield, AsymptoticNumericalMethod
Expand Down
22 changes: 11 additions & 11 deletions docs/src/tutorials/ode/tutorialsCodim2PO.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,24 +162,24 @@ brpo_pd = continuation(prob2, ci, PALC(), ContinuationPar(opts_po_cont, dsmax =
scene = plot(brpo_pd)
```

## Continuation of Fold / PD of periodic orbits with Shooting
## Continuation of Fold / PD of periodic orbits with Collocation

We continue the previously detected fold/period-doubling bifurcations as function of two parameters and detect codim 2 bifurcations. We first start with the computation of the curve of Folds.

```@example TUTPPREY
opts_posh_fold = ContinuationPar(br_fold_sh.contparams, detect_bifurcation = 3, max_steps = 100, p_min = 0.01, p_max = 1.2)
@set! opts_posh_fold.newton_options.tol = 1e-12
opts_pocoll_fold = ContinuationPar(brpo_fold.contparams, detect_bifurcation = 3, max_steps = 100, p_min = 0.01, p_max = 1.2)
@set! opts_pocoll_fold.newton_options.tol = 1e-12
fold_po_sh2 = continuation(br_fold_sh, 1, (@lens _.ϵ), opts_posh_fold;
# verbosity = 2, plot = true,
fold_po_coll2 = continuation(brpo_fold, 1, (@lens _.ϵ), opts_pocoll_fold;
verbosity = 2, plot = true,
detect_codim2_bifurcation = 2,
jacobian_ma = :minaug,
start_with_eigen = false,
bothside = true,
callback_newton = BK.cbMaxNorm(1),
)
fold_po_sh1 = continuation(br_fold_sh, 2, (@lens _.ϵ), opts_posh_fold;
fold_po_coll1 = continuation(brpo_fold, 2, (@lens _.ϵ), opts_pocoll_fold;
# verbosity = 2, plot = true,
detect_codim2_bifurcation = 2,
jacobian_ma = :minaug,
Expand All @@ -197,9 +197,9 @@ sol2 = solve(remake(prob_de, p = par_pop2, u0 = [0.1,0.1,1,0], tspan=(0,1000)),
sol2 = solve(remake(sol2.prob, tspan = (0,10), u0 = sol2[end]), Rodas5())
plot(sol2, xlims= (8,10))
probshpd, ci = generate_ci_problem(ShootingProblem(M=3), re_make(prob, params = sol2.prob.p), remake(prob_de, p = par_pop2), sol2, 1.; alg = Rodas5())
probcoll, ci = generate_ci_problem(PeriodicOrbitOCollProblem(30, 3), re_make(prob, params = sol2.prob.p), sol2, 1.)
prob2 = @set probshpd.lens = @lens _.ϵ
prob2 = @set probcoll.prob_vf.lens = @lens _.ϵ
brpo_pd = continuation(prob2, ci, PALC(), ContinuationPar(opts_po_cont, dsmax = 5e-3);
# verbosity = 3, plot = true,
argspo...,
Expand All @@ -208,7 +208,7 @@ brpo_pd = continuation(prob2, ci, PALC(), ContinuationPar(opts_po_cont, dsmax =
opts_pocoll_pd = ContinuationPar(brpo_pd.contparams, max_steps = 40, p_min = 1.e-2, dsmax = 1e-2, ds = -1e-3)
@set! opts_pocoll_pd.newton_options.tol = 1e-12
pd_po_sh2 = continuation(brpo_pd, 2, (@lens _.b0), opts_pocoll_pd;
pd_po_coll2 = continuation(brpo_pd, 2, (@lens _.b0), opts_pocoll_pd;
# verbosity = 3,
detect_codim2_bifurcation = 2,
start_with_eigen = false,
Expand All @@ -218,8 +218,8 @@ pd_po_sh2 = continuation(brpo_pd, 2, (@lens _.b0), opts_pocoll_pd;
bothside = true,
)
plot(fold_po_sh1, fold_po_sh2, branchlabel = ["FOLD", "FOLD"])
plot!(pd_po_sh2, vars = (:ϵ, :b0), branchlabel = "PD")
plot(fold_po_coll1, fold_po_coll2, branchlabel = ["FOLD", "FOLD"])
plot!(pd_po_coll2, vars = (:ϵ, :b0), branchlabel = "PD")
```

## References
Expand Down
10 changes: 5 additions & 5 deletions docs/src/tutorials/ode/tutorialsODE-PD.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,30 +143,30 @@ prob_ode = ODEProblem(lur!, copy(z0), (0., 1.), par_lur; abstol = 1e-11, reltol
# continuation parameters
# we decrease a bit the newton tolerance to help automatic branch switching from PD point
opts_po_cont = ContinuationPar(dsmax = 0.03, ds= -0.001, newton_options = NewtonPar(tol = 1e-8), tol_stability = 1e-5, n_inversion = 8, nev = 3)
opts_po_cont = ContinuationPar(dsmax = 0.03, ds= -0.001, newton_options = NewtonPar(tol = 1e-9), tol_stability = 1e-5, n_inversion = 8, nev = 3)
br_po = continuation(
br, 1, opts_po_cont,
# parallel shooting functional with 5 sections
ShootingProblem(5, prob_ode, Rodas5(); parallel = true);
ShootingProblem(15, prob_ode, Rodas5(); parallel = true);
# plot = true,
record_from_solution = recordPO,
plot_solution = plotPO,
# limit the residual, useful to help DifferentialEquations
callback_newton = BK.cbMaxNorm(10),
normC = norminf)
scene = title!("")
plot(br_po)
```

We provide Automatic Branch Switching from the PD point and computing the bifurcated branch is as simple as:

```@example TUTLURE
# aBS from PD
br_po_pd = continuation(deepcopy(br_po), 1,
setproperties(br_po.contparams, max_steps = 20, ds = 0.008);
setproperties(br_po.contparams, max_steps = 20, ds = -0.008);
plot = true, verbosity = 2,
δp = -0.005, override = true,
δp = -0.005, ampfactor = 0.1,
plot_solution = (x, p; k...) -> begin
plotPO(x, p; k...)
## add previous branch
Expand Down
2 changes: 1 addition & 1 deletion docs/src/tutorials/tutorialsPD.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ opts_br = ContinuationPar(dsmax = 0.04, ds = -0.01, p_min = -1.8,
br = continuation(re_make(probBif, params = (@set par_br.C = -0.2)), PALC(), opts_br;
plot = true, verbosity = 3)
scene = title!("")
plot(br)
```

## Periodic orbits from the Hopf point (Standard Shooting)
Expand Down

0 comments on commit 540dc0a

Please sign in to comment.