-
Notifications
You must be signed in to change notification settings - Fork 5
Example: Multilayer stack (Distributed Bragg Reflector, DBR)
Now we can draw an example of another type of thin-film multilayer stack (AR are also multilayer, but they are referred to as AR within the literature). Here, we will alternate two different layers periodically, plus the two incident and emergent media, giving one type of the so-called DBR.
The complete code can be found here.
using Plots, LaTeXStrings
pyplot()
using ThinFilmsTools
λi = 200 # intial wavelength [nm]
λf = 1000 # final wavelength [nm]
λ = LinRange(λi, λf, λf-λi) # wavelength range [nm]
θ = [0.] # angle of incidence [degrees]
beam = PlaneWave(λ, θ)
l0 = LayerTMMO(RIdb.air(beam.λ))
l1 = LayerTMMO(RIdb.dummy(beam.λ, 1.45, 0.0); type=:OT, d=1.0/4.0)
l2 = LayerTMMO(RIdb.dummy(beam.λ, 3.45, 0.0); type=:OT, d=1.0/4.0)
layers = [l0, l1, l2, l1, l2, l1, l2, l1, l2, l0]
λ0 = 700.0
sol = tmm_optics(beam, layers; λ0=λ0, emfflag=true, h=10, pbgflag=true)
We plot the spectra, the distribution of electric field inside the stack in log
for better visualisation, the indices profile and the dispersion.
# Plot spectra
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]),
ylims=(0.0,1.0),
xlims=(sol.beam.λ[1], sol.beam.λ[end]),
);
gui()
# Plot the EMF pattern for normal incidence
plot(EMF2D(),
sol.beam.λ, sol.Misc.ℓ, log10.(sol.Field.emfp[:,1,:]),
title=("Log of EMF intensity"),
);
gui()
# plot the refractive index profile
plot(RIprofile(), sol; plotemf=true)
gui()
# plot the photonic dispersion with custom function
plot(PBGDispersion1D(), sol.Bloch)
gui()
plot(PBGDispersion1Dalt(), sol.Bloch)
gui()
plot(PBGDispersion1Dimre(), sol.Bloch)
gui()
And we get:
Notice that there are two plots of indices profile, where the second one overlaps the electric field across the multilayer for both polarisations, at the default wavelength and angle of incidence. This plot appears only when the EMF is calculated. Also, notice that the EMF plot overlapping the indices profile is not in log
but the as calculated.