Skip to content

Commit

Permalink
correct mistake in hopf curve
Browse files Browse the repository at this point in the history
  • Loading branch information
rveltz committed Apr 13, 2024
1 parent 6409a42 commit 0a9911a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/bifdiagram/BranchSwitching.jl
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ function continuation(br::AbstractResult{EquilibriumCont, Tprob}, ind_bif::Int,
kwargs...) where Tprob
# The usual branch switching algorithm is described in Keller. Numerical solution of bifurcation and nonlinear eigenvalue problems. We do not use this algorithm but instead compute the Lyapunov-Schmidt decomposition and solve the polynomial equation.

@assert br.specialpoint[ind_bif].type == :bp "This bifurcation type is not handled.\n Branch point from $(br.specialpoint[ind_bif].type)"
@assert br.specialpoint[ind_bif].type in (:bp, :nd) "This bifurcation type is not handled.\n Branch point from $(br.specialpoint[ind_bif].type)"

verbose = get(kwargs, :verbosity, 0) > 0 ? true : false
verbose && println("──▶ Considering bifurcation point:")
Expand Down Expand Up @@ -162,7 +162,7 @@ Automatic branch switching at branch points based on a computation of the normal
"""
function multicontinuation(br::AbstractBranchResult, ind_bif::Int, options_cont::ContinuationPar = br.contparams;
δp = nothing,
ampfactor::Real = getvectoreltype(br)(1),
ampfactor::Real = _getvectoreltype(br)(1),
nev::Int = options_cont.nev,
Teigvec = _getvectortype(br),
ζs = nothing,
Expand Down
10 changes: 6 additions & 4 deletions src/codim2/MinAugHopf.jl
Original file line number Diff line number Diff line change
Expand Up @@ -472,8 +472,9 @@ function continuation_hopf(prob_vf, alg::AbstractContinuationAlgorithm,
BT2 = real( dot(ζ★ ./ normC(ζ★), ζ) )
ζ★ ./= dot(ζ, ζ★)
@debug "Hopf normal form computation"
hp = Hopf(x, nothing, p1, ω, newpar, lens1, ζ, ζ★, (a = zero(Complex{T}), b = zero(Complex{T})), :hopf)
hopf_normal_form(prob_vf, hp, options_newton.linsolver, verbose = false)
hp0 = Hopf(x, nothing, p1, ω, newpar, lens1, ζ, ζ★, (a = zero(Complex{T}), b = zero(Complex{T})), :hopf)
hp = hopf_normal_form(prob_vf, hp0, options_newton.linsolver, verbose = false) # CA ALLOUE DANS hp !!!
@debug "" hp.nf.a hp.nf.b

# lyapunov coefficient
probhopf.l1 = hp.nf.b
Expand All @@ -498,10 +499,11 @@ function continuation_hopf(prob_vf, alg::AbstractContinuationAlgorithm,
# define event for detecting bifurcations. Coupled it with user passed events
# event for detecting codim 2 points
event_user = get(kwargs, :event, nothing)
if compute_eigen_elements

if compute_eigen_elements #|| event_user == BifDetectEvent
if isnothing(event_user)
event = PairOfEvents(
ContinuousEvent(2, test_bt_gh, compute_eigen_elements, ("bt", "gh"), threshBT),
ContinuousEvent(2, test_bt_gh, true, ("bt", "gh"), threshBT),
BifDetectEvent)
else
event = SetOfEvents(
Expand Down
2 changes: 1 addition & 1 deletion test/testNF.jl
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ BK.hasbranch(bdiag)
BK.from(bdiag.child[1].γ)
BK.get_branches_from_BP(bdiag, 2)
BK.get_contresult(br)
BK.get_contresult(get_branch(bdiag,(1,)).γ)
BK.get_contresult(get_branch(bdiag, (1,)).γ)
size(bdiag)
get_branch(bdiag, (1,))
show(stdout, bdiag)
Expand Down

0 comments on commit 0a9911a

Please sign in to comment.