Skip to content

Commit

Permalink
Fixing few more mistakes in boundary conditions of one plate two media
Browse files Browse the repository at this point in the history
  • Loading branch information
pivaps committed Aug 15, 2024
1 parent 8a39efc commit 05aa027
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/effective_waves/plane_waves/boundary-condition.jl
Original file line number Diff line number Diff line change
Expand Up @@ -263,15 +263,15 @@ function solve_boundary_condition(ω::T, k_eff::Complex{T}, eigvectors1::Array{C
for p = 1:size(F, 3), l = 0:basis_order for m = -l:l, j in eachindex(species))

Iu(F::Array{Complex{T}}, p_or_m::Int) = (2π / (k0^2)) * sum(
1im^(-T(dl)) * Ys[lm_to_n(dl, dm)] * exp(1im * (p_or_m * k_eff - k0) * rs[j]) * F[lm_to_n(dl, dm), j, p] * nf[j] / (k_eff - p_or_m * k0)
1im^(-T(dl)) * Ys[lm_to_n(dl, dm)] * exp(1im * (p_or_m * k_eff - k0) * rs[j]) * F[lm_to_n(dl, dm), j, p] * nf[j] / (k0 - p_or_m * k_eff)
for p = 1:size(F, 3), dl = 0:basis_order for dm = -dl:dl, j in eachindex(species))

Il(F::Array{Complex{T}}, p_or_m::Int) = (2π / (k0^2)) * sum(
1im^(T(dl)) * Ys[lm_to_n(dl, dm)] * exp(1im * (p_or_m * k_eff + k0) * (Z - rs[j])) * F[lm_to_n(dl, dm), j, p] * nf[j] / (k_eff + p_or_m * k0)
1im^(T(dl)) * Ys[lm_to_n(dl, dm)] * exp(1im * (p_or_m * k_eff + k0) * (Z - rs[j])) * F[lm_to_n(dl, dm), j, p] * nf[j] / (k0 + p_or_m * k_eff)
for p = 1:size(F, 3), dl = 0:basis_order for dm = -dl:dl, j in eachindex(species))

MI11 = D_2 * Bp(F_p, 1) * exp(1im * k0 * Z) + D_1 * Bm(F_p, 1) * exp(-1im * k0 * Z) + 1im * Iu(F_p, 1)
MI12 = D_2 * Bp(F_m, -1) * exp(1im * k0 * Z) + D_1 * Bm(F_m, -1) * exp(-1im * k0 * Z) + 1im * Iu(F_m, -1)
MI11 = D_2 * Bp(F_p, 1) * exp(1im * k0 * Z) + D_1 * Bm(F_p, 1) * exp(-1im * k0 * Z) - 1im * Iu(F_p, 1)
MI12 = D_2 * Bp(F_m, -1) * exp(1im * k0 * Z) + D_1 * Bm(F_m, -1) * exp(-1im * k0 * Z) - 1im * Iu(F_m, -1)
MI21 = (D_1 * Bp(F_p, 1) + D_2 * Bm(F_p, 1)) * exp(1im * k0 * Z) - 1im * Il(F_p, 1)
MI22 = (D_1 * Bp(F_m, -1) + D_2 * Bm(F_m, -1)) * exp(1im * k0 * Z) - 1im * Il(F_m, -1)

Expand Down
4 changes: 2 additions & 2 deletions src/effective_waves/plane_waves/reflection-transmission.jl
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,9 @@ function reflection_transmission_coefficients(wavemodes::Vector{E}, psource::Pla

Tamp = (D_m * Bm(wavemodes[1].eigenvectors, wavemodes[2].eigenvectors) +
D_p * Bp(wavemodes[1].eigenvectors, wavemodes[2].eigenvectors) +
D_0 * G) * exp(-1im * k * Z)
D_0 * G)

return [Ramp, Tamp * exp(im * kz * Z2)]
return [Ramp, Tamp] * exp(im * k * Z1)
else
# Unpacking parameters
ω = wavemodes[1].ω
Expand Down

0 comments on commit 05aa027

Please sign in to comment.