fbpx
Wikipedia

Arnold's cat map

In mathematics, Arnold's cat map is a chaotic map from the torus into itself, named after Vladimir Arnold, who demonstrated its effects in the 1960s using an image of a cat, hence the name.[1] It is a simple and pedagogical example for hyperbolic toral automorphisms.

Picture showing how the linear map stretches the unit square and how its pieces are rearranged when the modulo operation is performed. The lines with the arrows show the direction of the contracting and expanding eigenspaces

Thinking of the torus as the quotient space , Arnold's cat map is the transformation given by the formula

Equivalently, in matrix notation, this is

That is, with a unit equal to the width of the square image, the image is sheared one unit up, then two units to the right, and all that lies outside that unit square is shifted back by the unit until it is within the square.

Properties edit

The discrete cat map edit

 
From order to chaos and back. Sample mapping on a picture of 150x150 pixels. The number shows the iteration step; after 300 iterations, the original image returns.
 
Sample mapping on a picture of a pair of cherries. The image is 74 pixels wide, and takes 114 iterations to be restored, although it appears upside-down at the halfway point (the 57th iteration).

It is possible to define a discrete analogue of the cat map. One of this map's features is that image being apparently randomized by the transformation but returning to its original state after a number of steps. As can be seen in the adjacent picture, the original image of the cat is sheared and then wrapped around in the first iteration of the transformation. After some iterations, the resulting image appears rather random or disordered, yet after further iterations the image appears to have further order—ghost-like images of the cat, multiple smaller copies arranged in a repeating structure and even upside-down copies of the original image—and ultimately returns to the original image.

The discrete cat map describes the phase space flow corresponding to the discrete dynamics of a bead hopping from site qt (0 ≤ qt < N) to site qt+1 on a circular ring with circumference N, according to the second order equation:

 

Defining the momentum variable pt = qt − qt−1, the above second order dynamics can be re-written as a mapping of the square 0 ≤ q, p < N (the phase space of the discrete dynamical system) onto itself:

 
 

This Arnold cat mapping shows mixing behavior typical for chaotic systems. However, since the transformation has a determinant equal to unity, it is area-preserving and therefore invertible the inverse transformation being:

 
 

For real variables q and p, it is common to set N = 1. In that case a mapping of the unit square with periodic boundary conditions onto itself results.

When N is set to an integer value, the position and momentum variables can be restricted to integers and the mapping becomes a mapping of a toroidial square grid of points onto itself. Such an integer cat map is commonly used to demonstrate mixing behavior with Poincaré recurrence utilising digital images. The number of iterations needed to restore the image can be shown never to exceed 3N.[4]

For an image, the relationship between iterations could be expressed as follows:

 

Models edit

Python code for Arnold's Cat Map edit

import os from PIL.Image import open as load_pic, new as new_pic def main(path, iterations, keep_all=False, name="arnold_cat-{name}-{index}.png"):  """  Params  path:str  path to photograph  iterations:int  number of iterations to compute  name:str  formattable string to use as template for file names  """ title = os.path.splitext(os.path.split(path)[1])[0] counter = 0 while counter < iterations: with load_pic(path) as image: dim = width, height = image.size with new_pic(image.mode, dim) as canvas: for x in range(width): for y in range(height): nx = (2 * x + y) % width ny = (x + y) % height canvas.putpixel((nx, height-ny-1), image.getpixel((x, height-y-1))) if counter > 0 and not keep_all: os.remove(path) counter += 1 print(counter, end="\r") path = name.format(name=title, index=counter) canvas.save(path) return canvas if __name__ == "__main__": path = input("Enter the path to an image:\n\t") while not os.path.exists(path): path = input("Couldn't find your chosen image, please try again:\n\t") result = main(path, 3) result.show() 

See also edit

References edit

  1. ^ Vladimir I. Arnold; A. Avez (1967). Problèmes Ergodiques de la Mécanique Classique (in French). Paris: Gauthier-Villars.; English translation: V. I. Arnold; A. Avez (1968). Ergodic Problems in Classical Mechanics. New York: Benjamin.
  2. ^ Franks, John M (October 1977). "Invariant sets of hyperbolic toral automorphisms". American Journal of Mathematics. 99 (5). The Johns Hopkins University Press: 1089–1095. doi:10.2307/2374001. ISSN 0002-9327. JSTOR 2374001.
  3. ^ Sloane, N. J. A. (ed.). "Sequence A004146". The On-Line Encyclopedia of Integer Sequences. OEIS Foundation.
  4. ^ Dyson, Freeman John; Falk, Harold (1992). "Period of a Discrete Cat Mapping". The American Mathematical Monthly. 99 (7). Mathematical Association of America: 603–614. doi:10.2307/2324989. ISSN 0002-9890. JSTOR 2324989.

