API Reference

Index

General functions

AnalyticEMModes.wavenumberFunction
wavenumber(f, μᵣ, εᵣ)

Computes the wavenumber ω√(μ⋅ε).

Arguments

  • f: Frequency in Hz
  • μᵣ: Relative permeability
  • εᵣ: Relative permittivity
source
AnalyticEMModes.phase_constantFunction
phase_constant(kc, f, μᵣ, εᵣ)

Computes β given the cutoff wavenumber kc.

Arguments

  • kc: Cutoff wavenumber
  • f: Frequency in Hz
  • μᵣ: Relative permeability
  • εᵣ: Relative permittivity
source
AnalyticEMModes.attenuation_factorFunction
attenuation_factor(kc, f, μᵣ, εᵣ)

Computes α, the attenuation constant of a given mode for frequencies below the cutoff.

Arguments

  • kc: Cutoff wavenumber
  • f: Frequency in Hz
  • μᵣ: Relative permeability
  • εᵣ: Relative permittivity
source
AnalyticEMModes.propagation_constantFunction
propagation_constant(kc, f, μᵣ, εᵣ)

Computes γ = α + jβ given the cutoff wavenumber kc.

Arguments

  • kc: Cutoff wavenumber
  • f: Frequency in Hz
  • μᵣ: Relative permeability
  • εᵣ: Relative permittivity
source
AnalyticEMModes.cutoff_frequencyFunction
cutoff_frequency(kc, μᵣ, εᵣ)

Computes the cutoff frequency of a mode given the cutoff wavenumber kc.

Arguments

  • kc: Cutoff wavenumber
  • μᵣ: Relative permeability
  • εᵣ: Relative permittivity
source
AnalyticEMModes.mode_wavelengthFunction
mode_wavelength(β)

Returns the guided wavelength (mode wavelength) of the propagating mode given the phase constant β.

Arguments

  • β: Phase constant
source
AnalyticEMModes.mode_impedanceFunction
mode_impedance(T, fcutoff, f, μᵣ, εᵣ)

Computes the mode impedance of a T ∈ (:TE, :TM) mode given the cutoff frequency.

Arguments

  • T: Mode type (:TE or :TM)
  • fcutoff: Cutoff frequency
  • f: Frequency in Hz
  • μᵣ: Relative permeability
  • εᵣ: Relative permittivity
source

Rectangular waveguide

AnalyticEMModes.kc_rwgFunction
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-direction
  • n: Mode index in y-direction
source
AnalyticEMModes.te_rwg_fieldsFunction
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 waveguide
  • b: Height of the waveguide
  • m, n: Mode indices
  • c_e, c_h: Field coupling coefficients (from te_coefficients), or
  • f: Frequency in Hz
  • μᵣ: Relative permeability
  • εᵣ: Relative permittivity

Returns

(Ex, Ey, Ez, Hx, Hy, Hz)

source
AnalyticEMModes.tm_rwg_fieldsFunction
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 waveguide
  • b: Height of the waveguide
  • m, n: Mode indices
  • c_e, c_h: Field coupling coefficients (from tm_coefficients), or
  • f: 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)
source
AnalyticEMModes.te_normalization_rwgFunction
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 waveguide
  • b: Height of the waveguide
  • m, n: Mode indices
  • kc: Cutoff wavenumber
  • β: Phase constant
  • f: Frequency in Hz
  • μᵣ: Relative permeability
  • εᵣ: Relative permittivity
source
AnalyticEMModes.tm_normalization_rwgFunction
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 waveguide
  • b: Height of the waveguide
  • m, n: Mode indices
  • kc: Cutoff wavenumber
  • β: Phase constant
  • f: Frequency in Hz
  • μᵣ: Relative permeability
  • εᵣ: Relative permittivity
source

Circular waveguide

AnalyticEMModes.kc_cwgFunction
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 waveguide
  • m: Azimuthal mode index
  • n: Radial mode index
  • T: Mode type (:TE or :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)
source
AnalyticEMModes.te_cwg_fieldsFunction
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 coordinate
  • m: Azimuthal mode index
  • kc: Cutoff wavenumber, or
  • a: Radius of the waveguide
  • n: Radial mode index
  • f: Frequency in Hz
  • μᵣ: Relative permeability
  • εᵣ: Relative permittivity
  • c_e, c_h: Field coupling coefficients (from te_coefficients)

