-
Notifications
You must be signed in to change notification settings - Fork 5
Example: Fabry Perot type multilayer (Microcavity)
We will compute the spectral behavior of a periodic binary thin-film multilayer with a defect placed in the middle. The defect is defined as a layer with certain index of refraction, equal to one of the two layers, with different thicknesses. This type of structure is called Fabry-Perot interferometer (FPI) or also microcavities (MC). The example was taken from Sensors and Actuators B 149 (2010) 189-193.
The complete code can be found here.
using Plots, LaTeXStrings
pyplot(reuse=false, grid=false)
using ThinFilmsTools
λi = 400 # intial wavelength [nm]
λf = 1000 # final wavelength [nm]
λ = LinRange(λi, λf, λf-λi+1) # wavelength range [nm]
θ = [0.] # angle of incidence [degrees]
beam = PlaneWave(λ, θ)
The way is constructed, the defect has to be written one by one. Here, we define a defect layer with ten times the optical thickness of layer 1. To do this, we write down l1
ten times by concatenating the left-side mirror with the defect using repeat([l1], 1, 10)
and the right-side mirror. The repeat([l1], 1, 10)
conveniently allows repeating the l1
the number of times we want.
n1 = RIdb.air(beam.λ)
n2 = RIdb.silicon(beam.λ)
l0 = LayerTMMO(n1)
l1 = LayerTMMO(RI.looyenga([0.86 1.0-0.86],[n1 n2]); type=:OT, d=1.0/4.0)
l2 = LayerTMMO(RI.looyenga([0.54 1.0-0.54],[n1 n2]); type=:OT, d=1.0/4.0)
l3 = LayerTMMO(RIdb.glass(beam.λ./1e3)) # λ for glass input in micrometers
layers = vec([l0 l1 l2 l1 l2 l1 l2 l1 l2 repeat([l1], 1, 10) l2 l1 l2 l1 l2 l1 l2 l1 l3])
λ0 = 730.0
sol = tmm_optics(beam, layers; λ0 =λ0, emfflag=true, h=10)
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]), xlims=(sol.Beam.λ[1], sol.Beam.λ[end]),
yaxis=("Transmittance", (0.,1.0)));
gui()
plot(EMF2D(),
sol.beam.λ, sol.Misc.ℓ, sol.Field.emfp[:,1,:])
gui()
plot(RIprofile(), sol)
gui()