HOW TO CONSTRUCT IN THE PARTICLE WORLD
Fredrik Karlsson - 2000
CONTENTS
Introduction
Select Objects
    Select Particles
    Select Springs
Add Objects
    Add Particles
    Add Springs
    Add Particle Array
Change Properties
    Change Particle Properties
    Change Spring Properties
    Change Environment Properties
Load and Save Constructions
    Extract Configuration File ("Save")
    Import Configuration File ("Load")
INTRODUCTION
The Particle World is a Java Applet simulating particles connected by springs in a 2D world. The world can include gravity/electrostatic forces between particles, constant gravity/electric/magnetic fields and air resistance. It is possible to affect the simulation in real-time by grabbing the particles with the mouse or by changing the properties of the objects/environment.

Perhaps the easiest way to get a feeling of the simulator is to play with some of the predefined systems which are available in [File / Predefined] in the menubar. (See the adjoining figure.)

The status of the simulation can be switched between running and pausing by Pause toggle (or simply press P). Paused simulation is convenient while constructing.

A simulation can be restarted by Initialize (or simply press I).


Predefined systems in the menubar.
SELECT OBJECTS
All the selected objects will be affected when the properties are changed (see Change Properties). It is also possible to edit the selected objects in the conventional way in [Edit] in the menubar; cut/copy/paste/delete

Select Particles

Four ways to select particles exists:
 
  • click on the particle with the mouse (keep Ctrl down to select several particles)
  • press space bar while clicking in the vicinity of the particle (convenient for small particles which are difficult to target)
  • frame the particles by the selection rectangle - press the mouse button on the background and drag
  • choose the particle name in the Particle World Control / [Particle] window
The selected particles are "lifted up" from the plane of simulation  and cannot collide with the unselected particles. 

Selected particles become darker in color, except the black particles which become brighter.

Select Springs

There are two ways to select springs:
  • select the particles to which the spring is attached and the spring will automatically be selected
  • click on, or in the vicinity of, the spring (keep Ctrl down to select several springs)
A selected spring changes color from gray to blue.
ADD OBJECTS

Add a Particle

A particle is added to the world by [Add / Add particle] (or simply by pressing key A while clicking with the mouse). The default values of the added particle has to be changed in the Particle World Control / [Particle] window (see Change Particle Properties).
Add Springs

Select all the particles which should be connected by springs and choose [Add / Add springs]  (or simply by pressing Ctrl S). The default values of the added springs have to be changed in the Particle World Control / [Spring] window. The relaxed length is determined by the distance between the selected particles.


The Add springs function applied to six selected particles.

Add Particle Array

Sometimes is it convenient to add an array of particles - connected by springs or not. By choosing [Add / Add Particle Array] a new window appear. This window is shown in the figure below and the input fields are described to the left.

The result when choosing box springs and cross springs, respectively.
Input Field Description
Original The properties of the selected particle will be transferred to all particles in the array.
Rows Number of array rows.
Columns Number of array columns.
Position X The X coordinate for the upper left corner of the array.
Position Y The Y coordinate for the upper left corner of the array.
Separation X The distance between the particles in the X-direction.
Separation Y The distance between the particles in the Y-direction
Box springs Add horizontal and vertical springs between the particles in the array.
Cross springs Add diagonal springs between the particles in the array.
Spring damping The damping of the springs in the array (see Change Spring Properties)
Spring constant The stiffness of the springs in the array (see Change Spring Properties)
Warning - be careful not to add more particles to your system than your computer can handle!
CHANGE PROPERTIES
The properties of the particles, springs and environment can be changed in the Particle World Control window. This window is reached by the respective items in [View].

All the selected objects are affected by the change. Only properties which the selected objects have in common are shown in the input fields. The input fields are described below, suitable values are given in parenthesis.

Change Particle Properties

Input Field Description
Label Label
Color Color
Initial position X Start position X coordinate (see note below)
Initial position Y Start position Y coordinate (see note below)
Initial velocity X Start velocity X
Initial Velocity Y Start velocity Y
Radius Radius
Mass Mass (1 - 10000)
Charge Charge (-1000 - 1000)
Fixed position Makes the particle immobile
Trace Trace the particle trajectory
Note: The current position of a particle can be set as the initial position by selecting the particle and choosing [Edit / Redefine initial position] (or simply press Ctrl I).

Change Spring Properties

Input Field Description
Damping Energy dissipation of spring (0 - 20)
Warning - too high a damping may cause instability! Avoid instability.
Spring constant Spring stiffness (0 - 500)
Warning - too high a stiffness may cause instability! Avoid instability.
Relaxed length Length of spring in absence of any force
Amplitude Amplitude of harmonic excitation (in percent of relaxed length) 
Frequency Frequency of harmonic excitation
Phase Phase of harmonic excitation

Change Environment Properties

Input Field Description
Walls Three options
  • None - No walls
  • Absorbing - Walls which absorb the perpendicular kinetic energy
  • Reflecting - Walls which reflect the perpendicular kinetic energy
Wall friction Wall friction (0-5)
Gravity constant Magnitude of gravity forces between particles (0 - 20)
Electric constant Magnitude of electrostatic forces between particles (0 - 20)
Gravity field X Constant gravity field in X-direction (0 - 20)
Gravity field Y Constant gravity field in Y-direction (0 - 20)
Electric field X Constant electric field in X-direction (0 - 20)
Electric field Y Constant electric field in Y-direction (0 - 20)
Magnetic field Z Constant magnetic field perpendicular to the 2D world (0 - 2.5)
Air resistance Air resistance (0 - 1)
Warning - too high air resistance may cause instability! Avoid instability.

Change Simulator Parameters

Iterations per second determines how fast the simulator calculates, a high value corresponds to a fast simulation but it is very CPU consuming.
Frames per second determines how often the graphics is updated, a high value corresponds to a very smooth animation but is very CPU consuming. It is normally never useful to use more than 30 frames per second. 
Double buffering avoids flickering of the animation but consumes some extra CPU.
Iteration time step is a very important parameter that determines how much time passes between iterations, i.e. how accurate the simulation is. A high value gives a fast but rough simulation and a low value gives a slow but accurate simulation.

Avoid instability and divergence by reducing the iteration time step!
If the simulation is unstable or tends to diverge the iteration time step must be decreased. This is especially important if very stiff springs are connected with light masses, which gives high resonance frequencies or if high spring damping or air resistance is used.

LOAD AND SAVE CONSTRUCTIONS
Unfortunately there is no possibility in a Java Applet to write on the local hard drive (As far as I know). Consequently, no conventional save function is available in the Particle World.  To overcome this problem the configuration file, describing the environment and construction, is extracted into a text-window. From this window is it possible to copy the configuration file into a text editor and save it on the hard drive. The "load" procedure is similar, copy the configuration file from the text editor and paste it into the text-window.

Extract Configuration File ("Save")

The configuration file is extracted by choosing [File / Extract].

Import Configuration File ("Load")

The configuration file is imported by choosing [File / Import], paste it into the text-window and press the Import button.