Returns

(Er, Eθ, Ez, Hr, Hθ, Hz) in cylindrical coordinates centered at (0,0).

source
AnalyticEMModes.tm_cwg_fieldsFunction
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 coordinate
  • m: Azimuthal mode index
  • kc: Cutoff wavenumber, or
  • a: Radius of the waveguide
  • n: Radial mode index
  • f: Frequency in Hz
  • μᵣ: Relative permeability
  • εᵣ: Relative permittivity
  • c_e, c_h: Field coupling coefficients (from tm_coefficients)

Returns

(Er, Eθ, Ez, Hr, Hθ, Hz) in cylindrical coordinates centered at (0,0).

source
AnalyticEMModes.te_normalization_cwgFunction
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 waveguide
  • m: Azimuthal mode index
  • kc: Cutoff wavenumber
  • β: Phase constant
  • f: Frequency in Hz
  • μᵣ: Relative permeability
  • εᵣ: Relative permittivity
source
AnalyticEMModes.tm_normalization_cwgFunction
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 waveguide
  • m: Azimuthal mode index
  • kc: Cutoff wavenumber
  • β: Phase constant
  • f: Frequency in Hz
  • μᵣ: Relative permeability
  • εᵣ: Relative permittivity
source
AnalyticEMModes.metric_and_unit_cylindricalFunction
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 to r.
  • e_r_x: X-component of the radial unit vector
  • e_r_y: Y-component of the radial unit vector
  • e_ϕ_x: X-component of the azimuthal unit vector
  • e_ϕ_y: Y-component of the azimuthal unit vector
source

Coaxial waveguide

AnalyticEMModes.kc_coaxFunction
kc_coax(a, b, m, n, T)

Compute the cutoff wave number for a coaxial waveguide.

Arguments

  • a: Outer radius
  • b: Inner radius
  • m: Azimuthal mode index
  • n: Radial mode index
  • T: Mode type (:TE, :TM, or :TEM)

Note

For TEM mode, returns 0.0 (no cutoff).

source
AnalyticEMModes.te_coax_fieldsFunction
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 by coax_boundary_coeff_te. Is always 1.0
  • Bm: Second value retuened by coax_boundary_coeff_te.
  • m: The azimuthal mode number.
  • n: radial mode number.
  • kc: cutoff wavenumber.
  • c_e: imωμ/kc^2
  • c_h: -im*β/kc^2
  • a: outer radius.
  • b: inner radius
  • 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 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).

source
AnalyticEMModes.tm_coax_fieldsFunction
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 by coax_boundary_coeff_te. Is always 1.0
  • Bm: Second value retuened by coax_boundary_coeff_te.
  • m: The azimuthal mode number.
  • n: radial mode number.
  • kc: cutoff wavenumber.
  • c_e: imωμ/kc^2
  • c_h: -im*β/kc^2
  • a: outer radius.
  • b: inner radius
  • 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).

source
tm_coax_fields(r, θ, a, b, m, n, f, μᵣ, εᵣ)

Arguments

  • r: r polar coordinate.
  • θ: angle in polar coordinates.
  • a: outer radius.
  • b: inner radius
  • m: 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).

source
AnalyticEMModes.tem_coax_fieldsFunction
tem_coax_fields(r, a, b, μᵣ, εᵣ)

Calculate the electric and magnetic field components of the TEM mode in a coaxial waveguide.

Arguments

  • r: Radial coordinate
  • a: Outer radius
  • b: Inner radius
  • μᵣ: Relative permeability
  • εᵣ: Relative permittivity

Returns

  • (Er, Eθ, Ez, Hr, Hθ, Hz)
source
AnalyticEMModes.te_normalization_coaxFunction
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 radius
  • b: Inner radius
  • m: Azimuthal mode index
  • kc: Cutoff wavenumber
  • β: Phase constant
  • f: Frequency in Hz
  • μᵣ: Relative permeability
  • εᵣ: Relative permittivity
