Skip to content

push! is type unstable #328

@rveltz

Description

@rveltz

Hi,

I use SA in BifurcationKit but I recently noticed that the push! is type unstable. If I remove StructArray in here in ContResult, the TI disappear. Am I wrongly using your package?

using Revise
using BifurcationKit

function Fsl!(out, X, p)
    (;μ, c ) = p
    x, y = X
    ua = x^2 + y^2
    out[1] = μ * x - y - x * ua * c
    out[2] = x + μ * y - y * ua * c
    out
end

function JFsl!(J, X, p)
    (;μ, c) = p
    x, y = X
    ua = x^2 + y^2

    J[1, 1] = μ - c * (ua + 2x^2)
    J[1, 2] = -1 - 2c * x * y
    J[2, 1] = 1 - 2c * x * y
    J[2, 2] = μ - c * (ua + 2y^2)

    J
end
JFsl(x,p) = JFsl!(zeros(2,2),x,p)
prob = BifurcationProblem(Fsl!, zeros(2), (μ=0-.1, c=1.), (@optic _.μ); J! = JFsl!, J = JFsl)

opts = ContinuationPar(p_max = 2., detect_bifurcation = 0, detect_fold=false)
br = @time continuation(prob, PALC(), opts)

@profview (for _=1:10000; continuation(prob, PALC(), ContinuationPar(p_max = 2., detect_bifurcation = 0, detect_fold=false)); end 

gives

Image Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions