differt.em module

differt.em module#

Electromagnetic (EM) fields utilities.

Constants

Electrical constants used for EM fields computation.

c

The speed of light in vacuum.

epsilon_0

The vacuum permittivity \(\epsilon_0\).

mu_0

The vacuum permeability \(\mu_0\).

z_0

The impedance of free space \(Z_0\).

Fields coefficients

Fresnel and diffraction coefficients, as described by the Geometrical Optics (GO) and the Uniform Theory of Diffraction (UTD).

As detailed in [11, eq. 3.199, p. 131], the GO reflected field from a smooth conducting surface can be expressed as:

\[\boldsymbol{E}^r(P) = \boldsymbol{E}^r(Q_r) \sqrt{\frac{\rho_1^r\rho_2^r}{\left(\rho_1^r+s^r\right)\left(\rho_2^r+s^r\right)}} e^{-jks^r},\]

where \(P\) is the observation point and \(Q_r\) is the reflection point on the surface, \(\rho_1^r\) and \(\rho_2^r\) are the principal radii of curvature at \(Q_r\) of the reflected wavefront, \(k\) is the wavenumber, and \(s_r\) is the distance between \(Q_r\) and \(P\). Moreover, \(\boldsymbol{E}^r(Q_r)\) can be expressed in terms of the incident field \(\boldsymbol{E}^i\):

\[\boldsymbol{E}^r(Q_r) = \boldsymbol{E}^i(Q_r) \cdot \boldsymbol{R}\]

where \(\boldsymbol{R}\) is the dyadic matrix with the reflection coefficients.

The fundamentals of UTD are also described in [11], where Chapter 6 (p. 263) covers three-dimensional wedge diffraction. A similar expression can be obtained to express the diffraction field as a function of the incident field [11, eq. 6.13, p. 268]:

\[\boldsymbol{E}^d(P) = \boldsymbol{E}^d(Q_d) \sqrt{\frac{\rho^d}{\left(\rho_1^d+s^d\right)\left(\rho_2^r+s^r\right)}} e^{-jks^d},\]

where \(P\) is the observation point and \(Q_d\) is the diffraction point on the edge, \(\rho^d\) is the edge caustic distance, \(k\) is the wavenumber, and \(s_d\) is the distance between \(Q_r\) and \(P\). Moreover, \(\boldsymbol{E}^d(Q_d)\) can be expressed in terms of the incident field \(\boldsymbol{E}^i\):

\[\boldsymbol{E}^d(Q_d) = \boldsymbol{E}^i(Q_d) \cdot \boldsymbol{D}\]

where \(\boldsymbol{D}\) is the dyadic matrix with the diffraction coefficients.

fresnel_coefficients(n_r, cos_theta_i)

Compute the Fresnel reflection and refraction coefficients at an interface.

reflection_coefficients(n_r, cos_theta_i)

Compute the Fresnel reflection coefficients at an interface.

refraction_coefficients(n_r, cos_theta_i)

Compute the Fresnel refraction coefficients at an interface.

refractive_indices(epsilon_r[, mu_r])

Compute the refractive indices corresponding to relative permittivities and relative permeabilities.

Antennas

The following antenna classes are defined to work in vacuum. If you want to use those classes in another medium, you can do so by multiplying the output fields by relative permeabilities and permittivities, when relevant.

BaseAntenna(frequency, *[, center])

An antenna class, base class for Antenna and RadiationPattern.

Antenna(frequency, *[, center])

An antenna class, must be subclassed.

Dipole(frequency[, num_wavelengths, length, ...])

A simple electrical (or Hertzian) dipole.

Materials

We provide a basic class to represent radio materials, and a mapping containing some common materials (e.g., ITU-R materials).

Material(name, properties[, thickness, aliases])

A class representing a material and it electrical properties.

materials

A dictionary mapping material names and corresponding object instances.

Types of interaction (reflection, diffraction, etc.) within a path are identified by different numbers, which are listed in an enum class.

InteractionType(*values)

Enumeration of interaction types.

Utilities

Utility functions, mostly used internally for computing EM fields.

fspl(d, f, *[, dB])

Compute the free-space path loss (FSPL), optionally in dB.

lengths_to_delays(lengths[, speed])

Compute the delay, in seconds, corresponding to each length.

path_delays(paths, **kwargs)

Compute the path delay, in seconds, of each path.

poynting_vector(e, b)

Compute the Poynting vector in vacuum from electric \(\vec{E}\) and magnetic \(\vec{B}\) fields.

sp_directions(k_i, k_r, normals)

Compute the directions of the local s and p components, before and after reflection, relative to the propagation direction and a local normal.

sp_rotation_matrix(e_a_s, e_a_p, e_b_s, e_b_p)

Return the rotation matrix to convert the s and p components from one base to another.

F(z)

Evaluate the transition function at the given points.

L_i(s_d, sin_2_beta_0[, rho_1_i, rho_2_i, ...])

Compute the distance parameter associated with the incident shadow boundaries.

Work in progress

The following utilities are still under development, and using them is not recommended.

diffraction_coefficients(*_args)

Compute the diffraction coefficients based on the Uniform Theory of Diffraction.

transition_matrices(vertices, objects, ...)

Compute the transition matrix, ...

ShortDipole(frequency[, num_wavelengths, ...])

Short dipole.

RadiationPattern(frequency, *[, center])

An antenna radiation pattern class, must be subclassed.

HWDipolePattern(frequency, direction, *[, ...])

An half-wave dipole radiation pattern.

ShortDipolePattern(frequency, direction, *)

An short dipole radiation pattern.