Hi everyone! Currently I’m working on a problem where I have non-standard Hopf-bifurcation points (Hopf-Hopf or degenerate Hopf) which get an “nd” (not documented) mark on my diagrams. Since these are not identified as Hopf points, the Hopf continuation fails of course. The question is: can I still somehow find the periodic orbits (stable and unstable)?
using BifurcationKit
using Plots,LaTeXStrings
using Setfield
using LinearAlgebra
const BK=BifurcationKit
function skipsum(a,i)
x = a[1:2:end]
return sum(x) - a[i]
end
function att_din!(u,p)
g,w,n = p
n = Int(n)
du = similar(u)
for i in 1:2:(2*n)
du[i] = g*u[i]*(1 - (1 - w)*u[i+1] - w/(n-1)*skipsum(u,i))
du[i+1] = u[i] - u[i+1]
end
du
end
par = (g = 5,w = 0.1,n = 3)
# sup norm
norminf(x) = norm(x, Inf)
initconds = [[0.0,0.0,0.0,0.0,0.0,0.0],
ones(2*par.n),
[1/(1-par.w),1/(1-par.w),0.0,0.0,0.0,0.0],
[0.0,0.0,1/(1-par.w/2),1/(1-par.w/2),1/(1-par.w/2),1/(1-par.w/2)]]
line_colors = [:gray10,:red,:blue,:green]
labels = [L"$x^{*}_0$",L"$x^{*}_1$",L"$x^{*}_2$",L"$x^{*}_3$"]
pl = plot()
for (i,ic) in enumerate(initconds)
@show ic
prob = BifurcationProblem(att_din!, ic, par, (@lens _.w),
recordFromSolution = (x, p) -> norminf(x),
plotSolution = (x, p; k...) -> plot!(x; ylabel="solution", label="", k...))
# continuation options
opts_br = ContinuationPar(pMin = 0.05, pMax = 0.8, dsmax = 0.01,
# options to detect bifurcations
detectBifurcation = 3, nInversion = 8, maxBisectionSteps = 25,
# number of eigenvalues
nev = 6,
# maximum number of continuation steps
maxSteps = 1000,
# parameter theta, see `? continuation`. Setting this to a non
# default value helps passing the transcritical bifurcation
θ = 0.3)
br = continuation(prob, PALC(tangent=Bordered()), opts_br;
plot = false,normC = norminf)
if i == 2
@show br
end
plot!(br;
putspecialptlegend=true,
plotstability=true,
linewidthunstable=1,
linewidthstable=5,
plotcirclesbif = false,
tickfontsize=10,
lc = line_colors[i],
xguidefontsize=20,
yguidefontsize=20,
ms=6,
markerstrokewidth=0.01,
legendfontsize = 10,
legend=:topleft,
xticks=[0:0.1:0.8;],
xlabel=L"$w$",
dpi=300)
end
plot!(pl,ylabel=L"$max(|x^{*}|)$")
display(pl)