Читать книгу Electromagnetic Simulation Using the FDTD Method with Python - Dennis M. Sullivan - Страница 19
1.5 SIMULATING DIFFERENT SOURCES
ОглавлениеIn the fd1d_1_1.py and fd1d_1_2.py, a source is assigned as values to Ex; this is referred to as a hard source. In fd1d_1_3.py, however, a value is added to Ex at a certain point; this is called a soft source. The reason is that with a hard source, a propagating pulse will see that added value and be reflected because a hard value of Ex looks like a metal wall to FDTD. With the soft source, a propagating pulse will just pass through.
Until now, we have been using a Gaussian pulse as the source. It is very easy to switch to a sinusoidal source. Just replace the parameter pulse
with the following:
The parameter freq_in
determines the frequency of the wave. This source is used in the program fd1d_1_4.py. Figure 1.5 shows the same dielectric medium problem with a sinusoidal source. A frequency of 700 MHz is used. Notice that the simulation was stopped before the wave reached the far right side. Remember that we have an absorbing boundary condition, but only for free space.
Figure 1.5 Simulation of a propagating sinusoidal wave of 700 MHz striking a medium with a relative dielectric constant of 4.
In fd1d_1_4.py, the cell size ddx
and the time step dt
are specified explicitly. We do this because we need dt
in the calculation of pulse
. The cell size ddx
is only specified because it is needed to calculate dt
from Eq. (1.7).