From f0c9a62770b82288f643662437416e074bc0e517 Mon Sep 17 00:00:00 2001 From: Olivier Vanvincq Date: Tue, 21 Mar 2023 18:06:21 +0100 Subject: [PATCH 1/2] Exchange TE and TM modes --- src/StepIndexFibre.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/StepIndexFibre.jl b/src/StepIndexFibre.jl index 7c6c5200..f4bf75a1 100644 --- a/src/StepIndexFibre.jl +++ b/src/StepIndexFibre.jl @@ -163,11 +163,11 @@ function char_HE(radius, k0, ncore, nclad, n, neff) char_LHS(n, u) - char_RHS(ncore, nclad, n, w) + R(ncore, nclad, n, u, w, neff) end -function char_TE(radius, k0, ncore, nclad, neff) +function char_TM(radius, k0, ncore, nclad, neff) char_HE(radius, k0, ncore, nclad, 0, neff) end -function char_TM(radius, k0, ncore, nclad, neff) +function char_TE(radius, k0, ncore, nclad, neff) char_EH(radius, k0, ncore, nclad, 0, neff) end From 7b4ec8719af4c50b6dfea2171a56752476b9a610 Mon Sep 17 00:00:00 2001 From: Olivier Vanvincq Date: Tue, 21 Mar 2023 18:07:41 +0100 Subject: [PATCH 2/2] Fix findneff function Add a workaround to remove the discontinuities found by Roots.jl in findneff function. --- src/StepIndexFibre.jl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/StepIndexFibre.jl b/src/StepIndexFibre.jl index f4bf75a1..b68db098 100644 --- a/src/StepIndexFibre.jl +++ b/src/StepIndexFibre.jl @@ -202,6 +202,10 @@ end function findneff(radius, k0, ncore, nclad, n, m, mode=:HE, pts=100) char = make_char(radius, k0, ncore, nclad, n, mode) roots = find_zeros(char, nclad, ncore, no_pts=pts) + r=[nclad;roots] + t1=char.(roots-diff(r)/3*2) + t2=char.(roots-diff(r)/3) + roots=roots[abs.(t2).