Skip to content

Radar waves and an aircraft: the echo, and a coating that hides it

FEM aircraft_radar_scattering.py

A radar sends a wave at an aircraft and listens for what comes back. How much comes back, the echo width, decides whether the aircraft is seen. A plane wave scatters off a small jet in plan view, and a thin absorbing coating along the outline is designed by gradient descent through the finite-element solve to cut the echo near the nose. The cell that makes such a coating is the absorber cell tutorial.

Two panels of the radar wave around the jet over one period. Left: the bare conductor, with a strong interference lattice in front of the wings. Right: the jet with the designed coating, where the incoming wave keeps a clean pattern and little is reflected.

The radar wave, travelling towards the nose, over one period. Left: a perfectly conducting jet reflects it into a standing-wave lattice. Right: the jet with the designed coating.

This is a scaled model: the jet is 9 wavelengths long, and the problem is two-dimensional, with the electric field normal to the page (TM).

Left: a polar plot of the echo width in dB over all directions for the bare conductor, a uniform coating and the designed coating, with the radar on the left. Right: the monostatic echo width in dB against the radar direction from nose-on to 60 degrees, the design sector shaded.

Left: the echo width over all directions for a radar at the nose. Right: the echo back to the radar against its direction; the shaded sector is what the design was asked to hide.

The problem

The scattered field \(u_s\) obeys the Helmholtz equation, with a stretch \(S\) that turns the outer frame into a perfectly matched layer, and the jet's surface carries the impedance (Leontovich) condition with admittance \(y\):

\[-\nabla\cdot(S\nabla u_s) - k^2\det(S)\,u_s = 0,\qquad \partial_n E = ik\,y\,E\ \text{on the surface},\qquad E = u_s + e^{ik\,\mathbf e\cdot\mathbf x} .\]

\(y\to\infty\) is a perfect conductor, and a passive coating has \(\mathrm{Re}\,y\ge0\). The coating cell gives \(y=1/\rho+i\cot(kd)\) for a sheet resistance \(\rho\) and a spacer \(d\). The design minimises the echo back to the radar, in dB, averaged over three radar directions (0°, 15°, 30°):

\[\min_\theta\ \frac13\sum_{a}10\log_{10}\sigma(a;\,y_\theta),\qquad \sigma = \frac{|I|^2}{4k},\]

with \(I\) the far field, a weighted integral of \(u_s\) over a ring around the jet. The optical theorem gives the power taken from the incident wave from the forward far field alone, \(-\mathrm{Im}\,I_0/k\).

The jNO code

The jet is three polygons joined into one outline:

aircraft = lambda h: polygon(fuselage, h) | polygon(wings, h) | polygon(tail, h)  # one outline

The scattering problem for any radar direction and any admittance, a number or a function of position:

def scatter(angle, y_s):
    """FEM problem for the scattered field; the surface admittance ``y_s`` is a number or a function y_s(xb, yb)."""
    adm = y_s(xb, yb) if callable(y_s) else y_s
    inc, dinc = incident(angle)
    weak = (Sy / Sx) * ui.x * vi.x + (Sx / Sy) * ui.y * vi.y - K**2 * Sx * Sy * ui * vi
    surface = -(1j * K * adm * us + (1j * K * adm * inc - dinc)) * vs  # dE_s/dn = ik y E_s + (ik y E_i - dE_i/dn)
    return jno.fem([weak, surface, u(*frame) - 0.0], quad_degree=4)

The coating as a design field. Two small networks of the position give \(\rho\) and \(d\) along the outline, so the coating is smooth, symmetric, and passive for any weights (\(\mathrm{Re}\,y=1/\rho>0\)):

nets = [jno.nn(foundax.mlp(in_features=2, hidden_dims=24, num_layers=3, key=jax.random.PRNGKey(i))) for i in (0, 1)]
cell = lambda xb, yb: (  # (rho, d) at a point of the outline; the design is mirror-symmetric, so the nets see |y|
    jno.np.exp(1.5 * jno.np.tanh(0.25 * nets[0](xb / 5, jno.np.abs(yb) / 5))),  # rho in [0.22, 4.5] eta0
    0.05 + 0.2 * (1 + jno.np.tanh(0.25 * nets[1](xb / 5, jno.np.abs(yb) / 5))),  # d in [0.05, 0.45] lambda
)

