Two-dimensional TLM in Java

deutsch

A quick start

If you want to do a short try of the TLM simulation program, I recommend to follow these steps:

Editing the geometry

Try to edit your own structure. It is not difficult to enter a new geometry into the mesh of the TLM applet. Click on the Edit button and open the edit window. Enter the width and height of the new mesh in the field nx= and ny=. Then press new/clear. The size of the mesh in the main windows changes to the new size. All structure elements entered previously disappear.

Now, draw walls, fill in media, and set field excitations:

Select the wall type. You can choose from an ideal electric wall, an ideal magnetic wall, and a simple absorbing wall. Use the mouse to draw the walls in the TLM mesh. The number of walls is not restricted. If you did a mistake and want to delete a wall, select the wall with a short mouse click. The selected structure element will become red. Then you can delete the wall with the delete item button in the edit window. If the first mouse click on the wall does not select the right element, you must repeat the the mouse click until the correct element is selected.

If you want to use media in the structure, you have to activate medium in the edit windows and enter the desired media parameters. eps_r is the relative dielectricity, and g_loss is the loss factor of the medium. Use the mouse to fill the TLM mesh with medium. You can enter as many types and areas of media as you like. If you want to delete a area with medium, select the area (the selected area is marked with a red rectangle), and push the delete item button.

The field excitation is very important. If you forget to set a field excitation in the TLM mesh, all field components in all TLM cells remain zero, and the simulation is rather boring. In this TLM simulator, the field can be excited with a time domain gaussian pulse. Select gaussian pulse in the edit window, then enter the parameters of the pulse. The field t_max contains the time step number of the maximum of the gaussian pulse. sigma corresponds to the pulse width, and ampl is its maximum value. As a rule of thumb, t_max should be at least three times sigma.
It is possible to set more than one excitation in the mesh.

The TLM applet allows to save the field sequence during simulation. Select observe field and mark an area of the TLM mesh. Prior to this, you should enter the filename of the result file. Two cases are to distinguish. The behaviour of the program depends on whether the filename contains a %-character or not:
a) The filename contains the %-character: After every timestep a new file will be created. In the filename the %-character is substituted with the current timestep number. This file format is suitable for observing large areas.
b) The filename contains no %-character: One file will be created. The timestep number, the cell coordinates, and the field amplitudes of the selected TLM-cells will be written into the file after every timestep. This file format is suitable for observing single cells.
Tip: The observation function does not work in the www-browser programs. It is not possible to create and write files from an applet running in browsers. It is only possible to use this feature, if you run the TLM applet program directly with you Java interpreter.

All parameters of media, walls, excitations, and field observations can be changed easily. Select the object of which you want to change the properties with a short mouse click. Now, you can edit its properties in the edit window, e. g. turn an electric wall into an magnetic wall. Then press the apply button to accept the changes.

If you use a Java interpreter to run the TLM applet, then you can save the structure geometry into a file. To that, press the save structure button. You can read and edit the geometry data later.

When the editing is finished, close the edit windows with the Done button and start the two-dimensional TLM simulation with Run.

Running the TLM simulation

The simulation speed can be controlled by the Slower and Faster buttons. The current speed value is displayed in the number field between these two buttons. The lowest value is 0 (very slow), the highest value is 100 (maximum calculation speed). If you want to watch the propagation of a nice wave front, then you can slow down the calculation speed by pressing the buttons. It is also possible to enter the speed value directly into the number field via keyboard.
A click on Pause stops the calculation. An additional mouse click on the same button, which is now labeled Cont, will continue the simulation. If you want to restart the TLM simulation at zero, you should press Pause and then Restart. This will clear all field amlitudes in all TLM cells and start the simulation again.
The scale-selector allows you to choose the color-scaling methods. In principle, the the display procedure of the TLM applet maps the field amplitudes on colors, which range from blue to yellow. The blue color corresponds to a negative field value, yellow means positive. A zero field is always displayed black. The scaling of the field-color mapping is done with one of the following methods: If the selection is changed, the maximum field value of all former timesteps will be cleared. The maximum of the field-color mapping is always kept greater than 0.05.

Using a Java interpreter

If you want to use all features of the two-dimensional TLM java program, you should download the archive and run the program with your java interpreter. In addition to the applet version all geometry data and simulation results can be stored in files.
Load the archive file zweidtlm.zip, and extract the jar file and the structure definition files into a sub-directory. Take care not to destroy the long file names. Start the 2d TLM java program with: Internet Explorer fans enter this command line: in the DOS window of Windows. The program starts and the applet window opens. The usage of the program is almost identical to the usage of the applet in a browser. In difference to the browser version, the Save Structure button can be used. This allows to save the geometry to use it later. These geometry data can be read also from the TLM applet running in a browser. Additionally all observation field data will be saved during simulation. These data files can easily be analysed or displayed with other programs, e. g. Gnuplot.

The size of the TLM mesh can be selected by the command line switch -cs followed by the mesh distance in pixel:

The program will show all possible parameters when the command line switch -h is used.

Hints

smaller TLM cells
The following link starts the TLM applet with smaller TLM cells. It uses the same program files as the applet with normal sized cells. Here, the cellsize parameter in the HTLM-file is set to a smaller value.
Start 2d-TLM with smaller cells.

Tests
Version 1.0b of the applet has been tested with MS Internet Explorer 3 (Windows95), IE4 (Windows 95), Netscape 3 (Windows 95, Digital-Unix, Linux, HP-UX), Netscape Communicator 4 (Windows 95, Sun Sparc), JDK1.0.2 (Linux, Digital-Unix), and JDK1.1.1 (Linux).
The current version 1.0c of the applet has been tested with IE5 (Windows 98), Netscape 4.73 (Windows 98), Netscape 4.5 (Linux), JDK 1.3.0 (Windows 98), and JDK 1.1.7 (Linux).

The Java program does not start
Some WWW-browsers have difficulties to run Java programs, when the environment variable CLASSPATH is set. If the CLASSPATH variable is set improperly, the Java virtual-machine will not find its libraries and the applet window will remain empty. In this case, one should delete the CLASSPATH variable and start the browser again. In a C shell on Unix systems simply enter unsetenv CLASSPATH to remove the environment variable. (Usually, the CLASSPATH variable is used by the java compiler and debugger.)

Green Threads
Very rarely the applet blocks the browser program. This problem only appears if Netscape 3 is used and the simulation speed is set to the maximum value 100. I think, the problem is related with netscape's multi-threading model. Unfortunately, I have no clue how to fix it.
Tip: Netscape 3 users should use maximum speed 99.

Send your comments to: Bernhard Bader.


What is TLM?

The simulation method used in this Java program is named Transmission-Line-Matrix method, which is abbreviated as TLM. Transmission-Line-Matrix modelling is a numerical method for solving electromagnetic field problems. It is based on the analogy of the propagation of electromagnetic waves and electric impulses travelling in a network of transmission lines.

Line structures or other devices, which are to be examined, must be modelled on the TLM mesh. Then the Java program calculates the electric and magnetic fields in time domain. From these results the properties (e. g. scattering parameters) of the examined structures can be derived. TLM is not restricted to two-dimensional structures. It can be used to calculate three-dimensional problems, too.

Additional information on the three-dimensional TLM method and its development into the Alternating-Transmission-Line-Matrix methode (ATLM) can be obtained here: Untersuchung der ATLM-Methode (in German).


© 1997, 2000 Bernhard Bader Zur FBH-Seite.