source
AnalyticEMModes.tm_normalization_coaxFunction
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 radius
  • b: Inner radius
  • m: Azimuthal mode index
  • kc: Cutoff wavenumber
  • β: Phase constant
  • f: Frequency in Hz
  • μᵣ: Relative permeability
  • εᵣ: Relative permittivity
source
AnalyticEMModes.characteristic_coax_equation_teFunction
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 index
  • kc: Cutoff wavenumber
  • a: Outer radius
  • b: Inner radius
source
AnalyticEMModes.characteristic_coax_equation_tmFunction
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 index
  • kc: Cutoff wavenumber
  • a: Outer radius
  • b: Inner radius
source

Radial waveguide

AnalyticEMModes.kc_radialFunction
kc_radial(βz, f, μᵣ, εᵣ)

Computes the radial propagation constant kᵨ (analogous to kc in other geometries) for a radial waveguide.

Arguments

  • βz: Axial phase constant
  • f: Frequency in Hz
  • μᵣ: Relative permeability
  • εᵣ: Relative permittivity

Reference

Advanced engineering electromagnetics by Constatine A. Balanis. Chapter 9.5.1

source
AnalyticEMModes.phase_constant_radialFunction
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 waveguide
  • n: Axial mode index

Reference

Advanced engineering electromagnetics by Constatine A. Balanis. Chapter 9.5.1

source
AnalyticEMModes.cutoff_frequency_radialFunction
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
source
AnalyticEMModes.te_radial_fieldsFunction
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 coordinate
  • z: Axial coordinate where z ∈ [0, h]
  • m: Azimuthal mode index
  • Amn, Bmn: Wave amplitudes (outgoing/incoming)
  • kc: Radial propagation constant, or
  • h: Height of the waveguide
  • n: Axial mode index
  • f: Frequency in Hz
  • μᵣ: Relative permeability
  • εᵣ: Relative permittivity
  • β: Axial phase constant
  • c_e, c_h: Field coupling coefficients

Returns

(Er, Eϕ, Ez, Hr, Hϕ, Hz)

Notes

Outgoing: Amn = 1, Bmn = 0; Incoming: Amn = 0, Bmn = 1

source
AnalyticEMModes.tm_radial_fieldsFunction
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].

source
AnalyticEMModes.te_zwFunction
te_zw(m, r, kc, Amn, Bmn, f, μᵣ)

Impedance of the wave in the ρ direction for a TE mode.

Arguments

  • m: Azimuthal mode index
  • r: Radial coordinate
  • kc: Radial propagation constant
  • Amn, Bmn: Wave amplitudes
  • f: Frequency in Hz
  • μᵣ: Relative permeability
source
AnalyticEMModes.te_normalization_radialFunction
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 coordinate
  • h: Height of the waveguide
  • m: Azimuthal mode index
  • Amn, Bmn: Wave amplitudes
  • kc: Radial propagation constant
  • f: Frequency in Hz
  • μᵣ: Relative permeability
  • εᵣ: Relative permittivity
source
AnalyticEMModes.tm_normalization_radialFunction
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 coordinate
  • h: Height of the waveguide
  • m: Azimuthal mode index
  • Amn, Bmn: Wave amplitudes
  • kc: Radial propagation constant
  • f: Frequency in Hz
  • μᵣ: Relative permeability
  • εᵣ: Relative permittivity
source

Wedge waveguide

AnalyticEMModes.kc_wedgeFunction
kc_wedge(βz, f, μᵣ, εᵣ)

Computes the radial propagation constant for a wedge waveguide (same as kc_radial).

Arguments

  • βz: Axial phase constant
  • f: Frequency in Hz
  • μᵣ: Relative permeability
  • εᵣ: Relative permittivity
source
AnalyticEMModes.te_wedge_fieldsFunction
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 angle
  • p: Angular mode index
  • Amn, Bmn: Wave amplitudes
  • kc: Radial propagation constant, or
  • h: Height of the waveguide
  • n: Axial mode index
  • f: Frequency in Hz
  • μᵣ: Relative permeability
  • εᵣ: Relative permittivity
  • β: Axial phase constant
  • c_e, c_h: Field coupling coefficients

Returns

(Er, Eϕ, Ez, Hr, Hϕ, Hz)

