Nonlinear Dynamics textbook + DynamicalSystems.jl 2.0

Hello everyone!

In this post I’m happy to announce the latest news surrounding the DynamicalSystems.jl library! In the following I’ll summarize the most exciting things that have been happening to the library over the previous year(s). Most of these have been incrementally added over time and are not really strictly part of 2.0 release, but oh well.

Typically this post would have been a blog post, but actually I don’t have a blog so here we are!

A main conclusion I can draw from all these updates is that according to my knowledge, more than 80% of the DynamicalSystems.jl functionality does not exist in any other open source package for any language. (please do let me know if you think I’m wrong, I would be very happy to encounter competition!)

Nonlinear dynamics textbook

Over the last two years we’ve been working on a new way to teach nonlinear dynamics. This cultivated into a new physics/mathematics textbook that explicitly includes runnable Julia code snippets and will soon be published in Springer’s “Undergraduate Lecture Notes in Physics” series.

My JuliaCon2021 talk Changing Physics education with Julia talks about the book in detail, so I’ll refer there! There is also an online repo related with the book: GitHub - JuliaDynamics/NonlinearDynamicsTextbook: coming soon

Small breaking changes

Two small breaking changes have occurred in this release:

  • Keyword argument dt was clashing with dt from DifferentialEquations.jl and had to be renamed. It is now named Δt, accessed with \Delta<TAB>t. Many functions have been affected by this, e.g. lyapunov, lyapunovspectrum, gali, expansionentropy, orbitdiagram.

  • Dataset indexing has been clarified with a minor breaking change that dataset[i::AbstractVector] now returning a Dataset instead of a Vector{SVector}.

  • All deprecations existing in previous versions have been removed.

  • Some new deprecations have been added, which rename things for greater clarity.

Delay embeddings

We have moved forwards to a generalized embedding interface (genembed). This interface not only clears previously clunky structs, but allows some advanced methods of nonlinear dynamics (see below) to be implemented in an intuitive manner.

We now have implemented many, many new methods for delay coordinates embeddings.

We have an automated method for optimal embedding via the traditional approach.

We have also implemented the new cutting edge research on delay embedding, following the so called unified approach. A paper we wrote on a new method can be found here: https://iopscience.iop.org/article/10.1088/1367-2630/abe336

All this huge amount of work is due to @hkraemer (Hauke Kraemer)!

Entropies.jl

“New” Julia package from main author @kahaaga (Kristian A. Haaga) which is also part of the DynamicalSystems.jl library! It provides an interface to obtain probability distributions representing trajectories or sets in the state space. These probabilities can then be used to calculate a corresponding entropy. At the moment we have at least a dozen of distinct estimators.

Fractal dimensions

With the hard work of @apbraun (Anton Braun) and @igkottlarz (Inga Kottlarz), we have implemented several methods to estimate fractal dimensions. We used these methods to compare fractal dimension estimates in a thorough manner, something that was missing from the nonlinear dynamics literature. A paper with this comparison will be soon available on arXiv.

link to paper pending, subscribe to this post to get an update

Basins of attraction

Huge contributions from @awage (Alexandre Wagemakers) provided quality algorithms for finding basins of attraction of dynamical systems and to estimate the fractal nature of basin boundaries. We have a brand new basin method basins_of_attraction which works for any dynamical system: discrete, continuous, Poincare map, stroboscopic map, high dimensional, lower-dimensional projections of higher-dimensional, you name it.

It does not exist anywhere else and we are currently writing a paper about it that we will soon put on arXiv.

link to paper pending, subscribe to this post to get an update

Tipping points

The basins of attraction contributions opened the door for DynamicalSystems.jl to start implementing algorithms and concepts related to Tipping Points, which are the fanciest things happening on dynamical systems research in the past couple of years, and it is of major relevance for climate change. In fact, most conferences with anything related to climate will probably have a session on tipping points, and now I can happily say that DynamicalSystems.jl is having such methods!

(Unfortunately, even to this day, papers published in 2020 still do not make their methods available as open source implementations. I implement as much as I can to DynamicalSystems.jl after reading the papers, but I still long for the day where each published paper will have code published with it…)

Miscellaneous additions

There have been several miscellaneous additions, e.g. mean_return_times in ChaosTools.jl, and Recurrence Networks in RecurrenceAnalysis.jl. It is best to see the Contents page of the docs for more!

