LagrangianDescriptors.jl
Painting the phase portrait of random and deterministic systems
Install / Use
/learn @JuliaDynamics/LagrangianDescriptors.jlREADME
Lagrangian Descriptors

Implementation of the method of Lagrangian Descriptors to highlight singular features (e.g. stable or unstable invariant manifolds) of the dynamics of an evolutionary system (such as ordinary or partial differential equations, random equations, or stochastic differential equations).
Examples
Periodically forced Duffing oscillator
Here in an example on a periodically forced Duffing system.
using OrdinaryDiffEq, Plots
using LinearAlgebra: norm
using LagrangianDescriptors
function f!(du, u, p, t)
x, y = u
A, ω = p
du[1] = y
du[2] = x - x^3 + A * sin(ω * t)
end
u0 = [0.5, 2.2]
tspan = (0.0, 13.0)
A = 0.3; ω = π
p = (A, ω)
prob = ODEProblem(f!, u0, tspan, p)
M(du, u, p, t) = norm(du)
uu0 = [[x, y] for y in range(-1.0, 1.0, length=301), x in range(-1.8, 1.8, length=301)]
lagprob = LagrangianDescriptorProblem(prob, M, uu0)
With all setup, we may solve it as follows:
julia> @time lagsol = solve(lagprob, Tsit5())
4.241800 seconds (204.88 M allocations: 9.173 GiB, 23.40% gc time, 24.99% compilation time)
Then we use the built-in plot recipe to get the heatmap of the Lagrangian descriptors:
plot(lagsol)

Random Duffing oscillator
And here is a painting of a random Duffing oscillator, detailed in the Tutorials part of the documentation:

References
- Painting the Phase Portrait of a Dynamical System with the Computational Tool of Lagrangian Descriptors
- Lagrangian descriptors: A method for revealing phase space structures of general time dependent dynamical systems
- Lagrangian Descriptors - Discovery and Quantification of Phase Space Structure and Transport
- Frequently Asked Questions about Lagrangian Descriptors
Related Skills
node-connect
342.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
84.7kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
342.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
84.7kCommit, push, and open a PR
