API Reference
- Index
- General functions
- Rectangular waveguide
- Circular waveguide
- Coaxial waveguide
- Radial waveguide
- Wedge waveguide
- Elliptical waveguide
- Sort Modes
Index
AnalyticEMModes.Ce_mAnalyticEMModes.Se_mAnalyticEMModes.attenuation_factorAnalyticEMModes.cart2ellipticAnalyticEMModes.ce_mAnalyticEMModes.characteristic_coax_equation_teAnalyticEMModes.characteristic_coax_equation_tmAnalyticEMModes.cutoff_frequencyAnalyticEMModes.cutoff_frequency_radialAnalyticEMModes.first_n_modes_coaxAnalyticEMModes.first_n_modes_cwgAnalyticEMModes.first_n_modes_ewgAnalyticEMModes.first_n_modes_radialAnalyticEMModes.first_n_modes_rwgAnalyticEMModes.kc_coaxAnalyticEMModes.kc_cwgAnalyticEMModes.kc_ewgAnalyticEMModes.kc_radialAnalyticEMModes.kc_rwgAnalyticEMModes.kc_wedgeAnalyticEMModes.metric_and_unit_cylindricalAnalyticEMModes.metric_and_unit_ellipticAnalyticEMModes.mode_impedanceAnalyticEMModes.mode_wavelengthAnalyticEMModes.phase_constantAnalyticEMModes.phase_constant_radialAnalyticEMModes.propagation_constantAnalyticEMModes.se_mAnalyticEMModes.te_coax_fieldsAnalyticEMModes.te_cwg_fieldsAnalyticEMModes.te_ewg_fieldsAnalyticEMModes.te_normalization_coaxAnalyticEMModes.te_normalization_cwgAnalyticEMModes.te_normalization_radialAnalyticEMModes.te_normalization_rwgAnalyticEMModes.te_normalization_wedgeAnalyticEMModes.te_radial_fieldsAnalyticEMModes.te_rwg_fieldsAnalyticEMModes.te_wedge_fieldsAnalyticEMModes.te_zwAnalyticEMModes.tem_coax_fieldsAnalyticEMModes.tm_coax_fieldsAnalyticEMModes.tm_cwg_fieldsAnalyticEMModes.tm_ewg_fieldsAnalyticEMModes.tm_normalization_coaxAnalyticEMModes.tm_normalization_cwgAnalyticEMModes.tm_normalization_radialAnalyticEMModes.tm_normalization_rwgAnalyticEMModes.tm_normalization_wedgeAnalyticEMModes.tm_radial_fieldsAnalyticEMModes.tm_rwg_fieldsAnalyticEMModes.tm_wedge_fieldsAnalyticEMModes.tm_zwAnalyticEMModes.wavenumber
General functions
AnalyticEMModes.wavenumber — Function
wavenumber(f, μᵣ, εᵣ)Computes the wavenumber ω√(μ⋅ε).
Arguments
f: Frequency in Hzμᵣ: Relative permeabilityεᵣ: Relative permittivity
AnalyticEMModes.phase_constant — Function
phase_constant(kc, f, μᵣ, εᵣ)Computes β given the cutoff wavenumber kc.
Arguments
kc: Cutoff wavenumberf: Frequency in Hzμᵣ: Relative permeabilityεᵣ: Relative permittivity
AnalyticEMModes.attenuation_factor — Function
attenuation_factor(kc, f, μᵣ, εᵣ)Computes α, the attenuation constant of a given mode for frequencies below the cutoff.
Arguments
kc: Cutoff wavenumberf: Frequency in Hzμᵣ: Relative permeabilityεᵣ: Relative permittivity
AnalyticEMModes.propagation_constant — Function
propagation_constant(kc, f, μᵣ, εᵣ)Computes γ = α + jβ given the cutoff wavenumber kc.
Arguments
kc: Cutoff wavenumberf: Frequency in Hzμᵣ: Relative permeabilityεᵣ: Relative permittivity
AnalyticEMModes.cutoff_frequency — Function
cutoff_frequency(kc, μᵣ, εᵣ)Computes the cutoff frequency of a mode given the cutoff wavenumber kc.
Arguments
kc: Cutoff wavenumberμᵣ: Relative permeabilityεᵣ: Relative permittivity
AnalyticEMModes.mode_wavelength — Function
mode_wavelength(β)Returns the guided wavelength (mode wavelength) of the propagating mode given the phase constant β.
Arguments
β: Phase constant
AnalyticEMModes.mode_impedance — Function
mode_impedance(T, fcutoff, f, μᵣ, εᵣ)Computes the mode impedance of a T ∈ (:TE, :TM) mode given the cutoff frequency.
Arguments
T: Mode type (:TEor:TM)fcutoff: Cutoff frequencyf: Frequency in Hzμᵣ: Relative permeabilityεᵣ: Relative permittivity
Rectangular waveguide
AnalyticEMModes.kc_rwg — Function
kc_rwg(a, b, m, n)Calculates the cutoff wave number of the m,n mode for a rectangular waveguide with dimensions a, b where a >= b.
Arguments
a: Width of the waveguide (larger dimension)b: Height of the waveguide (smaller dimension)m: Mode index in x-directionn: Mode index in y-direction
AnalyticEMModes.te_rwg_fields — Function
te_rwg_fields(x, y, a, b, m, n, c_e, c_h)
te_rwg_fields(x, y, a, b, m, n, f, μᵣ, εᵣ)Calculate the electric and magnetic field components of a TE_{m,n} mode.
Arguments
x,y: Coordinates where x ∈ [0, a] and y ∈ [0, b]a: Width of the waveguideb: Height of the waveguidem,n: Mode indicesc_e,c_h: Field coupling coefficients (fromte_coefficients), orf: Frequency in Hzμᵣ: Relative permeabilityεᵣ: Relative permittivity
Returns
(Ex, Ey, Ez, Hx, Hy, Hz)
AnalyticEMModes.tm_rwg_fields — Function
tm_rwg_fields(x, y, a, b, m, n, c_e, c_h)
tm_rwg_fields(x, y, a, b, m, n, f, μᵣ, εᵣ)Compute the electric and magnetic field components of a TM_{m,n} mode.
Arguments
x,y: Coordinates where x ∈ [0, a] and y ∈ [0, b]a: Width of the waveguideb: Height of the waveguidem,n: Mode indicesc_e,c_h: Field coupling coefficients (fromtm_coefficients), orf: Frequency in Hzμᵣ: Relative permeabilityεᵣ: Relative permittivity
Returns
(Ex, Ey, Ez, Hx, Hy, Hz)
Example
c_e, c_h = tm_coefficients(kc, β, f, μᵣ, εᵣ)
tm_rwg_fields(x, y, a, b, m, n, c_e, c_h)AnalyticEMModes.te_normalization_rwg — Function
te_normalization_rwg(a, b, m, n, kc, β, f, μᵣ, εᵣ)Normalization factor for TE modes to achieve unit power.
The normalization is derived from integrating the Poynting vector over the waveguide cross-section, giving the total transmitted power. In TE modes, Hₒ is normalized. δm, δn account for mode indices being 0 or non-zero.
Arguments
a: Width of the waveguideb: Height of the waveguidem,n: Mode indiceskc: Cutoff wavenumberβ: Phase constantf: Frequency in Hzμᵣ: Relative permeabilityεᵣ: Relative permittivity
AnalyticEMModes.tm_normalization_rwg — Function
tm_normalization_rwg(a, b, m, n, kc, β, f, μᵣ, εᵣ)Normalization factor for TM modes to achieve unit power.
The normalization is derived from integrating the Poynting vector over the waveguide cross-section, giving the total transmitted power. In TM modes, Eₒ is normalized. In this case there is no δm, δn because m and n >= 1.
Arguments
a: Width of the waveguideb: Height of the waveguidem,n: Mode indiceskc: Cutoff wavenumberβ: Phase constantf: Frequency in Hzμᵣ: Relative permeabilityεᵣ: Relative permittivity
Circular waveguide
AnalyticEMModes.kc_cwg — Function
kc_cwg(r, m, n, T; tol = 1e-9, max_iters = 10)Calculates the cutoff wave number of the m,n mode for a circular waveguide with radius r. Uses tabulated data or asymptotic expansions of Bessel functions to calculate the zero.
Arguments
r: Radius of the circular waveguidem: Azimuthal mode indexn: Radial mode indexT: Mode type (:TEor:TM)tol: Tolerance for zero-finding (default: 1e-9)max_iters: Maximum iterations for Newton-Raphson (default: 10)
Example
kc_cwg(1.0, 2, 1, :TE)
kc_cwg(1.0, 2, 1, :TM)AnalyticEMModes.te_cwg_fields — Function
te_cwg_fields(r, θ, m, kc, c_e, c_h)
te_cwg_fields(r, θ, a, m, n, f, μᵣ, εᵣ)Computes the electric and magnetic field components of a TE_{m,n} mode in a circular waveguide.
Arguments
r: Radial coordinateθ: Angular coordinatem: Azimuthal mode indexkc: Cutoff wavenumber, ora: Radius of the waveguiden: Radial mode indexf: Frequency in Hzμᵣ: Relative permeabilityεᵣ: Relative permittivityc_e,c_h: Field coupling coefficients (fromte_coefficients)
Returns
(Er, Eθ, Ez, Hr, Hθ, Hz) in cylindrical coordinates centered at (0,0).
AnalyticEMModes.tm_cwg_fields — Function
tm_cwg_fields(r, θ, m, kc, c_e, c_h)
tm_cwg_fields(r, θ, a, m, n, f, μᵣ, εᵣ)Computes the electric and magnetic field components of a TM_{m,n} mode in a circular waveguide.
Arguments
r: Radial coordinateθ: Angular coordinatem: Azimuthal mode indexkc: Cutoff wavenumber, ora: Radius of the waveguiden: Radial mode indexf: Frequency in Hzμᵣ: Relative permeabilityεᵣ: Relative permittivityc_e,c_h: Field coupling coefficients (fromtm_coefficients)
Returns
(Er, Eθ, Ez, Hr, Hθ, Hz) in cylindrical coordinates centered at (0,0).
AnalyticEMModes.te_normalization_cwg — Function
te_normalization_cwg(a, m, kc, β, f, μᵣ, εᵣ)Normalization factor for TE modes to achieve unit power.
The expression can be derived by integrating the Poynting vector over the cross-section of the guide.
Arguments
a: Radius of the waveguidem: Azimuthal mode indexkc: Cutoff wavenumberβ: Phase constantf: Frequency in Hzμᵣ: Relative permeabilityεᵣ: Relative permittivity
AnalyticEMModes.tm_normalization_cwg — Function
tm_normalization_cwg(a, m, kc, β, f, μᵣ, εᵣ)Normalization factor for TM modes to achieve unit power.
The expression can be derived by integrating the Poynting vector over the cross-section of the guide.
Arguments
a: Radius of the waveguidem: Azimuthal mode indexkc: Cutoff wavenumberβ: Phase constantf: Frequency in Hzμᵣ: Relative permeabilityεᵣ: Relative permittivity
AnalyticEMModes.metric_and_unit_cylindrical — Function
metric_and_unit_cylindrical(r, ϕ)Computes the metric coefficients (scale factors) and the Cartesian components of the unit vectors (êᵣ, êᵩ) for the 2D cylindrical (polar) coordinate system (r, ϕ).
This function is used for transforming differential operators (like the gradient or Laplacian) and vectors between the cylindrical and Cartesian systems.
Arguments
r: The radial coordinate (distance from the z-axis).ϕ: The azimuthal coordinate (angle with respect to the positive x-axis, in radians).
Returns
A tuple containing the six components:
h_r: Metric coefficient in the radial direction . Always 1.0.h_ϕ: Metric coefficient in the azimuthal direction . Equal tor.e_r_x: X-component of the radial unit vectore_r_y: Y-component of the radial unit vectore_ϕ_x: X-component of the azimuthal unit vectore_ϕ_y: Y-component of the azimuthal unit vector
Coaxial waveguide
AnalyticEMModes.kc_coax — Function
kc_coax(a, b, m, n, T)Compute the cutoff wave number for a coaxial waveguide.
Arguments
a: Outer radiusb: Inner radiusm: Azimuthal mode indexn: Radial mode indexT: Mode type (:TE,:TM, or:TEM)
Note
For TEM mode, returns 0.0 (no cutoff).
AnalyticEMModes.te_coax_fields — Function
te_coax_fields(r, θ, Am, Bm, m, kc, c_e, c_h)
te_coax_fields(r, θ, a, b, m, n, f, μᵣ, εᵣ)Arguments
r: r polar coordinate.θ: angle in polar coordinates.Am: First value returned bycoax_boundary_coeff_te. Is always 1.0Bm: Second value retuened bycoax_boundary_coeff_te.m: The azimuthal mode number.n: radial mode number.kc: cutoff wavenumber.c_e: imωμ/kc^2c_h: -im*β/kc^2a: outer radius.b: inner radiusf: frequency.μᵣ: relative permeabilityεᵣ: relative permittivity
Returns
(Er, Eθ, Ez, Hr, Hθ, Hz)
Calculate the electric and magnetic field components in polar coordinates of a TE_{m,n} mode given the dimensions of the circular section with radius r. It is assumed that the center of the circular section is at (0,0).
AnalyticEMModes.tm_coax_fields — Function
tm_coax_fields(r, θ, Am, Bm, m, kc, c_e, c_h)Arguments
r: r polar coordinate.θ: angle in polar coordinates.Am: First value returned bycoax_boundary_coeff_te. Is always 1.0Bm: Second value retuened bycoax_boundary_coeff_te.m: The azimuthal mode number.n: radial mode number.kc: cutoff wavenumber.c_e: imωμ/kc^2c_h: -im*β/kc^2a: outer radius.b: inner radiusf: frequency.μᵣ: relative permeabilityεᵣ: relative permittivity
Returns
(Er, Eθ, Ez, Hr, Hθ, Hz)
Calculate the electric and magnetic field components in polar coordinates of a TM_{m,n} mode given the dimensions of the circular section with radius r. It is assumed that the center of the circular section is at (0,0).
tm_coax_fields(r, θ, a, b, m, n, f, μᵣ, εᵣ)Arguments
r: r polar coordinate.θ: angle in polar coordinates.a: outer radius.b: inner radiusm: azimuthal mode number.n: radial mode number.f: frequency.μᵣ: relative permeabilityεᵣ: relative permittivity
Returns
(Er, Eθ, Ez, Hr, Hθ, Hz)
Calculate the electric and magnetic field components in polar coordinates of a TM_{m,n} mode given the dimensions of the circular section with radius r. It is assumed that the center of the circular section is at (0,0).
AnalyticEMModes.tem_coax_fields — Function
tem_coax_fields(r, a, b, μᵣ, εᵣ)Calculate the electric and magnetic field components of the TEM mode in a coaxial waveguide.
Arguments
r: Radial coordinatea: Outer radiusb: Inner radiusμᵣ: Relative permeabilityεᵣ: Relative permittivity
Returns
(Er, Eθ, Ez, Hr, Hθ, Hz)
AnalyticEMModes.te_normalization_coax — Function
te_normalization_coax(a, b, m, kc, β, f, μᵣ, εᵣ)Normalization factor for TE modes to achieve unit power.
The expression can be derived by integrating the Poynting vector over the cross-section of the guide.
Arguments
a: Outer radiusb: Inner radiusm: Azimuthal mode indexkc: Cutoff wavenumberβ: Phase constantf: Frequency in Hzμᵣ: Relative permeabilityεᵣ: Relative permittivity
AnalyticEMModes.tm_normalization_coax — Function
tm_normalization_coax(a, b, m, kc, β, f, μᵣ, εᵣ)Normalization factor for TM modes to achieve unit power.
The expression can be derived by integrating the Poynting vector over the cross-section of the guide.
Arguments
a: Outer radiusb: Inner radiusm: Azimuthal mode indexkc: Cutoff wavenumberβ: Phase constantf: Frequency in Hzμᵣ: Relative permeabilityεᵣ: Relative permittivity
AnalyticEMModes.characteristic_coax_equation_te — Function
characteristic_coax_equation_te(m, kc, a, b)The zeros of this function correspond to the cutoff wave number of the TE modes.
Arguments
m: Azimuthal mode indexkc: Cutoff wavenumbera: Outer radiusb: Inner radius
AnalyticEMModes.characteristic_coax_equation_tm — Function
characteristic_coax_equation_tm(m, kc, a, b)The zeros of this function correspond to the cutoff wave number of the TM modes.
Arguments
m: Azimuthal mode indexkc: Cutoff wavenumbera: Outer radiusb: Inner radius
Radial waveguide
AnalyticEMModes.kc_radial — Function
kc_radial(βz, f, μᵣ, εᵣ)Computes the radial propagation constant kᵨ (analogous to kc in other geometries) for a radial waveguide.
Arguments
βz: Axial phase constantf: Frequency in Hzμᵣ: Relative permeabilityεᵣ: Relative permittivity
Reference
Advanced engineering electromagnetics by Constatine A. Balanis. Chapter 9.5.1
AnalyticEMModes.phase_constant_radial — Function
phase_constant_radial(h, n)Phase constant (βᶻ) of the axial component of the wavenumber in a radial waveguide.
This constant arises from the PEC boundary conditions imposed at z = 0 and z = h, which constrain the field variation along the axial direction as:
Eρ(0 <= ρ <= ∞, 0 <= ϕ <= 2π, z = 0) = Eρ(0 <= ρ <= ∞, 0 <= ϕ <= 2π, z = h) = 0 Eϕ(0 <= ρ <= ∞, 0 <= ϕ <= 2π, z = 0) = Eϕ(0 <= ρ <= ∞, 0 <= ϕ <= 2π, z = h) = 0
Arguments
h: Height of the radial waveguiden: Axial mode index
Reference
Advanced engineering electromagnetics by Constatine A. Balanis. Chapter 9.5.1
AnalyticEMModes.cutoff_frequency_radial — Function
cutoff_frequency_radial(βz, μᵣ, εᵣ)Like cutoff_frequency(kc, μᵣ, εᵣ) but using βz instead of kc for the particular case of the radial waveguide.
Arguments
βz: Axial phase constantμᵣ: Relative permeabilityεᵣ: Relative permittivity
AnalyticEMModes.te_radial_fields — Function
te_radial_fields(r, ϕ, z, m, Amn, Bmn, kc, β, c_e, c_h)
te_radial_fields(r, ϕ, z, h, m, n, Amn, Bmn, f, μᵣ, εᵣ)Compute the electric and magnetic field components of a TE_{m,n} mode in a radial waveguide.
Arguments
r: Radial coordinateϕ: Angular coordinatez: Axial coordinate where z ∈ [0, h]m: Azimuthal mode indexAmn,Bmn: Wave amplitudes (outgoing/incoming)kc: Radial propagation constant, orh: Height of the waveguiden: Axial mode indexf: Frequency in Hzμᵣ: Relative permeabilityεᵣ: Relative permittivityβ: Axial phase constantc_e,c_h: Field coupling coefficients
Returns
(Er, Eϕ, Ez, Hr, Hϕ, Hz)
Notes
Outgoing: Amn = 1, Bmn = 0; Incoming: Amn = 0, Bmn = 1
AnalyticEMModes.tm_radial_fields — Function
tm_radial_fields(r, ϕ, z, m, Amn, Bmn, kc, β, c_e, c_h)
tm_radial_fields(r, ϕ, z, h, m, n, Amn, Bmn, f, μᵣ, εᵣ )Compute the electric and magnetic field components of a TM_{m,n} mode given the dimensions radial waveguide. It is assumed that the radial section is centered at (0, 0, z) with height z ∈ [0, h].
AnalyticEMModes.te_zw — Function
te_zw(m, r, kc, Amn, Bmn, f, μᵣ)Impedance of the wave in the ρ direction for a TE mode.
Arguments
m: Azimuthal mode indexr: Radial coordinatekc: Radial propagation constantAmn,Bmn: Wave amplitudesf: Frequency in Hzμᵣ: Relative permeability
AnalyticEMModes.tm_zw — Function
tm_zw(m, r, kc, Amn, Bmn, f, μᵣ)Impedance of the wave in the ρ direction for a TM mode.
AnalyticEMModes.te_normalization_radial — Function
te_normalization_radial(r, h, m, Amn, Bmn, kc, f, μᵣ, εᵣ)Normalization factor for TE modes to achieve unit power.
The expression can be derived by integrating the Poynting vector over the cross-section of the guide.
Arguments
r: Radial coordinateh: Height of the waveguidem: Azimuthal mode indexAmn,Bmn: Wave amplitudeskc: Radial propagation constantf: Frequency in Hzμᵣ: Relative permeabilityεᵣ: Relative permittivity
AnalyticEMModes.tm_normalization_radial — Function
tm_normalization_radial(r, h, m, Amn, Bmn, kc, f, μᵣ, εᵣ)Normalization factor for TM modes to achieve unit power.
The expression can be derived by integrating the Poynting vector over the cross-section of the guide.
Arguments
r: Radial coordinateh: Height of the waveguidem: Azimuthal mode indexAmn,Bmn: Wave amplitudeskc: Radial propagation constantf: Frequency in Hzμᵣ: Relative permeabilityεᵣ: Relative permittivity
Wedge waveguide
AnalyticEMModes.kc_wedge — Function
kc_wedge(βz, f, μᵣ, εᵣ)Computes the radial propagation constant for a wedge waveguide (same as kc_radial).
Arguments
βz: Axial phase constantf: Frequency in Hzμᵣ: Relative permeabilityεᵣ: Relative permittivity
AnalyticEMModes.te_wedge_fields — Function
te_wedge_fields(r, ϕ, z, ϕ0, p, Amn, Bmn, kc, β, c_e, c_h)
te_wedge_fields(r, ϕ, z, h, ϕ0, p, n, Amn, Bmn, f, μᵣ, εᵣ)Compute the electric and magnetic field components of a TE_{p,n} mode in a wedge waveguide.
Arguments
r: Radial coordinateϕ: Angular coordinate where ϕ ∈ [0, ϕ0]z: Axial coordinate where z ∈ [0, h]ϕ0: Wedge anglep: Angular mode indexAmn,Bmn: Wave amplitudeskc: Radial propagation constant, orh: Height of the waveguiden: Axial mode indexf: Frequency in Hzμᵣ: Relative permeabilityεᵣ: Relative permittivityβ: Axial phase constantc_e,c_h: Field coupling coefficients
Returns
(Er, Eϕ, Ez, Hr, Hϕ, Hz)
AnalyticEMModes.tm_wedge_fields — Function
tm_wedge_fields(r, ϕ, z, ϕ0, p, Amn, Bmn, kc, β, c_e, c_h)
tm_wedge_fields(r, ϕ, z, h, ϕ0, p, n, Amn, Bmn, f, μᵣ, εᵣ)Compute the electric and magnetic field components of a TM_{p,n} mode in a wedge waveguide.
Arguments
r: Radial coordinateϕ: Angular coordinate where ϕ ∈ [0, ϕ0]z: Axial coordinate where z ∈ [0, h]ϕ0: Wedge anglep: Angular mode indexAmn,Bmn: Wave amplitudeskc: Radial propagation constant, orh: Height of the waveguiden: Axial mode indexf: Frequency in Hzμᵣ: Relative permeabilityεᵣ: Relative permittivityβ: Axial phase constantc_e,c_h: Field coupling coefficients
Returns
(Er, Eϕ, Ez, Hr, Hϕ, Hz)
AnalyticEMModes.te_normalization_wedge — Function
te_normalization_wedge(r, h, ϕ0, p, Amn, Bmn, kc, f, μᵣ, εᵣ)Normalization factor for TE modes to achieve unit power.
The expression can be derived by integrating the Poynting vector over the cross-section of the guide.
Arguments
r: Radial coordinateh: Height of the waveguideϕ0: Wedge anglep: Angular mode indexAmn,Bmn: Wave amplitudeskc: Radial propagation constantf: Frequency in Hzμᵣ: Relative permeabilityεᵣ: Relative permittivity
AnalyticEMModes.tm_normalization_wedge — Function
tm_normalization_wedge(r, h, ϕ0, p, Amn, Bmn, kc, f, μᵣ, εᵣ)Normalization factor for TM modes to achieve unit power.
The expression can be derived by integrating the Poynting vector over the cross-section of the guide.
Arguments
r: Radial coordinateh: Height of the waveguideϕ0: Wedge anglep: Angular mode indexAmn,Bmn: Wave amplitudeskc: Radial propagation constantf: Frequency in Hzμᵣ: Relative permeabilityεᵣ: Relative permittivity
Elliptical waveguide
AnalyticEMModes.kc_ewg — Function
kc_ewg(a, b, m, n, even, T)Computes the cutoff wavenumber k_c for the (m, n)-th mode in an elliptical waveguide (EWG).
This function determines the characteristic values of the Mathieu functions corresponding to the given mode symmetry (even) and type (T = :TE or :TM). The cutoff wavenumber is derived from the eigenvalues qₘₙ obtained by locating the zeros of the appropriate Mathieu function or its derivative.
Arguments
a,b: Semi-major and semi-minor axes of the ellipse.m,n: Mode indices.even::Bool: Whether the mode is even (true) or odd (false).T::Symbol: Mode type. Either:TEor:TM.
Returns
kc::Float64: Cutoff wavenumber for the specified mode.
Notes
- For TM modes, the zeros of the Mathieu functions Ceₘ or Seₘ are used.
- For TE modes, the zeros of their derivatives Ceₘ′ or Seₘ′ are used.
AnalyticEMModes.te_ewg_fields — Function
te_ewg_fields(ξ, η, ρ, m, even, coeff, q, c_e, c_h)
te_ewg_fields(ξ, η, a, b, m, n, even, f, μᵣ, εᵣ)Computes the electric and magnetic field components of a TE_{c/s,m,n} mode in an elliptical waveguide.
Arguments
ξ: Radial elliptical coordinateη: Angular elliptical coordinateρ: Focal distance √(a²-b²), ora: Semi-major axisb: Semi-minor axism: Mode ordern: Radial mode index (used with a, b)even:truefor even modes (c),falsefor odd modes (s)coeff: Mathieu function coefficientsq: Parameter q = (kc*ρ)²/4f: Frequency in Hzμᵣ: Relative permeabilityεᵣ: Relative permittivityc_e,c_h: Field coupling coefficients
Returns
(Eξ, Eη, Ez, Hξ, Hη, Hz) in elliptical coordinates centered at (0,0).
AnalyticEMModes.tm_ewg_fields — Function
tm_ewg_fields(ξ, η, ρ, m, even, coeff, q, c_e, c_h)
tm_ewg_fields(ξ, η, a, b, m, n, even, f, μᵣ, εᵣ)Computes the electric and magnetic field components of a TM_{c/s,m,n} mode in an elliptical waveguide.
Arguments
ξ: Radial elliptical coordinateη: Angular elliptical coordinateρ: Focal distance √(a²-b²), ora: Semi-major axisb: Semi-minor axism: Mode ordern: Radial mode index (used with a, b)even:truefor even modes (c),falsefor odd modes (s)coeff: Mathieu function coefficientsq: Parameter q = (kc*ρ)²/4f: Frequency in Hzμᵣ: Relative permeabilityεᵣ: Relative permittivityc_e,c_h: Field coupling coefficients
Returns
(Eξ, Eη, Ez, Hξ, Hη, Hz) in elliptical coordinates centered at (0,0).
AnalyticEMModes.cart2elliptic — Function
cart2elliptic(x, y, a, b)Transform from cartesian coordinates to elliptic coordinates.
Arguments
x,y: Cartesian coordinatesa: Semi-major axis of the ellipseb: Semi-minor axis of the ellipse
Returns
(ξ, η) elliptic coordinates
AnalyticEMModes.metric_and_unit_elliptic — Function
metric_and_unit_elliptic(ρ, ξ, η)Computes the metric factor and unit vectors for the 2D elliptic coordinate system.
AnalyticEMModes.ce_m — Function
ce_m(m, q, z)Even angular Mathieu function of order m with parameter q evaluated at z and its derivative.
Arguments
m: Order of the Mathieu functionq: Parameter related to the geometry (q = (kc*ρ)²/4)z: Coordinate (typically η)
AnalyticEMModes.se_m — Function
se_m(m, q, z)Odd angular Mathieu function of order m with parameter q evaluated at z and its derivative.
Arguments
m: Order of the Mathieu functionq: Parameter related to the geometry (q = (kc*ρ)²/4)z: Coordinate (typically η)
AnalyticEMModes.Ce_m — Function
Ce_m(m, q, z)Even Radial Mathieu function and its derivative. It's equivalent to the Modified Mathieu Function of first kind of order m with parameter q evaluated at z.
Arguments
m: Order of the Mathieu functionq: Parameter related to the geometry (q = (kc*ρ)²/4)z: Coordinate (typically ξ)
AnalyticEMModes.Se_m — Function
Se_m(m, q, z)Odd Radial Mathieu function and its derivative. It's equivalent to the Modified Mathieu Function of first kind of order m with parameter q evaluated at z.
Arguments
m: Order of the Mathieu functionq: Parameter related to the geometry (q = (kc*ρ)²/4)z: Coordinate (typically ξ)
Sort Modes
AnalyticEMModes.first_n_modes_rwg — Function
first_n_modes_rwg(N, a, b)Returns the first N modes for a rectangular waveguide with width a and height b.
Returns
A vector of tuples (kind, m, n, kc) where:
kind: Mode type (:TEor:TM)m,n: Mode indices (number of half-wavelength variations in x and y directions)kc: Cutoff wavenumber
Mode restrictions
- TE modes:
m + n > 0(at least one index must be non-zero) - TM modes:
m ≥ 1andn ≥ 1(both indices must be positive)
The dominant mode is TE₁₀ (or TE₀₁ if b > a).
Performance
This implementation uses a heap-based algorithm and is much faster than brute-force sorting over all possible (m,n) combinations, especially for large N.
AnalyticEMModes.first_n_modes_cwg — Function
first_n_modes_cwg(N, r)Returns the first N modes for a circular waveguide of radius r.
Returns
A vector of (kind, m, n, kc) where:
kind: Mode type (:TE,:TM,:TEc,:TEs,:TMc,:TMs)m,n: Mode indiceskc: Cutoff wavenumber
Mode notation
For m > 0, there are two degenerate polarizations with the same cutoff frequency:
:TEc,:TMc: Cosine modes (cos(mθ) variation):TEs,:TMs: Sine modes (sin(mθ) variation)
For m = 0, only :TE and :TM are returned (no polarization degeneracy).
AnalyticEMModes.first_n_modes_coax — Function
first_n_modes_coax(N, r1, r2)Returns the first N modes for a coaxial waveguide with inner radius r2 and outer radius r1.
Returns
A vector of(kind, m, n, kc) where:
kind: Mode type (:TEM,:TE,:TM,:TEc,:TEs,:TMc,:TMs)m,n: Mode indiceskc: Cutoff wavenumber
Mode notation
The TEM mode (:TEM) has zero cutoff frequency and is the dominant mode.
For m > 0, there are two degenerate polarizations with the same cutoff frequency:
:TEc,:TMc: Cosine modes (cos(mθ) variation):TEs,:TMs: Sine modes (sin(mθ) variation)
For m = 0, only :TE and :TM are returned (no polarization degeneracy).
AnalyticEMModes.first_n_modes_radial — Function
first_n_modes_radial(N, h)Returns the first N modes for a radial waveguide with height h between parallel plates.
Returns
A vector of (kind, m, n, kc) where:
kind: Mode type (:TEM,:TE,:TM)m: Azimuthal mode indexn: Vertical mode indexkc: Cutoff wavenumber (radial propagation constant)
Note
The TEM mode (m=0, n=0) has zero cutoff frequency and corresponds to radial propagation between parallel plates.
AnalyticEMModes.first_n_modes_ewg — Function
first_n_modes_ewg(N, a, b)Returns the first N modes for an elliptic waveguide with semi-major axis a and semi-minor axis b.
Returns
A vector of (kind, m, n, kc) where:
kind: Mode type (:TEe,:TEo,:TMe,:TMo)m,n: Mode indiceskc: Cutoff wavenumber
Mode notation
Unlike circular or coaxial waveguides, elliptic waveguides have even and odd modes that are not degenerate (they have different cutoff frequencies):
:TEe,:TMe: Even modes (using even Mathieu functions, cosine-elliptic):TEo,:TMo: Odd modes (using odd Mathieu functions, sine-elliptic)
For m = 0, only even modes exist (:TEe, :TMe). For m > 0, both even and odd modes exist with different cutoff frequencies.