A special feature of XFdtd is its ability to include timed switches in calculations. This allows the user to change the configuration of the calculation geometry during a simulation. Any number of switches may be introduced into the geometry, with each switch being specified as a separate port. The user may specify whether the initial state of the switch is open or closed, and the time at which the switching action begins.
A simple example of applying a switch is shown in Figure 1. This example is taken from a textbook example . In this example the current source is excited with a Gaussian pulse to charge the transmission line with the switch initially open. Once the Gaussian pulse ends, the current source is an open circuit which holds the charge on the transmission line. After the charging transients are dissipated the switch is closed. This then discharges the transmission line into the load resistor. For this example the load resistor was picked to be the same value as the characteristic impedance of the transmission line, 310 ohms. Thus the line is discharged in the time for the switched pulse to travel from the switch to the open end (current source) and back to the load resistor forming a square pulse.
The XFdtd geometry with the current source, load resistor, and switch marked by the green cylinders is shown in Figure 2. The mesh size is 1 mm, the length of the line is 60 mm, so the propagation time from one end to the other is 0.2 ns at the speed of light in air. A plot of the voltages across each port is shown in Figure 3. Initially the voltage across the current source indicates its Gaussian excitation, with the corresponding voltage arriving at the switch after the time necessary to propagate down the transmission line. The polarities are reversed to make it easier to see the two lines. There is a slight voltage initially introduced on the load resistor due to the displacement current that travels through the open switch and perhaps some direct radiation of energy. The current pulse amplitude of 1.6 mA was chosen to charge the line to approximately 2 volts. After 3.85 ns (2000 time steps) the switch closure begins, with a smooth transition over 60 time steps or 0.115 ns. This forms the pulse across the load resistor of amplitude 1 (since the load resistor is approximately equal to the characteristic impedance of the transmission line) and duration of twice the transit time of the transmission line plus the time for the switch to close. There are small trailing pulses due to high frequency components and perhaps a slight mismatch between the load resistor and characteristic impedance of the transmission line.
Color field displays show the electric field parallel to the ends of the line for the charged transmission line in Figure 4, just after the switch is closed in Figure 5, the right-ward traveling pulse just as it reaches the current source in Figure 6, and the left-ward traveling pulse traveling toward the load resistor in Figure 7 as it is absorbed in the matched source resistance.
- from Ramo, Whinnery, and Van Duzer, Fields and Waves in Communication Electronics, Third Edition, John Wiley and Sons, pp. 227-229