Skip to content

Commit 887f698

Browse files
authored
Update bifurcation_diagram_computation.md, add periodic orbits computation
1 parent 9fb2316 commit 887f698

File tree

1 file changed

+25
-5
lines changed

1 file changed

+25
-5
lines changed

docs/src/tutorials/bifurcation_diagram_computation.md

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,9 @@ bprob = BifurcationProblem(osys,
113113
jac = false)
114114
115115
p_span = (-3.0, 3.0)
116-
opt_newton = NewtonPar(tol = 1e-9, max_iterations = 20)
117-
opts_br = ContinuationPar(dsmin = 0.001, dsmax = 0.05, ds = 0.01,
118-
max_steps = 100, nev = 2, newton_options = opt_newton,
116+
opts_br = ContinuationPar(nev = 2,
119117
p_max = p_span[2], p_min = p_span[1],
120-
detect_bifurcation = 3, n_inversion = 4, tol_bisection_eigenvalue = 1e-8,
121-
dsmin_bisection = 1e-9)
118+
)
122119
123120
bf = bifurcationdiagram(bprob, PALC(), 2, (args...) -> opts_br; bothside = true)
124121
using Plots
@@ -131,3 +128,26 @@ plot(bf;
131128
```
132129

133130
Here, the value of `x` in the steady state does not change, however, at `μ=0` a Hopf bifurcation occur and the steady state turn unstable.
131+
132+
We compute the branch of periodic orbits which is nearby the Hopf Bifurcation. We thus provide the branch `bf.γ`, the index of the Hopf point we want to branch from: 2 in this case and a method `PeriodicOrbitOCollProblem(20, 5)` to compute periodic orbits.
133+
134+
```@example Bif2
135+
br_po = continuation(bf.γ, 2, opts_br,
136+
PeriodicOrbitOCollProblem(20, 5);
137+
)
138+
139+
plot(bf; putspecialptlegend = false,
140+
markersize = 2,
141+
plotfold = false,
142+
xguide = "μ",
143+
yguide = "x")
144+
plot!(br_po, xguide = "μ", yguide = "x", label = "Maximum of periodic orbit")
145+
```
146+
147+
Let's see how to plot the periodic solution we just computed:
148+
149+
```@example Bif2
150+
sol = get_periodic_orbit(br_po, 10)
151+
plot(sol.t, sol[1,:], yguide = "x", xguide = "time", label = "")
152+
```
153+

0 commit comments

Comments
 (0)