# Argument-recursive computation of Legendre polynomials and its application to the time domain near-to-far-field spherical-multipole analysis

## Abstract

[1] An efficient x-recursive numerical scheme is presented to compute Legendre polynomials Pn(x) and their derivatives P′n(x) on the interval (0, 1) for a fixed-order n. The numerical properties are discussed and, as an example of use in computational electromagnetics, the method is applied to improve a recently proposed spherical-multipole based time domain near-to-far-field transformation algorithm.

## 1. Introduction

[2] Legendre polynomials play an important role in electromagnetics as they belong to the elementary solutions of the Helmholtz equation in spherical coordinates. Moreover, they form an orthogonal set of L2 functions on the interval (−1, 1) and they are the Fourier transformation partners of spherical Bessel functions [Abramowitz and Stegun, 1972]. The computation of Legendre polynomials Pn is a well known task in numerical mathematics, in particular, the computation of Pn(x) for neighboring values of the argument x is often needed in computational electromagnetics (CEM).

[3] Classical algorithms to numerically compute Pn(x) are based on well known order (n)-recursive relations [Abramowitz and Stegun, 1972; Gautschi, 1967; Zhang and Jin, 1996; Press et al., 1992] for a fixed argument x. In this contribution, we introduce an alternative and efficient quadrature routine to compute discrete values of Legendre polynomials Pn(x) (and, simultaneously, of their derivatives P′n(x)) on the interval x ∈ (0, 1) with fixed-order n, which however is recursive with respect to the argument x. Therefore, the proposed numerical technique is useful in any situation where a large number of (neighboring) discrete values Pn(xi), P′n(xi) for a fixed order n is needed. In such cases, computational costs can be dramatically decreased because, as will be shown in the following, the computation time does not multiplicatively depend on the order of the polynomial, in contrast to usual n-recursive schemes.

[4] After introducing the proposed algorithm we discuss its numerical properties as consistency, numerical stability, and computational costs. Finally, we describe the implementation of the algorithm into a recently proposed CEM-related method, namely the near-to-far-field transformation by a time domain multipole analysis for the Finite Difference Time Domain method (FDTD) [Oetting and Klinkenbusch, 2005; Klinkenbusch and Oetting, 2007; Adam and Klinkenbusch, 2006].

## 2. Argument (x)-Recursive Computation of Pn(x) and P′n(x)

[5] The Legendre polynomials Pn satisfy the Legendre's differential equation

with x ∈ (0, 1), n.

[6] In order to approximately compute a set of discrete values n of a Legendre polynomial Pn of fixed-order n we first transform the differential equation (1) into a special two-dimensional linear system

with

We remark that the operator L is regular for all x ∈ (0, 1). Note that this transformation differs from the usual way of decomposing a second-order differential equation into a linear system [Walter, 1990] which would lead to

As easily can be seen the system (3) provides a better control of the second-order pole at x = 1.

[7] We numerically integrate the linear system (2), (3) by the Gaussian trapezoidal formula

with Δx : = xi+1xi (= 1/imax). To this end we consider a fixed-order n of the Legendre polynomial and a discretization of the interval [0, 1] by equidistant nodes 0 = x0 < x1 < x2 < … < x = 1, with imax>1. Let ℐ : = {1,…, imax − 2}. Further we introduce the abbreviations ν : = n(n + 1) and τi : = (xi2 − 1), for all i ∈ ℐ. Now the problem reduces to the computation of the operator

for all i ∈ ℐ, where Li+1 = L(xi+1, n), Li = (xi, n) and id = . Carrying out the product in (6), we derive the update equation

with the update operator

with i = (n(xi), τin(xi))T, and with the approximate values n and n at node xi. Note that, though the Gaussian trapezoidal formula (5) is an implicit scheme, our update equation (7) turns out to be explicit, because the operator (8) does not depend on n(xi+1) nor on n(xi+1).

[8] The two needed initial values, i.e., Pn(0) and τ0P′n(0) are easily obtained analytically [Zhang and Jin, 1996]:

## 3. Consistency, Numerical Stability, and Computational Cost

[9] With the Gaussian trapezoidal formula as the method of numerical integration the constructed algorithm is of second-order accuracy. This can also be seen from Figure 1 which shows the amount of the relative error as defined by

where 7 is obtained by means of the proposed technique, and the exact value is given by

Note that the peaks correspond to zeros of P7 and are due to the definition of the relative error.

[10] While accuracy (that is, consistency) is obviously given by construction, the verification of convergence and numerical stability turns out to be a more difficult task for such cases [Dahlquist, 1985; Rutishauser, 1952; Walter, 1990]. However, the Gaussian trapezoidal formula is known to be generally A stable [Schwarz, 1997], which leads to the assumption that the introduced algorithm has a large set of stability. As a criterion for numerical stability we consider the inequality

