4.83333

4.8 | 19 ratings Rate this file 140 downloads (last 30 days) File Size: 3.91 KB File ID: #4628

Calculation Lyapunov Exponents for ODE

by Vasiliy Govorukhin

 

15 Mar 2004 (Updated 18 Mar 2004)

Code covered by the BSD License  

Realization of alogrithm of chaos detection by determining Lyapunov exponents.

Download Now | Watch this File

File Information
Description

Lyapunov exponent calcullation for ODE-system. The alogrithm employed in this m-file for determining Lyapunov exponents was proposed in A. Wolf, J. B. Swift, H. L. Swinney, and J. A. Vastano, "Determining Lyapunov Exponents from a Time Series," Physica D, Vol. 16, pp. 285-317, 1985.

For integrating ODE system can be used any MATLAB ODE-suite methods.

This function is a part of MATDS program - toolbox for dynamical system investigation
See: http://www.math.rsu.ru/mexmat/kvm/matds/

Input parameters:
   n - number of equation
   rhs_ext_fcn - handle of function with right hand side of extended ODE-system. This function must include RHS of ODE-system coupled with variational equation (n items of linearized systems, see Example).
   fcn_integrator - handle of ODE integrator function, for example: @ode45
   tstart - start values of independent value (time t)
   stept - step on t-variable for Gram-Schmidt renormalization procedure.
   tend - finish value of time
   ystart - start point of trajectory of ODE system.
   ioutp - step of print to MATLAB main window. ioutp==0 - no print, if ioutp>0 then each ioutp-th point will be print.

   Output parameters:
   Texp - time values
   Lexp - Lyapunov exponents to each time value.

   Users have to write their own ODE functions for their specified systems and use handle of this function as rhs_ext_fcn - parameter.

Example. Lorenz system:
  dx/dt = sigma*(y - x)
  dy/dt = r*x - y - x*z
  dz/dt = x*y - b*z

      The Jacobian of system:
        | -sigma sigma 0 |
    J = | r-z -1 -x |
        | y x -b |

    Then, the variational equation has a form:
    F = J*Y
where Y is a square matrix with the same dimension as J.
    Corresponding m-file:
        function f=lorenz_ext(t,X)
        SIGMA = 10; R = 28; BETA = 8/3;
        x=X(1); y=X(2); z=X(3);
        Y= [X(4), X(7), X(10);
            X(5), X(8), X(11);
            X(6), X(9), X(12)];
        f=zeros(9,1);
        f(1)=SIGMA*(y-x);
        f(2)=-x*z+R*x-y;
        f(3)=x*y-BETA*z;
        Jac=[-SIGMA,SIGMA,0;
             R-z,-1,-x; y, x,-BETA];
        f(4:12)=Jac*Y;

% Run Lyapunov exponent calculation:
    
[T,Res]=lyapunov(3,@lorenz_ext,@ode45,0,0.5,200,[0 1 0],10);
   
    See files: lyapunov.m - algorithm
               lorenz_ext - Lorenz system extended rhs
               run_lyap - example of calling and result visualization
Govorukhin V.N.
This file is intended for use with MATLAB and was produced for MATDS-program http://www.math.rsu.ru/mexmat/kvm/matds/
lyapunov.m is free software. lyapunov.m is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY.

MATLAB release MATLAB 6.0 (R12)
Zip File Content  
Other Files lyapunov.m,
run_lyap.m,
lorenz_ext.m
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (25)
22 May 2004 Lahcen AIT MOUDID

Good work

12 Aug 2004 Haigeng Luo

I wrote a matlab programme for caculating the Lyapunov_exponents of chaotic system.Your programme give me a good reference,thank you!But there is a problem:the second lyapunov exponent do not converge to zero,as my result,why?

05 Apr 2005 francesco salvadori

Excellent program!
I'm writing an upgrade for calculation of Lyapunov spectra...
I have a question: why the second Lyapunov exponent do not converge to zero ?

20 May 2005 Jojo Blanza

Excellent!
Any reference on computing the lyapunov exponents of synchronized chaotic systems.

29 May 2005 sohel ali

I wrote a program to compute Lyapunov Exponent for Chaotic systems using equations. But I would like to know if anybody has written a program to compute Lyapunov Exponents from Time Series.

05 Jul 2005 Yolande Taffoti

Excellent program. Did somebody wrote one program that can calculate the Lyapunov exponent of coupled system? Like two coupled Lorenz attractors with then 6 degree of freedom?

05 Aug 2005 Hossein Nejat

Excellent

20 Jun 2006 amar bayou

good afternoon every one
I search a programm regarding lyapunov exponents calculation for a time series
thanks for your help

19 Jul 2006 Xiang Ji

Excellent. I am puzzling for the calculation of lyapunov exponents for a long time. Thanks for your work.

31 Jul 2006 mihailescu emilian

Excellent

06 Aug 2006 Li Xian-feng

Good !I hope anybody ,who majoring bifurcation and chaos, join my group,and become friends from now on! I am a Ph. D in China!

17 Nov 2006 Tanmoy Banerjee

Its a very useful for those who are new to the field and trying to cpture the vast field. Thank you.

13 Dec 2006 rui yue ouyang  
21 Feb 2007 José Armando Fernández Gallego

Muy buen algoritmo, ha sido muy útil para encontrar los Exponentes de Lyapunov usando otros sistemas continuos.

18 Apr 2007 Javier Bejarano  
06 Sep 2007 Andrew Lim

thanks for the code, just one question. The result produce by the code does not seems to correspond to the results shown in the book "Chaotic and Fractal Dynamics, Moon,1992, pg318". Why??

26 Sep 2007 Laura Villamizar

I was working with the algoritm, with the same example, the same conditions; I just write again the code, but it reports an error:
??? Error using ==> +
Function '+' is not defined for values of class 'function_handle'.

Error in ==> C:\MATLAB6p5\lyapunov\lyapunov.m
On line 86 ==> n1=n; n2=n1*(n1+1);

27 Sep 2007 Laura Villamizar

It´s excellent tool for the calculation of Lyapunov exponents.
Congratulations.

30 Sep 2007 alaa taha

I am working with the algoritm, with the same example, it works good
can you halpe me to use this program to work whith pendulum system and I greatly apreciate this help

06 Oct 2007 alaa taha

I am working with the algoritm, with the same example, it works good
can you halpe me to use this program to work whith pendulum system and I greatly apreciate this help

02 Apr 2008 luuk buur

good

03 Jun 2008 Behnam Molaee Ardekani

It works good.

For those interested readers who want to know more about the algorhtm of computing Lyapanov Exponent and do not have access to the refered article (i.e. A. Wolf et al 1985) I suggest them to read the following article:
K. Ramasubramanian, M.S. Sriram, A Comparative study of computation of Lyapunov spectra with different algorithms, Physica D, 139 pp 72-86, 2000.

Hint: The programmer has not used all capabilities of matrix manipulations in the MATLAB; instead he/she has used lots of "for" commands in the code.

26 Mar 2009 Pearlyn Lim

thank you

26 Mar 2009 Pearlyn Lim

I hav a time series signal, which i saved under the variable "X". How do i use the cides provided to calculate the Lyapunov Exponent? Thank you

26 Mar 2009 Pearlyn Lim

*codes

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
differential equations Vasiliy Govorukhin 22 Oct 2008 07:16:22
chaos Vasiliy Govorukhin 22 Oct 2008 07:16:22
lyapunov Vasiliy Govorukhin 22 Oct 2008 07:16:22
mathematics Vasiliy Govorukhin 22 Oct 2008 07:16:22
exponent Vasiliy Govorukhin 22 Oct 2008 07:16:22
nonlinear Viet Dang 05 Nov 2009 13:40:28
simulink Viet Dang 05 Nov 2009 13:40:28
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com