michaelslab

The objective of this project is two fold; on one hand to provide a small programming system which allows to play with the Huygens principle and on the other hand to elaborate important basic technologies for computing projects, such as:

  • Calculation Program written in Ada
  • Storing Result Data
  • Visualization Software
  • Creation of animations

 

 

This figure shows the field intensity of the wave field of a single spheric oscillator locate at (0,0) in the x/y plane.
The primary goal is to produce animations for different configurations of oscillators using my data center as computational platform..

 

The Computation Problem

The computational problem is to calculate the wave field at a point which is caused by a given configuration of oscillators which are generating spherical waves described by:

$$ \psi(r,t)=\frac{1}{r}sin(2\pi\frac{r+ct}{\lambda}) $$(1)

where denotes the speed of propagation and the wave length. The wave field caused by the configuration of N oscillators at a given point is given by the superposition of all waves described by equation (1) which yields

$$ \psi_{total}(\vec{x},t)=\sum_{i=1}^{N}\psi(\parallel\vec{\vec{x_{i}}-\vec{x}\parallel},t) $$(2)

The Program

A small Ada program computes formular (2) for a regular grid of point in the probe grid and prints the values of into a file.
The configuration paramters of the program are shown in figure 2. All oscillators are located in the positve Y quadrant. The computation is done for point in the called probe grid which can be shifted in Y direction.

The programm is taking the followng arguments:

main config phaseshift time-start total-steps
  • Config: Name of the configuration; a corresponding the configuration file of the name configuration.cfg is assumed to be located in the same directory where the program is called.
  • Phase shift: Phase shift in X direction per oszillator
  • Time-start: Start time of the computation.
  • Total-steps: The number of time steps to be calculated. The time step is defined by the parameter DT in the configuration file.

Besides of the command line arguments a configuration file controls the behaviour of the computation. A configuration file consists of lines with assignments or comments. A commented line starts with a # sign. An assignment is of the for identifier=value. Each identifier specifies some parameter of the program.
An example of this file is shown below:

WL=0.5;
C=1.0;

## oscillator grid
NX=4;
NY=1;
D=3.0;

DT=0.1;
EA=88.0;

## probe grid used to display the results
Probe_N=200
Probe_Y=0.0;
  • C: Speed of propagation; normaly set to 1
  • D: Grid width in X/Y directions
  • WL: Wavelength measured in D
  • NX/NY: Number of oscillators in X and Y direction
  • DT: Timestep width
  • Probe_N: Number of cells in the visualisation grid
  • Probe_Y: Y Offset of the visualsation grid

The result of the computation is stored in a simple ASCII file which can be read mostly as CSV format with headers as shown below:

X,Y,Intensity,Time
-7.4625000E+01,-7.4625000E+01, 1.6750029E-02, 0.0000000E+00
-7.4625000E+01,-7.3875000E+01, 1.6040666E-02, 0.0000000E+00
-7.4625000E+01,-7.3125000E+01, 1.4960118E-02, 0.0000000E+00

Storing Results

Since for most of the data file type used in the scientific community are no Ada bindings avaiable i have simplified the situation by storing the results of the comuptation in a simple ASCII (csv like) file which can be converted into the format under discussion.

Visualisation Tools

The following visualisation tools have been used during the project:

Creating Animations

Movies as shown in Figure 1 will be created from N pictures representing scenes of the
video which are converted in a gif file which can contain different pictures in sequence.
The browser will display there pictures in sequence resulting the impression of an
anmation.<br>

Assuming you have a collection of jpeg files representing your scene in the current 
directory the following shell commands are helpfull to automatize the process
of creating an animation.

	mogrify -format gif *.jpg

	gifsicle --colors=256 --delay=50 --loopcount=0 *.gif > result.gif

	</pre>

 

Example 0 - Single Oscillator

The basic test of the program described above is the caculation of a simple
spheric osccillator.

Please install the Flash Plugin

The video above shows the result of the program described above for a sungle spheric osccilator. The animation has been created using paraview.

 

Example 1 - Dipol

The first benchmark for all elaborations is the simple dipole configuration consiting of 4 oscillators in line and a probe field on 200x200 points.

This figure shows the wave field which is created by two synchronously oscillating wave sources.

 

Please install the Flash Plugin

The video above shows the cacultation results of a set of 5 synchronous oscillators lines up parallel to the x-axis.