differt.em.utd module

Contents

differt.em.utd module#

Uniform Theory of Diffraction (UTD) utilities.

The foundamentals of UTD are described in [MPM90].

F(z)[source]#

Evaluate the transition function [MPM90, p. 184] at the given points.

The transition function is defined as follows:

\[F(z) = 2j \sqrt{z} e^{j z} \int\limits_\sqrt{z}^\infty e^{-j u^2} \text{d}u,\]

where \(j^2 = -1\).

As detailed in [MPM90, p. 164], the integral can be expressed in terms of Fresnel integrals (\(C(z)\) and \(S(z)\)), so that:

\[C(z) - j S(z) = \int\limits_\sqrt{z}^\infty e^{-j u^2} \text{d}u.\]

Because JAX does not provide a XLA implementation of scipy.special.fresnel, this implementation relies on a custom complex-valued implementation of the error function and the fact that:

\[C(z) - j S(z) = \sqrt{\frac{\pi}{2}}\frac{1-j}{2}\text{erf}\left(\frac{1+j}{\sqrt{2}}z\right).\]

As a result, we can further simplify \(F(z)\) to:

\[F(z) = \sqrt{\frac{\pi}{2}} \sqrt{z} e^{j z} (1 - j) \text{erfc}\left(\frac{1+j}{\sqrt{2}}z\right),\]

where \(\text{erfc}\) is the complementary error function.

Parameters:

z (Inexact[Array, '*batch']) – The array of real or complex points to evaluate.

Return type:

Complex[Array, '*batch']

Returns:

The values of the transition function at the given point.

Examples

The following example reproduces the same plot as in [MPM90, fig. 4.16].

>>> from differt.em.utd import F
>>>
>>> x = jnp.logspace(-3, 1, 100)
>>> y = F(x)
>>>
>>> A = jnp.abs(y)  # Amplitude of F(x)
>>> P = jnp.angle(y, deg=True)  # Phase (in deg.) of F(x)
>>>
>>> fig, ax1 = plt.subplots()
>>>
>>> ax1.semilogx(x, A)  
>>> ax1.set_xlabel("$x$")  
>>> ax1.set_ylabel("Magnitude - solid line")  
>>> ax2 = plt.twinx()
>>> ax2.semilogx(x, P, "--")  
>>> ax2.set_ylabel("Phase (°) - dashed line")  
>>> plt.tight_layout()  
../_images/differt-em-utd-1.png