home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ARM Club 1
/
ARM_CLUB_CD.iso
/
contents
/
education
/
a
/
heart
/
!Heart
/
ReadMe
< prev
Wrap
Text File
|
1989-11-20
|
5KB
|
92 lines
Heart - a cellular automaton heart simulator
By C.T.Stretch
Directory File type purpose
!Heart !Run obey runs !RunImage
!Heart !RunImage executable the program
(requires Shared C Library module)
!Heart !Sprites sprite application sprites
!Heart readme text this file
Heart has been linked to o.stubs so you will need to load the
SharedCLibrary module CLib from !system.modules to run it. This can be done
by "showing" the ADFS the !System library, by inserting the Application
Disk 1 into a drive and clicking on the associated drive icon on the icon
bar of the desktop. The computer will then prompt for you to reinsert this
disk when required.
Heart is a cellular automaton that is supposed to model the electrical
activity on the surface of the heart.
My understanding (?) of the basis of this model is as follows.
To cause the muscles of the heart to contract in the right order a wave
of electrical activity is send down the surface of the heart by a pulse
trigger.The wave is caused by cells 'firing' . When a cell fires its
neighbours are caused to fire . After a cell has fired it needs some time
(the relaxation time) before it can be made to fire again . The relaxation
times of the cells vary and if too many are too long you are in trouble.
In the computer model the cells form a cylinder , a rectangle that is
joined along its sides . A cell can be taken to have 4 neighbours (N.S.E.W)
or 8 (NE.NW.SE.SW as well) or some random choice in between given by the
connection number i.e. the percentage of diagonals included.
A cell fires at one time step , then its neighbours fire at the next
unless they are still relaxing . The relaxation times are chosen randomly
between two values . A cell is shown red when firing , blue when ready and
white when relaxing . A stimulus is provided by firing a line of cells along
the top of the cylinder at a regular interval .
To run the program double click on !Heart or ensure that the
SharedCLibrary module is installed and you are in the correct directory then
type *!RunImage at the command prompt . The screen will go black for a short
while as a heart is set up.
The program does not multitask although it can be used from Riscos . It
uses mode 1 only and so cannot be used with a high resolution monitor .
The program takes as much memory as it can in a 1Mb machine . To use a
larger heart unplug as many modules as possible , set screensize to 20k and
other sizes to 0 . You can use
*!RunImage n
to give at most n cells , with maximum 64000 in a 4Mb machine . Of course a
larger heart will run slower .
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 .
Keys
Q quit
G set heart geometry (width , height , connection number)
N change relaxation times
D redistribute relaxation times
<space> pause - any key to restart
F faster change pulse rate
S slower " " "
O turn pulse on or off
T change pulse line
C clear - set all cells to ready
E turn ECG on or off
The ECG graph measures the difference between the number of relaxing
cells on the top and bottom rows of the graph . The red dots indicate the
pulse points .
By increasing the pulse rate the waves can become irregular or only occur
every other pulse . These phenomena are supposed to be related to medical
problems (?) . The phenomena vary with heart geometry and relaxation times .
It is possible to obtain chaotic behaviour that continues when the pulse is
stopped . Sometimes this turns into a wave travelling around the cylinder .
There are two obvious ways to write cellular automata programs . Either
scan all the cells and update them each time , or keep a list of active
cells and work on these . For 'life' programs both can be used successfully .
Heart uses the second method , a list of firing cells is kept , on the next
step these are put into a circular buffer of relaxing cells according to
when they come out . The program writes directly to the screen for speed .
This model was simplified from a paper by J.M.Smith and R.J.Cohen in
Proc.Natl.Acad.Sci.USA Vol 81 pp 233-237,Jan 1984.
Chris Stretch EUREKA (ARCHIVE BBS) 62
JANET CBTP13@UK.AC.ULSTER.UCVAX