The objective differentiates through three finite-element solves and the far-field integral:

fems = [design.scatter(a, admittance) for a in SECTOR]
sigma = [echo((design.u * design.far(a + np.pi)).integrate(f)) for a, f in zip(SECTOR, fems)]  # monostatic echo width
backscatter_dB = sum(10 * jno.np.log(s) / np.log(10) for s in sigma) / len(sigma)
crux = jno.core([backscatter_dB.name("backscatter_dB")])

Result

check result
cylinder, conductor and coated, against the Bessel–Hankel series: field / echo width \(1.7\times10^{-3}\) / \(1.6\times10^{-3}\)
bare jet: scattered width against extinction 15.47 / 15.47
uniform coating: extinction − scattered against absorbed \(\int\mathrm{Re}\,y\,\lvert E\rvert^2\) 7.431 / 7.430
designed coating: the same 7.036 / 7.036

The designed coating drawn along the outline of the jet: left, the sheet resistance in ohms per square, highest at the nose; right, the spacer thickness in wavelengths, thinnest at the nose.

The designed coating: highest sheet resistance and thinnest spacer at the nose, where the radar looks first.

The coating forming over the 30 optimiser iterations on the coarse mesh: sheet resistance on the left, spacer thickness on the right.

The echo back to the radar, averaged over the design sector (0° to 30°):

surface mean echo width (dB re wavelength)
bare conductor −6.1
uniform Salisbury coating (\(y=1\)) −19.3
designed coating −25.8

Outside the sector the design loses its edge: at 45° the uniform coating is better. The optimiser improved the directions it was asked about.

Full script

The whole script, as it runs in the tests
"""Radar waves scattering off an aircraft, and a coating designed to hide it: a 2-D scaled model, 9 wavelengths long.

A plane wave of unit amplitude (E along z, the TM case) meets the aircraft in plan view. The field u solves the
Helmholtz equation  -div(S grad u) - k^2 det(S) u = 0  with a perfectly matched layer S around the sky. The
aircraft surface carries the impedance condition  dE/dn = i k y E  (y = eta0 / Z_s is the surface admittance, y -> oo
a perfect conductor); a passive coating has Re y >= 0. Lengths are in wavelengths (k = 2 pi), impedances in eta0.
The far field is read off the computed field with a weighted volume integral, the echo width sigma(phi) from it.
"""

from types import SimpleNamespace

import foundax
import jax
import numpy as np
import optax
import scipy.special as sp

import jno

jax.config.update("jax_enable_x64", True)  # the real-equivalent block of a complex solve is float64
run = jno.setup(__file__)
K, LH, W = 2 * np.pi, 6.0, 1.0  # wavenumber; half-width of the clear sky, width of the PML
C0, RA, RB = 0.2, 5.0, 5.8  # far-field ring: centre, and the radii where the weight is 1 and where it is 0
Y_PEC = 1e6  # perfect conductor: the limit y -> oo of the impedance condition
relu = lambda z: jno.np.maximum(z, 0.0)
inside = lambda x, y: (abs(x) < LH + W - 1e-6) & (abs(y) < LH + W - 1e-6)  # not on the outer frame

# --- the aircraft: fuselage, swept wings and tailplane, nose to the left (the outline numbers are the input) ---
t = np.linspace(0, 1, 41)[1:-1]
half = 0.55 * np.sin(np.pi * t**0.75) ** 0.8 * (1 - 0.35 * t**3)  # fuselage half-width: pointed nose and tail
fuselage = np.r_[[[-4.5, 0]], np.c_[-4.5 + 9 * t, half], [[4.5, 0]], np.c_[4.5 - 9 * t[::-1], -half[::-1]]]
wings = [(-0.8, 0.3), (2.3, 3.7), (3.0, 3.7), (2.6, 0.3), (2.6, -0.3), (3.0, -3.7), (2.3, -3.7), (-0.8, -0.3)]
tail = [(2.9, 0.3), (4.3, 1.9), (4.5, 1.9), (4.4, 0.3), (4.4, -0.3), (4.5, -1.9), (4.3, -1.9), (2.9, -0.3)]
polygon = lambda pts, h: jno.shape.polygon(pts, size=h)
aircraft = lambda h: polygon(fuselage, h) | polygon(wings, h) | polygon(tail, h)  # one outline


def radar(body, h_sky, h_body):
    """The scattering problem around ``body``, as the functions that build and read one solve."""
    d = (jno.shape.rect(-LH - W, -LH - W, LH + W, LH + W, size=h_sky) - body).domain()
    x, y, _ = d.variable("interior", split=True)
    xb, yb, _, nx, ny = d.variable("body", where=inside, normals=True, split=True)  # normals point into the body
    frame = d.variable("frame", where=lambda x, y: ~inside(x, y), split=True)
    u = d.unknown.scalar(order=2)  # quadratic elements
    v = u.test()
    ui, vi, us, vs = u.bind(x=x, y=y), v.bind(x=x, y=y), u.bind(x=xb, y=yb), v.bind(x=xb, y=yb)
    Sx, Sy = (1 + 3j * (relu(t - LH) ** 2 + relu(-t - LH) ** 2) / W**2 for t in (x, y))  # PML stretch 1 + i sigma / k
    r = jno.np.sqrt((x - C0) ** 2 + y**2)

    def incident(angle):  # the plane wave travelling along `angle`, and its normal derivative, on the body
        e = (np.cos(angle), np.sin(angle))
        inc = jno.np.exp(1j * K * (e[0] * xb + e[1] * yb))
        return inc, 1j * K * (e[0] * nx + e[1] * ny) * inc

    def scatter(angle, y_s):
        """FEM problem for the scattered field; the surface admittance ``y_s`` is a number or a function y_s(xb, yb)."""
        adm = y_s(xb, yb) if callable(y_s) else y_s
        inc, dinc = incident(angle)
        weak = (Sy / Sx) * ui.x * vi.x + (Sx / Sy) * ui.y * vi.y - K**2 * Sx * Sy * ui * vi
        surface = -(1j * K * adm * us + (1j * K * adm * inc - dinc)) * vs  # dE_s/dn = ik y E_s + (ik y E_i - dE_i/dn)
        return jno.fem([weak, surface, u(*frame) - 0.0], quad_degree=4)

    def far(phi):
        """Weight w with  I(phi) = integral of u_s w dV  over the ring RA < r < RB: the far field in direction phi."""
        p = (np.cos(phi), np.sin(phi))
        s = jno.np.minimum(relu((RB - r) / (RB - RA)), 1.0)  # smooth step chi: 1 inside RA, 0 outside RB
        dchi, ddchi = -30 * s**2 * (1 - s) ** 2 / (RB - RA), 60 * s * (1 - s) * (1 - 2 * s) / (RB - RA) ** 2
        phase = jno.np.exp(-1j * K * (p[0] * x + p[1] * y))
        return phase * (
            -2j * K * dchi * ((x - C0) * p[0] + y * p[1]) / r + ddchi + dchi / r
        )  # (2 grad chi . grad + lap chi) e^{-ik p.x}

    def absorbed(angle, y_s):  # the power taken by the surface per unit incident intensity: integral of Re(y)|E|^2 ds
        adm = y_s(xb, yb) if callable(y_s) else y_s
        return adm.real * jno.np.abs(us + incident(angle)[0]) ** 2

    return SimpleNamespace(
        u=ui, xb=xb, yb=yb, scatter=scatter, far=far, absorbed=absorbed,
        I=lambda fem, field, phis: np.array([complex(np.asarray(fem.eval(ui * far(p), field))) for p in np.atleast_1d(phis)]),
    )  # fmt: skip


echo = lambda f: (f.real**2 + f.imag**2) / (4 * K)  # echo width sigma(phi) from the far-field integral
extinction = lambda I0: -I0.imag / K  # optical theorem: power removed from the incident wave
lu = jno.solve.lu()
solve = lambda fem: np.asarray(fem.solve(linear=lu))


# --- check 1: cylinders (a perfect conductor and a coated one) against the exact Bessel-Hankel series ---
def cylinder(y_s, n=np.arange(60)):  # u_s = sum a_n H_n(kr) cos(n phi), E_z along the cylinder of radius 1
    j, dj, h, dh = (f(n, K) for f in (sp.jv, sp.jvp, sp.hankel1, sp.h1vp))
    a = -np.where(n == 0, 1, 2) * 1j**n * (dj + 1j * y_s * j) / (dh + 1j * y_s * h)
    field = lambda r, phi: (a * sp.hankel1(n, K * r[:, None]) * np.cos(n * phi[:, None])).sum(1)
    pattern = lambda phi: 4 / K * abs((a * (-1j) ** n * np.cos(n * phi[:, None])).sum(1)) ** 2  # sigma(phi)
    return field, pattern


pipe = radar(jno.shape.disk(0, 0, 1.0, size=0.05), 0.15, 0.05)
phis = np.linspace(0, 2 * np.pi, 72, endpoint=False)
for y_s in (Y_PEC, 0.8 + 0.6j):
    fem = pipe.scatter(0.0, y_s)
    u_c, pts = solve(fem), np.asarray(fem.points)
    r, th = np.hypot(*pts.T), np.arctan2(pts[:, 1], pts[:, 0])
    near = (r > 1.01) & (r < LH - 0.3)  # the sky between the cylinder and the PML
    field, pattern = cylinder(y_s)
    err_field = np.linalg.norm(u_c[near] - field(r[near], th[near])) / np.linalg.norm(field(r[near], th[near]))
    err_echo = abs(echo(pipe.I(fem, u_c, phis)) - pattern(phis)).max() / pattern(phis).max()
    print(f"cylinder, y = {y_s}: field error {err_field:.1e}, echo width error (relative to its peak) {err_echo:.1e}")
    assert err_field < 1e-2 and err_echo < 1e-2

# --- the bare aircraft: scattered and total fields, echo width over all angles, energy balance ---
H_SKY, H_BODY, ITERATIONS = 0.15, 0.06, 30
sky = radar(aircraft(H_BODY), H_SKY, H_BODY)
phis = np.linspace(0, 2 * np.pi, 180, endpoint=False)
bare = sky.scatter(0.0, Y_PEC)  # radar waves travelling along +x meet the nose
u_bare = solve(bare)
I_bare = sky.I(bare, u_bare, phis)
sigma_scattered, sigma_ext = np.mean(echo(I_bare)), extinction(I_bare[0])
print(
    f"aircraft: {bare.dofs} dofs, nose-on backscatter {echo(I_bare)[90]:.3f}, scattered width {sigma_scattered:.2f}, extinction {sigma_ext:.2f}"
)
assert abs(sigma_ext - sigma_scattered) < 0.02 * sigma_ext  # a perfect conductor absorbs nothing: scattered = extinct

# --- a uniform Salisbury coating: sheet resistance eta0 a quarter wave above the metal, y = 1 + i cot(k d) = 1 ---
uniform = sky.scatter(0.0, 1.0)
u_uniform = solve(uniform)
I_uniform = sky.I(uniform, u_uniform, phis)
sigma_absorbed = float(np.asarray(uniform.eval(sky.absorbed(0.0, 1.0), u_uniform)).real)
print(
    f"uniform coating: backscatter {echo(I_uniform)[90]:.4f}; extinction - scattered {extinction(I_uniform[0]) - np.mean(echo(I_uniform)):.3f}, absorbed {sigma_absorbed:.3f}"
)
assert abs(extinction(I_uniform[0]) - np.mean(echo(I_uniform)) - sigma_absorbed) < 0.03 * sigma_absorbed  # energy balance

# --- the coating as a design field along the outline: a Salisbury cell, sheet resistance rho and spacer d, at each point ---
nets = [jno.nn(foundax.mlp(in_features=2, hidden_dims=24, num_layers=3, key=jax.random.PRNGKey(i))) for i in (0, 1)]
cell = lambda xb, yb: (  # (rho, d) at a point of the outline; the design is mirror-symmetric, so the nets see |y|
    jno.np.exp(1.5 * jno.np.tanh(0.25 * nets[0](xb / 5, jno.np.abs(yb) / 5))),  # rho in [0.22, 4.5] eta0
    0.05 + 0.2 * (1 + jno.np.tanh(0.25 * nets[1](xb / 5, jno.np.abs(yb) / 5))),  # d in [0.05, 0.45] lambda
)
admittance = lambda xb, yb: (lambda rho, d: 1 / rho + 1j / jno.np.tan(K * d))(
    *cell(xb, yb)
)  # y = 1/rho + i cot(k d): Re y > 0

# the design problem: the same sky on a coarser mesh; the radar directions to hide are nose-on +-30 degrees
design = radar(aircraft(0.08), 0.2, 0.08)
SECTOR = np.deg2rad([0.0, 15.0, 30.0])  # the aircraft is mirror-symmetric, and so is the design
fems = [design.scatter(a, admittance) for a in SECTOR]
sigma = [echo((design.u * design.far(a + np.pi)).integrate(f)) for a, f in zip(SECTOR, fems)]  # monostatic echo width
backscatter_dB = sum(10 * jno.np.log(s) / np.log(10) for s in sigma) / len(sigma)
for net in nets:
    net.optimizer(optax.adam(optax.exponential_decay(5e-2, 12, 0.6)))
crux = jno.core([backscatter_dB.name("backscatter_dB")])
rho, spacer = cell(design.xb, design.yb)
designs = []
for _ in range(ITERATIONS):
    crux.solve(1, log=False)
    designs.append(np.asarray(crux.eval([rho, spacer])))

# --- the designed coating on the finer mesh: fields, echo width over all angles, energy balance ---
designed = sky.scatter(0.0, admittance)
u_designed = np.asarray(crux.eval([designed.solve()]))
I_designed = sky.I(designed, u_designed, phis)
sigma_absorbed = float(np.asarray(crux.eval([sky.absorbed(0.0, admittance).integrate(designed)])).real)
print(
    f"designed coating: backscatter {echo(I_designed)[90]:.5f}; extinction - scattered {extinction(I_designed[0]) - np.mean(echo(I_designed)):.3f}, absorbed {sigma_absorbed:.3f}"
)
assert abs(extinction(I_designed[0]) - np.mean(echo(I_designed)) - sigma_absorbed) < 0.03 * sigma_absorbed
rho_final, spacer_final, xb_final, yb_final = (np.ravel(a) for a in crux.eval([*cell(sky.xb, sky.yb), sky.xb, sky.yb]))
assert (1 / rho_final).min() > 0  # passive by construction: Re y = 1/rho > 0 for any weights

# --- the monostatic echo width of the three coatings, radar direction swept from nose-on to 60 degrees off ---
sweep = np.deg2rad(np.arange(0, 61, 5))
mono = {name: [] for name in ("bare", "uniform", "designed")}
for a in sweep:
    for name, y_s in (("bare", Y_PEC), ("uniform", 1.0), ("designed", admittance)):
        fem = sky.scatter(a, y_s)
        field = np.asarray(crux.eval([fem.solve()])) if callable(y_s) else solve(fem)
        mono[name].append(echo(sky.I(fem, field, a + np.pi))[0])
mono = {name: np.array(v) for name, v in mono.items()}
mean_dB = {name: np.mean(10 * np.log10(v[sweep <= np.deg2rad(30)])) for name, v in mono.items()}  # over the sector
print(
    "mean monostatic echo width over nose-on +-30 deg (dB re wavelength): "
    + ", ".join(f"{n} {v:.1f}" for n, v in mean_dB.items())
)
assert mean_dB["designed"] < mean_dB["uniform"] < mean_dB["bare"]  # the design beats the textbook coating