One of the advantages of TLM is that the core algorithm is very straightforward. Each timestep can be divided into two processes:
During the "scatter" stage, voltage pulses incident on the node are scattered to produce a new set of outgoing voltage pulses. During the "connect" stage, voltage pulses are transferred to the adjacent nodes. It is possible to combine both processes together but it is simpler to consider them separately. Below, typical procedures for 3-dimensional electromagnetic problems are described.
The standard 12-port symmetrical condensed node can be used to model loss-less material of constant properties. Using Johns original notation [1], the scattering process can be written as (Fortran style):
V( 1,X,Y,Z) = 0.5 * ( V02 + V03 + V09 - V11 ) V( 2,X,Y,Z) = 0.5 * ( V01 + V06 - V10 + V12 ) V( 3,X,Y,Z) = 0.5 * ( V01 + V04 + V08 - V12 ) V( 4,X,Y,Z) = 0.5 * ( V03 + V05 - V07 + V11 ) V( 5,X,Y,Z) = 0.5 * ( V04 + V06 - V08 + V10 ) V( 6,X,Y,Z) = 0.5 * ( V02 + V05 + V07 - V09 ) V( 7,X,Y,Z) = 0.5 * (-V04 + V06 + V08 + V10 ) V( 8,X,Y,Z) = 0.5 * ( V03 - V05 + V07 + V11 ) V( 9,X,Y,Z) = 0.5 * ( V01 - V06 + V10 + V12 ) V(10,X,Y,Z) = 0.5 * (-V02 + V05 + V07 + V09 ) V(11,X,Y,Z) = 0.5 * (-V01 + V04 + V08 + V12 ) V(12,X,Y,Z) = 0.5 * ( V02 - V03 + V09 + V11 )
where V01
-V12
are temporary
quantities used to store the incident pulses. The storage for the
incident and reflected pulses can be shared, provided that local
storage is used during the scattering procedure to prevent
overwriting of incident pulses before they are used.
The number of arithmetic operations can be minimized by using the algorithm developed by Trenkic [2] (C style):
vdiff = vxpy - vxny; vtemp = 0.5 * ( vznx + vzpx + vdiff ); pt[PYPX] = vtemp; pt[PYNX] = vtemp - vdiff; vdiff = vxpz - vxnz; vtemp = 0.5 * ( vynx + vypx + vdiff ); pt[PZPX] = vtemp; pt[PZNX] = vtemp - vdiff; vdiff = vypz - vynz; vtemp = 0.5 * ( vxny + vxpy + vdiff ); pt[PZPY] = vtemp; pt[PZNY] = vtemp - vdiff; vdiff = vypx - vynx; vtemp = 0.5 * ( vzny + vzpy + vdiff ); pt[PXPY] = vtemp; pt[PXNY] = vtemp - vdiff; vdiff = vzpx - vznx; vtemp = 0.5 * ( vynz + vypz + vdiff ); pt[PXPZ] = vtemp; pt[PXNZ] = vtemp - vdiff; vdiff = vzpy - vzny; vtemp = 0.5 * ( vxnz + vxpz + vdiff ); pt[PYPZ] = vtemp; pt[PYNZ] = vtemp - vdiff;
This time, we use variables vxny
-vzpy
to temporarily store the incident pulses. This notation uses
three characters to identify the port, the first gives the
direction of the link-line, the second is "n" or
"p" indicating whether the port is on the negative or
positive side of the node (taking the centre as the origin), and
the third gives the polarisation of the voltage pulse [3]. The variables vdiff
and vtemp
are just used as short term storage. The variable pt
points to the current node and the constants PXNY
-PZPY
give the index into the node array for each port.
The stub-loaded node can be used to model lossy materials with properties different from other nodes in the mesh. Three open-circuit stubs are added to model increased permittivity, three short-circuit stubs are added to model increased permeability [1] and matched stubs coupling with either the electric [4] or magnetic fields [5] can be used to model losses. Note that no additional storage is required for the loss stubs since pulses scattered into these stubs are completely absorbed.
The scattering procedure can be written in the following form:
vx = kvx * ( vynx + vypx + vznx + vzpx + vocx ); vy = kvy * ( vzny + vzpy + vxny + vxpy + vocy ); vz = kvz * ( vxnz + vxpz + vynz + vypz + vocz ); ix = kix * ( vynz - vypz + vzpy - vzny + vscx ); iy = kiy * ( vznx - vzpx + vxpz - vxnz + vscy ); iz = kiz * ( vxny - vxpy + vypx - vynx + vscz ); pt[PXNY] = vy - iz - vxpy; pt[PXNZ] = vz + iy - vxpz; pt[PXPY] = vy + iz - vxny; pt[PXPZ] = vz - iy - vxnz; pt[PYNZ] = vz - ix - vypz; pt[PYNX] = vx + iz - vypx; pt[PYPZ] = vz + ix - vynz; pt[PYPX] = vx - iz - vynx; pt[PZNX] = vx - iy - vzpx; pt[PZNY] = vy + ix - vzpy; pt[PZPX] = vx + iy - vznx; pt[PZPY] = vy - ix - vzny; pt[POCX] = yocx * vx - vocx; pt[POCY] = yocy * vy - vocy; pt[POCZ] = yocz * vz - vocz; pt[PSCX] = zscx * ix - vscx; pt[PSCY] = zscy * iy - vscy; pt[PSCZ] = zscz * iz - vscz;
Here, variables vocx
-vocz
represent
the pulses on open-circuit stubs of normalised admittance yocx
-yocz
and vscx
-vscz
represent the pulses on
short-circuit stubs of normalized impedance zscx
-zscz
.
For the open-circuit stubs, it is convenient to store the product
of the voltage and the normalised admittance. The constants kvx
-kvz
and kix
-kiz
may be evaluated and stored
before the calculation proper, and are given by expressions of
the form:
kvx = 2.0 / ( 4.0 + yocx + gx ); kix = 2.0 / ( 4.0 + zscx + zx );
where gx
is the normalised electric loss stub
admittance and zx
is the normalised magnetic loss
stub impedance.
These expressions were originally put into this form by Naylor and Ait-Sadi [6] and it has been found that this is also a computationally efficient formulation [3].
The scattering procedures for hybrid [7] and super-condensed nodes [8] can also be expressed in a similar form but here account has to be taken of the fact the the 12 link-lines no longer have the same impedance.
More detailed discussions on the implementation and efficiency of various scattering procedures are given by Herring [3] [9] and Trenkic [10].
For the case when the link-line impedances are all equal, the connection stage consists simply of transferring the voltage pulses to the adjacent nodes. For the hybrid and super-condensed nodes, the link-line impedances can be different and an impedance discontinuity will exist. This must be taken into account when transferring the pulses.