# DynamicalSystems.jl v3

**URL:** <https://discourse.julialang.org/t/dynamicalsystems-jl-v3/95266>\
**Category:** Package Announcements\
**Tags:** nonlinear\
**Created:** [February 27, 2023, 12:14pm UTC](https://discourse.julialang.org/t/dynamicalsystems-jl-v3/95266 "2023-02-27T12:14:24Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Datseris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/datseris/32/13406_2.png) [@Datseris](https://discourse.julialang.org/u/Datseris)\
**Post date:** [February 27, 2023, 12:14pm UTC](https://discourse.julialang.org/t/dynamicalsystems-jl-v3/95266/1 "2023-02-27T12:14:24Z")

</div>

# DynamicalSystems.jl v3.0

Super duper major update that has just been tagged! 🙂

It has been a long time and a lot of hard work, but I can already see it was worth it :')

In the remaining of March I’ll spend time “putting out fires” (as I’m sure something broke that I didn’t foresee), porting the documentation to a DiffEq like style with links to other packages overhead, and making a new logo!

1. [Overhauling](#overhauling)

2. [Modularization](#modularization)

3. [New documentation](#new-documentation)

4. [Notable breaking changes](#notable-breaking-changes)

5. [Renames](#renames)

6. [Re-write of `DynamicalSystem`](#re-write-of-dynamicalsystem)

7. [ODE solver change](#ode-solver-change)

8. [Package split: StateSpaceSets.jl](#package-split-statespacesetsjl)

9. [Package split: FractalDimensions.jl](#package-split-fractaldimensionsjl)

10. [Partial overhaul: RecurrenceAnalysis.jl](#partial-overhaul-recurrenceanalysisjl)

11. [New amazing package ComplexityMeasures.jl](#new-amazing-package-complexitymeasuresjl)

12. [New amazing package Attractors.jl](#new-amazing-package-attractorsjl)

13. [Co-maintainer(s) needed](#co-maintainers-needed)

## Overhauling

Practically all packages that are part of DynamicalSystems.jl have been overhauled in some way or another. Some have been completely overhauled, like `DynamicalSystemsBase` and `ComplexityMeasures`. Some others have been partially overhauled like `RecurrenceAnalysis` and `ChaosTools`.

DynamicalSystems.jl was the first library I’ve written and after progressing as a software developer I have learned so much more about good design. I’ve put all this knowledge to good use and decided it was a good point to just do a mass-overhaul on the package.

## Modularization

The packages that compose DynamicalSystems.jl have been split up into more packages, making a more modular library, and also allowing a much smaller dependency tree for users that want only a specific part of the functionality.

The modularization itself did not bring any breaking changes.

## New documentation

This modularization also lead to a documentation overhaul: now every package of the library builds and hosts its own documentation. The DynamicalSystems.jl brings everything together with an overarching tutorial and points to the individual docs.

The main documentation of DynamicalSystems.jl now includes an overarching tutorial and overview, and then “dispatches” to documentations of other packages.

In the near future the documentation will be in the style similar to [DiffEqDocs](https://docs.sciml.ai/DiffEqDocs/stable/), however, I am still exploring alternative and stable ways to achieve similar results.

## Notable breaking changes

- The `trajectory` function now returns both the state space set and the time vector. In sort, all code that did `A = trajectory(...)` is now broken and should be replaced by `A, tvec = trajectory(...)`.

- There are no longer `diffeq` keyword arguments to downstream functions. All functions such as `lyapunovspectrum, basins_of_attraction`, etc. no longer accept the `diffeq` keyword, that used to specify arguments for DifferentialEquations.jl. Instead, the DiffEq solver options are decided during the creation of `CoupledODEs` (what was before `ContinuousDynamicalSystem`).

- The basic dynamical system constructors do not accept a Jacobian. Giving a fourth argument will error. The dedicated `TangentDynamicalSystem` should be used for this.

### Renames

Some things have been renamed to have a clearer and more specific name. These aren’t breaking changes, only deprecations. From the top of my head, the most important ones are:

- Dataset → StateSpaceSet

- DiscreteDynamicalSystem → DeterministicIteratedMap

- ContinuousDynamicalSystem → CoupledODEs

- The special type for 1D discrete dynamical systems has been removed. 1D systems are now represented by a 1D static vector that needs to be reshaped accordingly.

## Re-write of `DynamicalSystem`

The core library DynamicalSystemsBase.jl has had a complete re-write. This has the following major impacts:

1. Concept of what is a “dynamical system” is much more general. now `DynamicalSystem` defines a proper, extendable interface. The set of functions that the interface satisfies are listed in `DynamicalSystem` documentation string.

2. More variants of a dynamical system are offered. Any arbitrary steppable thing, like an agent based model, can become a dynamical system.

3. Overall much better and rigorous tests.

4. Now **_all concrete implementations of `DynamicalSystem` can be iteratively evolved in time via the `step!` function_**. For example, `ContinuousDynamicalSystem` is now a light wrapper around `ODEIntegrator`. After working with this library for years I realized that the “middle man” of representing a dynamical system (like an ode problem) was not really necessary in downstream functions, since all of them exclusively use an integrator.

5. Dynamical systems are completely detached from a Jacobian creation, which now is the exclusive task of `TangentDynamicalSystem`. As a result all predefined dynamical systems do not include a hand-coded Jacobian; rather the Jacobian needs to be given from `Systems` submodule to the `TangentDynamicalSystem`.

Also, the `Systems` submodule has been removed from the DynamicalSystemsBase.jl package and became a new package PredefinedDynamicalSystems.jl. It is untested and it is not recommended to use in any other setting other a demonstrational example. (this was always the case, it’s just that so far we weren’t transparent that nothing there was tested…)

Read more here: [DynamicalSystemsBase.jl · DynamicalSystemsBase.jl](https://juliadynamics.github.io/DynamicalSystemsBase.jl/dev/)

## ODE solver change

The default integrator used in continuous time Ordinary Differential Equations (what was before called `ContinuousDynamicalSystem` and now called `CoupledODEs`) is now `Tsit5()`. This means that OrdinaryDiffEq.jl is a dependency of DynamicalSystemsBase.jl. It is a better option than the previous `SimpleATsit5()`. Additionally, the insane compile and first-use time improvements in latest Julia versions had made the impact of loading OrdinaryDiffEq.jl much smaller.

## Package split: StateSpaceSets.jl

It has all functionality surrounding `StateSpaceSet` (what was previously known as `Dataset`). It therefore detaches the infrastructure for handing numeric data from delay embeddings, and now DelayEmbeddings.jl is a package dedicated to creating and optimizing delay coordinates embeddings.

> **[Numerical Data · StateSpaceSets.jl](https://juliadynamics.github.io/StateSpaceSets.jl/dev/)**
>
> Documentation for StateSpaceSets.jl.

## Package split: FractalDimensions.jl

All functionality related to computing fractal dimensions has been detached from ChaosTools.jl into a new package: [FractalDimensions.jl · FractalDimensions.jl](https://juliadynamics.github.io/FractalDimensions.jl/dev/)

## Partial overhaul: RecurrenceAnalysis.jl

RecurrenceAnalysis.jl, now in v2.0, has had its core type (`RecurrenceMatrix`) overhauled for better design, more clarity, extendibility, and overall more Julian programming utilizing multiple dispatch and dedicated types to specify options.

Now a subtype of `AbstractRecurrenceType` is used to specify how to create a recurrence matrix. More details in the docpage of the package:

> **[RecurrenceAnalysis.jl · RecurrenceAnalysis.jl](https://juliadynamics.github.io/RecurrenceAnalysis.jl/dev/)**
>
> Documentation for RecurrenceAnalysis.jl.

## New amazing package ComplexityMeasures.jl

This is a complete overhaul and massive enhancement of the previous Entropies.jl and deserves its own announcement post: [ComplexityMeasures.jl](https://discourse.julialang.org/t/complexitymeasures-jl/95198)

## New amazing package Attractors.jl

Incredibly exciting stuff that we (@awage @kalelr @Datseris) have been working on for the last year. It features an interface for finding attractors and their basin fractions, _as well as a new approach to “continuation”_. We are currently writing a paper for this, so the package doesn’t have an announcement yet. Once we have the preprint though, we will write an announcement post for the package and share the pre-print!

For now, feel free to see the docs and give us feedback!!!

> **[Attractors.jl · Attractors.jl](https://juliadynamics.github.io/Attractors.jl/dev/)**
>
> Documentation for Attractors.jl.

## Co-maintainer(s) needed

Some parts of the library have co-maintainers (Attractors.jl has @awage and @kalelr, ComplexityMeasures.jl and TimeseriesSurrogates.jl have @kahaaga) but this whole ecosystem around DynamicalSystems.jl has become too large and I think I just don’t have the time to maintain it alone anymore. So, I am kindly asking for people with expertise in both NLD and programming to consider coming on board and helping with answering questions, addressing issues, fixing bugs, and testing out the ecosystem. Feel free to contact me via a PM on Slack or here on Discourse!

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [February 27, 2023, 1:06pm UTC](https://discourse.julialang.org/t/dynamicalsystems-jl-v3/95266/2 "2023-02-27T13:06:55Z")

</div>

DynamicalSystems.jl is great stuff, happy to continue seeing it progress.

---

<div class="post-metadata">

**Author:** ![rveltz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rveltz/32/2707_2.png) [@rveltz](https://discourse.julialang.org/u/rveltz)\
**Post date:** [February 27, 2023, 4:44pm UTC](https://discourse.julialang.org/t/dynamicalsystems-jl-v3/95266/3 "2023-02-27T16:44:17Z")

</div>

> [@Datseris](#):
>
> CoupledODEs

This looks odd to me. Why not just ODE? Because of scalar ODE?

---

<div class="post-metadata">

**Author:** ![Datseris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/datseris/32/13406_2.png) [@Datseris](https://discourse.julialang.org/u/Datseris)\
**Post date:** [February 27, 2023, 4:58pm UTC](https://discourse.julialang.org/t/dynamicalsystems-jl-v3/95266/4 "2023-02-27T16:58:43Z")

</div>

Yeah it was very hard to come up with a very good name…

ContinuousDynamicalSystem wasn’t good enough in this new version, because it allows arbitrary systems, so what does continuous mean? in time, in variable space? And what kind of continuous? many different system types can be in continuous time, including stochastic systems. So that was a no go.

in the end I chose coupled ODEs for two reasons: 1) that’s how we first introduce these systems in our book, so I thought, might as well use the same here, and 2) I didn’t want to use only “ODEs” because, in the overwhelming majority of use cases of DynamicalSystems.jl one will have coupled ODEs. Uncoupled ones do not produce dynamics that are relevant enough for the scope of the package as they are separatable in individual 1-dimensional ODE, 3) only “ODEs” was very short compared to the now rather long `DeterministicIteratedMap`…

I’m not super happy with it, but its the best I could come up with…

---

<div class="post-metadata">

**Author:** ![empet](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/empet/32/221303_2.png) [@empet](https://discourse.julialang.org/u/empet)\
**Post date:** [February 27, 2023, 8:49pm UTC](https://discourse.julialang.org/t/dynamicalsystems-jl-v3/95266/5 "2023-02-27T20:49:18Z")

</div>

I had hoped to see that invariant manifolds of hyperbolic equilibria/fixed points of a DS had also been introduced.  
Is it planned to implement the computation of these invariant manifolds in the future?

---

<div class="post-metadata">

**Author:** ![rveltz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rveltz/32/2707_2.png) [@rveltz](https://discourse.julialang.org/u/rveltz)\
**Post date:** [February 27, 2023, 9:07pm UTC](https://discourse.julialang.org/t/dynamicalsystems-jl-v3/95266/6 "2023-02-27T21:07:10Z")

</div>

Which paper are you referring to?

---

<div class="post-metadata">

**Author:** ![empet](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/empet/32/221303_2.png) [@empet](https://discourse.julialang.org/u/empet)\
**Post date:** [February 27, 2023, 9:16pm UTC](https://discourse.julialang.org/t/dynamicalsystems-jl-v3/95266/7 "2023-02-27T21:16:28Z")

</div>

@rveltz I did not refer to a paper, but to a topic. I know that Yorke around 1991, Guckenheimer, a bit later, Osinga, Carles Simo have published algorithms to compute the invariant manifolds. Tomorrow I’ll search for the exact title of each paper and post here.

---

<div class="post-metadata">

**Author:** ![rveltz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rveltz/32/2707_2.png) [@rveltz](https://discourse.julialang.org/u/rveltz)\
**Post date:** [February 27, 2023, 10:35pm UTC](https://discourse.julialang.org/t/dynamicalsystems-jl-v3/95266/8 "2023-02-27T22:35:18Z")

</div>

Out of curiosity, are you referring to ODEs or iterated maps? (discalimer: I have not coded any)

---

<div class="post-metadata">

**Author:** ![empet](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/empet/32/221303_2.png) [@empet](https://discourse.julialang.org/u/empet)\
**Post date:** [February 28, 2023, 2:29am UTC](https://discourse.julialang.org/t/dynamicalsystems-jl-v3/95266/9 "2023-02-28T02:29:47Z")

</div>

I referred to both. Hyperbolic equilibria for vector fields, i.e. ODEs, while hyperbolic fixed points for discrete DS.

---

<div class="post-metadata">

**Author:** ![empet](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/empet/32/221303_2.png) [@empet](https://discourse.julialang.org/u/empet)\
**Post date:** [February 28, 2023, 8:21am UTC](https://discourse.julialang.org/t/dynamicalsystems-jl-v3/95266/10 "2023-02-28T08:21:32Z")

</div>

The first paper by Yorke et al, deals with invariant manifolds of discrete systems, and the next to ODEs:  
[https://yorke.umd.edu/Yorke\_papers\_most\_cited\_and\_post2000/1991\_07\_You\_Kostelich\_IJBC\_Calculating\_manifolds.pdf](https://yorke.umd.edu/Yorke_papers_most_cited_and_post2000/1991_07_You_Kostelich_IJBC_Calculating_manifolds.pdf)  
[https://www.researchgate.net/publication/230800479\_A\_Fast\_Method\_for\_Approximating\_Invariant\_Manifolds](https://www.researchgate.net/publication/230800479_A_Fast_Method_for_Approximating_Invariant_Manifolds)

> **[2006.01.pdf](https://research-information.bris.ac.uk/ws/portalfiles/portal/2994274/2006.01.pdf)**

> **[2003r26.pdf](https://research-information.bris.ac.uk/ws/portalfiles/portal/2989163/2003r26.pdf)**

> **[1105.1277.pdf](https://arxiv.org/pdf/1105.1277.pdf)**
>
> 2.12 MB

---

<div class="post-metadata">

**Author:** ![Datseris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/datseris/32/13406_2.png) [@Datseris](https://discourse.julialang.org/u/Datseris)\
**Post date:** [February 28, 2023, 10:11am UTC](https://discourse.julialang.org/t/dynamicalsystems-jl-v3/95266/11 "2023-02-28T10:11:06Z")

</div>

> [@empet](#):
>
> I had hoped to see that invariant manifolds of hyperbolic equilibria/fixed points of a DS had also been introduced.  
> Is it planned to implement the computation of these invariant manifolds in the future?

This is easy to do and in fact we have it as an exercise in our book. We already have the `fixedpoints` function that returns stable/unstable fixed points and their eigenvalues. One can carry one from this code to get the eigenvectors and then evolve the stable ones backwards in time or the unstable ones forwards in time.

Definitely easy to do.

Please open an issue or give it a shot at implementing it!

---

<div class="post-metadata">

**Author:** ![Sergey\_Novak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sergey_novak/32/37716_2.png) [@Sergey\_Novak](https://discourse.julialang.org/u/Sergey_Novak)\
**Post date:** [February 28, 2023, 10:35am UTC](https://discourse.julialang.org/t/dynamicalsystems-jl-v3/95266/12 "2023-02-28T10:35:20Z")

</div>

Hello, i not see function `produce_orbitdiagram`, it is removed?

---

<div class="post-metadata">

**Author:** ![Datseris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/datseris/32/13406_2.png) [@Datseris](https://discourse.julialang.org/u/Datseris)\
**Post date:** [February 28, 2023, 10:36am UTC](https://discourse.julialang.org/t/dynamicalsystems-jl-v3/95266/13 "2023-02-28T10:36:16Z")

</div>

Yes, it is obsolete. Now `orbitdiagram` works for any kind of dynamical system so you initialize a `PoincareMap` and give this to `orbitdiagram`. I guess I forgot to add this to the changelog!!!

\_that’s exactly what I am talking about putting out fires 😃 \_

---

<div class="post-metadata">

**Author:** ![Datseris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/datseris/32/13406_2.png) [@Datseris](https://discourse.julialang.org/u/Datseris)\
**Post date:** [February 28, 2023, 10:37am UTC](https://discourse.julialang.org/t/dynamicalsystems-jl-v3/95266/14 "2023-02-28T10:37:14Z")

</div>

Ah, it is not removed, it is deprecated: [ChaosTools.jl/deprecations.jl at main · JuliaDynamics/ChaosTools.jl · GitHub](https://github.com/JuliaDynamics/ChaosTools.jl/blob/main/src/deprecations.jl#L21-L34)

---

<div class="post-metadata">

**Author:** ![Sergey\_Novak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sergey_novak/32/37716_2.png) [@Sergey\_Novak](https://discourse.julialang.org/u/Sergey_Novak)\
**Post date:** [February 28, 2023, 10:38am UTC](https://discourse.julialang.org/t/dynamicalsystems-jl-v3/95266/15 "2023-02-28T10:38:20Z")

</div>

Thank you, when I lost function I was scared)

---

<div class="post-metadata">

**Author:** ![empet](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/empet/32/221303_2.png) [@empet](https://discourse.julialang.org/u/empet)\
**Post date:** [February 28, 2023, 10:43am UTC](https://discourse.julialang.org/t/dynamicalsystems-jl-v3/95266/16 "2023-02-28T10:43:59Z")

</div>

@Datseris It is straightforward to get a one dimensional unstable manifold of a hyperbolic equilibrium, but for two or three dimensional it isn’t, especially when this manifold has a special topology ( see Guckenheimer’s and Osinga’s papers from the links I posted).

---

<div class="post-metadata">

**Author:** ![Sergey\_Novak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sergey_novak/32/37716_2.png) [@Sergey\_Novak](https://discourse.julialang.org/u/Sergey_Novak)\
**Post date:** [February 28, 2023, 10:45am UTC](https://discourse.julialang.org/t/dynamicalsystems-jl-v3/95266/17 "2023-02-28T10:45:48Z")

</div>

Can you share code with example, how use it in v3?  
Over the past few months, I’ve been using it quite often for future articles and it has always helped quite a lot. Also I wanted to add save initial condition and saving output in file.

---

<div class="post-metadata">

**Author:** ![Datseris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/datseris/32/13406_2.png) [@Datseris](https://discourse.julialang.org/u/Datseris)\
**Post date:** [February 28, 2023, 10:48am UTC](https://discourse.julialang.org/t/dynamicalsystems-jl-v3/95266/18 "2023-02-28T10:48:16Z")

</div>

The link i’ve posted is the literal source code of what the function does.

---

<div class="post-metadata">

**Author:** ![Datseris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/datseris/32/13406_2.png) [@Datseris](https://discourse.julialang.org/u/Datseris)\
**Post date:** [February 28, 2023, 10:48am UTC](https://discourse.julialang.org/t/dynamicalsystems-jl-v3/95266/19 "2023-02-28T10:48:38Z")

</div>

Ah I see. Okay, then this can be done in steps. For 1D manifolds its easy so best to start there!

(EDIT: Also, I think it is rather uncommon to have eigenvalue degeneracy for a generic dynamical system. These are the situations you are referring to, right?)

---

<div class="post-metadata">

**Author:** ![Sergey\_Novak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sergey_novak/32/37716_2.png) [@Sergey\_Novak](https://discourse.julialang.org/u/Sergey_Novak)\
**Post date:** [February 28, 2023, 12:02pm UTC](https://discourse.julialang.org/t/dynamicalsystems-jl-v3/95266/20 "2023-02-28T12:02:22Z")

</div>

If I need to save all phase variables, should I specify the full vector? How to build a diagram in this case? I don’t really understand how to select the variable I need from the vector of vectors

Can I make changes to a function that will save the output to a file at each iteration, for example in jld2? If the orbit diagram is calculating for about a day, I think it would be good if you could look at the result at any time

[Next page](https://discourse.julialang.org/t/dynamicalsystems-jl-v3/95266.md?page=2)
