Skip to content

Example: Antireflection coating (AR)

Leandro Acquaroli edited this page Nov 27, 2019 · 3 revisions

Let's calculate an AR spectrum defining three different layers plus the incident and emergent media. The parameters for each layer are taken from Solar Energy Materials & Solar Cells 95, 3069 (2011).

The complete code can be found here.

Load modules

We will use the Plots and LaTeXStrings packages for plotting and then load the modules for the calculations. The RIdb.jl and RefractiveIndicesModels.jl are not part of ThinFilmsTools.jl itself, as they are the database for the index of refraction and mixing rules.

using Plots, LaTeXStrings
pyplot()
using ThinFilmsTools

Define the parameters of the beam

The first thing to do is to define the parameters for the beam or the incident light to the structure, by setting the wavelength range (nanometers) and the angle of incidence. The λ0 parameter is the reference wavelength. Note that the angle of incidence must be wrapped into a vector.

λi = 400 # intial wavelength [nm]
λf = 1000 # final wavelength [nm]
λ = LinRange(λi, λf, λf-λi+1) # wavelength range [nm]
λ0 = 700. # reference wavelength
θ = [0.] # angle of incidence [degrees]
beam = PlaneWave(λ, θ)

Define layers for the structure

Here we define the information for each layer of interest that will be used in the calculations. For each layer we have to define the type :GT (geometrical or physical thickness), the index of refraction n and the thickness d.

n1 = RIdb.air(beam.λ)
n2 = RIdb.silicon(beam.λ)
layers = [ LayerTMMO(n1),
           LayerTMMO(RI.looyenga([0.89 1.0-0.89],[n1 n2]); d=77.),
           LayerTMMO(RI.looyenga([0.70 1.0-0.70],[n1 n2]); d=56.),
           LayerTMMO(RI.looyenga([0.41 1.0-0.41],[n1 n2]); d=39.),
           LayerTMMO(n2) ]

You could also do

l0 = LayerTMMO(n1)
l1 = LayerTMMO(RI.looyenga([0.89 1.0-0.89],[n1 n2]); d=77.)
l2 = LayerTMMO(RI.looyenga([0.70 1.0-0.70],[n1 n2]); d=56.)
l3 = LayerTMMO(RI.looyenga([0.41 1.0-0.41],[n1 n2]); d=39.)
l4 = LayerTMMO(n2)
layers = [l0, l1, l2, l3, l4, l5]

Call the main script

After defining the parameters we call the main function for it tmm_optics and store the results in sol:

sol = tmm_optics(beam, layers)

Optional examples to plot results

The results can be plotted using some recipes and functions included in the package. For instance, for plotting the Reflectance, Transmittance and Absorbance spectra, we could do:

plot(Spectrum1D(), sol.beam.λ,
     [sol.Spectra.Rp, sol.Spectra.Tp, 1.0.-(sol.Spectra.Rp.+sol.Spectra.Tp)],
     label=["Reflectance" "Transmittance" "Absorbance"],
     line=([:solid :dash :dashdot]), grid=false)
gui()

Example 3: AR Coating

And to plot the profile of indexes of refraction inside the structure:

plot(RIprofile(), sol)
gui()

Example 3: AR Coating

The light strikes the system from the left to the right, being the incident medium the leftmost one and the substrate the rightmost one.

Clone this wiki locally