JuliaDynamics / CriticalTransitions.jl

A Julia package for critical transitions in dynamical systems with time-dependent forcing
https://juliadynamics.github.io/CriticalTransitions.jl/dev/
MIT License
26 stars 3 forks source link

gMAM HeymannVandenEijnden method broken #26

Open oameye opened 8 months ago

oameye commented 8 months ago

the following code

using CriticalTransitions, Test

function meier_stein(u, p, t) # out-of-place
    x, y = u
    dx = x - x^3 - 10 * x * y^2
    dy = -(1 + x^2) * y
    [dx, dy]
end
σ = 0.25
sys = StochSystem(meier_stein, [], zeros(2), σ, idfunc, nothing, I(2), "WhiteGauss")

# initial path: parabola
xx = range(-1.0, 1.0, length = 30)
yy = 0.3 .* (-xx .^ 2 .+ 1)
init = Matrix([xx yy]')

method = CriticalTransitions.LBFGS()
gm = geometric_min_action_method(sys, init, maxiter = 100, method=method)
method = "HeymannVandenEijnden"
gm = geometric_min_action_method(sys, init, maxiter = 100, method=method)

gives

InexactError: Int64(4.384056944159697)
reykboerner commented 8 months ago

Yes, sorry that the HeymannVandenEijnden option of gMAM is currently not working. I hope to fix it at some point but for now Optim.jl methods such as the default LBFGS() should be used instead.