Colorblind-friendly color palette

In the spirit of inclusivity I wanted to come up with a colorblind friendly palette to use in the book and as well in the documentation of JuliaDynamics packages. Thankfully, with the help of this amazing website by David Nichols I was able to come up with the following palette:

(p.s. i love purple)

COLORSCHEME = [
    "#6F4AC7",
    "#33CBD8",
    "#1B1B1B",
    "#E82727",
    "#535D7F",
    "#A6D210",
]

So in this subsection I pretty much wanted to advertise the website by David Nichols :smiley:

Thank you

Thanks to everyone that contributed to the library so far! You can see all of them here: JuliaDynamics

And thank you all for taking the time to read this update, and for supporting this library in any conceivable manner. Every single star on GitHub, or every single mentioning of the library, I can see it, and I appreciate every single one tremendously!

58 Likes

Awesome! I love your package and I will be first in line for your new book. I am about 200 pages into writing a control systems textbook (already got a publisher) and I was intending to do the same as you with Julia examples. So far I have just used SciLab scripts (because it’s free) but these will all be replaced by Julia scripts. Everything is in LaTeX + Tikz + Asymptote.

9 Likes

Ha, awesome! Good to hear Roger! Control systems aren’t that far off from what I’m doing!

1 Like

Would love to hear about your control system textbook :slight_smile: Is there any information yet?

1 Like

Hi @SonLe ! Thank you for your message! All my CPUs are at 100% at the moment with my day job so I won’t have any time to work on my book for a while. However, I retire in (about) May next year and then I will return to my text book. As yet it has no Julia, but I will replace most (possibly all) of the scripts with Julia examples, the plots will be re-done in Julia (Gadfly or Cairo Makie). I use LaTeX and the brilliant jlcode.sty . So don’t hold your breath! I have a lot to do before it’s finished. :sunglasses:

1 Like

@Datseris: I just watched yourJuliaCon 2021 talk. Really beautiful and inspiring! I’ve been teaching numerical linear algebra with Julia for several years and just did an undergrad nonlinear dynamics course last spring. I so totally agree with you about the need to mesh code-writing and calculation with theory in topics like this!

So far I’ve been rolling my own Julia notebooks for the purpose, say, teaching students about Poincare maps, showing how to calculate them in a Julia notebook, and then giving them as an assignment the task of computing a periodic orbit of a 3d chaotic ODE as a fixed point of the 2d return map on the Poincare section using NLsolve.jl. As you say, Julia’s combination of expressivity and high performance makes this kind of thing possible, in a way it never was before.

I look forward to getting your Springer book and probably teaching nonlinear dynamics with it next time.

By the way, I was happy to see you used delay embeddings as the example for this talk. I’m the Gibson in a few of the papers you reference in the New Journal of Physics paper (ref [8] and [10]). We met at JuliaCon 2017, I think, after your talk.

6 Likes

Hi John, thank you very much for your kind words! Yes, I remember JuliaCon 2017 and now I’m super nostalgic of real-life-meetings :’) Soon I believe we’ll meet in person again! haha!

Interesting! I’ve given pretty much identical exercises but asked for a different approach of first calculating the orbits and then using linear interpolation to obtain the crossings of the hyperplane. If you want I can share with you the exercises/solutions. The NLSolve way is something I haven’t done so far (I’m actually using Roots.jl and DiffEq’s interpolation capabilities to find PSOS in DynamicalSystems.jl), so if you have any code snippet lying around I’d be glad to have a look!

Awww thanks, but don’t rush coz you’ll be getting one in your mailbox soon (Springer will give us a batch to distribute as we please)!

hehe, it’s a small world, isn’t it? I think delay embeddings is one of the things one really, really has to stress a lot in an NLD course. Apparently many people approach delay embeddings as this “off the shelf magic tool that can be applied anywhere”, and this isn’t a productive way forwards… So on purpose one of the exercise datasets on delay embeddings is just crap, to train the students prepare for the real world hahaha

2 Likes

Hi @Datseris

Really excited about the book. Is there an expected date for publication?

Hi @EvoArt, I’m excited as well, but it seems like it will take a while… Springer gave us 28th of February as the date that the book would be out, but I’m not sure whether this is an accurate estimate! I guess you can track this page: Nonlinear Dynamics | SpringerLink