Skip to content

Commit

Permalink
correction constructor of BifProblem
Browse files Browse the repository at this point in the history
  • Loading branch information
rveltz committed Dec 14, 2024
1 parent 11687a2 commit aa95a45
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/BifurcationPoints.jl
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ $(TYPEDFIELDS)
"Continuation step at which the special occurs"
step::Int64 = 0

"`status ∈ {:converged, :guess, :guessL}` indicates whether the bisection algorithm was successful in detecting the special (bifurcation) point. If `status == :guess`, the bissection algorithm failed to meet the requirements given in `::ContinuationPar`. Same for `status == :guessL` but the bissection algorithm stopped on the left of the bifurcation point."
"`status ∈ {:converged, :guess, :guessL}` indicates whether the bisection algorithm was successful in detecting the special (bifurcation) point. If `status == :guess`, the bisection algorithm failed to meet the requirements given in `::ContinuationPar`. Same for `status == :guessL` but the bisection algorithm stopped on the left of the bifurcation point."
status::Symbol = :guess

"`δ = (δr, δi)` where δr indicates the change in the number of unstable eigenvalues and δi indicates the change in the number of unstable eigenvalues with nonzero imaginary part. `abs(δr)` is thus an estimate of the dimension of the kernel of the Jacobian at the special (bifurcation) point."
Expand Down
3 changes: 3 additions & 0 deletions src/Problems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,9 @@ for (op, at) in (
iip = _isinplace(_F)
F = iip ? (x, p) -> _F(similar(x), x, p) : _F
end

Finp = nothing

J = isnothing(J) ? (x, p) -> ForwardDiff.jacobian(z -> F(z, p), x) : J
jvp = isnothing(jvp) ?
(x, p, dx) -> ForwardDiff.derivative(t -> F(x .+ t .* dx, p), zero(eltype(dx))) : dF
Expand Down
4 changes: 2 additions & 2 deletions src/periodicorbit/PeriodicOrbitTrapeze.jl
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ function jacobian_potrap_block(pb::PeriodicOrbitTrapProblem, u0::AbstractVector,
cylic_potrap_block!(pb, u0, par, Aγ)

In = spdiagm( 0 => ones(N))
Aγ[Block(M, 1)] = -γ * In
Aγ[Block(M, 1)] = (-γ) * In
Aγ[Block(M, M)] = In
return
end
Expand Down Expand Up @@ -535,7 +535,7 @@ end

@. Jn = In - tmpJ * (h/2)
# setblock!(Jc, Jn, ii, ii)
J0.nzval[indx[ii,ii]] .= Jn.nzval
J0.nzval[indx[ii, ii]] .= Jn.nzval
end

# setblock!(Aγ, -γ * In, M, 1)
Expand Down
1 change: 0 additions & 1 deletion test/lorenz84.jl
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ testEV(hp_codim2_test)
@reset opts_br.newton_options.verbose = false
sn_codim2 = nothing
for _jac in (:autodiff, :minaug, :finiteDifferences, :MinAugMatrixBased)
@error "" _jac
# be careful here, Bordered predictor not good for Fold continuation
sn_codim2 = @time continuation((@set br.alg.tangent = Secant()), 5, (@optic _.T), ContinuationPar(opts_br, p_max = 3.2, p_min = -0.1, detect_bifurcation = 1, dsmin=1e-5, ds = -0.001, dsmax = 0.015, n_inversion = 10, save_sol_every_step = 1, max_steps = 30, max_bisection_steps = 55) ; verbosity = 0,
normC = norminf,
Expand Down
2 changes: 1 addition & 1 deletion test/test_linear.jl
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ typeof(z_sim) == typeof(z_sim2)
# test _axpy_op
J0 = rand(100, 100)
dx = rand(size(J0, 1))
_o = dx = rand(size(J0, 1))
_o = rand(ComplexF64, size(J0, 1))
a₀ = rand(ComplexF64)
a₁ = -1.432
BK._axpy(J0, 0, a₁)
Expand Down

0 comments on commit aa95a45

Please sign in to comment.