An FDTD simulation involves a number of numerical parameters that can be accessed and modified from the FDTD Engine Settings Dialog. To open this dialog, select '''Menu > Simulate > Simulation Engine Settings... '''or open the '''Run Dialog''', and click the '''Settings''' button next to the engine dropdown list.
In the " '''Convergence''' " section of the dialog, you can set the '''Termination Criterion''' for the FDTD time loop. The time loop must stop after a certain point in time. If you use a decaying waveform like a Gaussian pulse or a Modulated Gaussian pulse, after certain number of time steps, the total energy of the computational domain drops to very negligible values, and continuing the time loop thereafter would not generate any new information about your physical structure. By contrast, a sinusoidal waveform will keep pumping energy into the computational domain forever, and you have to force the simulation engine to exit the time loop. EM.Cube's [[FDTD Module]] provides two mechanism to terminated the time loop. In the first approach, an energy-like quantity defined as U<sub>n</sub> = Σ [ ε<sub>0</sub>|'''E<sub>i,n</sub>'''|<sup>2</sup> + μ<sub>0</sub>|'''H<sub>i,n</sub>'''|<sup>2</sup> ].ΔV<sub>i</sub> is calculated and recorded at a large random set of points in the computational domain. Here i is the space index and n is the time index. The quantity U<sub>n</sub> has a zero value at t = 0 (i.e. n = 0), and its value starts to build up over time. With a Gaussian or Modulated Gaussian pulse waveform, U<sub>n</sub> reach a maximum value U<sub>max</sub> at some time step and starts to decline thereafter. The ratio 10.log( U<sub>n</sub>/ U<sub>max</sub>) expressed in dB is used as the convergence criterion. When its value drops below certain '''Power Threshold''', the time loop is exited. The default value of Power Threshold is -30dB, meaning that the FDTD engine will exit the time loop if the quantity U<sub>n</sub> drops to 1/1000 of its maximum value ever. The second termination criterion is simply reaching a '''Maximum Number of Time Steps''' , whose default value set to 10,000. A third option, which is EM.Cube's default setting (labeled "'''Both'''"), terminates the simulation as soon as either of the first two criteria is met first. <font color="red"><u>''' {{Note|Keep in mind that for highly resonant structures, you may have to increase the maximum number of time steps to very large values above 20,000.'''</u></font>}}
[[Image:FDTD58.png]]