home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 1 / ARM_CLUB_CD.iso / contents / education / a / 2dwaves / !2DWaves / !help next >
Text File  |  1992-01-06  |  8KB  |  194 lines

  1.  
  2.                         ____________________________________
  3.  
  4.                         !2DWave by Jan Vlietinck (8-12-1992)
  5.                         ____________________________________
  6.  
  7.  
  8. 1. Introduction
  9. ===============
  10.  
  11. 2DWave is simulation program for two dimensional waves. The program is both
  12. educative and entertaining. The idea is to simulate waves exactly as they
  13. would behave in real live. Such waves are waves on a water surface, acoustic
  14. waves produced by a speaker and even electro magnetical waves. The waves are
  15. calculated according to the correct physical rules described by the Laplace
  16. differential equation, resulting in a smooth colourful animation. On an Arm2
  17. machine, 12.5 full screen frames per second can be displayed. Those frames
  18. are at the full 320x256 resolution of the 256 colours mode 13. Special hand
  19. optimised Arm machine code had to be written to achieve this speed.
  20.  
  21.  
  22. 2. Workings
  23. ===========
  24.  
  25. Internally the wave plane is represented by a two dimensional array with
  26. each point having two states : height and velocity of a cell. On the screen
  27. each pixel is coloured according to the height of a point on the wave
  28. surface. The calculations resembles those of a cellular automat. The new
  29. height is the old one added with a number proportionally to the velocity.
  30. The new velocity is the previous one multiplied by a viscous damping factor
  31. and incremented proportional to the difference between the average height of
  32. the four surrounding cells and the current height of the cell.
  33.  
  34. Thus :
  35.  
  36.   h'(x,y) =   h(x,y)+a*v(x,y)
  37.   v'(x,y) = b*v(x,y)+c*(h(x-1,y)+h(x+1,y)+h(x,y-1)+h(x,y+1)-4*h(x,y))/4
  38.  
  39. Where h(x,y) and v(x,y) are the height and velocity of a cell on position
  40. (x,y). In the program : a=1, b=1-2^-n, c= 2^-m.
  41.  
  42. To speed up calculations, interpolation is used. For a full screen 320x256
  43. display, only a 80x64 mesh is calculated. The other points are found by
  44. interpolation.
  45.  
  46.  
  47. 3. The menu
  48. ===========
  49.  
  50. After starting the program you are presented with the menu screen. The menu
  51. which is surrounded by a rectangle is divided in three submenus : 'actions',
  52. 'options' and 'settings'. A selection in this menu can be made by moving the
  53. mouse on one of the entries and clicking the left mouse button.
  54.  
  55.  
  56. 3.1 Actions submenu
  57. -------------------
  58. The actions submenu is used to enter wave sources in a number of ways before
  59. starting a simulation. The excitation of a source is either generated by the
  60. computer or you can control it with the mouse. The computer controlled
  61. sources produce a sinusoidal excitation of which the amplitude, frequency,
  62. phase and position can be entered.
  63.  
  64. When selecting 'automatic' a number of random sources are configured and the
  65. wave simulation starts.
  66.  
  67. Selecting the second entry in the menu leads to the 'semi-automatic' control
  68. screen. On the left top of this screen, the amplitude, frequency, phase and
  69. position of the current source are displayed. A source is represented by a
  70. solid circle, the current source is surrounded by a white circle. Also the
  71. current wave is graphically represented by a sinusoid. By moving the mouse
  72. you can alter the position of the source, clicking the left button enters
  73. the source.
  74.  
  75. Holding down the right mouse button and moving the mouse allows you to
  76. change the amplitude and frequency of the current source. Horizontal
  77. movements control the frequency while vertical movements alter the
  78. amplitude. The parameters of a source can also be configured by pressing the
  79. '1 2 3' and 'Q W E' keys to increase and decrease the amplitude, frequency
  80. and phase. When you have entered all the required sources the simulation is
  81. started after clicking the middle button.
  82.  
  83. The third, 'manual', entry in the actions submenu allows you to control a
  84. source with the mouse whilst simulation. Moving the mouse up and down
  85. controls the amplitude of the source. Moving the mouse and clicking the
  86. right button repositions the source. Holding down the left button and moving
  87. the mouse produces an effect similar to that of a boat sailing through the
  88. sea.
  89.  
  90. The 'continue' entry allows you to continue simulation after suspension.
  91.  
  92. At any time during simulation the action can be frozen by holding down the
  93. right button. Returning to the menu screen is done by clicking the middle
  94. button.
  95.  
  96.  
  97. 3.2 Options submenu
  98. -------------------
  99. The 'options' submenu allows you to switch on and off various options.
  100. Clicking on one of the three option switches the option on, another click
  101. switches it back off. The on state is depicted with a mark to the left of
  102. the option.
  103.  
  104. Setting on the 'projection' option gives you a three dimensional,
  105. perspective, projection of the simulation.
  106.  
  107. The 'loose edges' option allows you to choose between fixed or loose edges
  108. of the simulated surface. Fixed edges is like the film of a tambour while
  109. loose edges resembles water in a pool.
  110.  
  111. When the 'colour lookup' option is on, the colour of every pixel is
  112. translated via a lookup table before display, to give a more pretty colour
  113. display of the waves. When this option is off and projection is chosen then
  114. all the points are coloured white to give a look more reminiscent of water
  115. waves.
  116.  
  117. At any time during simulation the three options can be toggled on and off
  118. with a key to give instant change. To toggle the projection, edge and colour
  119. effect, press the 'P','E' and 'C' key.
  120.  
  121.  
  122. 3.3 Settings submenu
  123. --------------------
  124. With the 'settings' submenu some physical parameters of the simulated plane
  125. can be reconfigured. To alter the default value click on one of the five
  126. entries, enter a chosen number and press return. Out of range numbers are
  127. automatically constrained to the maximum or minimum value.
  128.  
  129. With the 'width' and 'height' parameters the physical extent of the plane
  130. may be set. The width may be varied between 10 and 80 while the height is
  131. variable between 10 and 64.
  132.  
  133. The 'viscosity' and 'time step' value determine the behaviour of the
  134. simulated plane. The viscosity factor may be varied between 1 and 10. A
  135. value of 1 gives a very watery appearance. Entering the maximum of 10 gives
  136. a very viscous, syrupy, simulation. Also the time step factor can be varied
  137. between 1 and 10. 10 is the default, a lower number allows you to slow down
  138. the action by reducing the elapsed simulation time between successive
  139. frames.
  140.  
  141. Finally the 'base colour' option allows you to shift through the colour
  142. pallet.
  143.  
  144.  
  145. 4. Saving the screen
  146. ====================     
  147.  
  148. At any time during simulation the current frame can be saved. Pressing the
  149. 'S' key causes the current screen to be saved. There is no need to enter a
  150. file name; all screens saved are automatically named as Dump0, Dump1,...
  151. Ensure that sufficient space is available on discs before saving!
  152.  
  153.  
  154. 5. Hints and tips
  155. ==================
  156.  
  157. - Projection is more attractive with loose edges.
  158.  
  159. - Colour lookup is prettier but it slow down the simulation considerably.
  160.  
  161. - Simulation with small width and height may execute too fast, therefore you
  162.   should reduce the time step.
  163.  
  164. - When you find that the waves decay to slowly then increase the viscosity
  165.   factor.
  166.  
  167. - Dipole sources are constructed with two very close sources with the same
  168.   amplitude and frequency but with a phase difference of pi. To avoid
  169.   reflections at the edges which would spoil the effect increase the
  170.   viscosity to 7.
  171.  
  172. - Analogous a swirl may be generated by four sources with the same amplitude
  173.   and frequency but with phases 0, 0.5, 1 and  1.5 pi, positioned in a close
  174.   cross formation.
  175.  
  176. - Also watch some sources with low amplitude and high frequency superimposed
  177.   on a source with a high amplitude and low frequency.
  178.  
  179. - Base colour 140 also gives nice colours.
  180.  
  181.  
  182. Enjoy the program !
  183.  
  184.  
  185.  
  186.  
  187. Any comments welcome at :
  188.  
  189. Jan vlietinck
  190. Essendreef 15
  191. 8300 Knokke-Heist
  192. Belgium
  193.  
  194.