Читать книгу Electromagnetic Simulation Using the FDTD Method with Python - Dennis M. Sullivan - Страница 11

1.1 ONE‐DIMENSIONAL FREE‐SPACE SIMULATION

Оглавление

The time‐dependent Maxwell’s curl equations for free space are

(1.1a)

(1.1b)

E and H are vectors in three dimensions, so, in general, Eq. (1.1a) and (1.1b) represent three equations each. We will start with a simple one‐dimensional case using only Ex and Hy, so Eq. (1.1a) and (1.1b) become

(1.2a)

(1.2b)

These are the equations of a plane wave traveling in the z direction with the electric field oriented in the x direction and the magnetic field oriented in the y direction.

Taking the central difference approximations for both the temporal and spatial derivatives gives

(1.3a)

(1.3b)

In these two equations, time is specified by the superscripts, that is, n represents a time step, and the time t is t = Δtn. Remember, we have to discretize everything for formulation into the computer. The term n + 1 means one time step later. The terms in parentheses represent distance, that is, k is used to calculate the distance z = Δxk. (It might seem more sensible to use Δz as the incremental step because in this case we are going in the z direction. However, Δx is so commonly used for a spatial increment that we will use Δx.) The formulation of Eq. (1.3a) and (1.3b) assume that the E and H fields are interleaved in both space and time. H uses the arguments k + 1/2 and k − 1/2 to indicate that the H field values are assumed to be located between the E field values. This is illustrated in Fig. 1.1. Similarly, the n + 1/2 or n − 1/2 superscript indicates that it occurs slightly after or before n, respectively. Equations (1.3a) and (1.3b) can be rearranged in an iterative algorithm:

(1.4a)

(1.4b)

Notice that the calculations are interleaved in space and time. In Eq. (1.4a), for example, the new value of Ex is calculated from the previous value of Ex and the most recent values of Hy.

Figure 1.1 Interleaving of the E and H fields in space and time in the FDTD formulation. To calculate Hy, for instance, the neighboring values of Ex at k and k + 1 are needed. Similarly, to calculate Ex, the values of Hy at k + 1/2 and are needed.

This is the fundamental paradigm of the FDTD method (1).

Equations (1.4a) and (1.4b) are very similar, but because ε0 and μ0 differ by several orders of magnitude, Ex and Hy will differ by several orders of magnitude. This is circumvented by making the following change of variables (2):

(1.5)

Substituting this into Eq. (1.4a) and (1.4b) gives

(1.6a)

(1.6b)

Once the cell size Δx is chosen, then the time step Δt is determined by

(1.7)

where c0 is the speed of light in free space. (The reason for this will be explained in Section 1.2.) Therefore, remembering that ε0μ0 = 1/(c0)2,

(1.8)

Rewriting Eq. (1.6a) and (1.6b) in Python gives the following:

(1.9a)

(1.9b)

Note that the n, n + 1/2, or n − 1/2 in the superscripts is gone. Time is implicit in the FDTD method. In Eq. (1.9a), the ex on the right side of the equal sign is the previous value at n − 1/2, and the ex on the left side is the new value n + 1/2, which is being calculated. Position, however, is explicit. The only difference is that k + 1/2 and k − 1/2 are rounded to k and k − 1 in order to specify a position in an array in the program.

The program fd1d_1_1.py at the end of this chapter is a simple one‐dimensional FDTD program. It generates a Gaussian pulse in the center of the problem space, and the pulse propagates away in both directions as seen in Fig. 1.2. The Ex field is positive in both directions, but the Hy field is negative in the negative direction. The following points are worth noting about the program:

1 The Ex and Hy values are calculated by separate loops, and they employ the interleaving described above.

2 After the Ex values are calculated, the source is calculated. This is done by simply specifying a value of Ex at the point k = kc and overriding what was previously calculated. This is referred to as a hard source because a specific value is imposed on the FDTD grid.

Figure 1.2 FDTD simulation of a pulse in free space after 100 time steps. The pulse originated in the center and travels outward.

Electromagnetic Simulation Using the FDTD Method with Python

Подняться наверх