Home » Recent acquisitions » Acorn ADFS disks » adfs_ArchimedesWorld_199201.adf » January92 » !AWJan92/Goodies/ArcAut/Automatons/HPP-Gas

!AWJan92/Goodies/ArcAut/Automatons/HPP-Gas

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Recent acquisitions » Acorn ADFS disks » adfs_ArchimedesWorld_199201.adf » January92
Filename: !AWJan92/Goodies/ArcAut/Automatons/HPP-Gas
Read OK:
File size: 037C bytes
Load address: 0000
Exec address: 0000
File contents
AUTOMATON*

  HPP-Gas

  This Margolus neighbourhood automaton simulates a gas cloud. The particles
  travel along diagonals; number & momentum are preserved in collisions. A
  simple alteration allows the introduction of walls & many coloured gasses.
  Experiments can then be performed demonstrating the self diffusion which
  takes place in a gas, constantly mixing it, & diffusion, whereby a gas will
  fill the container in which it is placed; because this is a very simple
  model, diffusion of the gas into a vacuum works best when the container is
  of an irregular shape. Compare with 'TM-Gas'.

INITIALISATION*

  10DEF PROCdo
  20*SetEval wrap on
  30*SetEval neig margolus
  40ENDPROC

SCREEN*

  10DEF PROCdo
  20PROCsoup(255,1,.1)
  30ENDPROC

CODE*

( READ_NEIG
  CELL OPP = IF (CW CCW = IF (CELL CW <> IF (CW ==)))
                                            OPP ==    )

