[waveguide_3d] fixup and doc update
This commit is contained in:
parent
7e8ff23356
commit
f5af0fef55
1 changed files with 16 additions and 5 deletions
|
|
@ -157,19 +157,31 @@ def compute_source(
|
||||||
|
|
||||||
|
|
||||||
def compute_overlap_e(
|
def compute_overlap_e(
|
||||||
E: cfdfield,
|
E: cfdfield_t,
|
||||||
wavenumber: complex,
|
wavenumber: complex,
|
||||||
dxes: dx_lists_t,
|
dxes: dx_lists_t,
|
||||||
axis: int,
|
axis: int,
|
||||||
polarity: int,
|
polarity: int,
|
||||||
slices: Sequence[slice],
|
slices: Sequence[slice],
|
||||||
|
omega: float,
|
||||||
) -> cfdfield_t:
|
) -> cfdfield_t:
|
||||||
"""
|
"""
|
||||||
Given an eigenmode obtained by `solve_mode`, calculates an overlap_e for the
|
Given an eigenmode obtained by `solve_mode`, calculates an overlap_e for the
|
||||||
mode orthogonality relation Integrate(((E x H_mode) + (E_mode x H)) dot dn)
|
mode orthogonality relation Integrate(((E x H_mode) + (E_mode x H)) dot dn)
|
||||||
[assumes reflection symmetry].
|
[assumes reflection symmetry].
|
||||||
|
|
||||||
TODO: add reference or derivation for compute_overlap_e
|
E x H_mode + E_mode x H
|
||||||
|
-> Ex Hmy - EyHmx + Emx Hy - Emy Hx (Z-prop)
|
||||||
|
Ex we/B Emx + Ex i/B dy Hmz - Ey (-we/B Emy) - Ey i/B dx Hmz
|
||||||
|
we/B (Ex Emx + Ey Emy) + i/B (Ex dy Hmz - Ey dx Hmz)
|
||||||
|
we/B (Ex Emx + Ey Emy) + i/B (Ex dy (dx Emy - dy Emx) - Ey dx (dx Emy - dy Emx))
|
||||||
|
we/B (Ex Emx + Ey Emy) + i/B (Ex dy dx Emy - Ex dy dy Emx - Ey dx dx Emy - Ey dx dy Emx)
|
||||||
|
|
||||||
|
Ex j/wu (-jB Emx - dx Emz) - Ey j/wu (dy Emz + jB Emy)
|
||||||
|
B/wu (Ex Emx + Ey Emy) - j/wu (Ex dx Emz + Ey dy Emz)
|
||||||
|
|
||||||
|
|
||||||
|
TODO: add reference
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
E: E-field of the mode
|
E: E-field of the mode
|
||||||
|
|
@ -197,9 +209,8 @@ def compute_overlap_e(
|
||||||
Etgt = numpy.zeros_like(Ee)
|
Etgt = numpy.zeros_like(Ee)
|
||||||
Etgt[slices2] = Ee[slices2]
|
Etgt[slices2] = Ee[slices2]
|
||||||
|
|
||||||
# note no sqrt() when normalizing below since we want to get 1.0 after overlapping with the
|
# Note: We normalize so that (Etgt @ E.conj()) == 1, so (Etgt @ Etgt.conj) != 1
|
||||||
# original field, not the normalized one
|
Etgt /= (Etgt.conj() * Etgt).sum()
|
||||||
Etgt /= (Etgt.conj() * Etgt).sum() # type: ignore
|
|
||||||
return cfdfield_t(Etgt)
|
return cfdfield_t(Etgt)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue