12.07.2015 Views

Lyapunov exponents of the predator prey model Ljapunovovy ...

Lyapunov exponents of the predator prey model Ljapunovovy ...

Lyapunov exponents of the predator prey model Ljapunovovy ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

436 ImplementationIn this section we explain <strong>the</strong> algorithms which were used in numerical experimentsand briefly introduce Python 2.7 in which all <strong>the</strong> numerical experiments were implemented.Python 2.7 is interpreted scripting language which does mean that <strong>the</strong> source codedoesn’t have to be compiled and it is executed by an interpreter while it is running. Thegreatest advantage <strong>of</strong> Python 2.7 is that <strong>the</strong> source codes are short and easy to read. Itis multi-platform and open-source language with many libraries for specific use suchas SciPy and NumPy which are an alternative for some MATLAB functions. For <strong>the</strong>introduction to Python 2.7 see [11].Here we give <strong>the</strong> overlook at libraries used for numerical experiments:• decimal – library used for variable precision arithmetic and work with big numbers• pylab – library for plotting• math – library for basic ma<strong>the</strong>matical operations• numpy – library used for work with matrices, alternative to MATLAB functions• scipy – library for scientific calculations, alternative to MATLAB functions• sympy – library for symbolic calculationsAlgorithms for one-dimensional casesThe following code computes <strong>the</strong> value <strong>of</strong> H n,k for <strong>the</strong> Logistic map directly from definition3.11.1 # import packages2 from decimal import *3 from math import *4 import pylab56 # set <strong>the</strong> precision7 getcontext() .prec = 40089 # set <strong>the</strong> initial values10 itermax = 500 # number <strong>of</strong> iterations11 k = Decimal(300.0) # k12 x = [Decimal(pi) − Decimal(3.0)] # seed 113 xt = [x[0] + Decimal(10 ** (−k))] # seed 21415 # set <strong>the</strong> initial value <strong>of</strong> H_1,k16 H = [Decimal(Decimal(log(abs(x[0] − xt[0]),10)) /( Decimal(1.0)) + (k/(Decimal(1.0)))) ]1718 for i in range(itermax):

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!