home *** CD-ROM | disk | FTP | other *** search
/ Best Objectech Shareware Selections / UNTITLED.iso / boss / grap / anim / 010 / chaos.doc < prev    next >
Encoding:
Text File  |  1989-10-08  |  13.7 KB  |  333 lines

  1.                        CHAOS version 2.1A
  2.  
  3.      (C) Copyright 1989 Judson McCranie.  All rights reserved.
  4.  
  5.                        Judson S. McCranie
  6.                        Software Solutions
  7.                        2406 Orlando Drive
  8.                        Valdosta, GA 31602
  9.                        Ph: (912) 242-1405
  10.  
  11. This program is produced by a member of the Association of
  12. Shareware Professionals (ASP).  ASP wants to make sure that the
  13. shareware principle works for you.  If you are unable to resolve
  14. a shareware-related problem with an ASP member by contacting the
  15. member directly, ASP may be able to help.  The ASP Ombudsman can
  16. help you resolve a dispute or problem with an ASP member, but
  17. does not provide technical support for members' products.  Please
  18. write to the ASP Ombudsman at P.O. Box 5786, Bellevue, WA 98006
  19. or send a Compuserve message via easyplex to ASP Ombudsman
  20. 70007,3536.
  21.  
  22. This program is distributed on a "Shareware" (try-before-you-buy)
  23. basis.  You are free to copy it and to distribute copies at cost. 
  24. You may not alter the program (or its documentation) or sell it
  25. for profit.  If you like these programs, register them by sending
  26. your name and address along with the program name and version
  27. number above with a $10 registration and license fee (for the
  28. entire package of Chaos programs) to me at the address above. 
  29. You will receive support for the program, announcements of new
  30. versions of this program, and information about several other
  31. programs.  Please send any inquires, comments, or suggestions to
  32. me at the address above.  Even if you are not a registered user,
  33. I would appreciate any comments or suggestions.  
  34.  
  35. These programs should run on any IBM-PC/XT/AT/PS-2, or compatible
  36. system that has any common graphics adapter.  A fast CPU is
  37. recommended.  (Significantly faster 80x87 versions may be
  38. forthcoming.)
  39.  
  40. Welcome to the world of Chaos!  The following programs are
  41. included in this package:
  42.  
  43.     BUTERFLY - Investigate the Lorentz "Butterfly"
  44.     TRIANGLE - Generate a surprising pattern randomly
  45.     LOGISTIC - Graphs the logistic equation
  46.     3-BODY   - A simplified orbit of a planet around two stars
  47.     HENON    - Draws Henon diagrams
  48.  
  49. These programs were developed using Turbo Pascal 3.0, 4.0, 5.0,
  50. and 5.5 from Borland International.  The Turbo Professional 5.0
  51. package from Turbo Power Software provided useful data entry
  52. routines.
  53.  
  54. The files *.BGI are graphics drivers for virtually all graphics
  55. adapters.  They are proprietary to Borland International and are
  56. distributed with permission.
  57.  
  58.  
  59. C H A O S
  60.  
  61. The PBS show "Nova" broadcast Jan 31, 1989 was about the new
  62. science of Chaos.  For reading about Chaos, I recommend:
  63.  
  64.     Chaos - making a new science" by James Gleick, Viking, 1987
  65.  
  66.     Does God Play Dice? - The Mathematics of Chaos"
  67.       by Ian Stewart, Basil Blackwell, 1989
  68.  
  69.     "Chaos" by James Crutchfield, et al, Sci. Amer. 12/89, 38-49
  70.  
  71.     "Metamagical Themas", Sci. Amer. 11/81, 16-29.
  72.  
  73.     "Computer Recreations", Sci. Amer., 7/87.
  74.  
  75.  
  76. B U T E R F L Y
  77.  
  78. Edward N. Lorenz published "Deterministic Nonperiodic Flow" in
  79. the Journal of Atmospheric Sciences in March 1963 (130-141). That
  80. paper modeled atmospheric convection by a system of nonlinear
  81. differential equations in a 3-dimensional phase space.  He showed
  82. that the equations have two stable solutions, and that when the
  83. value of a constant (R) is below a critical value, the convection
  84. will eventually get into one of those two stable states.  When R
  85. is larger than the critical value, the system "orbits" the two
  86. stable points or attractors (in phase space) chaotically and
  87. never settles down into a stable state.
  88.  
  89. BUTERFLY is a program to investigate the Lorenz "Butterfly" in
  90. several ways.  You begin by entering a value of R not greater
  91. than 40.  The program defaults to 35.0.  Then you have a choice
  92. of nine ways to look at the butterfly.  
  93.  
  94. Views "1", "2", and "3" graph two of the the dimensions of the
  95. object.  View 1 graphs Y and Z, view 2 graphs X and Z, and view 3
  96. graphs X and Y.  The graph is color coded according to the
  97. dimension not graphed in each view.  Press "C" to toggle the
  98. color option.  
  99.  
  100. Views "x", "y", and "z" graph that dimension in time.  When the
  101. graph gets to the right-hand side of the screen it will start
  102. over at the left, except that the X, Y, and Z values starting at
  103. the left side will be 1/10 of 1 percent (0.001) different.  The
  104. two graphs (in different colors) will overlap for a while, then
  105. they will separate - often radically.  When the second graph gets
  106. to the right-hand side of the screen it will pause until you
  107. press a key.  The "P" key will toggle this "pause" option.
  108.  
  109. Views "X", "Y", and "Z" graph each relative max or relative min
  110. in that dimension versus the previous one.  The relative max and
  111. relative min values are graphed in different colors.  This takes
  112. dome time to generate, since it takes a whole loop of the
  113. butterfly to generate two points.
  114.  
  115. While the program is running, you can also press "T" or "t".  The
  116. "t" key doubles the time increment.  This makes the program run
  117. faster, but the points are farther apart, and less accurate.  The
  118. "T" key halves the time increment.  
  119.  
  120. Press the <ESC> key and any other key to stop the program.  If
  121. you use <CTRL-BREAK>, the program will leave your screen in
  122. graphics mode, which is undesirable.
  123.  
  124.  
  125. T R I A N G L E
  126.  
  127. This program performs a process that generates a pattern randomly
  128. as seen on "Nova - The science of Chaos", Jan. 31, 1989.  
  129.  
  130. The process is as follows : choose points A, B, and C (not on a
  131. line).  Now choose an initial point (the "current point")
  132. anywhere.  Repeat the following process: randomly choose either
  133. A, B, or C.  Call the midpoint of that point and the current
  134. point the new current point and plot it.  Repeat the process with
  135. the new current point.
  136.  
  137. When the process is repeated many times, a surprising pattern
  138. emerges.  The program TRIANGLE performs this process and plots
  139. the points so you can see the pattern.  
  140.  
  141. The program asks you for the number of milliseconds to delay
  142. between each point, the default is 0.  A delay of 0 plots the
  143. points as rapidly as possible.  A delay of, say, 10 to 100 lets
  144. you see each point being plotted.
  145.  
  146. You will get a different set of points each time the program is
  147. run, but the pattern will be the same.
  148.  
  149. Some people have asked me for an explanation of how you get such
  150. a pattern from randomness.  This is a brief informal explanation
  151. that could be made rigorous.
  152.  
  153. The current point must eventually fall inside triangle ABC.  If
  154. the current point is outside triangle ABC, successive points are
  155. nearer to the triangle.  Once the current point is sufficiently
  156. near ABC, as soon as each of A, B, and C have been chosen the new
  157. current point must be inside ABC.
  158.  
  159. Now suppose the current point is anywhere inside ABC.  If point A
  160. is now chosen, the next current point (the midpoint of the
  161. current point and A) must be inside AEF.  Similarly, if B was
  162. chosen, the next current point must be in BDE, or if C is chosen
  163. it must be in CDF.  So once the current point is inside ABC, the
  164. next current point cannot be inside DEF.
  165.  
  166.                                   A
  167.                                   /\
  168.                                 /    \
  169.                               /        \
  170.                           E /------------\ F
  171.                           / \            / \
  172.                         /     \        /     \
  173.                       /         \    /         \
  174.                     /-------------\/-------------\
  175.                   B               D                C
  176.  
  177. Now, without loss of generality, assume that the current point is
  178. somewhere in AEF.  If point A is chosen, the midpoint (and next
  179. current point) must be in AGH.  If point B is chosen, the next
  180. current point must be in EIJ.  If point C is chosen, the next
  181. current point must be in FKL.
  182.  
  183.                                   A
  184.                                   /\
  185.                               G /----\ H
  186.                               / \    / \
  187.                           E /-----\/-----\ F
  188.                           / \     M      / \
  189.                       I /-----\ J     K/-----\L
  190.                       / \    /  \    /  \   /  \
  191.                     /-----\/------\/------\/-----\
  192.                   B       N       D       O        C
  193.  
  194. The cases where the current point was in BDE or CDF are
  195. symmetrical, and cause the next current point to be inside BIN,
  196. EGM, DKO, or CLO, FHM, or DJN, respectively.  So now the current
  197. point can't be in DEF, GHM, IJN, or KLO. 
  198.  
  199. This process is repeated recursively (an infinite number of
  200. times) on each of the triangles that the current point can be in
  201. and it generates the pattern of allowed points.
  202.  
  203. Question : How much allowed area is left after the recursive
  204. process is repeated an infinite number of times?
  205.  
  206. This shape is also known as the Sierpinski gasket.  It has
  207. fractal (Hausdorff) dimension of log 3 / log 2 = 1.584 ...  It is
  208. also isomorphic to the pattern that results when you plot only
  209. the even (or odd) values in Pascal's triangle.  There is also a
  210. one-dimensional cellular automata that generates this pattern
  211. when each generation is graphed successively.
  212.  
  213.  
  214. L O G I S T I C
  215.  
  216. Populations are sometimes modeled by the logistic equation 
  217.     Xnew = RX(1-X), 
  218. where X is the current population, Xnew is the next year's
  219. population, and R is a constant between 0 and 4.  X is between 0
  220. (population dies out) and 1 (max possible population).  Here R is
  221. varied from 2.75 to 4 across the screen.  The population for each
  222. R is plotted vertically.  When R is between 1 and 3, the
  223. population quickly converges to some stable value.  When R is a
  224. little larger than 3, it settles into an oscillation between two
  225. population sizes.  When R increases more the population begins
  226. oscillating among 4 values.  As R increases some more, the
  227. population begins to oscillate among 8 values.  If R increases a
  228. little more, Chaos breaks out - the population varies
  229. chaotically.  The logistic equation is also used in a laser
  230. optics problem see "Quantum Optics" in "The New Physics", edited
  231. by Paul Davies.
  232.  
  233. As an example, when R=2.7, X soon converges to 0.6292.  When
  234. R=3.5, and x is initially 0.4, say, the successive values of X
  235. are:
  236.  
  237.     0.4000  0.8400  0.4704  0.8719 -->
  238.     0.3908  0.8332  0.4862  0.8743 -->
  239.     0.3846  0.8284  0.4976  0.8750 -->
  240.               ... converging to and oscillating among:
  241.     0.3828  0.8269  0.5009  0.8750 -->
  242.     0.3828  0.8269  0.5009  0.8750
  243.  
  244. These values are plotted vertically as R varies horizontally. 
  245. The first few points calculated may stray from the final pattern. 
  246. For that reason, the program allows you to ignore the first few
  247. points.  By default, it ignores the first 100 points and plots
  248. the next 100 points for each value of R.  The program asks you
  249. for the number of initial points to ignore default is 100) and
  250. the number of points to plot for each R default is 100).  You can
  251. enter max and min R values so you can enlarge interesting areas. 
  252. The program allows you to vary the limits on R.  The graph has
  253. self-similar elements - parts of it are similar to the whole.
  254. You can vary the limits on R to enlarge certain ranges to see
  255. features in more detail.
  256.  
  257.  
  258. 3 - B O D Y
  259.  
  260. This program graphs a Hill's reduced model of the three-body
  261. problem.  All motion is restricted to a plane.  There are two
  262. massive stars and a planet of negligible mass orbiting under the
  263. influence of the two stars.  In the current program the two stars
  264. have the same mass and they are fixed in space.  This is not the
  265. same thing as having your coordinate system rotate so the stars
  266. appear fixed, however.  The program puts the planet randomly on
  267. the screen and gives it a random push.  The path of the planet is
  268. chaotic.  Basically, one of three things happens.  In order of
  269. likelihood, these are:
  270.  
  271. (1) The planet passes close to one of the stars and is thrown out
  272. of the system.  (The program beeps and stops if this happens,
  273. waiting for you to press a key.)
  274.  
  275. (2) The planet orbits chaotically for a while before being thrown
  276. out.
  277.  
  278. (3) The planet continues to orbit indefinitely in a non-periodic
  279. orbit that is confined.
  280.  
  281. Press <ESC> to stop the program.  When the program beeps it is
  282. waiting for you to press a key.
  283.  
  284.  
  285. H E N O N
  286.  
  287. The Henon maps deal with orbits in the restricted three-body
  288. problem.  For more details see the July 1987 Scientific American
  289. "Computer Recreations", "Henon Mapping with Pascal", by Gordon
  290. Hughes, Byte, Dec. 1986, page 161 ff, or the books by Gleick or
  291. Stewart.  
  292.  
  293. You're pretty much on your own for this one, but the parameter
  294. entry routines are easy to use.  Just accept the default
  295. parameters, or make small changes in them.  Try varying the first
  296. parameter (R) - especially between 1.0 and 1.5.  The graphs are
  297. quite interesting.
  298.  
  299.  
  300. O T H E R  P R O G R A M S
  301.  
  302. Other programs by this author:
  303.  
  304. Shareware programs:
  305.     
  306. Checkers - Plays the game of Checkers
  307. Connect4 - Plays the game of Connect 4
  308. Master   - Plays either side of the game of Mastermind
  309. Fox      - Plays the game of Fox and Geese
  310. HyperQub - Rotates a 4-dimensional hypercube
  311. Demon    - Graph crystal-like growth patterns (cellular automata)
  312. Chaos    - Graphs several types of "Chaos":
  313.               Lorenz Butterfly
  314.             Logistic Equation
  315.             Henon maps
  316.             Three-body problem
  317.             Triangle pattern
  318.  
  319.  
  320. Educationally oriented programs:
  321.  
  322. Factor   - Quickly finds the prime factors of an integer < 2^32
  323. MagicSq  - Generates magic squares up to 175 x 175
  324.  
  325.  
  326. Forthcoming:
  327.  
  328. SlideSho - Make text slide show in various fonts, sizes, & colors
  329. Life     - Conway's "Game of Life" - a computer simulation
  330. Orbits   - Graphs 2- and 3-body orbits
  331. Reversi  - Plays the game of Reversi (a.k.a. Othello)
  332. Squares  - Plays the game of Dots and Squares
  333.