END*
00000000  41 55 54 4f 4d 41 54 4f  4e 2a 0a 0a 20 20 48 50  |AUTOMATON*..  HP|
00000010  50 2d 47 61 73 0a 0a 20  20 54 68 69 73 20 4d 61  |P-Gas..  This Ma|
00000020  72 67 6f 6c 75 73 20 6e  65 69 67 68 62 6f 75 72  |rgolus neighbour|
00000030  68 6f 6f 64 20 61 75 74  6f 6d 61 74 6f 6e 20 73  |hood automaton s|
00000040  69 6d 75 6c 61 74 65 73  20 61 20 67 61 73 20 63  |imulates a gas c|
00000050  6c 6f 75 64 2e 20 54 68  65 20 70 61 72 74 69 63  |loud. The partic|
00000060  6c 65 73 0a 20 20 74 72  61 76 65 6c 20 61 6c 6f  |les.  travel alo|
00000070  6e 67 20 64 69 61 67 6f  6e 61 6c 73 3b 20 6e 75  |ng diagonals; nu|
00000080  6d 62 65 72 20 26 20 6d  6f 6d 65 6e 74 75 6d 20  |mber & momentum |
00000090  61 72 65 20 70 72 65 73  65 72 76 65 64 20 69 6e  |are preserved in|
000000a0  20 63 6f 6c 6c 69 73 69  6f 6e 73 2e 20 41 0a 20  | collisions. A. |
000000b0  20 73 69 6d 70 6c 65 20  61 6c 74 65 72 61 74 69  | simple alterati|
000000c0  6f 6e 20 61 6c 6c 6f 77  73 20 74 68 65 20 69 6e  |on allows the in|
000000d0  74 72 6f 64 75 63 74 69  6f 6e 20 6f 66 20 77 61  |troduction of wa|
000000e0  6c 6c 73 20 26 20 6d 61  6e 79 20 63 6f 6c 6f 75  |lls & many colou|
000000f0  72 65 64 20 67 61 73 73  65 73 2e 0a 20 20 45 78  |red gasses..  Ex|
00000100  70 65 72 69 6d 65 6e 74  73 20 63 61 6e 20 74 68  |periments can th|
00000110  65 6e 20 62 65 20 70 65  72 66 6f 72 6d 65 64 20  |en be performed |
00000120  64 65 6d 6f 6e 73 74 72  61 74 69 6e 67 20 74 68  |demonstrating th|
00000130  65 20 73 65 6c 66 20 64  69 66 66 75 73 69 6f 6e  |e self diffusion|
00000140  20 77 68 69 63 68 0a 20  20 74 61 6b 65 73 20 70  | which.  takes p|
00000150  6c 61 63 65 20 69 6e 20  61 20 67 61 73 2c 20 63  |lace in a gas, c|
00000160  6f 6e 73 74 61 6e 74 6c  79 20 6d 69 78 69 6e 67  |onstantly mixing|
00000170  20 69 74 2c 20 26 20 64  69 66 66 75 73 69 6f 6e  | it, & diffusion|
00000180  2c 20 77 68 65 72 65 62  79 20 61 20 67 61 73 20  |, whereby a gas |
00000190  77 69 6c 6c 0a 20 20 66  69 6c 6c 20 74 68 65 20  |will.  fill the |
000001a0  63 6f 6e 74 61 69 6e 65  72 20 69 6e 20 77 68 69  |container in whi|
000001b0  63 68 20 69 74 20 69 73  20 70 6c 61 63 65 64 3b  |ch it is placed;|
000001c0  20 62 65 63 61 75 73 65  20 74 68 69 73 20 69 73  | because this is|
000001d0  20 61 20 76 65 72 79 20  73 69 6d 70 6c 65 0a 20  | a very simple. |
000001e0  20 6d 6f 64 65 6c 2c 20  64 69 66 66 75 73 69 6f  | model, diffusio|
000001f0  6e 20 6f 66 20 74 68 65  20 67 61 73 20 69 6e 74  |n of the gas int|
00000200  6f 20 61 20 76 61 63 75  75 6d 20 77 6f 72 6b 73  |o a vacuum works|
00000210  20 62 65 73 74 20 77 68  65 6e 20 74 68 65 20 63  | best when the c|
00000220  6f 6e 74 61 69 6e 65 72  20 69 73 0a 20 20 6f 66  |ontainer is.  of|
00000230  20 61 6e 20 69 72 72 65  67 75 6c 61 72 20 73 68  | an irregular sh|
00000240  61 70 65 2e 20 43 6f 6d  70 61 72 65 20 77 69 74  |ape. Compare wit|
00000250  68 20 27 54 4d 2d 47 61  73 27 2e 0a 0a 49 4e 49  |h 'TM-Gas'...INI|
00000260  54 49 41 4c 49 53 41 54  49 4f 4e 2a 0a 0a 20 20  |TIALISATION*..  |
00000270  31 30 44 45 46 20 50 52  4f 43 64 6f 0a 20 20 32  |10DEF PROCdo.  2|
00000280  30 2a 53 65 74 45 76 61  6c 20 77 72 61 70 20 6f  |0*SetEval wrap o|
00000290  6e 0a 20 20 33 30 2a 53  65 74 45 76 61 6c 20 6e  |n.  30*SetEval n|
000002a0  65 69 67 20 6d 61 72 67  6f 6c 75 73 0a 20 20 34  |eig margolus.  4|
000002b0  30 45 4e 44 50 52 4f 43  0a 0a 53 43 52 45 45 4e  |0ENDPROC..SCREEN|
000002c0  2a 0a 0a 20 20 31 30 44  45 46 20 50 52 4f 43 64  |*..  10DEF PROCd|
000002d0  6f 0a 20 20 32 30 50 52  4f 43 73 6f 75 70 28 32  |o.  20PROCsoup(2|
000002e0  35 35 2c 31 2c 2e 31 29  0a 20 20 33 30 45 4e 44  |55,1,.1).  30END|
000002f0  50 52 4f 43 0a 0a 43 4f  44 45 2a 0a 0a 28 20 52  |PROC..CODE*..( R|
00000300  45 41 44 5f 4e 45 49 47  0a 20 20 43 45 4c 4c 20  |EAD_NEIG.  CELL |
00000310  4f 50 50 20 3d 20 49 46  20 28 43 57 20 43 43 57  |OPP = IF (CW CCW|
00000320  20 3d 20 49 46 20 28 43  45 4c 4c 20 43 57 20 3c  | = IF (CELL CW <|
00000330  3e 20 49 46 20 28 43 57  20 3d 3d 29 29 29 0a 20  |> IF (CW ==))). |
00000340  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00000360  20 20 20 20 20 20 20 20  20 20 20 4f 50 50 20 3d  |           OPP =|
00000370  3d 20 20 20 20 29 0a 0a  45 4e 44 2a              |=    )..END*|
0000037c