source
AnalyticEMModes.tm_wedge_fieldsFunction
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 angle
  • p: Angular mode index
  • Amn, Bmn: Wave amplitudes
  • kc: Radial propagation constant, or
  • h: Height of the waveguide
  • n: Axial mode index
  • f: Frequency in Hz
  • μᵣ: Relative permeability
  • εᵣ: Relative permittivity
  • β: Axial phase constant
  • c_e, c_h: Field coupling coefficients

Returns

(Er, Eϕ, Ez, Hr, Hϕ, Hz)

source
AnalyticEMModes.te_normalization_wedgeFunction
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 coordinate
  • h: Height of the waveguide
  • ϕ0: Wedge angle
  • p: Angular mode index
  • Amn, Bmn: Wave amplitudes
  • kc: Radial propagation constant
  • f: Frequency in Hz
  • μᵣ: Relative permeability
  • εᵣ: Relative permittivity
source
AnalyticEMModes.tm_normalization_wedgeFunction
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 coordinate
  • h: Height of the waveguide
  • ϕ0: Wedge angle
  • p: Angular mode index
  • Amn, Bmn: Wave amplitudes
  • kc: Radial propagation constant
  • f: Frequency in Hz
  • μᵣ: Relative permeability
  • εᵣ: Relative permittivity
source

Elliptical waveguide

AnalyticEMModes.kc_ewgFunction
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 :TE or :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.
source
AnalyticEMModes.te_ewg_fieldsFunction
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²), or
  • a: Semi-major axis
  • b: Semi-minor axis
  • m: Mode order
  • n: Radial mode index (used with a, b)
  • even: true for even modes (c), false for odd modes (s)
  • coeff: Mathieu function coefficients
  • q: Parameter q = (kc*ρ)²/4
  • f: Frequency in Hz
  • μᵣ: Relative permeability
  • εᵣ: Relative permittivity
  • c_e, c_h: Field coupling coefficients

Returns

(Eξ, Eη, Ez, Hξ, Hη, Hz) in elliptical coordinates centered at (0,0).

source
AnalyticEMModes.tm_ewg_fieldsFunction
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²), or
  • a: Semi-major axis
  • b: Semi-minor axis
  • m: Mode order
  • n: Radial mode index (used with a, b)
  • even: true for even modes (c), false for odd modes (s)
  • coeff: Mathieu function coefficients
  • q: Parameter q = (kc*ρ)²/4
  • f: Frequency in Hz
  • μᵣ: Relative permeability
  • εᵣ: Relative permittivity
  • c_e, c_h: Field coupling coefficients

Returns

(Eξ, Eη, Ez, Hξ, Hη, Hz) in elliptical coordinates centered at (0,0).

source
AnalyticEMModes.cart2ellipticFunction
cart2elliptic(x, y, a, b)

Transform from cartesian coordinates to elliptic coordinates.

Arguments

  • x, y: Cartesian coordinates
  • a: Semi-major axis of the ellipse
  • b: Semi-minor axis of the ellipse

Returns

(ξ, η) elliptic coordinates

source
AnalyticEMModes.ce_mFunction
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 function
  • q: Parameter related to the geometry (q = (kc*ρ)²/4)
  • z: Coordinate (typically η)
source
AnalyticEMModes.se_mFunction
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 function
  • q: Parameter related to the geometry (q = (kc*ρ)²/4)
  • z: Coordinate (typically η)
source
AnalyticEMModes.Ce_mFunction
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 function
  • q: Parameter related to the geometry (q = (kc*ρ)²/4)
  • z: Coordinate (typically ξ)
source
AnalyticEMModes.Se_mFunction
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 function
  • q: Parameter related to the geometry (q = (kc*ρ)²/4)
  • z: Coordinate (typically ξ)
source

Sort Modes

AnalyticEMModes.first_n_modes_rwgFunction
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 (:TE or :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 ≥ 1 and n ≥ 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.

source
AnalyticEMModes.first_n_modes_cwgFunction
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 indices
  • kc: 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).

source
AnalyticEMModes.first_n_modes_coaxFunction
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 indices
  • kc: 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).

source
AnalyticEMModes.first_n_modes_radialFunction
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 index
  • n: Vertical mode index
  • kc: 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.

source
AnalyticEMModes.first_n_modes_ewgFunction
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 indices
  • kc: 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.

source