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

How to obtain the correct corr dim for Lorenz attractor. #38

Open
ricardofrantz opened this issue Dec 7, 2023 · 1 comment
Open

How to obtain the correct corr dim for Lorenz attractor. #38

ricardofrantz opened this issue Dec 7, 2023 · 1 comment

Comments

@ricardofrantz
Copy link

Hi Christopher,

I'd like to extend my gratitude for developing such a library. I've chosen to raise a topic in the issues section, anticipating that others may also find it relevant. I aim to utilize your package to calculate the correlation dimension of various dynamical systems. However, to have confidence in the outcomes, I need to be able to replicate the commonly referenced dimension value of
d=2.05±0.01 for the Lorenz attractor with (sigma, rho, beta)=(10, 28, 8/3). Ideally, my goal is to generate a figure akin to the one attached. I find it perplexing that most packages, despite claims of this capability, seldom demonstrate this value in their documentation or examples. Could you provide any guidance or examples that successfully achieve this benchmark?

Thanks for your time,
Ricardo

Screenshot 2023-12-07 at 23 11 14
@CSchoel
Copy link
Owner

CSchoel commented Jan 4, 2024

Hi Ricardo. 👋 Unfortunately, I only occasionally have time to work on nolds, but good settings for the Lorenz system are one of my priorities for the path to version 1.0. The current version that you get when you install directly via pip install git+https://github.com/CSchoel/nolds.git has a corresponding example that you can run with python -m nolds.examples lorenz. If you add debug_plot=True to the call that reconstructs the correlation dimension from the data of the variable y, you get the following plot:

corr_dim_y

With the y coordinate, you get closest to the prescribed value with d = 2.057. If you want to look at the values outside the "linear part" of the curve, you can substitute rvals = nolds.logarithmic_r(1, np.e, 1.1) with rvals = nolds.logarithmic_r(np.e**-1, np.e**4, 1.1).

The example code boils down to this:

import nolds
import nolds.datasets as nd
sigma = 10
rho = 28
beta = 8.0/3
start = [0, 22, 10]
n = 10000
skip = 10000
dt = 0.012
data = nd.lorenz_euler(n + skip, sigma, rho, beta, start=start, dt=dt)[skip:]
rvals = nolds.logarithmic_r(np.e**-1, np.e**2, 1.1)  # determined experimentally
corr_dim_args = dict(emb_dim=5, lag=10, fit="poly", rvals=rvals)
cdx = nolds.corr_dim(data[:, 0], **corr_dim_args)
cdy = nolds.corr_dim(data[:, 1], **corr_dim_args, debug_plot=True)
cdz = nolds.corr_dim(data[:, 2], **corr_dim_args)  

Unfortunately, it was not at all trivial to find good parameter settings for this experiment. My main issue is that I didn't find any example in the literature that reports all parameters, both for the simulation of the Lorenz system and the correlation dimension algorithm. If you come across such an example, I would be immensely grateful for a link.

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

No branches or pull requests

2 participants