##################################### #### SMN Particle Simulator v3.1 #### ##################################### by John Ringland (2006-01-08) This program should run on all DOS or Windows based systems. SMN is a new system modeling methodology that allows for the realistic simulation of general systems. This program is a simple illustration of the core functionality of SMN. It implements a context for systems of particles to interact in space via a gravity-like force. Any type of system could have been chosen and future versions will allow for the creation and simulation of arbitrary general systems. For more information on this program and modeling paradigm see: www.Anandavala.info/TASTMOTNOR/code/v3.1/SMNPS3_1.html ------------ The Program: ------------ Unzip the folder then run "particle.bat". In Windows: If you wish to place an icon on your desktop right click and drag the file "particle.bat" onto your desktop and then from the menu choose to create a shortcut. This is only a very simple example of some of the core functionality of SMN, but SMN allows for many advanced features which are unique to SMN. These features are not implemented yet, but version 3.2 will be out soon with more features and fututre versions will become gradually more general, flexible and will exhibit advanced system analysis and simulation features. --------------------- The Simulated System: --------------------- The system consists a series of particles scattered in space. One can interact with these particles and thereby construct systems of particles. The force calculation has been modified (in a non-physical manner) to be repulsive at close range so the particles also exhibit solidity. The simulation is not meant to be physically realistic to the n'th degree, it is just a simple illustration of the core simulation capacities of the SMN modeling paradigm. The system model is defined in the file "smModels.ex" which is itself written in the programming language "Euphoria" (www.rapideuphoria.com). -------------------------------- Interacting with the Simulation: -------------------------------- When the simulation runs there is a system of particles displayed on the screen. One may interact with these by changing their empirical (observable) states. * 'p' = toggle pause on and off, whilst paused one can still edit the model * 'b' = toggle billiards mode on and off * 'v' = view system state * 'r' = reload current model (restore model) * 's' = save current model * 'l' = load a new model * 'h' or '?' = quick help screen * any other key = show main menu * use the left mouse button to drag particles around * use the right mouse button to select particles and edit their properties * click the left or right mouse button in empty space to clean up the graphics Note: in billiards mode one can shoot particles around using the mouse as a billiard cue. In general one can also grab a particle and use it to push or pull other particles around. One can also vary the strength of the impulse force applied by the "billiard cue" via a menu option from the main menu. If one left clicks on a particle one can drag it to a new position on the screen. Or in billiards mode one uses the left mouse button to apply an impulse force to particles. Press 'b' to toggle between these modes. If one right clicks on a particle its observable state is displayed (e.g. position, velocity, force) and one can edit the values to construct scenarios. If one presses any key that is not associated with an option above then the main menu is displayed. The rest of the interface should be self explanatory. -------- Billiards Mode: -------- One can toggle billiards mode by pressing 'b' and then shoot particles around using the mouse as a billiard cue. One can also vary the strength of the impulse force applied, via a menu option. Click the left mouse button on a particle and drag it. This draws out a fine white line that represents a sort of billiards cue. The direction in which the line is pointing indicates the direction of the applied force. The length of the line represents the strength of the applied force. When the mouse is released an impulse force is applied to the particle and it responds appropriately, perhaps by flying off screen or bouncing into other particles. ----------------- Model Parameters: ----------------- The system model is either stored as a sequence of parameters in the file "Models.txt" where you can add your own model parameters, or it is stored as an actual model file (*.p31 as a suffix but that is not essential). You can also create a model by typing in a parameter sequence during runtime. Generally one creates a model using a set of parameters, this can then be adjusted into some configuration (perhaps adding particles and moving them around and changing their properties). This can then saved as a model file, ready to be loaded and further developed. example of a parameter sequence for two particles: ------- sequence of coords sequence time friction radius softness | of masses step | size | scale| | | | | | | | | {{{360,210},{320,260}}, {1,1000}, 0.08, 0.05, 61, 61, 4e2, 0} note: size, radius and softness can also be sequences of distinct values. time step: determines the temporal resolution of the simulation, the duration between computed moments. This is a single value that applies to the whole simulation. size: is the size of a particle as it is visually represented on the screen. This parameter has no effect on the simulated dynamics. radius: is the size of the particle within the computed dynamics. This parameter does effect the simulated dynamics. softness: determines the degree of solidity of the particles softness = 0 means particles repel each other at close range softness = 1 means particles may pass through each other Friction: relates to the viscosity of space. f=0 means no viscosity and f=1 means full friction or maximum viscosity. scale: is a scaling factor to tune the strength of the gravitational interaction scale = 0 turns gravity off. This is a single value that applies to the whole simulation. Changing the scaling factor is equivalent to uniformly adjusting all of the particle masses. By modifying these one can design different particle simulations. Note: In order to get a stable system of particles the parameters need to be tuned appropriately, otherwise they may just fly off and disperse or fall together into a clump. E.g. if one increases the simulation time-step, each simulated step becomes larger, thus paticles may jump very close together in a single leap, and with repulsive particles they are then exposed to a Huge force that propels them far apart. Thus if one increases the time-step one should also reduce the force scaling factor. Or if one decreases the time-step one may wish to turn up the force scaling factor. Or one could also adjust the masses. -------- Exercises: -------- With the simulation running, grab a particle (left mouse) and move it about. If one selects a strongly interacting particle (large relative mass) one can use it to shephard other particles around. E.g. load up model parameters 14 (from main menu: (any key) -> edit model (4) -> create or load model (9) -> create model from parameters (4) -> select the 14'th parameter set (14) ) then drag the central particle around whilst the others follow it. In the default model, pause the simulation (p), then place one large particle almost directly on top of the other large particle (left mouse drag), then un-pause the simulation (p) and see what happens. You will then probably need to reload the current model (r) or load a new model; either (l) to load a model from file or create a model from a parameter set as described above. Go into billiards mode (b) and apply a force to a particle (left mouse). First pause then drag a particle away from the main group of particles, then edit it's velocity (right click -> change velocity) to send it into the main group as a projectile, or use the billiard method to propel the particle, then un-pause the simulation and see what happens. Or try adding or deleting particles, or changing their radii, softness values, the simulation time-step, etc. ----------------- There are many enhancements in progress and these will be released as they are ready. The next release will probably utilise the general principles illustrated in this example but develop them for arbitrary systems, not just systems of particles. Then I will construct a simple piece of software using SMN and people may explore it as a system model.