-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLEofLogisticMap.asv
More file actions
36 lines (35 loc) · 1.3 KB
/
LEofLogisticMap.asv
File metadata and controls
36 lines (35 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
function LE = LEofLogisticMap( rStart, rEnd, rStep )
% @brief calculates Lyapunov exponent of logistic map for r within the interval (3.5,4)
% x(t+1) = r*x(t)*(1-x(t))
% using derivative for values of control parameter from rStart to rEnd with step rStep
% INPUT
% - rStart - first value of control parameter r
% - rEnd - last values of control parameter r
% - rStep - step
% OUTPUT
% - LE - values of estimated Lyapunov exponent according to [S03]
% REFERENCES
% [S03] J.C. Sprott, 2003. Chaos and time-series analysis, volume 69. Oxford University Press Oxford.
%
% @author Valentina Unakafova
% @email UnakafovaValentina(at)gmail.com
% @date 11.07.2017
rValues = rStart:rStep:rEnd;
nPoints = length( rValues );
nIterations = 1000; % number of iterations
LE = zeros( 1, nPoints );
x = zeros( 1, nIterations + 1 );
x( 1 ) = 0.1;
for k = 1:nPoints
sum = 0;
for i = 1:nIterations
% x( i + 1 ) = 4*rValues( k )*x( i )*( 1 - x( i ) );
if (x( i ) < 0.5)
x( i + 1 )=cos(3.14*(rValues( k )*sin(3.14*x( i ))+2*(1-rValues( k ))*x( i )-0.5));
else
x( i + 1 ) =cos(3.14*(rValues( k )*sin(3.14*x( i ))+2*(1-rValues( k ))*(1-x( i ))-0.5)) ;
end
sum = sum + log( abs( rValues( k ) - 2*rValues( k )*x( i ) ) );
end
LE( k ) = sum / nIterations;
end