Skip to content

Commit

Permalink
improve show method for DCResult
Browse files Browse the repository at this point in the history
correct prediction in show method for NS normal form
remove figure size in Makie recipe
  • Loading branch information
rveltz committed Jul 12, 2024
1 parent 9651736 commit 4948c6a
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
3 changes: 2 additions & 1 deletion src/DeflatedContinuation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ Base.length(br::DCResult) = length(br.branches)

function Base.show(io::IO, brdc::DCResult; comment = "", prefix = " ")
printstyled(io, "Deflated continuation result, # branches = $(length(brdc.branches))", "\n", color=:cyan, bold = true)
for br in brdc.branches
for (ii, br) in pairs(brdc.branches)
printstyled("\nBranch #", ii, ":\n", color = :cyan, bold = true)
show(io, br)
end
end
Expand Down
2 changes: 1 addition & 1 deletion src/periodicorbit/BifurcationPoints.jl
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ function Base.show(io::IO, ns::NeimarkSackerPO)
println(io, " bifurcation point of periodic orbit\n┌─ ", get_lens_symbol(ns.nf.lens),"$(ns.p).")
println(io, "├─ Frequency θ ≈ ", ns.ω)
println(io, "├─ Period at the periodic orbit T ≈ ", abs(ns.T))
println(io, "├─ Second period of the bifurcated torus ≈ ", abs(2pi/ns.ω))
println(io, "├─ Second period of the bifurcated torus ≈ ", abs(2pi*ns.ω*ns.T))
if ns.prm
println(io, "├─ Normal form z -> z⋅eⁱᶿ(1 + a⋅δp + b⋅|z|²)")
else
Expand Down
6 changes: 3 additions & 3 deletions src/periodicorbit/PeriodicOrbitCollocation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -364,16 +364,16 @@ function generate_ci_problem(pb::PeriodicOrbitOCollProblem,
N = length(u0)

n, m, Ntst = size(pb)
nunknows = N * (1 + m * Ntst)
n_unknows = N * (1 + m * Ntst)

par = sol.prob.p
prob_vf = re_make(bifprob, params = par)

pbcoll = setproperties(pb,
N = N,
prob_vf = prob_vf,
ϕ = zeros(nunknows),
= zeros(nunknows),
ϕ = zeros(n_unknows),
= zeros(n_unknows),
cache = POCollCache(eltype(pb), N, m))

# find best period candidate
Expand Down
4 changes: 2 additions & 2 deletions src/periodicorbit/cop.jl
Original file line number Diff line number Diff line change
Expand Up @@ -302,9 +302,9 @@ end
_ipiv2perm!(p, F.ipiv, size(F, 1))
_invperm!(pinv, p)

@assert p[nbcoll+1] == nbcoll+1 "Pivoting strategy failed!!"
@assert p[nbcoll+1] == nbcoll+1 "Pivoting strategy failed!! Please report to the website of BifurcationKit. You may try the default linear solver `defaultLS` as a backup."
if dim > 0
@assert p[nbcoll+2] == nbcoll+2 "Pivoting strategy failed!!"
@assert p[nbcoll+2] == nbcoll+2 "Pivoting strategy failed!! Please report to the website of BifurcationKit. You may try the default linear solver `defaultLS` as a backup."
end

# Lₜ = LowerTriangular(F.L) # zero allocation?
Expand Down
4 changes: 2 additions & 2 deletions src/plotting/RecipesMakie.jl
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ function plot(contres::AbstractBranchResult; kP...)
ind1, ind2 = get_plot_vars(contres, nothing)
xlab, ylab = get_axis_labels(ind1, ind2, contres)

fig = Figure(size = (1200, 700))
fig = Figure()
ax1 = fig[1, 1] = Axis(fig, xlabel = String(xlab), ylabel = String(ylab), tellheight = true)

plot!(ax1, contres; kP...)
Expand All @@ -153,7 +153,7 @@ function plot(brs::AbstractBranchResult...;
branchlabel = fill("", length(brs)),
kP...)
if length(brs) == 0; return ;end
fig = Figure(size = (1200, 700))
fig = Figure()
ax1 = fig[1, 1] = Axis(fig)

for (id, contres) in pairs(brs)
Expand Down

0 comments on commit 4948c6a

Please sign in to comment.