Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reflectance for total internal reflection #10

Open
wschmail opened this issue Jan 8, 2025 · 1 comment
Open

Reflectance for total internal reflection #10

wschmail opened this issue Jan 8, 2025 · 1 comment

Comments

@wschmail
Copy link

wschmail commented Jan 8, 2025

I stumbled over surprising results when I use the package for structures where total internal reflectance can occur.
A simple example is the reflectance for a model with silicon as superstrate, silicon dioxide as layer and air as substrate.

using RigorousCoupledWaveAnalysis
using CairoMakie
using Interpolations

N = 0
λs = 300:0.2:950
Rtms = zeros(length(λs))
Rtes = zeros(length(λs))
Ttms = zeros(length(λs))
Ttes = zeros(length(λs))

θ = 1E-5
θ = 13

α = 0
px = py = 1.0

# -----------------------------------------------------------------
Si = InterpolPerm(RigorousCoupledWaveAnalysis.si_schinke)

# ---- Silicon with extinction coefficient set to zero behaves different
# Si = InterpolPerm(
#     interpolate(
#         (λs,),
#         real(RigorousCoupledWaveAnalysis.si_schinke.(λs)),
#         Gridded(Linear()),
#     ),
# )
# -----------------------------------------------------------------

Air = ConstantPerm(1)
SiO2 = ModelPerm(RigorousCoupledWaveAnalysis.sio2_malitson)

superstrate = Si
substrate = Air

sio2 = SimpleLayer(200, SiO2)
Mdl = RCWAModel([sio2], superstrate, substrate)

# ---------------------------------------------- #
for (i, λ) in enumerate(λs)
    Grd = rcwagrid(N, N, px, py, θ, α, λ, superstrate)
    ste, stm = rcwasource(Grd)
    # Rte, Tte = srcwa_reftra(ste, Mdl, Grd, λ)
    Rte, Tte = etm_reftra(ste, Mdl, Grd, λ)
    # Rtm, Ttm = srcwa_reftra(stm, Mdl, Grd, λ)
    Rtm, Ttm = etm_reftra(stm, Mdl, Grd, λ)
    Rtes[i] = Rte
    Ttes[i] = Tte
    Rtms[i] = Rtm
    Ttms[i] = Ttm
end

fig = Figure(; size=(900, 600))
ax = Axis(
    fig[1, 1];
    title="θ = $(θ) | TE",
    xticks=0:50:1000,
    yticks=-0.1:0.1:2,
    limits=(λs[1], λs[end], -0.1, 1.5),
    xlabel="Wavelength (nm)",
    ylabel="Reflectance & Transmittance",
)
lines!(ax, λs, Rtes; label="R")
lines!(ax, λs, Ttes; label="T")
axislegend(ax)
ax = Axis(
    fig[1, 2];
    title="θ = $(θ) | TM",
    xticks=0:50:1000,
    yticks=-0.1:0.1:2,
    limits=(λs[1], λs[end], -0.1, 1.5),
    xlabel="Wavelength (nm)",
    ylabel="Reflectance & Transmittance",
)
lines!(ax, λs, Rtms; label="R")
lines!(ax, λs, Ttms; label="T")
axislegend(ax)
fig

The code above gives:
image

When I set the extinction coefficient of silicon to zero I get:
image

Which is much closer to the result that I get with Filmetrics.

@jonschlipf
Copy link
Owner

Hi,
I never tried injecting a source in a lossy material, this is the first time I see this. I was not able to resolve this quickly, but will get back to it when I have more time.

I suspect the source vector might become complex, but am currently not too much into the code to know where this makes a problem.

The math is done in great detail in the supplemental document of our paper:
https://doi.org/10.1364/oe.438585
In case you want to check for yourself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants