My old project for strange attractors
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 
 

47 lines
1.1 KiB

fractal dimension (actually the correlation dimension)
int counts[2] = {0};
r = 0.006 * totalSize;
for(j = 1:1000){
x0 = x;
for(i = 1:1000){
x = f(x);
if( |x - x0| <= r )
++counts[0];
if( |x - x0| <= 10*r )
++counts[1];
}
}
return log(counts[1] / counts[0]) / log(10.0);
lyapunov
double s = 0;
for(j = 1:1000){
x' = x + dx;
x = f(x);
x' = f(x');
s += log(|x' - x| / dx)
}
return s / N;
"The Lyapunov exponent is calculated as with the corresponding maps except that it is divided by e so that its units are bits per second rather than bits per iteration since each iteration advances the solution by e seconds. It is customary to express the Lyapunov exponent in this way for differential equations since the step size depends upon the numerical approximation that is being used whereas the divergence of the trajectories per unit time is an intrinsic property of the differential equations."
lyapunov 0, dimension 2 => torus
" For polynomial maps and ODEs the fractal dimension varies approximately as the square root of the embedding dimension."
entropy?
3 10%
x^3 = 0.1
log (0.1) / log (3)