This example shows how to correct the amplitude of field data recorded by frequency domain monitors when the simulation does not run long enough for the fields to fully decay.
Correcting mode profile amplitudes
The absolute mode profile describes the spatial shape of the fields AND the strength of the coupling between the source and cavity mode. The absolute mode profile is usually not a quantity of interest because the FDTD source used to excite the cavity is not representative of the physical source that excites the cavity.
NOTE: In most cases, it's not necessary to calculate the absolute amplitude of the mode profile. The Quality (Q) factor and relative mode profile are usually the quantities of interest.
If your FDTD source is representative of the physical source, you may want to know the actual amplitude of the mode profile. This page shows how to correct the mode profile amplitude for high Q cavities where it's not practical to run the simulation until the fields decay to zero.
The reason that the amplitude will be incorrect is that the simulation ends before the cavity fields have decayed to zero, as shown in the following figure. The frequency monitor field normalization is only correct when the entire time signal is considered. This effect is very similar to configuring the monitor to use End Apodization.
Figure 1
It's possible to correct the field amplitude's simply by re-scaling the fields. The field amplitude is proportional to the area under the curve of the above figure. Therefore, we need to correct the fields by the fraction of the area that was missed because the simulation stopped too early. The field scale factor is a function of the resonant frequency, the simulation end time, and the Quality factor of the mode:
$$\gamma=\frac{1}{1-e^{\frac{-\omega t_{E N D}}{2 Q}}}$$
$$\vec{E}=\gamma \vec{E}_{s i m}$$
The file cavity_mode_amplitude.fsp contains an analysis group that does this calculation. The group "mode profile and Q" contains a frequency domain field monitor and a Q analysis group. The Q analysis group is used to calculate the Q-factor of the mode. Once the Q is known, the group rescales the field data from the field monitor by gamma, the field scale factor.
To see how it works, run the script file name cavity_mode_amplitude.lsf. The script will run two simulations: one that is 500fs long and and other that is 3000fs long. The script will plot |E(t)|^2, |E(x,y)|^2 directly from the monitor, and |E(x,y)|^2 after it has been rescaled.
Figure 2: Simulation time 500fs
Figure 5: Simulation time 3000fs
Cavity fields as a function of time at the center of the cavity. Notice that the 500 fs simulation is not long enough for the fields to fully decay.
Figure 3: Simulation time 500fs
Figure 6: Simulation time 3000fs
Field profile from the field monitor. Notice that the field amplitude depends on the simulation time. If the simulation doesn't run long enough, the field amplitude will be smaller than it should be.
Figure 4: Simulation time 500fs
Figure 7: Simulation time 3000fs
Field profile from the the analysis group, after the field data has been rescaled. Notice that the field profile is the same from the 500 and 3000fs simulations. The fields from the 500fs was rescaled by a larger amount to compensate for the shorter simulation time. Also notice that the scale factor for the 3000 fs simulation is ~1. There is no need to re-scale the fields if the simulation runs long enough for the fields to fully decay.
The key points to notice are:
1) The 3000fs simulation is long enough for the fields to decay to zero so there is no need to re-scale the fields. Figure 6 and 7 are basically the same because the scale factor is 1.
2) The 500 fs is too short for the fields to decay. Therefore, the fields from the field monitor need to be rescaled. In this case, the scale factor is approximately 3.
3) The "absolute field profile and Q" group returns the same field profile from the 500 and 3000fs simulation. Therefore, there is no need to run a simulation until the fields decay. All information can be extracted from the shorter simulation.