where ρ(T) is the spectral radius of a given integral operator T. As proven in Appendix A the following estimation holds:

[11] Lemma 1: Let n. The Legendre polynomial Pn can be approximated by the numerically stable scheme (7), (8) by choosing the maximum number of equidistant nodes imax = 1/Δx within the interval [0, 1] according to

[12] Note that equation (10) is particularly true for imax, thus, the algorithm is numerically stable for all cases of practical relevance.

[13] The computational cost for computing imax neighboring values of Pn (with fixed n) is easily estimated as &#55349;&#56490; [n] + &#55349;&#56490; [imax] where the first part is needed for obtaining the initial values. The cost of the usual order-related recursive algorithms [Zhang and Jin, 1996] is obviously given by &#55349;&#56490; [n] · &#55349;&#56490; [imax]. The comparison is illustrated in Figure 2.

## 4. Application to the Multipole Based Near-to-Far-Field Transformation

[14] The new technique has been implemented into a recently proposed spherical-multipole based near-to-far-field transformation algorithm [Oetting and Klinkenbusch, 2005; Klinkenbusch and Oetting, 2007; Adam and Klinkenbusch, 2006]. Here, the electric far-field strength at = (r, ϑ, ϕ)T (at r → ∞) is represented by the time domain spherical-multipole expansion

where vc = denotes the (vacuum) velocity of light and Z = is the corresponding intrinsic impedance. Note that each term of the spherical-multipole expansion (11) can also be physically interpreted as the far field of a free-space spherical mode; see Blume and Klinkenbusch [2000] for details.

[15] The angular-dependent functions in (11) are referred to as the transverse vector functions

They essentially consist of the accordingly normalized surface spherical harmonics

Pnm denotes an associated Legendre function of the first kind, as defined by Abramowitz and Stegun [1972]. The surface spherical harmonics as well as the transverse vector functions each form a complete set of orthogonal functions on the 3 sphere.

[16] The proposed near-to-far-field algorithm aims at finding the electric and magnetic time domain spherical-multipole amplitudes an,m and bn,m, respectively, by which the spherical-multipole expansion (11) can be further processed purely analytically and, in particular, evaluated at arbitrary far-field observation points.

[17] According to the surface equivalence theorem [Balanis, 1989] the electromagnetic far field of any scatterer can be determined by the tangential components of the near-field data on a (Huygens) surface S completely enclosing all scattering objects. Here, that near-field data is obtained in time- and space-discrete form as an outcome of a Finite Difference Time Domain (FDTD) solver [Taflove and Hagness, 2005; Kunz and Luebbers, 1993]. In order to determine the corresponding spherical-multipole amplitudes the spherical-multipole interface (L. Klinkenbusch, A spherical multipole interface for numerical methods in electromagnetic field theory, paper presented at the Latsis Symposium on Computational Electromagnetics, Zürich, Switzerland, 1995) has been used: The field components on the Huygens surface S are replaced by a finite number of appropriately chosen electric and magnetic dipoles. We assume that the collectivity of those dipoles consists of Nel electric dipoles at grid points el[i], i ∈ {1,…, Nel} and Nmag magnetic dipoles at grid points mag[i], i ∈ {1,…, Nmag}, and can represent the time domain spherical-multipole amplitudes by the following finite summation of convolution integrals [Oetting and Klinkenbusch, 2005]:

The current moments el[i] and mag[i] are directly obtained from the FDTD output on the Huygens surface according to

( and Δf[i] denote the normal unit vector and the surface element, respectively, of the surface element on the Huygens surface at [i] = (r[i], ϑ[i], ϕ[i]); see Figure 3 for details.) while the vector convolution partners are given by [Klinkenbusch and Oetting, 2007]

and

Here, Pn denotes a Legendre polynomial of order n, while the rectangle function is defined in the usual way as

It is worth noting that the rectangle function in equations (16) and (17) enforces the convolution integrals within equations (14) and (15) to be reduced to the intervals Ci ≔ [−tvc/r[i], tvc/r[i]]. Consequently, for reducing the numerical cost it is effective, to choose the diameter of the Huygens surface as small as possible.

[18] Originally, the multipole amplitudes (14) and (15) are evaluated from field data at discrete time steps kΔt. However, by a temporal linear interpolation of the discrete current moments elk[i]el[i] (kΔt) and magk[i]mag[i] (kΔt) (similar to the procedure used for the treatment of dispersive media in FDTD [Taflove and Hagness, 2005]) and by consequently replacing the differential operators in equations (16) and (17) by central (second-order) difference quotients, we obtain the following numerical representations

