Week 10: Results and Conclusions from S4
May 21, 2025
Welcome back to my final blog! Today I’ll present the code I used to replicate results from the graph from Bonod et al. [1].
The Script
S4 uses a lua script to run the model. In this section, I’ll go over what every line of my script does. Refer to Week 9 or [1] for the model.
![]()
Line 1 creates the simulation object, defining the lattice distance (distance between grooves) as 1000. The BasisSize refers to the number of Fourier expansions S4 will perform.

Lines 4-6 define the materials and their corresponding permittivities. The left number and right numbers are the real and imaginary components respectively.

Lines 8-12 add each of the layers, with names “Above,” “Middle,” and “Bottom.” Line 10 defines the rectangular grating made of substrate material within the “Middle” layer. The second argument of this function corresponds with the thickness of this layer with 0 as the semi-infinite layer.

Line 15 sets the initial incident light wave. Both incident angles are zero, since the light is normal to the substrate plane. We are solely looking at p-polarized light, so the p-polarized amplitude is normalized to 1.

These lines run the model through different values of wavelength, calculating a 0th order diffraction efficiency (defined as the reflected power over incident power).
Plotting the printed columns of wavelength vs diffraction efficiency gives us the following,

This matches the same resonance behavior as in [1], but not so much the values of efficiency. My theory is that the function called did not return the same reflected power flux as [1] calculated. However, it’s promising that they produced the same resonance behavior using the effective permittivity values.
[1] N. Bonod, E. Popov, M. Nevière. Fourier factorization of nonlinear Maxwell equations in periodic media: application to the optical Kerr effect. Optics Communications, 2005, 244, pp.389-398. ⟨hal-00015523⟩

Leave a Reply
You must be logged in to post a comment.