The study of periodic structures can often be reduced to the analysis of a single basic cell. For an oblique incident plane wave, the periodic boundary condition needs some special attention, due to the fact that an advanced time field is needed. This problem is avoided by introducing a phase shift and by splitting the obtained plane wave into two components. The resulting equations are updated using similar leapfrog algorithms, such as the finite-difference time-domain (FDTD) algorithm.

The simulation area is defined by the

and

parameters. The parameters

and

denote the number of mesh points per unit on the

and

axes, respectively. The periodicity of the simulation area is considered in the

direction such that a periodic source is set in the plane defined by the equation

. At

, we set electric and magnetic currents in order to cancel the incoming plane wave. The propagation angle is defined as the angle between the

axis and the wave vector of the source

and is given by the relation

where the parameters

and

are multiples of

and

, respectively. Since we have considered

-periodicity, the parameter

cannot be set to zero. The program lets you plot the electromagnetic field components

,

and

and also some intermediary fields

,

.

[1] T. Tan and M. Potter, "FDTD Discrete Planewave (FDTD-DPW) Formulation for a Perfectly Matched Source in TFSF Simulations,"

*IEEE Transactions on Antennas and Propagation*,

**58**(8), 2010 pp. 2641–2648.

doi:10.1109/TAP.2010.2050446.

[2] A. Taflove, ed.,

*Advances in Computational Electrodynamics: The Finite-Difference Time-Domain Method*, Boston: Artech House, 1998.