and

with the abbreviations cel = (ell,[i]ell−1,[i]) and cmkl = (magl,[i]magl−1,[i]) for all l. The three vector functions n,m[i], n,m[i] and n,m[i] are defined by

where [i] indicates that the corresponding function is evaluated at ϑ[i], ϕ[i]. Furthermore we introduce the abbreviation w[i] = tvc/r[i], with · denoting the next largest integer value. The two scalar integrals χnl,[i] and ψnl,[i] are given by

with the abbreviation tl[i] = l (l). Employing partial integration and special integrals involving Legendre polynomials [Gradshteyn and Ryzhik, 2000], both of the integrals (25) and (24) can be evaluated completely analytically. We derive for the first one:

where the auxiliary function γnl is given by

In the case n > 1 the second integral reads

with the auxiliary function

In the case n = 1 we finally derive

With γnl and λnl embodying the kernel of the calculation of the multipole amplitudes an,m and bn,m, equations (27) and (29) reveal that the proposed time-recursive scheme (8) is perfectly suited for an efficient implementation into the spherical-multipole based time domain near-to-far-field transformation algorithm. Furthermore, the proposed technique is of second-order accuracy, and hence perfectly fits to the standard FDTD algorithms with central difference quotients.

[19] Note that the proposed method is different from other near-to-far-field approaches, a few of which are mentioned here: In the context of analyzing antenna fields in the work of Shlivinski and Heyman [1999], first an effective source is calculated by scaling the time coordinate of the source signals with respect to the radial coordinate r and a spectral integration parameter ξ, and then, the time-dependent multipole moments are calculated by a “geometrical projection” of these effective source functions onto the spherical harmonics. The slant stack transform (SST) technique as shown in the works of Heyman [1996] for scalar and Shlivinski et al. [1997] for vector fields, expresses the pattern explicitly in terms of the plane wave propagating in desired observation directions, whereas in the present approach the radiation pattern at any direction is always a summation of the spherical moments. Consequently, for collimated fields with one main radiation direction, the SST approach might be preferable to efficiently represent time domain far fields. The bridge from the plane wave (SST) formulation to spherical-multipole fields has been represented in the work of Shlivinski et al. [2001] for scalar (acoustic) fields with distributed volume sources.

## 5. Numerical Results

[20] The multipole based near-to-far-field (NFF) algorithm proposed in section 4 has been integrated into XFDTD, a 3-D FDTD code [Remcom Inc, 1998] (scattered field formulation, PML). Here, the discrete convolution sums (19) and (20) are easily implemented in the FDTD time-stepping process. Hence, the multipole amplitudes an,m and bn,m are calculated as “on the fly” with the FDTD near-field solver. With the once obtained multipole amplitudes, it is an easy and efficient task to compute the time domain far field (11) at any point in the far-field region.

### 5.1. Plane Wave Scattered by a Sphere

[21] In order to validate the obtained results, we first apply an FDTD Code with built-in spherical multipole interface to calculate the scattered far field caused by a dielectric as well as by a perfectly conducting (PEC) sphere where analytical results are available.

[22] The sphere with radius 0.255m is centered in an 81 × 81 × 81 cells FDTD region, with cubic cells each 103 mm3, surrounded by a 10 cell thick Perfectly Matched Layer (PML). The Huygens surface is located in between the sphere and the PML, with five cells distance to the boundary. The time step is set to 19.26 ps to secure a stable computation (see Taflove and Hagness [2005] and Kunz and Luebbers [1993] for details).

[23] The incident plane wave is given by a Gaussian-type modulated sine pulse

with center frequency fc = 500 MHz and 20 dB loss at fmin = 300 MHz and fmax = 700 Mhz. Δt is the time step increment of the FDTD solver, and the loss factor is α = , while the pulse width (in time steps) is given by β = . The plane wave is incident from ϑ = 0 (from the +z axis) and polarized in the ϑ (x) direction, with an amplitude A = 1000 V/m. Figure 4 sketches the setup of the FDTD domain and the direction of the incident plane wave.

[24] To start with a demonstration of the outstanding postprocessing facilities of the method, Figure 5 shows the normalized far-field scattered by the dielectric sphere in the xy plane as a time-angle plot: The angles correspond to the scattering directions while the distance from the center of the plot is interpreted as the time axis. The incident plane wave is chosen as shown in Figure 4.

[25] Semianalytical reference solutions have been obtained by performing a numerical Fourier transformation on the classical Mie solutions for the sphere. Forward and backward scattered field are shown in Figures 6 and 7 for the dielectric sphere, as well as in Figures 8 and 9 for the PEC sphere. For Figures 6–9, the label “analytical” represents the FFT-transformed analytical solution, while both of the other curves are obtained by the XFDTD Code with different near-to-far-field transformation algorithms: The label “XFDTD” represents the curves obtained by the original XFDTD's intrinsic near-to-far-field algorithm, which is based on the method of retarded potentials using the closed form of the Green's function of free space [Luebbers et al., 1991]. Note, that this method demands a new integration over the Huygens surface for each far-field point and hence is ineffective concerning high-resolution far fields. The label “multipole” represents curves obtained by the described spherical-multipole based near-to-far-field transformation integrated in the XFDTD code. Figures 6–9 show a perfect match between the two latter (purely numerical) approaches. The minor differences in the maxima compared to the semianalytical method are due to numerical (discretization) errors.

### 5.2. Time Domain Total Scattering Error

[26] The existence of an exact reference solution and the corresponding multipole amplitudes allows a systematic characterization of the new numerical method through the definition of a time domain total scattering error

where anasc represents the reference solution and numsc is the numerically obtained scattered electric far field. Utilizing the orthogonality relations of the transverse vector functions, it can be easily shown that the total scattering error may be expressed in terms of the corresponding multipole amplitudes as:

An equivalent definition of a frequency domain total scattering error can be found in the work of L. Klinkenbusch (Analytical representation of the field from numerically obtained current distributions via the spherical multipole interface, paper presented at the 7th International IGTE Symposium, Institut für Grundlagen und Theorie der Elektrotechnik, Graz, Austria, 1996). The scalar value δsc can be understood as the (relative) mean squared error with respect to the entire far field spherical surface. Hence, it provides an analytical measure for the overall quality of the transient simulation.

[27] To investigate correctness and efficiency of the proposed method, the plane wave scattering by a dielectric sphere has been simulated with identical setups and material parameters as in section 5.1, however, with four different discretizations: 25, 51, 101, 200 FDTD cells sphere diameter, with 20, 10, 5, 2.5 mm cell width and 38.52, 19.26, 9.63, 4.81 ps time step increment, respectively, have been employed. For each simulation the time domain total scattering error is calculated (versus the corresponding Fourier-transformed analytical reference solution) and illustrated in Figure 10. Moreover, they also exemplarily include the corresponding computation time on a customary desktop computer.

## 6. Conclusion

[28] We have presented an efficient x-recursive algorithm to compute Legendre polynomials Pn(x) and their derivatives P′n(x) on the interval (0, 1). We have shown how to integrate the algorithm into a recently proposed spherical-multipole based time domain near-to-far-field transformation algorithm, delivering an efficient method to deduce transient far fields from a near-field time domain solver. The successful implementation into an existing 3D FDTD code has been described. The numerical results prove the correctness and applicability of the proposed technique.

## Appendix A:: Proof of Numerical Stability

[29] In this section we will show the following: If we choose the discretization according to (10), the operator i, defined in (8), is a contraction for all i ∈ ℐ, i.e., its spectral radius ρ(i) is lower than 1. Thus, according to the stability criterion (9) the algorithm is numerically stable.

[30] For that we consider all definitions and abbreviations of section 2 and furthermore use the abbreviation v = n(n + 1). Let i∈ ℐ. Then, due to a straightforward computation, the two complex eigenvalues of the operator i are given by

[31] Note that according to the definition τi and τi+1 are negative. Hence the denominator 8τiτi+1 − 2Δx2i of the eigenvalues λ±(i) is positive for all i ∈ ℐ.

[32] Now we will take a closer look at the radicand in (A1). With the definitions of τi and τi+1 we derive:

It is easy to see that tends to infinity, if Δx → 0. Thus, if we choose Δx small enough, we have

Hence, if we choose Δx according to (A3), we have

Thus, the radicand in (A1) is negative and the square root has no real part. Further we have

because according to the definition of τi and τi+1 we have τiτi+1(τi+1 + τi) < 0. Under this preliminaries the eigenvalues of i are easily splitted into imaginary and real parts:

and

With these preparations we obtain Theorem 1:

[33] Let Δx be chosen with respect to equation (A3). Then for all iI it holds ρ(i) < 1, i.e., the operator i contracts for all i ∈ ℐ.

[34] Proof: By definition the spectral radius of i is given by

According to equations (A5) and (A6) the eigenvalues λ+(i) and λ(i) of i have the same absolute value. Thus we have:

because τi+1 > τi by definition and therefore

The theorem follows with the monotony of the square root.

[35] Expressing equation (A3) in terms of the maximum number of nodes imax, it is easy to see that it is equivalent to equation (10). This proves lemma 1.

## Acknowledgments

[36] This work has been supported by the Deutsche Forschungsgemeinschaft. The authors are grateful to anonymous reviewers for the fruitful comments.