Skip to content

Commit

Permalink
build_jacobian -> generate_jacobian
Browse files Browse the repository at this point in the history
  • Loading branch information
rveltz committed Jan 5, 2025
1 parent 7e8748d commit 86126d9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions src/periodicorbit/PeriodicOrbitCollocation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,7 @@ Compute the jacobian of the problem defining the periodic orbits by orthogonal c
mul!(pj, uc[:, rg], L) # pj ≈ (L * uj')'
# put the jacobian of the vector field
for l in 1:m
_rgX = rgNx .+ (l-1)*n
if _transpose == false
J0 .= jacobian(VF, pj[:,l], pars)
else
Expand Down Expand Up @@ -986,7 +987,7 @@ function newton(probPO::PeriodicOrbitOCollProblem,
_newton_pocoll(probPO, orbitguess, options; defOp = defOp, kwargs...)
end

function build_jacobian(coll::PeriodicOrbitOCollProblem,
function generate_jacobian(coll::PeriodicOrbitOCollProblem,
orbitguess,
par;
δ = convert(eltype(orbitguess), 1e-8))
Expand Down Expand Up @@ -1038,7 +1039,7 @@ function continuation(coll::PeriodicOrbitOCollProblem,
plot_solution = nothing,
kwargs...)

jacPO = build_jacobian(coll, orbitguess, getparams(coll); δ)
jacPO = generate_jacobian(coll, orbitguess, getparams(coll); δ)
_Jcoll = analytical_jacobian(coll, orbitguess, getparams(coll))
if linear_algo isa COPBLS
linear_algo = COPBLS(coll)
Expand Down
6 changes: 3 additions & 3 deletions src/periodicorbit/codim2/codim2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ function _continuation(gh::Bautin, br::AbstractResult{Tkind, Tprob},
_recordsol = modify_po_record(probPO, kwargs, getparams(probPO), getlens(probPO))
_plotsol = modify_po_plot(probPO, kwargs)

jac = build_jacobian(probPO, orbitguess, getparams(probPO); δ = getdelta(prob_vf))
jac = generate_jacobian(probPO, orbitguess, getparams(probPO); δ = getdelta(prob_vf))
pbwrap = _wrap(probPO, jac, orbitguess, getparams(probPO), getlens(probPO), _plotsol, _recordsol)

# we have to change the Bordered linearsolver to cope with our type FloquetWrapper
Expand Down Expand Up @@ -394,7 +394,7 @@ function _continuation(hh::HopfHopf, br::AbstractResult{Tkind, Tprob},
_recordsol = modify_po_record(probPO, _kwargs, getparams(probPO), getlens(probPO))
_plotsol = modify_po_plot(probPO, _kwargs)

jac = build_jacobian(probPO, orbitguess, getparams(probPO); δ = getdelta(prob_vf))
jac = generate_jacobian(probPO, orbitguess, getparams(probPO); δ = getdelta(prob_vf))
pbwrap = _wrap(probPO, jac, orbitguess, getparams(probPO), getlens(probPO), _plotsol, _recordsol)

# we have to change the Bordered linearsolver to cope with our type FloquetWrapper
Expand Down Expand Up @@ -524,7 +524,7 @@ function _continuation(zh::ZeroHopf, br::AbstractResult{Tkind, Tprob},
_recordsol = modify_po_record(probPO, kwargs, getparams(probPO), getlens(probPO))
_plotsol = modify_po_plot(probPO, kwargs)

jac = build_jacobian(probPO, orbitguess, getparams(probPO); δ = getdelta(prob_vf))
jac = generate_jacobian(probPO, orbitguess, getparams(probPO); δ = getdelta(prob_vf))
pbwrap = _wrap(probPO, jac, orbitguess, getparams(probPO), getlens(probPO), _plotsol, _recordsol)

# we have to change the Bordered linearsolver to cope with our type FloquetWrapper
Expand Down
2 changes: 1 addition & 1 deletion test/lorenz84.jl
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ for _jac in (:autodiff, :minaug, :finiteDifferences, :MinAugMatrixBased)
@test bpbt_2.nfsupp.H0002 [-0.34426541029040103, 0.7403628764888541, 0.5020796040084594, 0.7211107457956355] rtol = 1e-3 rtol = 1e-3
@test bpbt_2.nfsupp.H1001 [0.8609019479520158, 0.3666091456682787, 0.09272126477464948, -1.1252591151814477] rtol = 1e-3
@test bpbt_2.nfsupp.H2000 [-1.1430891994241816, 0.5090981254844374, 0.4300904962638521, -0.4240003230561569] rtol = 1e-3
# test branch switching from BT points
# test branch switching from BT points
hp_codim2_2 = continuation(sn_codim2, 1, ContinuationPar(opts_br, ds = -0.001, dsmax = 0.02, dsmin = 1e-4, n_inversion = 6, detect_bifurcation = 1, p_max = 15.) ;
normC = norminf,
detect_codim2_bifurcation = 2,
Expand Down

0 comments on commit 86126d9

Please sign in to comment.