Skip to content

Commit

Permalink
Merge pull request #128 from danielwe/master
Browse files Browse the repository at this point in the history
Fix outdated use of camelCase names, et cetera
  • Loading branch information
rveltz authored Nov 14, 2023
2 parents 027968b + 7f545a3 commit d8bfa3d
Show file tree
Hide file tree
Showing 46 changed files with 132 additions and 137 deletions.
6 changes: 3 additions & 3 deletions examples/COModel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ show(br)

plot(br, plotfold=false, markersize=4, legend=:topright, ylims=(0,0.16))
####################################################################################################
@set! opts_br.newtonOptions.verbose = false
@set! opts_br.newtonOptions.maxIter = 10
opts_br = @set opts_br.newtonOptions.tol = 1e-12
@set! opts_br.newton_options.verbose = false
@set! opts_br.newton_options.maxIter = 10
opts_br = @set opts_br.newton_options.tol = 1e-12

sn = newton(br, 3; options = opts_br.newton_options, bdlinsolver = MatrixBLS())

Expand Down
16 changes: 8 additions & 8 deletions examples/SH2d-fronts.jl
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ optcont = @set optcont.newton_options.eigsolver = EigArpack(0.1, :LM)
br = @time continuation(
prob, PALC(), optcont;
plot = true, verbosity = 3,
# finaliseSolution = (z, tau, step, contResult; k...) -> (Base.display(contResult.eig[end].eigenvals) ;true),
# finalise_solution = (z, tau, step, contResult; k...) -> (Base.display(contResult.eig[end].eigenvals) ;true),
# callback_newton = cb,
normC = norminf)
###################################################################################################
Expand All @@ -113,7 +113,7 @@ brfold = continuation(br, 1, (@lens _.ν), optfold;
start_with_eigen = true,
detect_codim2_bifurcation = 0,
bothside = true,
# plotSolution = (x, p; kwargs...) -> (plotsol!((x.u); label="", kwargs...)),
# plot_solution = (x, p; kwargs...) -> (plotsol!((x.u); label="", kwargs...)),
update_minaug_every_step = 1,
)

Expand Down Expand Up @@ -158,9 +158,9 @@ diagram = bifurcationdiagram(br.prob, br, 2, optionsCont;
plot = true, verbosity = 0,
# usedeflation = true,
# δp = 0.005,
# callbackN = cb,
# linearAlgo = MatrixBLS(),
# finaliseSolution = (z, tau, step, contResult; k...) -> (Base.display(contResult.eig[end].eigenvals) ;true),
# callback_newton = cb,
# linear_algo = MatrixBLS(),
# finalise_solution = (z, tau, step, contResult; k...) -> (Base.display(contResult.eig[end].eigenvals) ;true),
normC = norminf,
verbosediagram = true,
)
Expand All @@ -175,8 +175,8 @@ algdc = BK.DefCont(deflation_operator = deflationOp, perturb_solution = (x,p,id)

brdf = continuation(prob, algdc, setproperties(optcontdf; detect_bifurcation = 0, plot_every_step = 1);
plot = true, verbosity = 2,
# finaliseSolution = (z, tau, step, contResult) -> (Base.display(contResult.eig[end].eigenvals) ;true),
# callbackN = cb,
normN = x -> norm(x, Inf))
# finalise_solution = (z, tau, step, contResult) -> (Base.display(contResult.eig[end].eigenvals) ;true),
# callback_newton = cb,
normC = x -> norm(x, Inf))

