From 05aa02771abe37e27e9b199224b40ee7f45810f4 Mon Sep 17 00:00:00 2001 From: pivaps Date: Thu, 15 Aug 2024 19:27:37 +0100 Subject: [PATCH] Fixing few more mistakes in boundary conditions of one plate two media --- src/effective_waves/plane_waves/boundary-condition.jl | 8 ++++---- .../plane_waves/reflection-transmission.jl | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/effective_waves/plane_waves/boundary-condition.jl b/src/effective_waves/plane_waves/boundary-condition.jl index a2d888d..670b182 100644 --- a/src/effective_waves/plane_waves/boundary-condition.jl +++ b/src/effective_waves/plane_waves/boundary-condition.jl @@ -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) diff --git a/src/effective_waves/plane_waves/reflection-transmission.jl b/src/effective_waves/plane_waves/reflection-transmission.jl index c725508..f8e109c 100644 --- a/src/effective_waves/plane_waves/reflection-transmission.jl +++ b/src/effective_waves/plane_waves/reflection-transmission.jl @@ -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].ω