Skip to content

Commit

Permalink
work on tutorials
Browse files Browse the repository at this point in the history
  • Loading branch information
rveltz committed Jul 12, 2024
1 parent 373c905 commit 08381a0
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion docs/src/tutorials/ode/lorenz84-PO.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ prob = BK.BifurcationProblem(Lor, z0, parlor, (@lens _.F);
opts_br = ContinuationPar(p_min = -1.5, p_max = 3.0, ds = 0.002, dsmax = 0.05, n_inversion = 6, nev = 4, max_steps = 200)
@set! opts_br.newton_options.tol = 1e-12
br = @time continuation(re_make(prob, params = setproperties(parlor;T=0.04,F=3.)),
br = @time continuation(re_make(prob, params = (parlor..., T=0.04,F=3.)),
PALC(), opts_br;
normC = norminf, bothside = true)
Expand Down
2 changes: 1 addition & 1 deletion docs/src/tutorials/ode/lorenz84.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ z0 = [2.9787004394953343, -0.03868302503393752, 0.058232737694740085, -0.021052
# bifurcation problem
recordFromSolutionLor(x, p) = (X = x[1], Y = x[2], Z = x[3], U = x[4])
prob = BifurcationProblem(Lor, z0, setproperties(parlor; T=0.04, F=3.), (@lens _.F);
prob = BifurcationProblem(Lor, z0, (parlor..., T=0.04, F=3.), (@lens _.F);
record_from_solution = recordFromSolutionLor)
nothing #hide
```
Expand Down
2 changes: 2 additions & 0 deletions docs/src/tutorials/ode/steinmetz.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ br_coll = continuation(probcoll, cicoll, PALC(tangent = Bordered()), opts_po_con
# verbosity = 3, plot = true,
callback_newton = BK.cbMaxNorm(10),
argspo...)
scene = plot(br_coll)
```

### Curve of Fold points of periodic orbits
Expand Down
2 changes: 1 addition & 1 deletion docs/src/tutorials/ode/tutorials1.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
This is a simple example in which we aim at solving $\Delta T+\alpha N(T,\beta)=0$ with boundary conditions $T(0) = T(1)=\beta$. This example is coded in `examples/chan.jl`. We start with some imports:

```@example TUT1ODE
using BifurcationKit, LinearAlgebra, Plots
using BifurcationKit, Plots
const BK = BifurcationKit
N(x; a = 0.5, b = 0.01) = 1 + (x + a*x^2)/(1 + b*x^2)
Expand Down
7 changes: 3 additions & 4 deletions docs/src/tutorials/ode/tutorialsCodim2PO.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ We are now equipped to build a periodic orbit problem from a solution `sol::ODEP
probtrap, ci = BK.generate_ci_problem(PeriodicOrbitTrapProblem(M = 150),
prob, sol, 2.)
opts_po_cont = setproperties(opts_br, max_steps = 50, tol_stability = 1e-8)
opts_po_cont = ContinuationPar(opts_br, max_steps = 50, tol_stability = 1e-8)
brpo_fold = continuation(probtrap, ci, PALC(), opts_po_cont;
verbosity = 3, plot = true,
argspo...
Expand All @@ -117,7 +117,7 @@ We are now ready to build a periodic orbit problem from a solution `sol::ODEProb
probsh, cish = generate_ci_problem( ShootingProblem(M=3),
prob, prob_de, sol, 2.; alg = Rodas5(), abstol = 1e-12, reltol = 1e-10)
opts_po_cont = setproperties(opts_br, max_steps = 50, tol_stability = 1e-3)
opts_po_cont = ContinuationPar(opts_br, max_steps = 50, tol_stability = 1e-3)
br_fold_sh = continuation(probsh, cish, PALC(tangent = Bordered()), opts_po_cont;
argspo...
)
Expand All @@ -144,7 +144,7 @@ We do the same as in the previous section but using orthogonal collocation. This
probcoll, ci = generate_ci_problem(PeriodicOrbitOCollProblem(30, 4),
prob, sol, 2.)
opts_po_cont = setproperties(opts_br, max_steps = 50, tol_stability = 1e-8)
opts_po_cont = ContinuationPar(opts_br, max_steps = 50, tol_stability = 1e-8)
brpo_fold = continuation(probcoll, ci, PALC(), opts_po_cont;
argspo...
)
Expand Down Expand Up @@ -212,7 +212,6 @@ pd_po_coll2 = continuation(brpo_pd, 2, (@optic _.b0), opts_pocoll_pd;
start_with_eigen = false,
jacobian_ma = :minaug,
normC = norminf,
callback_newton = BK.cbMaxNorm(10),
bothside = true,
)
Expand Down
8 changes: 3 additions & 5 deletions docs/src/tutorials/ode/tutorialsODE-PD.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,7 @@ We provide Automatic Branch Switching from the PD point and computing the bifurc

```@example TUTLURE
# aBS from PD
br_po_pd = continuation(deepcopy(br_po), 1, setproperties(br_po.contparams, max_steps = 100, dsmax = 0.02, plot_every_step = 10, ds = 0.005);
# plot = true, verbosity = 2,
br_po_pd = continuation(deepcopy(br_po), 1, ContinuationPar(br_po.contparams, max_steps = 100, dsmax = 0.02, plot_every_step = 10, ds = 0.005);
prm = true, detailed = true,
plot_solution = (x, p; k...) -> begin
plotPO(x, p; k...)
Expand All @@ -125,7 +124,6 @@ br_po_pd = continuation(deepcopy(br_po), 1, setproperties(br_po.contparams, max_
end,
record_from_solution = recordPO,
normC = norminf,
callback_newton = BK.cbMaxNorm(10),
)
scene = plot(br_po, br_po_pd, title = "Collocation based")
Expand Down Expand Up @@ -164,7 +162,7 @@ We provide Automatic Branch Switching from the PD point and computing the bifurc
```@example TUTLURE
# aBS from PD
br_po_pd = continuation(deepcopy(br_po), 1,
setproperties(br_po.contparams, max_steps = 20, ds = -0.008);
ContinuationPar(br_po.contparams, max_steps = 20, ds = -0.008);
plot = true, verbosity = 2,
δp = -0.005, ampfactor = 0.1,
plot_solution = (x, p; k...) -> begin
Expand Down Expand Up @@ -207,7 +205,7 @@ Two period doubling bifurcations were detected. We shall now compute the branch

```@example TUTLURE
# aBS from PD
br_po_pd = continuation(deepcopy(br_po), 1, setproperties(br_po.contparams, max_steps = 70);
br_po_pd = continuation(deepcopy(br_po), 1, ContinuationPar(br_po.contparams, max_steps = 70);
# plot = true,
ampfactor = .2, δp = -0.005,
plot_solution = (x, p; k...) -> begin
Expand Down

0 comments on commit 08381a0

Please sign in to comment.