plot(brdf...)
4 changes: 2 additions & 2 deletions examples/SH3d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ br = @time continuation(
plot = true, verbosity = 1,
normC = norminf,
event = BK.FoldDetectEvent,
# finaliseSolution = (z, tau, step, contResult; k...) -> begin
# finalise_solution = (z, tau, step, contResult; k...) -> begin
# if length(contResult) == 1
# pretty_table(contResult.branch)
# else
Expand All @@ -169,7 +169,7 @@ br1 = @time continuation(br, 3, setproperties(optcont; save_sol_every_step = 10,
end
true
end,
# callbackN = cb,
# callback_newton = cb,
normC = norminf)

BK.plotBranch(br, br1...)
Expand Down
10 changes: 4 additions & 6 deletions examples/SHpde_snaking.jl
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,11 @@ end

kwargsC = (verbosity = 3,
plot = true,
# tangentAlgo = BorderedPred(),
linear_algo = MatrixBLS(),
callback_newton = cb
)

brflat = @time continuation(prob, PALC(), opts; kwargsC..., verbosity = 0)
brflat = @time continuation(prob, PALC(#=tangent=Bordered()=#), opts; kwargsC..., verbosity = 0)

plot(brflat, putspecialptlegend = false)
####################################################################################################
Expand All @@ -89,15 +88,14 @@ diagram2 = bifurcationdiagram!(diagram.γ.prob, BK.get_branch(diagram, (2,)), 3,

####################################################################################################
deflationOp = DeflationOperator(2, 1.0, [sol1.u])
algdc = BK.DefCont(deflation_operator = deflationOp, max_branches = 50, perturb_solution = (sol, p, id) -> sol .+ 0.02 .* rand(length(sol)),)
algdc = BK.DefCont(deflation_operator = deflationOp, max_branches = 50, perturb_solution = (sol, p, id) -> sol .+ 0.02 .* rand(length(sol)),#= alg = PALC(tangent=Secant())=#)

br = @time continuation(
re_make(prob, params = @set parSH.λ = -0.1), algdc,
setproperties(opts; ds = 0.001, max_steps = 20000, p_max = 0.25, p_min = -1., newton_options = setproperties(optnew; tol = 1e-9, max_iterations = 15, verbose = false), save_sol_every_step = 0, detect_bifurcation = 0);
verbosity = 1,
normN = norminf,
# tangentAlgo = SecantPred(),
# callbackN = (x, f, J, res, iteration, itlinear, options; kwargs...) ->(true)
normC = norminf,
# callback_newton = (x, f, J, res, iteration, itlinear, options; kwargs...) ->(true)
)

plot(br, legend=false, linewidth=1, vars = (:param, :n2))
12 changes: 6 additions & 6 deletions examples/TMModel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ br_potrap = continuation(br, 4, opts_po_cont,
PeriodicOrbitTrapProblem(M = 250, jacobian = :Dense, update_section_every_step = 0);
verbosity = 2, plot = false,
args_po...,
callbackN = BK.cbMaxNorm(10.),
callback_newton = BK.cbMaxNorm(10.),
)

plot(br, br_potrap, markersize = 3)
Expand All @@ -76,13 +76,13 @@ br_pocoll = @time continuation(
verbosity = 2,
plot = true,
args_po...,
plotSolution = (x, p; k...) -> begin
plot_solution = (x, p; k...) -> begin
xtt = BK.get_periodic_orbit(p.prob, x, p.p)
plot!(xtt.t, xtt[1,:]; label = "", marker =:d, markersize = 1.5, k...)
plot!(br; subplot = 1, putspecialptlegend = false)

end,
callbackN = BK.cbMaxNorm(1000.),
callback_newton = BK.cbMaxNorm(1000.),
)

plot(br, br_pocoll, markersize = 3)
Expand All @@ -107,7 +107,7 @@ br_posh = @time continuation(
# ShootingProblem(15, probsh, TaylorMethod(15), parallel = false);
ampfactor = 1.0, δp = 0.0005,
usedeflation = true,
linearAlgo = MatrixBLS(),
linear_algo = MatrixBLS(),
verbosity = 2, plot = true,
args_po...,
)
Expand All @@ -128,10 +128,10 @@ br_popsh = @time continuation(
alg = PALC(tangent = Bordered()),
ampfactor = 1.0, δp = 0.005,
# usedeflation = true,
linearAlgo = MatrixBLS(),
linear_algo = MatrixBLS(),
verbosity = 2, plot = true,
args_po...,
callbackN = BK.cbMaxNorm(1e1),
callback_newton = BK.cbMaxNorm(1e1),
record_from_solution = (x, p) -> (return (max = getmaximum(p.prob, x, @set par_tm.E0 = p.p), period = getperiod(p.prob, x, @set par_tm.E0 = p.p))),
normC = norminf)

Expand Down
10 changes: 5 additions & 5 deletions examples/brusselator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ par_bru = (α = 2., β = 5.45, D1 = 0.008, D2 = 0.004, l = 0.3)
sol0 = vcat(par_bru.α * ones(n), par_bru.β/par_bru.α * ones(n))
prob = BifurcationProblem(Fbru!, sol0, par_bru, (@lens _.l);
J = Jbru_sp,
#plotSolution = (x, p; kwargs...) -> plotsol(x; label="", kwargs... ),
# plotSolution = (ax, x, p) -> plotsol(ax, x),
#plot_solution = (x, p; kwargs...) -> plotsol(x; label="", kwargs... ),
# plot_solution = (ax, x, p) -> plotsol(ax, x),
record_from_solution = (x, p) -> x[div(n,2)])
# # parameters for an isola of stationary solutions
# par_bru = (α = 2., β = 4.6, D1 = 0.0016, D2 = 0.008, l = 0.061)
Expand Down Expand Up @@ -173,7 +173,7 @@ br_po = continuation(
@info "Floquet exponents:"
(Base.display(contResult.eig[end].eigenvals) ;true)
end,
# plotSolution = (x, p; kwargs...) -> heatmap!(get_periodic_orbit(p.prob, x, par_bru).u'; ylabel="time", color=:viridis, kwargs...),
# plot_solution = (x, p; kwargs...) -> heatmap!(get_periodic_orbit(p.prob, x, par_bru).u'; ylabel="time", color=:viridis, kwargs...),
normC = norminf)

####################################################################################################
Expand All @@ -192,7 +192,7 @@ br_po2 = BK.continuation(
########
finalise_solution = (z, tau, step, contResult; k...) ->
(Base.display(contResult.eig[end].eigenvals) ;true),
# plotSolution = (x, p; kwargs...) -> begin
# plot_solution = (x, p; kwargs...) -> begin
# heatmap!(get_periodic_orbit(p.prob, x, par_bru).u'; ylabel="time", color=:viridis, kwargs...)
# plot!(br_po,legend = :bottomright, subplot=1)
# end,
Expand All @@ -213,4 +213,4 @@ vf = ODEFunction(Fbru!, jac = (J,u,p,t)-> J .= Jbru_sp(u,p))
prob_ode = ODEProblem(vf, br_po2.specialpoint[1].x[1:2n], (0,150.), @set par_bru.l = 1.37)
sol_ode = @time solve(prob_ode, Rodas4P(linsolve = KrylovJL_GMRES()), progress = true, progress_steps = 1); println("--> #steps = ", length(sol_ode))
heatmap(sol_ode.t, 1:n, sol_ode[1:n,:], color = :viridis)
plot(sol_ode.t, sol_ode[n÷2,:])
plot(sol_ode.t, sol_ode[n÷2,:])
4 changes: 2 additions & 2 deletions examples/brusselatorShooting.jl
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ br = @time continuation(
#################################################################################################### Continuation of Periodic Orbit
M = 10
ind_hopf = 1
l_hopf, Th, orbitguess2, hopfpt, vec_hopf = BK.guessFromHopf(br, ind_hopf, opts_br_eq.newton_options.eigsolver, M, 22*0.075)
l_hopf, Th, orbitguess2, hopfpt, vec_hopf = BK.guess_from_hopf(br, ind_hopf, opts_br_eq.newton_options.eigsolver, M, 22*0.075)
#
orbitguess_f2 = reduce(hcat, orbitguess2)
orbitguess_f = vcat(vec(orbitguess_f2), Th) |> vec
Expand Down Expand Up @@ -307,4 +307,4 @@ br_po2 = continuation(deepcopy(br_po), 1, setproperties(br_po.contparams, detect
BK.plot_periodic_shooting!(x[1:end-1], Mt; kwargs...)
plot!(br_po; subplot = 1)
end,
)
)
12 changes: 6 additions & 6 deletions examples/cGL2d-shooting.jl
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ br_po = @time continuation(probSh, outpo.u, PALC(),
plot = true,
linear_algo = MatrixFreeBLS(@set ls.N = probSh.M*2n+2),
plot_solution = (x, p; kwargs...) -> heatmap!(reshape(x[1:Nx*Ny], Nx, Ny); color=:viridis, kwargs...),
# plotSolution = (ax, x, p; kwargs...) -> heatmap!(ax, reshape(x[1:Nx*Ny], Nx, Ny); kwargs...),
# plot_solution = (ax, x, p; kwargs...) -> heatmap!(ax, reshape(x[1:Nx*Ny], Nx, Ny); kwargs...),
record_from_solution = (u, p; k...) -> (amp = BK.getamplitude(p.prob, u, (@set par_cgl.r = p.p); ratio = 2), period = u[end]),
normC = norminf)

Expand All @@ -175,13 +175,13 @@ br_po = continuation(
opts_po_cont,
ShootingProblem(Mt, prob_sp, ETDRK2(krylov = true); abstol = 1e-10, reltol = 1e-8, jacobian = BK.FiniteDifferencesMF(),) ;
verbosity = 3, plot = true, ampfactor = 1.5, δp = 0.01,
# callbackN = (x, f, J, res, iteration, itl, options; kwargs...) -> (println("--> amplitude = ", BK.amplitude(x, n, M; ratio = 2));true),
# callback_newton = (x, f, J, res, iteration, itl, options; kwargs...) -> (println("--> amplitude = ", BK.amplitude(x, n, M; ratio = 2));true),
linear_algo = MatrixFreeBLS(@set ls.N = Mt*2n+2),
finaliseSolution = (z, tau, step, contResult; k...) ->begin
finalise_solution = (z, tau, step, contResult; k...) ->begin
BK.haseigenvalues(contResult) && Base.display(contResult.eig[end].eigenvals)
return true
end,
plotSolution = (x, p; k...) -> heatmap!(reshape(x[1:Nx*Ny], Nx, Ny); color=:viridis, k...),
# plotSolution = (ax, x, p; kwargs...) -> heatmap!(ax, reshape(x[1:Nx*Ny], Nx, Ny); kwargs...),
recordFromSolution = (u, p; k...) -> (amp = BK.getamplitude(p.prob, u, (@set par_cgl.r = p.p); ratio = 2), period = u[end]),
plot_solution = (x, p; k...) -> heatmap!(reshape(x[1:Nx*Ny], Nx, Ny); color=:viridis, k...),
# plot_solution = (ax, x, p; kwargs...) -> heatmap!(ax, reshape(x[1:Nx*Ny], Nx, Ny); kwargs...),
record_from_solution = (u, p; k...) -> (amp = BK.getamplitude(p.prob, u, (@set par_cgl.r = p.p); ratio = 2), period = u[end]),
normC = norminf)
8 changes: 4 additions & 4 deletions examples/cGL2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,8 @@ br_pok2 = continuation(PeriodicOrbitTrapProblem(poTrap; jacobian = :FullLU),
orbitguess_f, PALC(),
opts_po_cont;
verbosity = 2, plot = true,
plotSolution = (x ;kwargs...) -> plot_periodic_potrap(x, M, Nx, Ny; kwargs...),
recordFromSolution = (u, p) -> BK.amplitude(u, Nx*Ny, M), normC = norminf)
plot_solution = (x ;kwargs...) -> plot_periodic_potrap(x, M, Nx, Ny; kwargs...),
record_from_solution = (u, p) -> BK.amplitude(u, Nx*Ny, M), normC = norminf)
###################################################################################################
# we use an ILU based preconditioner for the newton method at the level of the full Jacobian of the PO functional
Jpo = @time poTrap(Val(:JacFullSparse), orbitguess_f, @set par_cgl.r = r_hopf - 0.01); # 0.5sec
Expand All @@ -250,8 +250,8 @@ opts_po_cont = ContinuationPar(dsmin = 0.0001, dsmax = 0.03, ds = 0.001, p_max =
br_po = @time continuation(poTrapMF, outpo_f.u, PALC(), opts_po_cont;
verbosity = 3,
plot = true,
# plotSolution = (x, p;kwargs...) -> BK.plot_periodic_potrap(x, M, Nx, Ny; ratio = 2, kwargs...),
# recordFromSolution = (u, p) -> BK.amplitude(u, Nx*Ny, M; ratio = 2),
# plot_solution = (x, p;kwargs...) -> BK.plot_periodic_potrap(x, M, Nx, Ny; ratio = 2, kwargs...),
# record_from_solution = (u, p) -> BK.amplitude(u, Nx*Ny, M; ratio = 2),
normC = norminf)

branches = Any[br_pok2]
Expand Down
2 changes: 1 addition & 1 deletion examples/carrier.jl
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ brdc = @time continuation(
p_max = 0.7, p_min = 0.05, detect_bifurcation = 0, plot_every_step = 40,
newton_options = setproperties(optnew; tol = 1e-9, max_iterations = 100, verbose = false)),
;verbosity = 1,
normN = norminf,
normC = norminf,
)

plot(brdc, legend=true)#, marker=:d)
Expand Down
2 changes: 1 addition & 1 deletion examples/chan-af.jl
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ plot(deflationOp.roots)
# other dot product
# dot(x::ApproxFun.Fun, y::ApproxFun.Fun) = sum(x * y) * length(x) # gives 0.1

optcont = ContinuationPar(dsmin = 0.001, dsmax = 0.05, ds= 0.01, p_max = 4.1, plot_every_step = 10, newtonOptions = NewtonPar(tol = 1e-8, max_iterations = 20, verbose = true), max_steps = 300, θ = 0.2, detect_bifurcation = 0)
optcont = ContinuationPar(dsmin = 0.001, dsmax = 0.05, ds= 0.01, p_max = 4.1, plot_every_step = 10, newton_options = NewtonPar(tol = 1e-8, max_iterations = 20, verbose = true), max_steps = 300, θ = 0.2, detect_bifurcation = 0)

br = @time continuation(
prob, PALC(bls=BorderingBLS(solver = optnew.linsolver, check_precision = false)), optcont;
Expand Down
2 changes: 1 addition & 1 deletion examples/codim2PO-sh-mf.jl
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ ns_po_sh = continuation(brpo_ns, 1, (@lens _.ϵ), opts_posh_ns;
jacobian_ma = :minaug,
# jacobian_ma = :autodiff,
# jacobian_ma = :finiteDifferences,
normN = norminf,
normC = norminf,
bothside = false,
callback_newton = BK.cbMaxNorm(1),
bdlinsolver = MatrixFreeBLS(@set lspo.N = lspo.N+2),
Expand Down
4 changes: 2 additions & 2 deletions examples/codim2PO.jl
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ pd_po_trap = continuation(brpo_pd, 1, (@lens _.b0), opts_potrap_pd;
detect_codim2_bifurcation = 0,
start_with_eigen = false,
jacobian_ma = :finiteDifferences,
normN = norminf,
normC = norminf,
callback_newton = BK.cbMaxNorm(1),
# bdlinsolver = BorderingBLS(solver = DefaultLS(), check_precision = false),
)
Expand Down Expand Up @@ -462,7 +462,7 @@ pd_po_sh2 = continuation(brpo_pd, 2, (@lens _.b0), opts_pocoll_pd;
jacobian_ma = :minaug,
# jacobian_ma = :autodiff,
# jacobian_ma = :finiteDifferences,
normN = norminf,
normC = norminf,
callback_newton = BK.cbMaxNorm(10),
bothside = true,
# bdlinsolver = BorderingBLS(solver = DefaultLS(), check_precision = false),
Expand Down
10 changes: 5 additions & 5 deletions examples/mittleman.jl
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ solbif = newton(prob, bp2d.x0, bp2d(deflationOp[3], δp), (@set par_mit.λ = bp2
plotsol(solbif.u-0*bp2d(deflationOp[2], δp))

brnf1 = continuation(re_make(prob, u0 = solbif.u, params = (@set par_mit.λ = bp2d.p + δp)), PALC(), setproperties(opts_br; ds = 0.005);
plotSolution = (x, p; kwargs...) -> plotsol!(x ; kwargs...),
plot_solution = (x, p; kwargs...) -> plotsol!(x ; kwargs...),
plot = true, verbosity = 3, normC = norminf)

branches2 = Any[br,br1,br2,brnf1]
Expand All @@ -242,7 +242,7 @@ push!(branches2, brnf1)
# plot!(brnf1)

brnf2 = continuation(re_make(prob, u0 = solbif.u, params = (@set par_mit.λ = bp2d.p + δp)), PALC(), setproperties(opts_br; ds = -0.005);
plotSolution = (x, p; kwargs...) -> plotsol!(x ; kwargs...),
plot_solution = (x, p; kwargs...) -> plotsol!(x ; kwargs...),
plot = true, verbosity = 3, normC = norminf)

# plot([br,br1,br2]);plot!(brnf1);plot!(brnf2)
Expand Down Expand Up @@ -286,8 +286,8 @@ brdef2 = @time BK.continuation(
re_make(brdef1.prob, u0 = deflationOp[5]), PALC(),
setproperties(opts_br;ds = -0.001, detect_bifurcation = 0, dsmax = 0.02);
verbosity = 3, plot = true,
recordFromSolution = (x, p) -> normbratu(x),
plotSolution = (x, p; kwargs...) -> plotsol!(x ; kwargs...), normC = norminf)
record_from_solution = (x, p) -> normbratu(x),
plot_solution = (x, p; kwargs...) -> plotsol!(x ; kwargs...), normC = norminf)

plot(br,br1,br2, brdef1, brdef2,plotfold=false, putspecialptlegend = false)

Expand All @@ -301,6 +301,6 @@ brdef2 = @time BK.continuation(
(@set prob.params.λ = 0.367), algdc,
ContinuationPar(opts_br; ds = -0.0001, max_steps = 800000, plot_every_step = 10, detect_bifurcation = 0);
plot=true, verbosity = 2,
normN = norminf)
normC = norminf)

plot(brdef2, color=:red)
20 changes: 9 additions & 11 deletions examples/pd-1d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,9 @@ br_po = @time continuation(
# ampfactor is a factor to increase the amplitude of the guess
verbosity = 2,
plot = true,
normN = norminf,
callbackN = BK.cbMaxNorm(1e2),
plotSolution = (x, p;kwargs...) -> (heatmap!(reshape(x[1:end-1], 2*N, M)'; ylabel="time", color=:viridis, kwargs...);plot!(br, subplot=1)),
recordFromSolution = (u, p) -> (max = maximum(u[1:end-1]), period = u[end]),#BK.maximumPOTrap(u, N, M; ratio = 2),
callback_newton = BK.cbMaxNorm(1e2),
plot_solution = (x, p;kwargs...) -> (heatmap!(reshape(x[1:end-1], 2*N, M)'; ylabel="time", color=:viridis, kwargs...);plot!(br, subplot=1)),
record_from_solution = (u, p) -> (max = maximum(u[1:end-1]), period = u[end]),#BK.maximumPOTrap(u, N, M; ratio = 2),
normC = norminf)

plot(br, br_po, label = "")
Expand All @@ -130,12 +129,11 @@ br_po_pd = @time continuation(
ampfactor = 0.9, δp = -0.01,
verbosity = 3,
plot = true,
normN = norminf,
callbackN = BK.cbMaxNorm(1e2),
callback_newton = BK.cbMaxNorm(1e2),
# jacobianPO = :FullSparseInplace,
# jacobianPO = :BorderedSparseInplace,
plotSolution = (x, p;kwargs...) -> (heatmap!(reshape(x[1:end-1], 2*N, M)'; ylabel="time", color=:viridis, kwargs...);plot!(br_po, subplot=1)),
recordFromSolution = (u, p) -> (max = maximum(u[1:end-1]), period = u[end]),#BK.maximumPOTrap(u, N, M; ratio = 2),
plot_solution = (x, p;kwargs...) -> (heatmap!(reshape(x[1:end-1], 2*N, M)'; ylabel="time", color=:viridis, kwargs...);plot!(br_po, subplot=1)),
record_from_solution = (u, p) -> (max = maximum(u[1:end-1]), period = u[end]),#BK.maximumPOTrap(u, N, M; ratio = 2),
normC = norminf)

plot(br, br_po, br_po_pd, label = "")
Expand Down Expand Up @@ -178,10 +176,10 @@ optcontpo = ContinuationPar(dsmin = 0.0001, dsmax = 0.01, ds= -0.005, p_min = -1
br_po_sh = @time continuation(probSh, outposh.u, PALC(), optcontpo;
verbosity = 3, plot = true,
linear_algo = MatrixFreeBLS(@set ls.N = probSh.M*n+2),
finaliseSolution = (z, tau, step, contResult; kw...) ->
finalise_solution = (z, tau, step, contResult; kw...) ->
(BK.haseigenvalues(contResult) && Base.display(contResult.eig[end].eigenvals) ;true),
plotSolution = (x, p; kwargs...) -> BK.plot_periodic_shooting!(x[1:end-1], 1; kwargs...),
recordFromSolution = (u, p) -> BK.getmaximum(probSh, u, (@set par_br_hopf.C = p.p); ratio = 2), normC = norminf)
plot_solution = (x, p; kwargs...) -> BK.plot_periodic_shooting!(x[1:end-1], 1; kwargs...),
record_from_solution = (u, p) -> BK.getmaximum(probSh, u, (@set par_br_hopf.C = p.p); ratio = 2), normC = norminf)

# branches = [br_po_sh]
# push!(branches, br_po_sh)
Expand Down
Loading

0 comments on commit d8bfa3d

Please sign in to comment.