Ginelli et al. (2007), Figure 1a

Ginelli 07 Fig 1a reproduced

This is an attempt to reproduce Figure 1a of Ginelli et al. (2007). The following code sets up two problems CLVProblem to compute the covariant Lyapunov vectors (CLVs) of the two-dimensional maps, the Hénon map (LyapunovExponents.henon_map) and the Lozi map (LyapunovExponents.lozi_map).

The probability density function of the angles between the two CLVs are plotted. See Ginelli et al. (2007) for how the shape of this probability density function is related to hyperbolicity.

using LyapunovExponents

function get_angles(solver)
    return [acos(abs(dot(C[:, 1], C[:, 2]))) * 2 / π for C
            in backward_dynamics!(solver; progress=1)]
end

henon_demo = LyapunovExponents.henon_map(t_attr=1000000)
henon_demo.prob :: LEProblem
henon_prob = CLVProblem(henon_demo.prob)  # convert it to CLVProblem
henon_angles = @time get_angles(init(henon_prob))

lozi_prob = CLVProblem(LyapunovExponents.lozi_map(t_attr=1000000).prob)
lozi_angles = @time get_angles(init(lozi_prob))

using Plots
plt = plot(xlabel="Angle [pi/2 rad]", ylabel="Density", legend=:topleft)
stephist!(plt, henon_angles,
          bins=1000, normalize=true, linecolor=1, label="Henon")
stephist!(twinx(plt), lozi_angles,
          bins=1000, normalize=true, linecolor=2, label="Lozi")
plt