Skip to content

improve legend for bifurcation diagrams using Makie #244

@rveltz

Description

@rveltz

Hi,

The following situation is not very nice. Can it be improved?

using Revise, GLMakie
using BifurcationKit
const BK = BifurcationKit

# vector field of the problem
function COm(u, p)
	(;q1,q2,q3,q4,q5,q6,k) = p
	x, y, s = u
	z = 1-x-y-s

	[
		2q1 * z^2 - 2q5 * x^2 - q3 * x * y,
		q2 * z - q6 * y - q3 * x * y,
		q4 * z - k * q4 * s
	]
end

recordCO(x, p; k...) = (x = x[1], y = x[2], s = x[3])

prob = BifurcationProblem(COm, [0.07, 0.2, 05], (q1 = 2.5, q2 = 0.6, q3 = 10., q4 = 0.0675, q5 = 1., q6 = 0.1, k = 0.4), (@optic _.q2); record_from_solution = recordCO)

opts_br = ContinuationPar(p_max = 1.9, dsmax = 0.01)
br = continuation(prob, PALC(), opts_br; normC = norminf)

sn_codim2 = continuation(br, 2, (@optic _.k), ContinuationPar(opts_br, p_max = 2.2, ds = -0.001, dsmax = 0.05);
normC = norminf, bothside = true, detect_codim2_bifurcation = 2,)

hp_codim2 = continuation(br, 1, (@optic _.k), ContinuationPar(opts_br, p_max = 2.8, ds = -0.001, dsmax = 0.025) ;
normC = norminf, detect_codim2_bifurcation = 2,bothside = true,)

BK.plot(sn_codim2, hp_codim2)
Image

Idem for this

BK.plot(sn_codim2, hp_codim2, vars = (:q2, :x))

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions