JuliaDynamics / Attractors.jl

Find attractors of dynamical systems, their basins, and continue them across parameters. Study global stability (a.k.a. non-local, or resilience). Also tipping points functionality.
MIT License
27 stars 5 forks source link

Improvements to convergence time functions. #125

Closed Datseris closed 2 months ago

Datseris commented 2 months ago

Add new function convergence_and_basins_fractions, and improve the algorithm counting the convergence iterations for AttractorsViaRecurrences to give more accurate results, by taking into account the user-provided convergence criteria.

To make it possible i added one more field on the basin info struct that contains a return code that tells us how the recurrences map ended.

awage commented 2 months ago

Nice one! I didn't spotted these inconsistencies! The only mismatch will happen with the :bas_hit state has been reached. In this case you cannot know the convergence because the trajectory has not converged to the attractor yet. Nevertheless, if accuracy is an issue, setting consecutive_basin_steps to a high number does the trick.

I have seen the code and just made a suggestion. I can try to set up a test if you need it.

Datseris commented 2 months ago

If you wish to contribute a test that indeed would be fantastic!

Datseris commented 2 months ago

I also realized that in the case of the Proximity Mapper, we return the actual convergence time, not iteration number. While in the recurrences we return the iteration number instead. We have to harmonize this.

First, we need to rename this function to convergence_time and second, for the recurrences we need to return the iteration multiplied by the internal; Δt. I will do this change now.