I try to investigate pitchfork bifurcation, using the BifurcationKit
. My problem looks as follow. I start from some definitions:
ND = 500
dx = 1.0/ND
x = collect(1:ND)*dx.-dx/2
J = +1.0
beta0 = 0.1
u0 = 0.01*ones(Float64,ND)
W = ones(Float64,ND,ND);
function rhs(u, beta)
global J,dx,W
return u - tanh.(J*beta*dx*W*u)
end
Then, I introduce bifurcation problem:
prob = BifurcationKit.BifurcationProblem(rhs, u0, beta0, 1)
and use
opt_newton = BifurcationKit.NewtonPar(tol=1e-9)
opts = BifurcationKit.ContinuationPar(p_min=0.0, p_max=5.0, max_steps=500, dsmax=2.e-2, dsmin=1.e-4, ds=1.e-4, nev=ND, newton_options=opt_newton);
I run continuation
method as follows:
br = BifurcationKit.continuation(prob, BifurcationKit.PALC(),opts, bothside = true, normC=norm, verbosity=0)
I see the correct bifurcation point at p\approx 1 and extract it:
p_test = br.specialpoint[2].param
Then, I try to switch branch:
test = BifurcationKit.continuation(br, 2, opts; δp = -0.1)
My final goal is to obtain 2 vectors p_values
and solution_u
. I have tried to extract this solution as br.sol
or test.sol
. But everywhere I see only the (seems that) trivial solution. For instance:
I have tried to manipulate with record_from_solution
, but it does not give the desired result. I have tried to add:
record_from_solution = (u,beta; k...) -> (n2=norm(u),solu=u)
I have read the documentation, but I still do not understand properly what did I wrong.