# Uniform Theory of Diffraction: how to compute the transition function

In the Uniform Theory of Diffraction (UTD), diffraction coefficients require evaluating a transition function, \(F(x)\), who has no closed form. However, we will see that its evaluation can be done quite easily with modern scientific libraries.

## Context

In 1990, McNamara et al. published *Introduction to the Uniform Geometrical Theory of Diffraction* (McNamara et al., 1990) in which they describe with details how to apply the UTD and how to compute its coefficients. I will not go into details here, but one of the pillars of the UTD is the use of a so-called *transition function*, whose expression is given by

with \(j^2 = -1\) (see Page 184).

On the same page, the authors propose approximations for \(F(x)\) for \(x \le 0.3 \) and \(x \ge 5.5 \), saying we could interpolate when \(0.3 \lt x \lt 5.5 \).

However, with modern scientific libraries, we should be able to avoid these approximations and take a more generic approach.

### Link to Fresnel integral

As mentioned in the book, the integral part in the transition function resembles a Fresnel integral

\[\int\limits_0^\infty e^{-j u^2} \text{d}u = \sqrt{\frac{\pi}{2}} \frac{1 - j}{2}.\]Then, \(F(x)\) can be rewritten as

\[F(x) = 2j \sqrt{x} e^{j x} \Big( \underbrace{\int\limits_0^\infty e^{-j u^2} \text{d}u}_{\sqrt{\frac{\pi}{2}} \frac{1 - j}{2}} - \int\limits_0^\sqrt{x} e^{-j u^2} \text{d}u\Big).\]Finally, using Euler’s formula, we can further expand

\[\int\limits_0^\sqrt{x} e^{-j u^2} \text{d}u = \int\limits_0^\sqrt{x} \cos(u^2) -j\sin(u^2) \text{d}u = \underbrace{\int\limits_0^\sqrt{x} \cos(u^2)\text{d}u}_{C(\sqrt{x})} - j \underbrace{\int\limits_0^\sqrt{x} \sin(u^2)\text{d}u}_{S(\sqrt{x})},\]where \(C(x)\) and \(S(x)\) are also Fresnel integrals, available in many (free) scientific libraries, such as in `scipy.special.fresnel`

. If one cannot find an implementation of those functions, it is worth mentioning that \(C(x)\) and \(S(x)\) can be expressed using the error function, which is very likely to be freely available in most programming languages.

### Transition function via Fresnel integrals

As a summary, \(F(x)\) can be rewritten as

\[2j \sqrt{x} e^{j x} \Big( \sqrt{\frac{\pi}{2}} \frac{1 - j}{2} - C(\sqrt{x}) + j S(\sqrt{x})\Big).\]## Implementation

Here, I will detail how one can implement the transition function in a few lines with Python, using the very popular open source packages NumPy and SciPy.

The advantage of using those libraries is that they allow for both scalar and vector inputs, and handle both real and complex numbers.

Finally, the plotting will be performed by matplotlib, another very popular open source package.

**Note:** SciPy defines \(C(x)\) and \(S(x)\) integrals using \(\frac{\pi}{2}u^2\) instead of \(u^2\). As such, the result of the integrals must be multiplied by some **factor** (\(\sqrt{\frac{\pi}{2}}\)) and the argument of \(C(\sqrt{x})\) and \(S(\sqrt{x})\) must be divided by this factor.

1
2
3
4
5

# Package imports
import numpy as np
import scipy.special as sc
from plotting import pyplot as plt

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

# Transition function
def F(x):
factor = np.sqrt(np.pi / 2)
sqrtx = np.sqrt(x)
S, C = sc.fresnel(sqrtx / factor)
return (
2j
* sqrtx
* np.exp(1j * x)
* (factor * ((1 - 1j) / 2 - C + 1j * S))
# We changed the parenthesis so that
# \sqrt{pi/2} now multiplies C and S
)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

# Plotting
x = np.logspace(-3, 1, 100)
y = F(x)
A = np.abs(y) # Amplitude of F(x)
P = np.angle(y, deg=True) # Phase (in deg.) of F(x)
fig, ax1 = plt.subplots(figsize=(10, 6.5))
ax1.semilogx(x, A, "k-")
ax1.set_ylabel("Magnitude - solid line")
ax2 = plt.twinx()
ax2.semilogx(x, P, "k--")
ax2.set_ylabel("Phase (°) - dashed line");

As a verification, we obtain the same results as in the reference book (McNamara et al., 1990, fig. 4.16).

## References

- McNamara, D., Pistorius, C., & Malherbe, J. (1990).
*Introduction to the Uniform Geometrical Theory of Diffraction*. Artech House.