External links edit

arnold, mathematics, chaotic, from, torus, into, itself, named, after, vladimir, arnold, demonstrated, effects, 1960s, using, image, hence, name, simple, pedagogical, example, hyperbolic, toral, automorphisms, picture, showing, linear, stretches, unit, square,. In mathematics Arnold s cat map is a chaotic map from the torus into itself named after Vladimir Arnold who demonstrated its effects in the 1960s using an image of a cat hence the name 1 It is a simple and pedagogical example for hyperbolic toral automorphisms Picture showing how the linear map stretches the unit square and how its pieces are rearranged when the modulo operation is performed The lines with the arrows show the direction of the contracting and expanding eigenspacesThinking of the torus T2 displaystyle mathbb T 2 as the quotient space R2 Z2 displaystyle mathbb R 2 mathbb Z 2 Arnold s cat map is the transformation G T2 T2 displaystyle Gamma mathbb T 2 to mathbb T 2 given by the formula G x y 2x y x y mod1 displaystyle Gamma x y 2x y x y bmod 1 Equivalently in matrix notation this is G xy 2111 xy mod1 1101 1011 xy mod1 displaystyle Gamma left begin bmatrix x y end bmatrix right begin bmatrix 2 amp 1 1 amp 1 end bmatrix begin bmatrix x y end bmatrix bmod 1 begin bmatrix 1 amp 1 0 amp 1 end bmatrix begin bmatrix 1 amp 0 1 amp 1 end bmatrix begin bmatrix x y end bmatrix bmod 1 That is with a unit equal to the width of the square image the image is sheared one unit up then two units to the right and all that lies outside that unit square is shifted back by the unit until it is within the square Contents 1 Properties 2 The discrete cat map 3 Models 3 1 Python code for Arnold s Cat Map 4 See also 5 References 6 External linksProperties editG is invertible because the matrix has determinant 1 and therefore its inverse has integer entries G is area preserving G has a unique hyperbolic fixed point the vertices of the square The linear transformation which defines the map is hyperbolic its eigenvalues are irrational numbers one greater and the other smaller than 1 in absolute value so they are associated respectively to an expanding and a contracting eigenspace which are also the stable and unstable manifolds The eigenspaces are orthogonal because the matrix is symmetric Since the eigenvectors have rationally independent components both the eigenspaces densely cover the torus Arnold s cat map is a particularly well known example of a hyperbolic toral automorphism which is an automorphism of a torus given by a square unimodular matrix having no eigenvalues of absolute value 1 2 The set of the points with a periodic orbit is dense on the torus Actually a point is periodic if and only if its coordinates are rational G is topologically transitive i e there is a point whose orbit is dense The number of points with period n displaystyle n nbsp is exactly l1n l2n 2 displaystyle lambda 1 n lambda 2 n 2 nbsp where l1 displaystyle lambda 1 nbsp and l2 displaystyle lambda 2 nbsp are the eigenvalues of the matrix For example the first few terms of this series are 1 5 16 45 121 320 841 2205 3 The same equation holds for any unimodular hyperbolic toral automorphism if the eigenvalues are replaced G is ergodic and mixing G is an Anosov diffeomorphism and in particular it is structurally stable The mapping torus of G is a solvmanifold and as with other Anosov diffeomorphisms this manifold has solv geometry The discrete cat map edit nbsp From order to chaos and back Sample mapping on a picture of 150x150 pixels The number shows the iteration step after 300 iterations the original image returns nbsp Sample mapping on a picture of a pair of cherries The image is 74 pixels wide and takes 114 iterations to be restored although it appears upside down at the halfway point the 57th iteration It is possible to define a discrete analogue of the cat map One of this map s features is that image being apparently randomized by the transformation but returning to its original state after a number of steps As can be seen in the adjacent picture the original image of the cat is sheared and then wrapped around in the first iteration of the transformation After some iterations the resulting image appears rather random or disordered yet after further iterations the image appears to have further order ghost like images of the cat multiple smaller copies arranged in a repeating structure and even upside down copies of the original image and ultimately returns to the original image The discrete cat map describes the phase space flow corresponding to the discrete dynamics of a bead hopping from site qt 0 qt lt N to site qt 1 on a circular ring with circumference N according to the second order equation qt 1 3qt qt 1 0modN displaystyle q t 1 3q t q t 1 0 mod N nbsp Defining the momentum variable pt qt qt 1 the above second order dynamics can be re written as a mapping of the square 0 q p lt N the phase space of the discrete dynamical system onto itself qt 1 2qt ptmodN displaystyle q t 1 2q t p t mod N nbsp pt 1 qt ptmodN displaystyle p t 1 q t p t mod N nbsp This Arnold cat mapping shows mixing behavior typical for chaotic systems However since the transformation has a determinant equal to unity it is area preserving and therefore invertible the inverse transformation being qt 1 qt ptmodN displaystyle q t 1 q t p t mod N nbsp pt 1 qt 2ptmodN displaystyle p t 1 q t 2p t mod N nbsp For real variables q and p it is common to set N 1 In that case a mapping of the unit square with periodic boundary conditions onto itself results When N is set to an integer value the position and momentum variables can be restricted to integers and the mapping becomes a mapping of a toroidial square grid of points onto itself Such an integer cat map is commonly used to demonstrate mixing behavior with Poincare recurrence utilising digital images The number of iterations needed to restore the image can be shown never to exceed 3N 4 For an image the relationship between iterations could be expressed as follows n 0 T0 x y Input Image x y n 1 T1 x y T0 mod 2x y N mod x y N n k Tk x y Tk 1 mod 2x y N mod x y N n m Output Image x y Tm x y displaystyle begin array rrcl n 0 quad amp T 0 x y amp amp text Input Image x y n 1 quad amp T 1 x y amp amp T 0 left bmod 2x y N bmod x y N right amp amp vdots n k quad amp T k x y amp amp T k 1 left bmod 2x y N bmod x y N right amp amp vdots n m quad amp text Output Image x y amp amp T m x y end array nbsp Models editPython code for Arnold s Cat Map edit import os from PIL Image import open as load pic new as new pic def main path iterations keep all False name arnold cat name index png Params path str path to photograph iterations int number of iterations to compute name str formattable string to use as template for file names title os path splitext os path split path 1 0 counter 0 while counter lt iterations with load pic path as image dim width height image size with new pic image mode dim as canvas for x in range width for y in range height nx 2 x y width ny x y height canvas putpixel nx height ny 1 image getpixel x height y 1 if counter gt 0 and not keep all os remove path counter 1 print counter end r path name format name title index counter canvas save path return canvas if name main path input Enter the path to an image n t while not os path exists path path input Couldn t find your chosen image please try again n t result main path 3 result show See also edit nbsp Mathematics portalList of chaotic maps Recurrence plotReferences edit Vladimir I Arnold A Avez 1967 Problemes Ergodiques de la Mecanique Classique in French Paris Gauthier Villars English translation V I Arnold A Avez 1968 Ergodic Problems in Classical Mechanics New York Benjamin Franks John M October 1977 Invariant sets of hyperbolic toral automorphisms American Journal of Mathematics 99 5 The Johns Hopkins University Press 1089 1095 doi 10 2307 2374001 ISSN 0002 9327 JSTOR 2374001 Sloane N J A ed Sequence A004146 The On Line Encyclopedia of Integer Sequences OEIS Foundation Dyson Freeman John Falk Harold 1992 Period of a Discrete Cat Mapping The American Mathematical Monthly 99 7 Mathematical Association of America 603 614 doi 10 2307 2324989 ISSN 0002 9890 JSTOR 2324989 External links editWeisstein Eric W Arnold s Cat Map MathWorld Effect of randomisation of initial conditions on recurrence time Arnold s Cat Map by Enrique Zeleny The Wolfram Demonstrations Project Arnold s Cat Map An interactive graphical exploration Retrieved from https en wikipedia org w index php title Arnold 27s cat map amp oldid 1195940870, wikipedia, wiki, book, books, library,

article

, read, download, free, free download, mp3, video, mp4, 3gp, jpg, jpeg, gif, png, picture, music, song, movie, book, game, games.