Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] nonlocal stability measure estimator #165

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

Datseris
Copy link
Member

This PR is by @andreasmorr and adds a nonlocal stability estimator construct that can compute every nonlocal stability measure at once during finding attractors and/or during the continuation.

mutable struct StabilityMeasuresAccumulator <: AttractorMapper
mapper::AttractorMapper
ds::DynamicalSystem
basin_points::Dict{Int64, StateSpaceSet}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All these dictionaries should state StateSpaceSet{D, T} and {D, T} should be type parameters of the struct.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the cleanest way to extract the specific {D, T} from a given mapper?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

D = dimension(ds)
T = eltype(current_state(ds))

* `finite_time_basin_stability`: Same as `finite_time_basin_fractions`, but the
initial conditions are weighted by the probability density of the distribution
`d`.
* `persistence`: Trajectories from all points of the attractor are evolved under
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is special. Measures that require parameter change do not fit to this interface. We need to create another function for them I think...

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I agree. Can we still include it in this PR/ file though?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, if you want to, but it has to be a separate function for source code clarity. It would be a function you run after global_continuation has finished and you utilize the attractors_cont output.

@Datseris
Copy link
Member Author

plotting is simple, we don't need a specialized function:

attractors_cont, all_measures = global_cont(stability_accumulator)

all_measures = vector ( dictonary ( measure_name => dictionary (id => number) ) )

mcs = [dicts["minimal_fatal_shock_magnitude"] for dicts in all_measures]

plot_continuation_curves(mcs, parameter_curve)

@Datseris
Copy link
Member Author

Datseris commented Mar 6, 2025

I just found the paper: https://journals.aps.org/pre/abstract/10.1103/PhysRevE.93.042205 "Constrained basin stability for studying transient phenomena in dynamical systems".

It is identical to estimating the basin stability, but instead of weighting the distribution by a given density ρ, you weight the distribution by a "selector function". Only trajectories whose transients satisfy property "X" are counted. I think it is very straightforward to add this as yet another indicator in this PR.

We make a function indicator(u0, ds, tc) with ds the dynamical system. Inside this function the user may perform arbitrary numerics of whether the trajectory starting from u0, with arbitrary transient, satisfies the condition. tc is the convergence time that we have already estimated from the given initial condition at the previous step of the aglroithm of estimating all other stability measures. then the indicator function returns true/false, which tells whether to add u0 to the count or not.

@andreasmorr I can add this functionality in the code once the PR is ready to go.

Improved some resilience measures and corrected errors and imprecisions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants