Numerische Mathematik manuscript No. (will be inserted by the editor) Accuracy of staircase approximations in finite-difference methods for wave propagation Jon Häggblad · Olof Runborg Received: date / Accepted: date Abstract While a number of increasingly sophisticated numerical methods have been developed for time-dependent problems in electromagnetics, the Yee scheme is still widely used in the applied fields, mainly due to its simplicity and computational efficiency. A fundamental drawback of the method is the use of staircase boundary approximations, giving inconsistent results. Usually experience of numerical experiments provides guidance of the impact of these errors on the final simulation result. In this paper, we derive exact discrete solutions to the Yee scheme close to the staircase approximated boundary, enabling a detailed theoretical study of the amplitude, phase and frequency errors created. Furthermore, we show how evanescent waves of amplitude O(1) occur along the boundary. These characterize the inconsistencies observed in electromagnetic simulations and the locality of the waves explain why, in practice, the Yee scheme works as well as it does. The analysis is supported by detailed proofs and numerical examples. Keywords FDTD · Yee · staircasing Mathematics Subject Classification (2000) 35L05 · 65N22 · 78M20 1 Introduction One of the more popular methods for numerically solving wave propagation problems is the Yee scheme, also sometimes referred to as the Finite-Difference TimeDomain (FDTD) method. Originally devised for Maxwell’s equations in electromagnetics [18], it has since also found many uses in acoustic simulations [1,11,15]. It is a simple algorithm based on compact centered finite difference approximations on J. Häggblad · O. Runborg Department of Numerical Analysis, KTH Royal Institute of Technology, SE-10044 Stockholm, Sweden, E-mail: [email protected] O. Runborg Swedish e-Science Research Centre (SeRC), Stockholm, Sweden. 2 Jon Häggblad, Olof Runborg a uniform staggered grid. The scheme is explicit, making it highly efficient, as well as having a small memory footprint since the field values are not stored on all discretization points. A drawback of this approach is that boundaries not aligned with the grid are difficult to model, and hence are usually approximated by staircasing. Not only is this a poor approach, it is inconsistent [16]. Hence, in general the scheme will produce O(1) errors. Despite this, it is still common in applications, due to its simplicity. Previous work on the analysis of the numerical errors caused by staircase approximations include the oft-cited paper by Cangellaris and Wright [2], where they show that staircasing of a boundary with π /4 inclination compared to the grid admit surface waves. Holland [8] shows numerically the large errors generated in practical problems. The issue is also discussed in a number of publications regarding the development of more accurate boundary approximations [4,7,9,14,17]. Since staircase approximations of boundaries are still common in applications, a more detailed theoretical understanding is worthwhile rather then to rely on numerical experiments. In this paper we study a two-dimensional model problem for numerical solution of electromagnetic waves by the classical Yee scheme with a boundary approximated by staircasing. This model problem includes boundaries of all rational inclinations. Despite the fact that the most popular use of the Yee scheme is in electromagnetics, we shall instead use the acoustic wave equation formulation, as this gives a simpler notation. We will mainly focus on perfect electric conductor (PEC) boundaries for both the TM and TE modes of Maxwell’s equations. These correspond to stress release and perfectly rigid boundaries in acoustics. In two dimensions the acoustic equations are given by pt = a(ux + vy ), ut = bpx , vt = bpy , (1.1) where p denotes the pressure and u, v are the x- and y-components of the velocity field. √ We will assume that a and b are constant. We also introduce the velocity c = ab. The equations (1.1) are equivalent to the two-dimensional transverse magnetic (TM) and transverse electric (TE) vacuum modes of Maxwell’s equations under the set of substitutions p = Ez , u = Hy , v = −Hx and p = Hz , u = −Ey , v = −Ex , respectively, together with a = 1/ε , b = 1/µ . Note that in three dimensions there is no such equivalence. We will consider (1.1) set in a semi infinite open domain Ω = {(x, y) ∈ R2 : y > α x}, where 0 < α < 1. On the boundary Γ = {(x, y) ∈ R2 : y = α x}, we will prescribe boundary conditions. We consider homogeneous Dirichlet conditions both in the form p = 0, referred to as soft boundaries, and n̂ · (u, v) = 0, referred to as hard boundaries, where n̂ ⊥ (1, α ) is the unit normal vector. These two forms of boundary conditions correspond to PEC boundaries for the TM and TE mode, respectively, in two-dimensional electromagnetics. The equations are complemented with initial data for p, u and v. In the analysis we will restrict ourselves to rational slopes α which lie between zero and one, i.e., we write α = µ /ν , where µ and ν are two positive, relatively prime integers with 0 < µ < ν . The cases α = 0 and α = 1 are quite special, since Accuracy of staircase approximations in FD methods for wave propagation 3 the staircase approximation of the boundary becomes of higher order than in the other cases [16]. The errors in the Yee scheme are then much more benign, see Remark 4.1. Our aim is to analyze the errors generated in staircase approximations by deriving exact discrete modal solutions. As far as the authors know, for staircase boundaries this has not been done before. A number of boundary modeling techniques have been created to improve the accuracy of the Yee scheme for curved boundaries without introducing non-orthogonal coordinates or unstructured grids. One of the earliest is the contour-path FDTD method (CP-FDTD) [9], which in its initial form was plagued by late-time instabilities, regardles of the timestep used [10]. This can be fixed by e.g. adding a term to the update equations [12]. Later another scheme was introduced by Dey and Mittra [3], usually dubbed locally conformal FDTD (CFDTD), which is much simpler. This class of methods involve weighting the update stencil according to the fraction of the sides of the unit cube which are inside the domain. See [13] for an overview. Another approach is to remove the highest order term in the Taylor expansion of the local truncation error [16,5,6]. A big motivation for studying the boundary errors in detail in this paper is to give further insights and hopefully open the door to additional improvements to the above techniques. Note that, although commonly used to analyze numerical stability, we here use the modal solutions to study the typical errors in the Yee scheme. That the Yee scheme is stable for a staircase boundary is already known, see e.g. [5]. Our main results of the analysis is that away from boundaries the total error is dominated by a first order error stemming from an error in the effective (discrete) reflection coefficient of the staircased boundary. Close to the boundaries, on the other hand, an O(1) error is present. It comes from evanescent waves that concentrate on the boundary, but die off exponentially with the number of grid points away from the boundary. Hence, the O(1) errors produced by the inconsistent discretization will be localized at the boundary. Our conclusion is that this explains why, in practice, the Yee scheme works as well as it√does. We note also that the convergence rate in L2 norm is formally reduced to O( h) due to the large errors at the boundary. While the model problem might at first seem oversimplified, we argue that asymptotically it is still applicable to general boundaries and domains, since the critical effect of the boundary on the accuracy is independent of the grid size h. We also show a numerical example with a more general domain where we see that the numerical results are consistent with the conclusions of the analysis. The article is organized as follows. After stating the Yee scheme in Section 2, we derive the necessary conditions for modal solutions in Section 3, giving explicit expressions first for soft boundaries, and then hard boundaries. We then proceed to analyze the accuracy by looking at the asymptotic behavior at fine discretizations in Section 4. In Section 5 we collect the proofs of the analysis. We finish by verifying the analysis with numerical tests in Section 6. 4 Jon Häggblad, Olof Runborg 2 The Yee scheme We introduce the Yee staggered grid as follows. Let xm = mh, y j = jh and tn = n∆ t, where h is the grid spacing and ∆ t is the time step. Denote by Im j the Yee cell [xm , xm+1 ] × [y j , y j+1 ]. The unknowns are approximated in different spatial locations in the cell: u, v on the cell boundary and p in the center of the cell. Moreover, p is approximated half a time step off from u and v. More precisely, p n+ 21 m+ 21 , j+ 12 ≈ p(tn + ∆ t/2, xm + h/2, y j + h/2), unm, j+ 1 ≈ u(tn , xm , y j + h/2), 2 vnm+ 1 , j ≈ v(tn , xm + h/2, y j ). 2 Discretizing (1.1) on this staggered grid gives the Yee scheme, which for interior cells reads p n+ 12 m+ 21 , j+ 12 un+1 m, j+ 1 2 vn+11 m+ 2 , j n− 21 n n n n λ u , (2.1) + a − u + v − v 1 1 1 1 m+1, j+ 2 m, j+ 2 m+ 2 , j+1 m+ 2 , j m+ 21 , j+ 21 n+ 1 n+ 1 = unm, j+ 1 + bλ p 21 1 − p 21 1 , (2.2) m+ 2 , j+ 2 m− 2 , j+ 2 2 n+ 1 n+ 1 = vnm+ 1 , j + bλ p 21 1 − p 21 1 , (2.3) =p m+ 2 , j+ 2 2 m+ 2 , j− 2 where λ = ∆ t/h. The boundary is approximated by staircasing where the boundary cells are those whose centers are just inside the domain, i.e. the setof boundary cells ΓC is defined as ΓC = Im j : α (xm + h/2) ≤ y j < α (xm + h/2) + h . We furthermore define the indices for these cells as (m, jm ) so that ΓC = [ m Im, jm , jm = ⌈(m + 1/2) α − 1/2⌉. (2.4) The boundary cells are illustrated in Fig. 2.1. We note also that since α = µ /ν the indices satisfy jm+ν = jm + µ . (2.5) The discretization in the boundary cells depends on the type of boundary conditions chosen. For all cases we consider, the stencil is only altered in the boundary cells, not in any other cells. The precise discretization will be detailed later on. 3 Modal solutions of the Yee scheme The aim is to study the behavior of numerical solutions of (2.1), (2.2) and (2.3) around staircase approximations of boundaries in the Yee scheme. To this end we want to find exact discrete modal solutions for a given time frequency ω . Accuracy of staircase approximations in FD methods for wave propagation 5 (Inside) y/h 1 1/2 0 0 1 1/2 p= x/h u= v= (Outside) Fig. 2.1 Illustrating the boundary cells. The cells marked by squares are the boundary cells ΓC and thus are adjacent to the staircased boundary. 3.1 Continuous case To motivate our derivation of the discrete modes we consider first the continuous case. We fix a time frequency ω and seek solutions of the form p(t, x, y) P̄(x, y) w̄(t, x, y) := u(t, x, y) = eiω t Ū(x, y) =: eiω t W̄(x, y), v(t, x, y) V̄ (x, y) where W̄(x, y) is the modal solution. This corresponds to the frequency space solutions given by Helmholtz equation. We can also think of W̄ as the Fourier transform in time of w̄(t, x, y) at ω . Propagating modes are given by sums of exponentials, ′ ′ W̄(x, y) = w̄in eikx x+iky y + β w̄ref eikx x+iky y , (3.1) where (recall c2 = ab) 1 w̄in = bkx /ω , bky /ω 1 w̄ref = bkx′ /ω , bky′ /ω which represents an incoming and a reflected wave. The wave numbers kx , ky , kx′ and ky′ should satisfy the dispersion relation 2 2 c2 (kx2 + ky2 ) = c2 (kx′ + ky′ ) = ω 2 , (3.2) 6 Jon Häggblad, Olof Runborg and the exponentials should be equal when evaluated on the boundary, kx + α ky = kx′ + α ky′ mod 2π . (3.3) The value of β is determined by the chosen boundary condition. For soft boundaries β = −1 and for hard boundaries β = 1. We note that these modes can be parametrized by the temporal frequency ω and the value of K = kx + α ky , which corresponds to the angle of incidence with the boundary. The same turns out to be true for the discrete modes. For these parameters we assume that there is a real parameter η > 0 such that |ω | |K| ≤ η √ , 1 + α2 |ω | ≥ η , (3.4) which essentially means that we only consider waves hitting the boundary at an angle. These conditions also mean that (3.2)–(3.3) has two distinct solutions. Remark 3.1 There are also non-propagating modal solutions with zero ω . These correspond to the non-zero rotational part of the solution, which is stationary. They are of the form 0 W̄(x, y) = w̄stat eikx x+iky y , w̄stat = −ky , kx For soft boundaries all such modes are valid. For hard boundaries they are restricted to the case kx + α ky = 0. 3.2 Admissible discrete modes As in the continuous case we fix a temporal frequency ω and seek a discrete modal solution W such that n pm, j P(m, j) wnm, j := unm, j = eiω n∆ t W(m, j) := eiω n∆ t U(m, j). V (m, j) vnm, j The modal solutions will be parameterized by ω and a value K, which corresponds to the angle of incidence with the boundary, as above. Note that in this definition the discrete solution can be evaluated at any real values of (m, j); in the Yee scheme only certain discrete values are used, and they are different for P, U and V . To find admissible discrete modal solutions we will first consider the free space case and find what restrictions are imposed. Motivated by the continuous case we look for a solution of the form p̂ W(m, j) := ŵE(m, j), ŵ = û, E(m, j) = eikx mh+iky jh , v̂ where (kx , ky ) are unknown wave numbers. For the actual grid functions used in the scheme, this means Accuracy of staircase approximations in FD methods for wave propagation p n+ 21 m+ 12 , j+ 21 7 = eiω (n+ 2 )∆ t p̂E (m + 1/2, j + 1/2), 1 = eiω (n+1)∆ t ûE (m, j + 1/2), un+1 m, j+ 1 2 vn+11 = eiω (n+1)∆ t v̂E (m + 1/2, j). m+ 2 , j Then for the time derivative 1 eiω (n+1)∆ t − eiω n∆ t sin (ω∆ t/2) iω (n+ 1 )∆ t 2 =: iω̃ (∆ t)eiω (n+ 2 )∆ t , =i e ∆t ∆ t/2 where tilde (˜) denotes the mapping x̃(y) = sin xy/2 . y/2 (3.5) Similarly for the space derivatives, E(m + 1, j) − E(m, j) = ik̃x (h)E (m + 1/2, j), h E(m, j + 1) − E(m, j) = ik̃y (h)E (m, j + 1/2). h Entering this into the scheme (2.1)–(2.3) we obtain iω̃ p̂E (m + 1/2, j + 1/2)eiω n∆ t = ia k̃x û + k̃y v̂ E (m + 1/2, j + 1/2)eiω n∆ t , iω̃ ûE (m, j + 1/2)eiω (n+ 2 )∆ t = ibk̃x p̂E (m, j + 1/2)eiω (n+ 2 )∆ t , 1 1 iω̃ v̂E (m + 1/2, j)eiω (n+ 2 )∆ t = ibk̃y p̂E (m + 1/2, j)eiω (n+ 2 )∆ t , 1 which simplifies to the linear equations for p̂, û and v̂, ω̃ p̂ = a k̃x û + k̃y v̂ , ω̃ û = bk̃x p̂, 1 ω̃ v̂ = bk̃y p̂. We have a nontrivial solution when the system matrix of these equations is singular, that is when ω̃ −ak̃x −ak̃y det −bk̃x ω̃ 0 = ω̃ c2 (k̃x2 + k̃y2 ) − ω̃ 2 = 0. ω̃ −bk̃y 0 When ω̃ 6= 0 we have propagating modes and the null space is spanned by the vector 1 ŵ = bk̃x /ω̃ . bk̃y /ω̃ The corresponding W can be written as 1 W(m, j) = bk̃x /ω̃ E(m, j). bk̃y /ω̃ 8 Jon Häggblad, Olof Runborg Based on the analysis above we will call a discrete propagating modal solution of this type admissible for ω and K if (kx , ky ) satisfy the discrete dispersion relation c2 (k̃x2 + k̃y2 ) = ω̃ 2 , (3.6) and the boundary relation kx + α ky = K mod 2π . h (3.7) We will also simply say that (kx , ky ) are admissible for the real numbers ω and K if (3.6) and (3.7) hold. Note that (3.6) can be expanded to ω∆ t ∆t 2 2 2 hkx 2 hky c λ sin λ= . = sin2 + sin , 2 2 2 h Since the solution does not change if we add an integer multiple 2π /h to the real part of kx or ky we will further assume that 0 ≤ Re kx < 2π , h 0 ≤ Re ky < 2π . h (3.8) In Section 5, Theorem 5.1, we shall see that the system (3.6) and (3.7) always has 2ν solutions when (kx , ky ) are restricted to this set. Moreover, for small enough h there are ν − 1 solutions with a negative imaginary part in kx or ky , which corresponds to exponentially growing waves. These we discard. We denote the remaining solutions by (kxr , kyr ), r = 0, . . . , ν . With this we are now ready to consider some explicit forms of staircasing. 3.3 Soft boundaries First we consider homogeneous Dirichlet conditions in the p variable, which are sometimes referred to as soft or stress release boundaries in the acoustic community. In electromagnetics they correspond to PEC boundaries for the TM mode. Thus the boundary condition in the continuous case is given by p(t, x, y) = 0, y = α x, x ∈ R. The corresponding numerical boundary condition is p n+ 21 m+ 12 , jm + 21 = 0, ∀m ∈ Z. We will derive modal solutions which satisfy this for a fixed pair ω and K. As mentioned in the previous section there are ν + 1 admissible pairs (kxr , kyr ) which satisfy (3.6) and (3.7) and are bounded, for each choice of ω and K, when h is small enough. r r We denote the P part of these modes by Pr (m, j) = eikx mh+iky jh , r = 0, . . . , ν . From these we take a linear combination and set ν P(m, j) = ∑ αr Pr (m, j), r=0 Accuracy of staircase approximations in FD methods for wave propagation 9 (Inside) δ9/2 y/h δ7/2 δ5/2 δ3/2 1 1/2 δ1/2 0 0 1/2 p= 1 x/h u= v= (Outside) Fig. 3.1 Staircasing of soft boundaries and µ = 2, ν = 5. The boundary is defined by the pressure points at 12 , 21 , 23 , 32 , 25 , 32 , 27 , 32 , 29 , 52 . where αr are to be determined such that 1 1 1 n+ 1 = e−iω (n+ 2 )∆ t p 21 = 0, P m + , jm + m+ 2 , jm + 12 2 2 ∀m ∈ Z. Let us now define the offsets δm+ 1 between the exact boundary and the staircase 2 approximation at these points, δm+ 1 = jm + 1/2 − α (m + 1/2). See Fig. 3.1. Then 2 0 ≤ δm+ 1 < 1 and δm+ν + 1 = δm+ 1 by the definition of jm in (2.4) and by (2.5). We 2 2 2 obtain 1 1 P m + , jm + 2 2 ν = ∑ αr eikx (m+ 2 )h+iky ( jm + 2 )h r=0 ν = ∑ αr e 1 r 1 r i(kxr +α kyr )(m+ 21 )h+ikyr δ m+ 12 h r=0 ν = eiK (m+ 2 )h ∑ αr e 1 ikyr δ m+ 12 h . r=0 We note that the function within the sum is ν -periodic in m and it is therefore sufficient to enforce the zero condition for m = 0, . . . , ν − 1. To further simplify, we note 10 Jon Häggblad, Olof Runborg that δm+ 1 ν = ( jm + 1/2 − α (m + 1/2)) ν = jm ν − mµ + (ν − µ )/2 := dm + d,¯ where 2 ν −µ ν −µ dm = jm ν − mµ + ∈ N, d¯ = . (3.9) 2 2 Here {x} denotes the fractional part of x. Note that d¯ is independent of m. Thus if we r define zr := exp iky h/ν , we get the condition ν 1 1 1 ¯ P m + , jm + = eiK (m+ 2 )h ∑ αr zrdm +d = 0, m = 0, . . . , ν − 1. 2 2 r=0 We can write this in matrix form as Aα = 0, where A = ZS ∈ Cν ×(ν +1) , α = (α0 , . . . , αν )T ∈ Cν +1 , (3.10) and zd00 · · · zνd0 . . Z = .. . . . .. ∈ Cν ×(ν +1) . d d z0ν −1 · · · zνν −1 S = diag(zd0 , . . . , zdν ) ∈ C(ν +1)×(ν +1) , ¯ ¯ (3.11) (3.12) The coefficients α are thus given by first finding a vector in the null space of Z and then scaling it by the nonsingular diagonal matrix S−1. From these coefficients α we thus have the full modal solution as ν W (m, j) = ∑ αr ŵr Er (m, j), (3.13) r=0 where Er (m, j) = e ikxr mh+ikyr jh , 1 ŵr = bk̃xr /ω̃ . bk̃yr /ω̃ In Theorem 5.1 it is proved that the null space of A is one-dimensional, and that we can always obtain a unique (up to normalization) non-trivial solution α bounded in h. 3.4 Hard boundaries Next we consider another common type of boundary conditions, which is homogeneous Dirichlet conditions for the normal component of the velocity field, n̂ · (u, v) = 0, for y = α x, x ∈ R. In the acoustics community this is sometimes referred to as hard boundaries, and it is equivalent to PEC boundaries for the TE mode in electromagnetics. In the discretization we use the same boundary cells (2.4) as in the case of soft boundaries. However, the boundary cells are divided into two sets according to Ωcr = {m : jm+1 = jm + 1}, Ωhz = {m : jm+1 = jm } , (3.14) Accuracy of staircase approximations in FD methods for wave propagation 11 (Inside) y/h 1 1/2 0 0 1 1/2 p= x/h u= v= (Outside) Fig. 3.2 Staircasing of hard boundaries for µ = 2, ν = 5. In the case shown, the boundary cells centered at x/h = 1/2,7/2 are corner cells, in that the boundary occur along both u and v. In the cells centered around x/h = 3/2,5/2,9/2, the boundary only occurs along v. where Ωcr refers to the corner cells with two faces adjacent to the boundary, and Ωhz the remaining cells. See Fig. 3.2 for an illustration. Then the staircase boundary condition is enforced by um+1, jm + 1 − vm+ 1 , jm = 0, 2 2 vm+ 1 , jm = 0, 2 ∀m ∈ Ωcr (3.15) ∀m ∈ Ωhz . (3.16) Again we look for modal solutions satisfying this for a fixed pair ω and K. Thus, using the wave numbers defined by (3.6)–(3.7) we denote the U and V part of these modes by bk̃yr ikr mh+ikr jh bk̃xr ikxr mh+ikyr jh y , e , Vr (m, j) = e x ω ω for r = 0, . . . , ν . If we evaluate these expressions on the boundary points, then they reduce to 1 r r ω Ur (m + 1, jm + 21 ) = k̃xr eikx (m+1)h+iky ( jm + 2 )h b Ur (m, j) = = k̃xr e ikxr (m+1)h+ikyr δ m+ 12 1 = k̃xr eiK (m+ 2 ) e +α (m+ 21 ) h ikxr h/2+ikyr δ m+ 12 h (3.17) 12 Jon Häggblad, Olof Runborg 1 r r ω Vr (m + 21 , jm ) = k̃yr eikx (m+ 2 )h+iky jm h b ikr m+ 21 )h+ikyr δ 1 − 21 +α (m+ 21 ) h m+ 2 r x( = k̃y e ikyr δ 1 − 12 h 1 m+ 2 = k̃yr eiK (m+ 2 ) e . (3.18) ¯ Recalling that zr := exp ikyr h/ν and zrdm +d = exp ikyr δm+ 1 h , we can now write the 2 linear combination of (3.17) and (3.18) as ν 1 ω r ¯ U(m + 1, jm + 12 ) = eiK (m+ 2 )h ∑ αr k̃xr eikx h/2 zrdm +d , b r=0 ν 1 ω r ¯ V (m + 12 , jm ) = eiK (m+ 2 )h ∑ αr k̃yr e−iky h/2 zrdm +d . b r=0 From these expressions we can formulate the discrete boundary conditions (3.15)– (3.16) as ν ¯ r ikxr h/2 r −ikyr h/2 zrdm +d = 0, k̃ e − k̃ e α r ∑ x y r=0 ν ∑ αr k̃yr e−iky h/2 zrdm +d = 0, ¯ r r=0 ∀m ∈ Ωcr , ∀m ∈ Ωhz . (3.19) (3.20) Thus since these expressions are ν -periodic in m, we only need to satisfy the zero conditions for m = 0, . . . , ν −1. We also point out that there are µ number of equations (3.19), and ν − µ number of equations (3.20). We can write (3.19)–(3.20) as a linear system Aα = 0, with A = QZK(k̃x ) + ZK(−k̃y ) S ∈ Cν ×(ν +1) , (3.21) and where K(k) = diag(k0 eik 0 h/2 , . . . , kν eik ν h/2 and Q ∈ Cν ×ν is the diagonal matrix with ( 1 (Q)mm = 0 ) ∈ C(ν +1)×(ν +1) , m ∈ Ωcr , m∈ / Ωcr . k ∈ Cν +1 , In Theorem 5.1 we prove that (kxr , kyr ) ∼ 1/h, for r ≥ 2. Therefore we rescale the K matrices as K ′ = KD, where D = diag(1, 1, h, . . . , h). Then by using (3.5) we see that the (diagonal) elements in K ′ (kx ) and K ′ (−ky ) for r ≥ 2 are given by, µ hk̃xr eikx h/2 = i(1 − wz− r ), r ν −hk̃yr e−iky h/2 = i(1 − z− r ), r respectively, where w := eiKh , and we use kxr = K − α kyr . Accuracy of staircase approximations in FD methods for wave propagation 13 As in the previous case, the full modal solution is then given by ν W (m, j) = ∑ αr ŵr Er (m, j). (3.22) r=0 Remark 3.2 Unlike the situation with soft boundaries, there could potentially be situations where (3.21) is singular. In particular, consider the case when ν = µ = 1, giving the angle α = 1, together with incoming waves along the boundary. For this case then A → (0, 0) when h → 0, which falls outside the theory covered here. This case is, however, considered in [2]. 4 Error estimates In computations involving the Yee scheme, O (1) errors are sometimes observed around boundaries [16]. The aim here is to give precise expressions for the errors in the discrete modal solutions compared to the continuous modal solutions, i.e. error = W(m, j) − W̄(mh, jh), for a given ω and K. The wave vectors for the continuous modes are denoted by k̄ = (k̄x , k̄y ), k̄′ = (k̄x′ , k̄y′ ), and the admissible waves by kr = (kxr , kyr ). To normalize the modes in the same way we always let α0 = 1 in the discrete modal expressions, (3.13), (3.22). We can then divide the error as follows ν error = ∑ αr ŵr eikx mh+iky jh − w̄ineik̄x mh+ik̄y jh + w̄refeik̄x mh+ik̄y jh r ′ r ′ r=0 = Ein + Eref + Ephase + Eeva , where 0 0 Ein = ŵ0 eikx mh+iky jh − w̄in eik̄x mh+ik̄y jh , 1 ′ 1 ′ Eref = −ŵ1 eikx mh+iky jh + w̄ref eik̄x mh+ik̄y jh , 1 1 Ephase = (α1 + 1)ŵ1eikx mh+iky jh , ν Eeva = ∑ αr ŵr eikx mh+iky jh . r r r=2 The first two terms are the error in the free space wave propagation. The third term is the error in the reflection coefficient of the approximate boundary, which adds an extra phase factor. The fourth term is the error from the evanescent waves which concentrate on the boundary. These errors can be explained by using Theorem 5.1 in Section 5. For the free space propagation error we use the result that k0 (h) − k̄ = O(h2 ). Then 0 0 |Ein | ≤ |ŵ0 − w̄in | + |w̄in | eikx mh+iky jh − eik̄x mh+ik̄y jh 0 b ω = k̃0 (h) − k̄ + |w̄in | ei(k (h)−k̄)·(mh, jh) − 1 ≤ Ch2 , ω ω̃ 14 Jon Häggblad, Olof Runborg since ω /ω̃ = 1+O(∆ t 2 ). Precisely the same argument can be made for Eref . Note that the bars | · | here denote the point wise Euclidean norm in R3 . Hence, the propagation errors in Yee are second order, regardless of boundary conditions, as expected. For the remaining errors we must consider the particular boundary conditions separately. We find below in Sections 4.1 and 4.2 that for both hard and soft boundaries the phase error Ephase is of first order, while the evanescent wave error Eeva is of zeroth order on the boundary but decays exponentially with the distance, measured in grid points, away from the boundary. The total error is therefore O(h) away from boundaries, where it is dominated by Ephase , and O(1) in the grid points close to the boundary, where it√is dominated by Eeva . When measured in L2 norm, this implies an error of size O( h). We recall that the staircase discretization of the boundaries is formally inconsistent and that, therefore, O(1) errors in general will appear. Our conclusion here is that the localization of these errors at the boundaries explains why the staircase discretization still works well for many problems in practice. 4.1 Soft boundaries As derived in Section 3.3, the system of equations for the modal solutions when we have soft boundaries is Aα = ZSα = 0, where A, S and Z are given in (3.10), (3.12) and (3.11). We note first that by Theorem 5.1 the null space of Z is one-dimensional so the direction of α is well-defined. To normalize it we fix the first component α0 = 1. Let α̃ = (α1 , . . . , αν )T be the remaining part of α and similarly let Z̃, S̃ be the parts of Z and S where the first columns have been removed, zd10 · · · zdν0 . . Z̃ = .. . . . .. , d d z1ν −1 · · · zνν −1 ¯ ¯ S̃ = diag(zd1 , . . . , zdν ). (4.1) Then z0 (h)d0 ¯ .. Z̃(h)S̃(h)α̃(h) = −z0 (h)d . . d ν −1 z0 (h) Define α′ = (−1, 0, . . . , 0)T ∈ Rν . Then ¯ ¯ z1 (h)d0 +d − z0 (h)d0 +d .. Z̃(h)S̃(h)(α̃(h) − α′ ) = . . ¯ ¯ z1 (h)dν −1 +d − z0 (h)dν −1 +d By Theorem 5.2 the roots satisfy z0 (h) = 1 + O(h) and z1 (h) = 1 + O(h). Hence, the right hand side is O(h). By Theorem 5.1 the inverse of Z̃(h) is bounded for small enough h. Therefore, α̃ − α′ ≤ Ch. (4.2) Accuracy of staircase approximations in FD methods for wave propagation 15 With this estimate we can now consider the remaining errors. For the phase error we have 1 1 |Ephase | = (α1 (h) + 1)ŵ1eikx mh+iky jh ≤ Ch, since (4.2) implies that |α1 (h) + 1| ≤ Ch and the remaing factors are bounded in h due to k1 (h) being bounded in h by Theorem 5.1. The final error from the evanescent waves Eeva is a sum of terms of the form 1 r r r r αr ŵr eikx mh+iky jh = αr (h)bk̃xr (h)/ω̃ eikx mh+iky jh . bk̃yr (h)/ω̃ By Theorem 5.1 there is an η > 0 such that Im kyr (h) > η /h. Moreover, since K is real in (3.7) we have Im kxr (h) = −α Im kyr (h). Hence, |eikx mh+iky jh | = e− Im(kx mh+ky jh) = e− Im ky (−α mh+ jh) < e−η ( j−α m) . r r r r r For the amplitude we note further that by (4.2) we have |αr (h)| ≤ Ch and by (5.2) in Theorem 5.1 we have |k̃r | < C/h. Therefore, we get different errors in the p and the p u , E v )T we get remaining components. More precisely, if Eeva = (Eeva , Eeva eva p |Eeva | = O(he−η ( j−α m) ), u v |Eeva | = |Eeva | = O(e−η ( j−α m) ). (4.3) Note that j − α m is approximately equal to the distance in grid cells from the point ( j, m) to the boundary, in the y-direction. The error from the evanescent waves thus die off with the number of grid cells, not with the physical distance. They therefore concentrate more and more at the boundaries at fine resolutions, but never go away. Thus we see that we have three types of errors: Propagating errors Ein , Eout of second order O(h2 ), phase shift errors Ephase of first order O(h), as well as boundary errors Eeva of zeroth order O(e−η ) for u, v, and O(h) for p. Close to the boundary then Eeva dominates for u, v, elsewhere the phase error Ephase . This gives formally the estimated effective L2 norms v u N2 u N p p kE k2 ≤ t ∑ (Ch)2 h2 + ∑ (Ch)2 h2 = C2 h3 + C2 h2 = O(h), m=1 v u u N u,v kE k2 ≤ t ∑ C2 h2 + m=1 m=1 N2 ∑ (Ch)2 h2 = m=1 p √ C2 h + C2h2 = O( h), since there are O(N) = O(1/h) boundary cells in a computation on a N × N grid. 4.2 Hard boundaries For hard boundaries the system is Aα = 0, where A is given by (3.21), A = QZK(k̃x ) + ZK(−k̃y ) S = QZK ′ (k̃x ) + ZK ′ (−k̃y ) D−1 S ∈ Cν ×(ν +1) , 16 Jon Häggblad, Olof Runborg which is similar to (3.10), besides the extra scalings. Consider the factor A′ = QZK ′ (k̃x )+ ZK ′ (−k̃y ). Summing the columns gives that 1T A′ = (c, −c, 0, . . . , 0)T + O(h), (4.4) where c = µ kx0 − ν ky0 . To see this we first introduce the notation where Ar is the rth column of A. Also, denote zr = Zr . Thus for the first two columns, r = 0, 1, (1T QZK ′ (kx ))r = 1T Qzr kxr (0) + O(h) = µ kxr (0) + O(h), (1T ZK ′ (−ky ))r = 1T zr (−kyr (0)) + O(h) = −ν kxr (0) + O(h), since zr (h) = 1 + O(h), r = 0, 1, and 1T Q1 = µ . That µ kx0 − ν ky0 = −µ kx1 + ν ky1 follows from the boundary condition n̂ · (u, v) = 0 for the continuous solution (3.1). For the remaining columns r = 2, . . . , ν − 1, then ! (1T QZK ′ (kx ))r = = ∑ m∈Ωcr µ −1 ∑ zdr m i(1 − wzr−µ ) ! µ i(1 − wz− r )= zr − 1 i(1 − wzr−µ ), zr − 1 ! zνr − 1 ν i(1 − z− r ). zr − 1 zm r m=0 T ′ (1 ZK (−ky ))r = ν −1 ∑ m=0 zm r ν i(1 − z− r )= µ Here we have used Lemma 5.8. Taking these two together gives, since w = 1 + O(h), (1T A′ )r = ν iz− r P(zr ) + O(h) = O(h), zr − 1 where P is the polynomial (5.6). Hence (4.4) follows. Thus we can expand the matrix equation Aα = A′ α′ = 0, where α′ = D−1 Sα, as 1T A′ α′ = α0′ c − α1′ c + O(h) = 0, giving α1′ = 1 + O(h), since we normalize the incoming wave to α0 = 1 and α0′ = 1. The unprimed α is given by α = S−1 Dα′ , and thus αr = O(h), r = 2, . . . , ν . The phase error then becomes 1 1 |Ephase | = (α1 (h) − 1)ŵ1eikx mh+iky jh ≤ Ch. Since αr ≤ Ch, r = 2, . . . , ν for the evanescent waves, the same arguments as for soft boundaries hold and we get the bounds (4.3). In the end we obtain the same behavior of the different errors as for soft boundaries. Remark 4.1 The cases α = 0 and α = 1 can be analyzed in simpler ways than with the techniques used above. Still, our analysis, although restricted to the case 0 < α < 1, can give some insight also into the limiting cases α = 0, 1. The basic second order propagation errors Ein and Eref are independent of α and will also be present for α = 0, 1. However, the O(1) error Eeva = 0 disappears. The reason is that when Accuracy of staircase approximations in FD methods for wave propagation 17 α = 0, 1, then ν = 1, µ = α and P(z) in (5.6) is just a second order polynomial (α + 1)(z − 1)2 with two roots. There are therefore only two admissible waves, k0 and k1 , which correspond to the incoming and reflected waves, and no evanescent waves. When it comes to the O(h) phase error Ephase , it may or may not be present. It is easy to check that dm = 0 when α = 0, 1. In the soft boundary case one then ¯ gets Z̃ = 1 and α1 (h) = −(z0 (h)/z1 (h))d . Since z0 (0) = z1 (0) = 1, Lemma 5.7 shows that z0 (h)/z1 (h) = 1 + O(h) and the phase error Ephase = O(|α1 (h) + 1|) is of size O(h) unless d¯ = 0, in which case Ephase vanishes. But since dm = 0 and ν = 1 we have d¯ = δm+1/2 , the offset between the grid cell center and the boundary. Hence, the O(h) phase error disappears when all grid cell centers lie on the boundary. With the convention we have used for boundary cells ΓC in (2.4) this happens when α = 1 (then δm+1/2 = 0) but not when α = 0 (then δm+1/2 = 1/2). Upon shifting the grid by half a cell one would remove the phase error also for the case α = 0. The argument for hard boundaries is a bit more involved, but renders the same principal result, although in this case our boundary cell convention leads to a O(h) phase error when α = 1 and no phase error when α = 0, since the quantities involved in the boundary conditions, û, v̂, are now evaluated on the edges of the boundary cells. In conclusion, when α = 0, 1 the basic O(h2 ) error remains. There is, however, no O(1) error from evanescent waves and also no O(h) phase error if the quantities in the boundary conditions are evaluated precisely on the boundary. 5 Analysis of the admissible wave numbers We now prove the results we have referred to in the previous sections. The aim is to show the following main theorem. Theorem 5.1 Assume ν > µ are relatively prime and that 0 < h ≤ h0 . – There are 2ν admissible waves kr with r = 0, . . . , 2ν − 1, for all h0 . – For small enough h0 we can order {kr (h)} such that they are continuously differentiable in h on (0, h0 ). – For small enough h0 we can choose the r-indexing such that: – For r ∈ {0, 1} the wave vectors kr (h) are bounded on (0, h0 ) and lim k0 (h) = k̄, h→0 and lim k1 (h) = k̄′ , h→0 which are the incoming and reflected waves in the continuous case (3.1). Moreover, if (3.4) holds, |k0 (h) − k̄| ≤ Ch2 , |k1 (h) − k̄′| ≤ Ch2 . (5.1) – For 2 ≤ r ≤ ν , the imaginary part of kyr (h) is positive and Im kyr (h) ≥ C/h, |kr | ≤ C/h, r = 2, . . . , ν . – For ν + 1 ≤ r ≤ 2ν , the imaginary part of kyr (h) is negative. (5.2) 18 Jon Häggblad, Olof Runborg – For small enough h0 the null space of the matrix Z in (3.11) is onedimensional. The matrix Z̃ in (4.1) is non-singular and its inverse is bounded in [0, h0 ]. The first two waves have real-valued wave numbers and correspond to the incoming and reflected waves. The ones with positive imaginary part are evanescent waves that concentrate on the staircase boundary. The remaining waves, with negative imaginary part, are non-physical waves which cannot exist in a bounded solution. The main steps in the proof are as follows: 1. Rewrite the admissibility conditions (3.6) and (3.7) as a polynomial equation of order 2ν (Section 5.1). 2. Analyze the roots of this polynomial in the limit h → 0 (Theorem 5.2 in Section 5.2). 3. Use perturbation arguments to show that the roots are qualitatively the same also for h small (Section 5.3, Lemma 5.7). 4. Use the properties of the roots and show their implications for the wave vectors kr and the matrices Z, Z̃ (Section 5.3.1). 5.1 Preliminaries The dispersion relation for the Yee scheme, ω̃ 2 = c2 (k̃x2 + k̃y2 ), c2 = ab, expands to ∆t 2 hkx 2 ω∆ t 2 2 2 hky , sin = c λ sin + sin (5.3) λ= . 2 2 2 h This equation together with the equation 2π , (5.4) h defines the admissible wave numbers for ω and K, as was seen in Section 3.2. First we note that we can rewrite (5.3) as kx + α ky = K coshkx + coshky = mod 1 (cos ω∆ t − 1) + 2. c2 λ 2 Thus using (5.4) we get an equivalent equation eih(K−α ky ) + e−ih(K−α ky) + eihky + e−ihky = 4 − 2 (1 − cos ω∆ t) c2 λ 2 to (5.3)–(5.4). This we can simplify by introducing w = eihK , z = eihky /ν , giving the order 2ν polynomial equation z2ν + 1 ν +µ − Rzν + wzν −µ + 1 = 0, z w (5.5) where R := 4 − 2(1 − cos ω∆ t)/(c2 λ 2 ). This gives us 2ν solutions, which we index by r. We finally note that by (5.4), eikx h = eiKh e−ihky α = wz−µ . Hence, if we pick Re hky and Re hkx as the arguments in [0, 2π ) for zν and wz−µ respectively, we have a solution that satisfies (5.3), (5.4) as well as (3.8). Moreover, each z corresponds to precisely one such pair kx and ky . Accuracy of staircase approximations in FD methods for wave propagation 19 5.2 The limit equation To study the asymptotics of these waves, we note that w → 1 and R → 4 in the limit h → 0 and ∆ t → 0, and thus the polynomial reduces to P(z) := z2ν + zν +µ − 4zν + zν −µ + 1 = 0. (5.6) For this equation we can show the following theorem. Theorem 5.2 The polynomial (5.6), where ν > µ are relatively prime, has one double root at z = 1. Its other roots are all distinct. Moreover, half of the remaining roots have magnitude stricly less than one, and the other half have magnitude stricly larger than one. The result follows from a sequence of lemmas in which we all make the assumption that ν > µ are relatively prime. Lemma 5.3 There are no positive real roots other than z = 1, which is a double root. When ν is odd there are no negative real roots. Proof. First we observe that the polynomial is symmetric in the sense that if z⋆ 6= 0 is a root, then so is 1/z⋆ . This follows from the simple relation z⋆2ν P(1/z⋆ ) = P(z⋆ ). The existence of a double root z = 1 is established by taking the derivative, i.e., P(1) = 1 + 1 − 4 + 1 + 1 = 0, P (1) = 2ν + (ν + µ ) − 4ν + (ν − µ ) = 0, ′ which is not a higher order root since P′′ (1) = (ν + µ )2 + (ν − µ )2 > 0. To show that this is the only real positive root, assume s ∈ R, s > 1. Then sµ + s−µ > 2 and P(s) = s2ν + sν +µ − 4sν + sν −µ + 1 > s2ν − 2sν + 1 = (sν − 1)2 > 0. Hence there are no other roots for s > 1. Assume now that ν is odd. Then P(−s) = (−s)2ν + (−s)ν +µ − 4(−s)ν + (−s)ν −µ + 1 = s2ν + sν ((−1)ν +µ sµ − 4(−1)ν + (−1)ν −µ s−µ ) + 1 = s2ν + sν (−(−1)µ sµ + 4 − (−1)µ s−µ ) + 1 = s2ν + sν (4 − (−1)µ (sµ + s−µ )) + 1 > s2ν + sν (4 − 1 − sµ ) + 1 > 3sν + 1 > 0, which means that there are no roots for s < −1. By symmetry of roots z⋆ , 1/z⋆ there are therefore also no roots s with 0 < s < 1 and, if ν is odd, no roots with −1 < s < 0. Finally, when ν is odd, P(−1) = 1 − (−1)µ + 4 − (−1)µ + 1 = 6 − 2(−1)µ 6= 0, 20 Jon Häggblad, Olof Runborg which proves the lemma. ⊓ ⊔ Next we can prove that P has no roots on the lines shooting out from the origin in the complex plane, crossing roots of zν + 1 = 0. Lemma 5.4 Let u j = eiα j and α j = 2π ( j + 1/2)/ν . Then P(su j ) 6= 0 for s ≥ 0 and 0 ≤ j ≤ ν − 1. Proof. We first note that P(0) = 1 6= 0 so we only need to consider s > 0. Since uνj = −1 we get µ Im P(su j ) = Im s2ν − sν (su j )µ − 4sν − sν (su j )−µ + 1 = −sν Im (su j )µ + (su j )−µ . (5.7) If Im u j 6= 0 this can only be zero if |(su j )µ | = 1. Since |(su j )µ | = sµ we must then have s = 1, but µ −µ P(u j ) = 1 − u j + 4 − u j + 1 µ −µ = 6 − uj + uj µ (5.8) µ = 6 − 2 Reu j ≥ 6 − 2|u j |4 > 0. µ µ Hence, P(su j ) 6= 0 for s ≥ 0 if Im u j 6= 0. On the other hand, if Im u j = 0 then exp (2π i ( j + 1/2) µ /ν ) ∈ R, or (2 j + 1)µ /ν ∈ Z for some j = 0, . . . , ν − 1. Since µ and ν are relatively prime, the only possibility is 2 j + 1 = ν , which corresponds to u j = −1. But then ν is odd and z = 1 is the only real root according to Lemma 5.3; P(su j ) = P(−s) is therefore non-zero also for this case, which proves the lemma. ⊓ ⊔ For the next lemma we construct a pie-shaped region in the complex plane, bounded by the lines γ1 = z = su j | 0 ≤ s ≤ R , γ2 = z = Reis | α j ≤ s ≤ α j+1 , γ3 = z = su j+1 | 0 ≤ s ≤ R , where u j is defined as in Lemma 5.4. We can then show the following result. Lemma 5.5 Let γ be the union of the curves γ1 , γ2 and γ3 defined above. If R is large enough, there are precisely two roots of (5.6) inside γ . Proof. We chose R strictly larger than the magnitude of all roots of P. This means that P(z) 6= 0 on γ2 . It follows from Lemma 5.4 that P(z) 6= 0 also on γ1 and γ2 , and hence on all of γ . We can then use the argument principle, that for any closed curve γ ⊂ C, and analytic function f , with no zeros on γ , the change in argument in P(z) as z traverses γ is equal to 2π times the number of zeros of P(z) inside γ . First consider γ1 and noting that arg P(0) = arg 1 = 0. If Im u j = 0, then P(z) is purely real and there is no change in the argument. On the other hand, if Im u j 6= 0 then by (5.7) the only zeros of Im P(su j ) on γ1 are when s = 0 or s = 1. For both these points Accuracy of staircase approximations in FD methods for wave propagation 21 µ Re P > 0 by (5.8) and therefore P never crosses the negative real axis. Setting v = u j and exploiting the fact that uνj = −1, we then get Im P(Ru j ) Re P(Ru j ) −Rν Im [Rµ v + R−µ v−µ ] = arctan 2ν R + 4Rν + 1 − Rν Re [Rµ v + R−µ v−µ ] arg P(Ru j ) = arctan − Im [v + R−2µ v−µ ] 1 + 4R−ν + R−2ν − Rµ −ν Re [v + R−µ −ν v−µ ] µ −ν = arctan R −1 + O(R−ν ) = O(Rµ −ν ). = arctan Rµ −ν The same result also holds for γ3 . Now consider γ2 . For this case we have dz = iReis ds and Z α j+1 ′ Z P′ (z) P Reis arg P (Ru j ) − argP Ru j+1 = dz = i Reis ds. P (Reis ) γ2 P(z) αj But the quotient reduces according to zP′ (z) 2ν z2ν + (µ + ν ) zµ +ν − 4ν zν + (ν − µ ) zν −µ = = 2ν + O(|z|µ −ν ). P(z) z2ν + zµ +ν − 4zν + zν −µ + 1 This means that we can simplify according to Z γ2 P′ (z) dz = 2ν i P(z) Z α j+1 αj ds + O(Rµ −ν ) = 2ν i(α j+1 − α j ) + O(Rµ −ν ). The total change in the argument along γ thus becomes ∆ argP(z) = 4π i + O(Rµ −ν ). This is valid for all R large enough, so if we let R → ∞ we can conclude that there are precisely two roots inside γ . ⊓ ⊔ Finally we consider the unit circle and show the following lemma. Lemma 5.6 There are no roots on the unit circle other than z = 1. Proof. We have P(eiθ ) = e2iθ ν + eiθ (µ +ν ) − 4eiθ ν + eiθ (ν −µ ) + 1 = e2iθ ν + 2eiθ ν (cos θ µ − 2) + 1 =: P̃ eiθ ν , µθ , where P̃(z, θ̃ ) = z2 + 2z(cos θ̃ − 2)+ 1. Hence, if P eiθ = 0, the polynomial P̃(z, θ µ ) with fixed θ µ has a unit root. This happens precisely when |cos θ µ − 2| ≤ 1, i.e. only when θ µ = 2π n for some integer n. But in that case cos θ µ − 2 = −1 and the root is one, 1 = eiθ ν , giving θ ν = 2π m for some integer m. Since µ and ν are relatively prime it follows that θ = 2π n′ for some integer n′ , so the only root with magnitude one is z = 1. ⊓ ⊔ By the symmetry of roots z∗ and 1/z∗ it now follows that the two roots in each pie shaped region considered in Lemma 5.5 are different, except when the root is one. Therefore their magnitudes are also strictly smaller than and larger than one, respectively. This proves Theorem 5.2. 22 Jon Häggblad, Olof Runborg 5.3 Results for small h From the conclusions about the limiting equation (5.5) we can get results also for the full equation (5.6) with small h and ∆ t by considering it as a perturbation. We let λ , ω and K be fixed. Then the roots of (5.5) only depend on h and we denote them by z j (h). The following lemma shows that they are all first order perturbations in h. Lemma 5.7 Assume ν > µ are relatively prime. For small enough h0 we can order {z j (h)} such that each z j (h) is continuously differentiable in h on [0, h0 ) and z j (0) are the roots of (5.6). Moreover, |z j (h) − z j (0)| ≤ Ch, ∀h ∈ [0, h0 ), (5.9) where C is independent of h and j. Proof. Let P(z) be the limit polynomial (5.6) and Q(z, h) the full polynomial (5.5) with a fixed λ , ω and K, Q(z, h) = z2ν + 1 ν +µ z − R(h)zν + w(h)zν −µ + 1. w(h) It is classical perturbation theory that we can order the roots in the way described in the theorem and that (5.9) holds for the distinct roots of P(z). By Theorem 5.2 all roots of P(z) are distinct except a double root at z = 1. For this root, classical theory tells us that it can be expanded in a Puiseux series, z(h) = 1 + z1hγ + o(hγ ), (5.10) for some exponent γ ≤ 1. Since w = 1 + iKh + O(h2 ) and R = 4 + O(h2 ) we can write Q(z, h) as Q(z, h) = P(z) + hP̃(z) + O(h2 ), P̃(z) = iK(zν −µ − zν +µ ). Since P̃(1) = 0, entering (5.10) in this expansion of Q(z, h) we get 0 = Q(z(h), h) = P(1 + z1hγ + o(hγ )) + hP̃(1 + z1hγ + o(hγ )) + O(h2 ) 1 = P′′ (1)z21 h2γ + o(h2γ ) + P̃′ (1)z1 hγ +1 + o(hγ +1) + O(h2) 2 The leading term must vanish and since P′′ (1) 6= 1 this can only happen if 2γ = γ + 1 = 2. Hence, γ = 1 in (5.10) and (5.9) holds also for the double root at z = 1. Moreover, limh→0 z′ (h) = z1 . ⊓ ⊔ Accuracy of staircase approximations in FD methods for wave propagation 23 5.3.1 Proof of Theorem 5.1 Since there are 2ν roots to the polynomial (5.5) there are 2ν admissible waves. The ordering is given in the same way as for z j (h) in Lemma 5.7, and the statement follows since kr (h) depends smoothly on zr (h). Let z0 (h) and z1 (h) be the roots of Q(z, h) for which z0 (0) = z1 (0) = 1. Then again by Lemma 5.7 there is a constant C independent of h < h0 , such that ν ν (5.11) |kyr (h)| = log(zr (h)) = log(1 + [zr (h) − zr (0)]) ≤ C, h h for small enough h0 and r = 0, 1. Since kxr (h) = K − α kyr (h), the same holds for kxr (h). Moreover, k̃x (h) = kx + O(kx3 h2 ), k̃y (h) = kx + O(ky3 h2 ), ω̃ (∆ t) = ω + O(ω 3 h2 ), if ∆ t = λ h for a fixed λ . Then, kxr (h)2 + kyr (h)2 = ω 2 + h2Θ (h, kxr (h), kyr (h)), (5.12) kxr (h) + α kyr (h) = K, where |Θ | ≤ C independent of h ≤ h0 for r = 0, 1 and small enough h0 . From (5.11) we furthermore see that the limit limh→0 kr (h) is well-defined and equal to z′r (0)ν /i. Defining kr (0) thus by continuity we get that kxr (0)2 + kyr (0)2 = ω 2 , kxr (0) + α kyr (0) = K, (5.13) which are the conditions for the incoming and reflected wave numbers in the continuous case (3.2)–(3.3). The equation reduces to a second order polynomial equation with two roots. Hence, we can indeed choose our index r such that k0 (0) = k̄ and k1 (0) = k̄′ . Let us now fix r ∈ {0, 1} and define x(h) = kxr (h) − kxr (0) and y(h) = kyr (h) − kyr (0). Then, upon subtracting (5.13) from (5.12), x(kxr (h) + kxr (0)) + y(kyr (h) + kyr (0)) = h2Θ , x + α y = 0. Eliminating x with the second equation, gives y = h2 Θ Θ = h2 , kyr (h) − α kxr (h) + kyr (0) − α kxr (0) q(h) + q(0) where q(h) := kyr (h) − α kxr (h). From (3.4) and (5.13) we can now deduce that (1+ α 2 )ω 2 = (kyr (0)− α kxr (0))2 +(kxr (0)+ α kyr (0))2 = q(0)2 +K 2 ≤ q(0)2 + η (1+ α 2 )ω 2 , which shows that |q(0)| ≥ δ > 0. By continuity |q(0) + q(h)| ≥ δ̃ > 0 for small enough h and therefore, |y| ≤ Ch2 . Since |x| = α |y| the same holds for x and (5.1) is proved. r r For the remaining roots we note first that since |zr (h)| = |eiky (h)/ν | = e− Im ky h/ν , it r follows that the sign of Im ky (h) is positive when |zr (h)| < 1 and negative if |zr (h)| > 1. By Theorem 5.2, when h = 0 there are precisely ν − 1 roots with magnitude strictly smaller than one and the same number with magnitude strictly larger than 24 Jon Häggblad, Olof Runborg one. Moreover, by Lemma 5.7 the same thing holds also when 0 ≤ h ≤ h0 if h0 is small enough. This proves that we can order the wave numbers such that r = 2, . . . , ν correspond to those with positive imaginary parts, and r = ν + 1, . . . , 2ν correspond to those with negative imaginary parts. Finally, for 2 ≤ r ≤ ν there is a δ > 0 such that for 0 < h ≤ h0 , 1 − δ ≥ |zr (h)|, giving Im kyr (h) ≥ (ν /h)| log(1 − δ )|. Moreover, |hkyr | = ν | log zr (h)| ≤ C. Since kxr = K − α kyr the estimate (5.2) follows. To investigate the properties of the matrix Z in (3.11) we first note that it is in fact a permutation of a Vandermonde matrix due to the following property of the {dm } indices. −1 as defined in (3.9) is a Lemma 5.8 If ν > µ are relatively prime, then {dm }νm=0 permutation of the integers {0, . . . , ν −1}. If m corresponds to the corner cells defined by (3.14), then {dm } is a permutation of the integers {0, . . . , µ − 1}. Proof. Suppose first that dm1 = dm2 . Then 0 = dm2 − dm1 = ( jm1 − jm2 )ν − (m1 − m2 )µ , and since ν and µ are relatively prime, jm1 − jm2 = nµ , m1 − m2 = nν for some n. But 0 ≤ m1 , m2 ≤ ν − 1 so n = 0 and m1 = m2 . Therefore all dm are distinct. Moreover, since δm+ 1 ∈ [0, 1) and d¯ ∈ {0, 1/2}, 2 h 1 dm = νδm+ 1 − d¯ ∈ − , ν . 2 2 Hence, by counting, all integers {0, . . ., ν − 1} are represented by precisely one dm . The second statement follows from the fact that when jm+1 = jm + 1, dm+1 = jm+1 ν − (m + 1)µ + ν −µ = dm + ν − µ , 2 m ∈ Ωcr , ⊓ ⊔ and dm+1 < ν . It follows from Lemma 5.8 that there is a permutation matrix W ∈ Rν ×ν such that WZ = 1 z0 z20 .. . 1 z1 z21 .. . zν0 −1 zν1 −1 ··· 1 · · · zν · · · z2ν ∈ Rν ×(ν +1) . .. .. . . · · · zνν −1 By its size, the column rank of this matrix is at most ν . By Lemma 5.7, for 0 ≤ h ≤ h0 with h0 small enough, all z j are distinct, except possibly z0 and z1 which may be equal. Upon removing the first column (the z0 -column) we obtain a Vandermonde matrix with distinct values z j , which is non-singular. This is W Z̃ in (4.1) showing that Z̃ is non-singular. Moreover, there are hence ν linearly independent columns in W Z, so rank W Z = ν , and therefore the dimension of the null space of W Z, and hence also of W Z, is one. The inverse of Z̃ is a continuous function of h on the compact interval [0, h0 ], since it is well-defined on [0, h0 ] and each z j (h) is continuous. It is hence bounded. Accuracy of staircase approximations in FD methods for wave propagation 0 25 0 10 10 −1 10 −1 10 −2 10 −2 10 −3 10 |Re(α1+1)| |Re(α1−1)| |Im(α1)| |Im(α1)| −4 10 −3 −3 10 −2 10 h −1 10 10 −3 10 −2 10 h −1 10 Fig. 6.1 The convergence of α1 , which is the reflection coefficient for the propagating wave. The case considered is µ = 3, ν = 2. Left: soft boundary. Right: hard boundary. 6 Numerical tests To verify the analysis, we compute the explicit solution to (3.10) and (3.21). We choose the boundary angle α = µ /ν = 2/3, which gives 2 propagating modes and ν − 1 = 2 evanescent waves. We compare against the known solution (3.1) of the continuous problem. First we verify the convergence in Fig. 6.1, where we clearly observe first order behavior in the reflection coefficient α1 , for both hard and soft boundaries. The wave vectors for the same solutions are shown in Fig. 6.2, showing the O(1/h) growth in the frequency of the evanescent waves k2 , k3 , as well as O(h2 ) convergence for the reflected wave k1 . Using the computed αr and kr the full field can be obtained from (3.13). Evaluating this on a [0, 1]2 domain for 1/h = 26 , 27 , 28 , we plot the field along a line x = 1/2 in Fig. 6.3, first for a soft boundary, and then a hard boundary. We see the O(h) convergence in the propagating waves and the O(1) spike at the boundary. Zooming in shows the decay as a function of h in Fig. 6.4. While the amplitude of the spike seems to change for the 27 resolution, this is only due to the high frequency along the boundary, which we see in Fig. 6.5. 6.1 General boundary shapes To see that the analysis is applicable to more general domains and boundary shapes, we perform a simulation of harmonic waves scattering against a rigid cylinder. The setup is chosen so that we have an exact continuous solution for the corresponding continuous problem to compare the results with. It can be found in any basic text 26 Jon Häggblad, Olof Runborg 4 3 10 10 kx k kx k y y 3 2 10 Im(k) Re(k) 10 2 1 10 10 1 0 10 −3 10 −2 10 −3 10 −1 10 h 10 −2 −1 10 h 10 0 10 −1 || k1 − k ||2 10 −2 10 −3 10 −4 10 −3 −2 10 −1 10 h 10 Fig. 6.2 The wave vectors as a function of grid size h. Top: since ν = 3, we have 2 evanescent waves. Bottom: the wave vector for reflecting wave displaying O(h2 ) convergence. book. In polar coordinates it is given by ∞ ϕ inc (r, θ ) = eikr cos θ = J0 (kr) + ∑ 2(i)n Jn (kr) cos nθ , n=1 ϕ ref (r, θ ) = ∞ ∑ (1) Mn Hn (kr) cos nθ , n=0 together with 1 p(x, y,t) = Re (∂t ϕ e−iω t ), b u(x, y,t) = Re (∇ϕ e−iω t ). (6.1) The expansion coefficients for the reflected field are determined by the boundary (1)′ (1)′ conditions, giving M0 = −J0′ (kR)/H0 (kR), Mn = −2(i)n Jn′ (kR)/Hn (kR). These (1) include Bessel functions Jn as well as Hankel functions of first kind Hn . We use the computational domain Ω = {(x, y) ⊂ [0, 2π ] × [0, 2π ] | (x − π )2 + (y − π )2 ≥ 1}, and initialize the field to the exact continuous solution (6.1). We then run the Yee scheme until t = 0.3 and compare the result against the exact solution (6.1) at t = 0.3. The error is plotted in Fig. 6.6. Here we see that the same characteristic spikes in the error occur along the boundary. These oscillate as O(1/h) and have an amplitude of the same order of magnitude as the incoming field. Accuracy of staircase approximations in FD methods for wave propagation 0.035 27 0.25 0.03 0.2 v at x=1/2 p at x=1/2 0.025 0.02 0.015 0.15 0.1 0.01 0.05 0.005 0 0 0.1 0.2 0.3 0.4 0.5 0 0.6 0 0.1 0.2 0.3 y 0.4 0.5 0.6 0.7 0.4 0.5 0.6 0.7 y 0.5 0.2 0.4 v at x=1/2 p at x=1/2 0.15 0.1 0.05 0.3 0.2 0.1 0 0 0 0.1 0.2 0.3 0.4 0.5 0.6 0 0.7 0.1 0.2 0.3 y y Fig. 6.3 The absolute value of the computed solutions for a soft (top) and hard boundary (bottom), shown along a line x = 1/2, for three different grid resolutions N = 26 ,27 ,28 . We see the h convergence of the propagating modes as well as the spike at the boundary in v. 0.7 0.25 128 0.6 128 256 0.5 256 512 0.15 v at x=1/2 v at x=1/2 0.2 0.1 512 0.4 0.3 0.2 0.05 0.1 0 0.16 0.17 0.18 0.19 y 0.2 0.21 0 0.16 0.17 0.18 0.19 0.2 0.21 y Fig. 6.4 Close-up of the solution in Fig. 6.3 verifies the decay as a function of the number of cells. 7 Conclusion We have rigorously derived exact solutions to the Yee scheme close to staircase approximated boundaries. This enables a detailed error analysis, showing how the staircasing affects amplitude, phase, frequency and attenuation of waves. In particular, this 28 Jon Häggblad, Olof Runborg 0.2 0.2 0.1 0.1 0 0 0.25 0.3 0.4 0.5 0.6 0.7 y 0.3 0.5 0.6 x 0.7 0.4 0.35 0.3 0.45 0.5 x 0.55 y Fig. 6.5 Surface plot of |v| for the soft boundary solution in Fig. 6.3 with N = 27 . The field oscillates along the boundary, with frequency O(1/h). 1 0.8 0.6 0.4 0.2 0 2 2.5 3 3.5 4 4.5 x 2 3 2.5 3.5 4 4.5 y Fig. 6.6 Plot of the error in v for harmonic waves scattering against a hard (rigid) cylinder. The errors are seen to fluctuate with frequency O(1/h) along the cylinder, with an amplitude of the same order of magnitude as the incoming field. characterizes the O(1) evanescent waves occurring at the boundary which prevents √ convergence in L∞ and reduces it in L2 to O( h). The analysis shows that the errors are local in nature, and explains why they can very often be ignored in applications if the field along the boundary is not the focus of the simulation. The explicit form of the solutions to the Yee scheme should also provide a starting point for deriving more accurate boundary approximations. Accuracy of staircase approximations in FD methods for wave propagation 29 References 1. Botteldooren, D.: Finite-difference time-domain simulation of low-frequency room acoustic problems. J. Acoust. Soc. Am. 98(6), 3302–3308 (1995) 2. Cangellaris, A., Wright, D.: Analysis of the numerical error caused by the stair-stepped approximation of a conducting boundary in FDTD simulations of electromagnetic phenomena. IEEE Trans. Antennas Propag. 39(10), 1518–1525 (1991) 3. Dey, S., Mittra, R.: A locally conformal finite-difference time-domain (FDTD) algorithm for modeling three-dimensional perfectly conducting objects. IEEE Microw. Guided. W. 7(9), 273–275 (1997) 4. Ditkowski, A., Dridi, K., Hesthaven, J.S.: Convergent cartesian grid methods for Maxwell’s equations in complex geometries. J. Comput. Phys. 170(1), 39–80 (2001) 5. Engquist, B., Häggblad, J., Runborg, O.: On energy preserving consistent boundary conditions for the Yee scheme in 2D. BIT 52(3), 615–637 (2012) 6. Haggblad, J., Enquist, B.: Consistent modeling of boundaries in acoustic finite-difference timedomain simulations. J. Acoust. Soc. Am. 132(3), 1303–1310 (2012) 7. Hao, Y., Railton, C.: Analyzing electromagnetic structures with curved boundaries on Cartesian FDTD meshes. IEEE Trans. Microw. Theory Tech. 46(1), 82–88 (1998) 8. Holland, R.: Pitfalls of staircase meshing. IEEE Trans. Electromagn. C. 35(4), 434–439 (1993) 9. Jurgens, T., Taflove, A., Umashankar, K., Moore, T.: Finite-difference time-domain modeling of curved surfaces. IEEE Trans. Antennas Propag. 40(4), 357–366 (1992) 10. Madsen, N.K.: Divergence preserving discrete surface integral methods for Maxwell’s curl equations using non-orthogonal unstructured grids. J. Comput. Phys. 119(1), 34–45 (1995). DOI http://dx.doi.org/10.1006/jcph.1995.1114 11. Maloney, J.G., Cummings, K.E.: Adaptation of FDTD techniques to acoustic modeling. In: 11th Annual Review of Progress in Applied Computational Electromagnetics, vol. 2, pp. 724–731. Monterey, CA (1995) 12. Railton, C., Craddock, I.: Stabilised CPFDTD algorithm for the analysis of arbitrary 3D PEC structures. IEE Proc. Microwaves Antennas Propag. 143(5), 367–372 (1996) 13. Railton, C., Schneider, J.: An analytical and numerical analysis of several locally conformal FDTD schemes. IEEE Trans. Microw. Theory. 47(1), 56–66 (1999) 14. Rickard, Y., Nikolova, N.: Off-grid perfect boundary conditions for the FDTD method. IEEE Trans. Microw. Theory Tech. 53(7), 2274–2283 (2005) 15. Stephen, R.A.: Modeling sea surface scattering by the time-domain finite-difference method. J. Acoust. Soc. Am. 100(4), 2070–2078 (1996) 16. Tornberg, A.K., Engquist, B.: Consistent boundary conditions for the Yee scheme. J. Comput. Phys. 227(14), 6922–6943 (2008) 17. Xiao, T., Liu, Q.H.: A staggered upwind embedded boundary (SUEB) method to eliminate the FDTD staircasing error. IEEE Trans. Antennas Propag. 52(3), 730–741 (2004) 18. Yee, K.S.: Numerical solution of initial boundary value problems involving Maxwell’s equations in isotropic media. IEEE Trans. Antennas Propag. 14, 302–307 (1966)
© Copyright 2026 Paperzz