home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 1 / ARM_CLUB_CD.iso / contents / education / a / heart / !Heart / ReadMe < prev   
Text File  |  1989-11-20  |  5KB  |  92 lines

  1.             Heart - a cellular automaton heart simulator
  2.                     By C.T.Stretch
  3.   Directory   File        type            purpose
  4.  
  5.   !Heart      !Run        obey             runs !RunImage
  6.   !Heart      !RunImage   executable       the program 
  7.                                           (requires Shared C Library module)
  8.   !Heart      !Sprites    sprite           application sprites
  9.   !Heart      readme      text             this file
  10.  
  11.     Heart has been linked to o.stubs so you will need to load the
  12. SharedCLibrary module CLib from !system.modules to run it. This can be done
  13. by "showing" the ADFS the !System library, by inserting the Application
  14. Disk 1 into a drive and clicking on the associated drive icon on the icon
  15. bar of the desktop. The computer will then prompt for you to reinsert this
  16. disk when required.
  17.  
  18.  
  19.  
  20.     Heart is a cellular automaton that is supposed to model the electrical
  21. activity on the surface of the heart.
  22.  
  23.     My understanding (?) of the basis of this model is as follows.
  24.  
  25.     To cause the muscles of the heart to contract in the right order a wave
  26. of electrical activity is send down the surface of the heart by a pulse
  27. trigger.The wave is caused by cells 'firing' . When a cell fires its
  28. neighbours are caused to fire . After a cell has fired it needs some time
  29. (the relaxation time) before it can be made to fire again . The relaxation
  30. times of the cells vary and if too many are too long you are in trouble.
  31.  
  32.     In the computer model the cells form a cylinder , a rectangle that is
  33. joined along its sides . A cell can be taken to have 4 neighbours (N.S.E.W)
  34. or 8 (NE.NW.SE.SW as well) or some random choice in between given by the
  35. connection number i.e. the percentage of diagonals included.
  36.     A cell fires at one time step , then its neighbours fire at the next
  37. unless they are still relaxing . The relaxation times are chosen randomly
  38. between two values . A cell is shown red when firing , blue when ready and
  39. white when relaxing . A stimulus is provided by firing a line of cells along
  40. the top of the cylinder at a regular interval .
  41.  
  42.    To run the program double click on !Heart or ensure that the
  43. SharedCLibrary module is installed and you are in the correct directory then
  44. type *!RunImage at the command prompt . The screen will go black for a short
  45. while as a heart is set up.
  46.    The program does not multitask although it can be used from Riscos . It
  47. uses mode 1 only and so cannot be used with a high resolution monitor .
  48.    The program takes as much memory as it can in a 1Mb machine . To use a
  49. larger heart unplug as many modules as possible , set screensize to 20k and
  50. other sizes to 0 . You can use 
  51.                               *!RunImage n
  52. to give at most n cells , with maximum 64000 in a 4Mb machine . Of course a
  53. larger heart will run slower .
  54.  
  55.  
  56.    The program is controlled by single key presses . Pressing any unused key brings up a list of keys , press any key to leave the list .
  57.  
  58. Keys
  59.      Q    quit
  60.      G    set heart geometry  (width , height , connection number)
  61.      N    change relaxation times
  62.      D    redistribute relaxation times
  63.   <space> pause - any key to restart
  64.      F    faster   change pulse rate
  65.      S    slower     "      "    "
  66.      O    turn pulse on or off
  67.      T    change pulse line
  68.      C    clear -  set all cells to ready
  69.      E    turn ECG on or off
  70.  
  71.    The ECG graph measures the difference between the number of relaxing
  72. cells on the top and bottom rows of the graph . The red dots indicate the
  73. pulse points .
  74.  
  75.    By increasing the pulse rate the waves can become irregular or only occur
  76. every other pulse . These phenomena are supposed to be related to medical
  77. problems (?) . The phenomena vary with heart geometry and relaxation times .
  78. It is possible to obtain chaotic behaviour that continues when the pulse is
  79. stopped . Sometimes this turns into a wave travelling around the cylinder .
  80.  
  81.    There are two obvious ways to write cellular automata programs . Either
  82. scan all the cells and update them each time , or keep a list of active
  83. cells and work on these . For 'life' programs both can be used successfully .
  84. Heart uses the second method , a list of firing cells is kept , on the next
  85. step these are put into a circular buffer of relaxing cells according to
  86. when they come out . The program writes directly to the screen for speed .
  87.  
  88.     This model was simplified from a paper by J.M.Smith and R.J.Cohen in
  89. Proc.Natl.Acad.Sci.USA Vol 81 pp 233-237,Jan 1984.
  90.  
  91.      Chris Stretch        EUREKA (ARCHIVE BBS) 62
  92.                           JANET CBTP13@UK.AC.ULSTER.UCVAX