Волны H-поляризации

Ядро PlanarRT_H (в диссертации — Tamic Rt-H) рассчитывает во временной области волны H-поляризации в области с произвольным распределением диэлектрической проницаемости. На этой странице выведена схема узла Rτ-сетки, формула, по которой ядро пересчитывает напряжения узлов на каждом такте, и показано, как в узел заносится вещество. Основа — Rτ-схема элемента пространства со страницы о методе. Как это устроено в программе — Счётное ядро H.

Постановка

Рассматривается двумерная задача: геометрия и поля не зависят от координаты z. У волн H-поляризации отличны от нуля компоненты Ez, Hx, Hy (Hz=0, Ex=Ey=0), т. е. электрическое поле перпендикулярно плоскости расчёта, а магнитное лежит в ней. Так описываются, например, H-плоскостные волноводные устройства — волна H10 прямоугольного волновода в плоскости вектора H→ [Климов, 2007, рис. 9.8]. Для монохроматической волны уравнения Максвелла сводятся к (2.4) и уравнению Гельмгольца [Климов, 2025, (2.4), (2.5)]:

(∂2∂x2+∂2∂y2+k2)Ez=0,k2=ω2εaμa.(1)

Задача ядра: по заданным сигналам на портах найти во времени напряжения всех узлов сетки U=EzΔz и сигналы, отражённые и прошедшие на порты. Среда задаётся распределением ε(x,y); магнитная проницаемость в ядре H равна μ0 (алгоритмы для магнитного заполнения — в разделе Магнитная проницаемость). Границы — металл, магнитная стенка, поглотитель (граничные условия), возбуждение — через порты (порты).

Схема узла

Если магнитного заполнения нет (μ=μ0), в схеме элемента нет последовательных шлейфов, и после объединения четырёх параллельных шлейфов, подходящих к узлу, получается сетка, в которой каждый узел — параллельное соединение [Климов, 2025, разд. 4.1, рис. 4.3, 4.4]:

  • четырёх отрезков линий к соседним узлам 1–4 с волновыми проводимостями Y1…Y4 и задержкой τ0;
  • одного шлейфа с волновой проводимостью Y5 и задержкой τ0/2 — холостого хода (ХХ) при ε¯>ε0 или короткого замыкания (КЗ) при ε¯<ε0;
  • активной проводимости Y (потери; во внутренних узлах Y=0).
                       2  (сосед сверху)
                       │
                       │ Y2, τ0
                       │        шлейф Y5, τ0/2 (ХХ или КЗ)
   1 ───────── Y1, τ0 ─●─ Y3, τ0 ───────── 3
  (сосед слева)        │╲                  (сосед справа)
                       │ Y  (потери)
                       │ Y4, τ0
                       │
                       4  (сосед снизу)

Характер шлейфа и его проводимость определяются средней проницаемостью четырёх ячеек вокруг узла ε¯ (сетка) [Климов, 2025, (4.3), (4.4)]:

Y5=4Y0ε¯−ε0ε0(ε¯>ε0, ХХ),Y5=Y0(ωτ0)2ε0−ε¯ε0(ε¯<ε0, КЗ).(2)

Когда все линии сетки одинаковы (Yi=Y0), удобно перейти к нормированным величинам y5=Y5/Y0, y=Y/Y0.

В программе тип шлейфа хранится знаком: y5>0 — шлейф ХХ, y5<0 — шлейф КЗ (y5=Δε(ωτ0)2 с отрицательной Δε). Тогда обе ветви алгоритма записываются одной формулой с |y5| в знаменателе (рассеяние). На узел хранятся четыре числа: два напряжения и два коэффициента:

Ячейка Содержимое
prUNode1[2n], prUNode1[2n+1] напряжение узла n на двух последних тактах
prYNode[2n] y5 со знаком
prYNode[2n+1] множитель 2/(4+|y5|)

Это ровно тот набор, который назван в [Климов, 2025, разд. 4.1]: «кроме хранения значений напряжений за два предыдущих временных такта необходимо хранить значения ±y5 и 2/(4+y5), то есть расход памяти составляет четыре вещественных числа на каждый узел сетки».

Рассеяние в узле

Пусть Uτ, Uτ−1, Uτ−2 — напряжения центрального узла 0 в моменты τ, τ−τ0, τ−2τ0, а Uiτ−1 — напряжения соседних узлов в момент τ−τ0. Напряжение узла через падающие на него волны UPiτ со стороны входов i=1…5 [Климов, 2025, (4.10)]:

Uτ=2(Y1UP1τ+Y2UP2τ+Y3UP3τ+Y4UP4τ+Y5UP5τ)Y1+Y2+Y3+Y4+Y5+Y.(3)

То же выражение для момента τ−2τ0, переписанное через отражённые волны UOiτ−2=Uτ−2−UPiτ−2, даёт [Климов, 2025, (4.13)]

Uτ−2=2(Y1UO1τ−2+…+Y5UO5τ−2)Y1+Y2+Y3+Y4+Y5−Y.(4)

Падающие волны выражаются через напряжения соседей и отражённые волны (обмен волнами). Подставив их и исключив отражённые волны с помощью (4.13), получают формулу, в которую входят только напряжения узлов [Климов, 2025, (4.16)–(4.19)]:

Uτ=2(Y1U1τ−1+Y2U2τ−1+Y3U3τ−1+Y4U4τ−1±Y5Uτ−1+YUτ−2)Y1+Y2+Y3+Y4+Y5+Y−Uτ−2,(5)

где «+» перед Y5 — шлейф ХХ (ε¯>ε0), «−» — шлейф КЗ (ε¯<ε0). При одинаковых линиях Yi=Y0 [Климов, 2025, (4.20)]

Uτ=24+y5+y(U1τ−1+U2τ−1+U3τ−1+U4τ−1±y5Uτ−1+yUτ−2)−Uτ−2,(6)

и без потерь (y=0) [Климов, 2025, (4.21)]

Uτ=24+y5(U1τ−1+U2τ−1+U3τ−1+U4τ−1±y5Uτ−1)−Uτ−2.(7)

Алгоритм называется двухпараметрическим: для нового такта нужны значения напряжений за два предыдущих такта. На один узел и один такт — пять сложений-вычитаний и два умножения.

Формула в программе. Со знаковым y5 формула (4.21) принимает вид

Uτ=24+|y5|(U1τ−1+U2τ−1+U3τ−1+U4τ−1+y5Uτ−1)−Uτ−2,(8)

и в коде это одна строка на узел (подтакт 0, RunScatteringNode1line):

U[2n] = Y[2n+1] * ( U[2n-1] + U[2n+3] + U[2n+1-2nX] + U[2n+1+2nX] + Y[2n]*U[2n+1] ) - U[2n]

Здесь U — массив prUNode1, Y — prYNode; U[2n-1] и U[2n+3] — нечётные ячейки соседей слева и справа, U[2n+1-2nX] и U[2n+1+2nX] — соседей снизу и сверху, U[2n+1] — самого узла, все на такте τ−1; U[2n] справа — Uτ−2 самого узла, слева — новое Uτ. Внутренние узлы (ix=1…nX−2, iy=1…nY−2) обходятся построчно и парами. Крайние узлы области не пересчитываются (края области).

Обмен волнами между узлами

Узлы соединены отрезками линий с задержкой τ0. Волна, отражённая от узла i в сторону узла 0 в момент τ−τ0, приходит в узел 0 в момент τ как падающая [Климов, 2025, (4.14)]:

UPiτ=UiOτ−1=Uiτ−1−UiPτ−1=Uiτ−1−UOiτ−2,i=1…4,(9)

где UiOτ−1, UiPτ−1 — отражённая от узла i к узлу 0 и падающая на узел i от узла 0 волны, а UOiτ−2 — волна, отражённая от узла 0 к узлу i на такт раньше.

Шлейф имеет задержку τ0/2: волна, ушедшая в шлейф, возвращается через τ0. На холостом ходе она отражается без смены знака, на коротком замыкании — с изменением фазы на 180° [Климов, 2025, (4.15), (4.17)]:

UP5τ=Uτ−1−UO5τ−2(ХХ),UP5τ=−Uτ−1+UO5τ−2(КЗ).(10)

Именно эта разница знаков даёт «±» перед y5 в формуле узла.

В программе обмен волнами отдельной операцией не выполняется и волны не хранятся: он уже заложен в формулу (рассеяние) через напряжения соседей на прошлом такте и собственное напряжение на позапрошлом. Узлы с другими схемами — порты, поглотители, магнитные стенки — используют ту же идею с половинными линиями вдоль контура и нагрузками (граничные условия, порты).

Подтакты одного шага

Формула узла связывает три временных слоя: Uτ, Uτ−1, Uτ−2. Хранить три массива не нужно: новое значение Uτ записывается на место Uτ−2, которое после этого больше не требуется. Поэтому на узел отводятся две ячейки, и роли ячеек чередуются:

Подтакт Пишется (новое Uτ вместо Uτ−2) Читается (Uτ−1 соседей и узла) Функции
0 чётная ячейка prUNode1[2n] нечётные ячейки RunExciteInputs, RunScatteringNode, RunBlockNode
1 нечётная ячейка prUNode1[2n+1] чётные ячейки RunExciteInputs1, RunScatteringNode1, RunBlockNode1

Каждый подтакт продвигает расчёт на один такт τ0. На подтакте выполняются по порядку:

  1. возбуждение портов и запись сигналов портов в файл .t (порты);
  2. рассеяние во всех внутренних узлах сетки по (4.21);
  3. граничные условия блоков — металл, поглотитель, магнитная стенка (граничные условия);
  4. вывод кадра поля (если включён);
  5. накопление поля для диаграммы направленности (ДН).

Один проход цикла RunKernel1T — два подтакта. Внутри подтакта узлы независимы: каждый пишет только свою ячейку и читает только ячейки другой чётности, поэтому порядок обхода узлов не влияет на результат — это используется при расчёте на видеокарте (GPU). У ядра X схема связывает больше слоёв, и подтактов четыре (подтакты X).

Диэлектрик (eps) и проводимость шлейфа

Задание. Блоки диэлектрика (RECT_STAT, CIRCLE_STAT, POLYGON_STAT, FILE и др.) задают выражение eps, значение которого для ядра H — это добавка к вакууму Δε=ε−1 (относительная проницаемость минус единица). В выражение могут входить координаты узла x, y относительно точки привязки блока, расстояние r и полярный угол f.

Средняя проницаемость узла. В узел заносится w·Δε, где вес w — доля окружающих узел ячеек, лежащих в блоке. Вклады всех блоков складываются, поэтому в узле накапливается

Δε¯=ε¯−ε0ε0=∑блокиwΔε,(11)

что соответствует среднему по четырём ячейкам (4.2) (ячейки вне блоков — вакуум, Δε=0). У прямоугольника вес равен 1 внутри, 0,5 на стороне и 0,25 в углу. У круга, кольцевого сектора и многоугольника в программе вес набирается по 0,25 за каждую из четырёх диагональных точек (x±Δ, y±Δ), попавшую в фигуру. Блок FILE читает из файла .eps уже взвешенные значения.

Перевод в проводимость шлейфа. После построения всех блоков каждое накопленное значение Δε узла переводится в нормированную проводимость шлейфа по (4.3), (4.4) [Климов, 2025]:

y5={4Δε,Δε≥0(шлейф ХХ),[4pt]Δε(ωτ0)2=Δε(k0Δ)22,Δε<0(шлейф КЗ, y5<0),ω=2πFREQ,(12)

и записывается множитель 2/(4+|y5|). Здесь (ωτ0)2=(k0Δ)2/2, так как τ0=Δ/(c2).

Особенности программы:

  • Формулы перевода — приближение ωτ0≪1 точных соотношений (2.43), (2.45), в которых проводимость шлейфа отличается множителем ωτ0/2tg(ωτ0/2) (ХХ) или обратным ему (КЗ). В программе поправочный множитель равен 1: переменная koef1 (ωτ0/2) используется только для проверки ωτ0/2≤π/3 (иначе ошибка «very big Delta*Frequence»), а строка с поправкой koef1/tan(koef1) закомментирована.
  • Значения Δε, отличающиеся от 4 меньше чем на 0,004, сдвигаются до 3,996 или 4,004.
  • Для Δε≥0 проводимость от частоты не зависит; для Δε<0 она пропорциональна квадрату частоты задания FREQ: заданная Δε относится к этой частоте, а на других частотах среда ведёт себя как среда с частотной дисперсией (ниже).
  • При записи топологии выполняется обратный пересчёт: ε=y5/4+1 при y5≥0 и ε=y5/(ωτ0)2+1 при y5<0.
  • Тем же правилом по параметру W порта (это Δε среды входа) вычисляется шлейф узлов порта (параметр W).

Распространение. Для узлов со шлейфом КЗ волны распространяются, пока |y5|<(ωτ0)2, т. е. пока ε>0 (2.49). При ε≤0 волна в такой среде затухает — расчёт при этом устойчив (устойчивость).

Магнитная проницаемость

В программе ядро H моделирует только диэлектрическое заполнение (μ=μ0 во всех узлах). Блок «магнитная стенка» (MAGNETIC) — это граничное условие холостого хода, а не магнитная проницаемость (граничные условия). Ниже кратко изложены алгоритмы для магнитного заполнения, построенные в [Климов, 2025, разд. 4.2–4.4].

Неоднородное магнитное заполнение (ε=ε0, разд. 4.2). В схеме элемента нет параллельных шлейфов, но есть последовательные; напряжения в узлах параллельного соединения линий определять нецелесообразно, и алгоритм строится через токи в узлах последовательного включения шлейфов (узлы 01, 02, 03, 04 на рис. 4.10). Каждый такой узел лежит на середине линии между соседними узлами сетки; шлейф определяется средней проницаемостью двух соседних ячеек μ¯=(μ6+μ10)/2 (4.23):

Z01=2Z0μ¯−μ0μ0(μ¯>μ0, КЗ),Z01=2Z0(ωτ0)2μ0−μ¯μ0(μ¯<μ0, ХХ),(13)

Z0=1/Y0 (4.24), (4.25). Токи вычисляются с шагом τ0, но сдвинуты относительно напряжений на τ0/2. Без магнитных потерь (z=0) при одинаковых линиях [Климов, 2025, (4.73), (4.74)]:

I01τ+3/2=I11τ+1/2−I12τ+1/2−2I01τ+1/2+I14τ+1/2+I02τ+1/2+I03τ+1/2−I04τ+1/22+z01+2I01τ+1/2−I01τ−1/2(μ¯>μ0),(14)

а при μ¯<μ0 к правой части добавляется −4z012+z01I01τ+1/2, z01=Z01Y0. На узел и такт — девять сложений-вычитаний и четыре умножения; хранятся токи за два такта, z01 и 4z01/(2+z01). Алгоритм тоже двухпараметрический и устойчив при любых μ¯, в том числе μ¯≤0. При объединении двух последовательных шлейфов в один сделано допущение об их параллельном соединении; по [Климов, 2025] величина возникающей при этом ошибки требует отдельного исследования.

Модифицированный вариант без магнитных потерь (разд. 4.3) снова вычисляет напряжения узлов параллельного соединения, а для каждого последовательного шлейфа хранит удвоенное напряжение отражённой в шлейф волны [Климов, 2025, (4.90), (4.91)]:

U0τ+1=U1τ−U0τ+2UO31τ−1/22+z01+U2τ−U0τ−2UO32τ−1/22+z02+U3τ−U0τ−2UO33τ−1/22+z03+U4τ−U0τ+2UO34τ−1/22+z04+2U0τ−U0τ−1,(15)
2UO3τ+1/2=2·2UO3τ−1/2−2UO3τ−3/2−4z012+z01(U1τ−U0τ+2UO3τ−1/2),(16)

где UO3kτ−1/2=0 при μ¯>μ0 и UO3kτ−1/2=UO3τ−1/2 при μ¯<μ0 (4.78), (4.79).

Сравнение алгоритмов [Климов, 2025, табл. 4.3] — на один элементарный объём и один такт:

Тип области Хранимые числа Сложения-вычитания Умножения Записи в память
магнитное заполнение с магнитными потерями 10 22 10 2
магнитное заполнение без потерь 8 18 8 2
диэлектрическое заполнение с электрическими потерями 5 6 3 1
диэлектрическое заполнение без потерь 4 5 2 1

Скорость счёта определяется в основном числом записей вещественных чисел в память, поэтому при организации программы важно учитывать, есть ли в задаче диэлектрическое или магнитное заполнение [Климов, 2025, разд. 4.4]. Внутренние узлы ядра H считаются по самому экономному алгоритму — последней строке таблицы.

Среды с частотной дисперсией

Зависимость проницаемостей от частоты делает их интегро-дифференциальными операторами во временной области [Климов, 2025, разд. 2.3, (2.32), (2.33)]. Для плазмы без внешнего магнитного поля (Ω=0) первое уравнение Максвелла принимает вид [Климов, 2025, (2.37)]

∇×H→=Ce0∂E→∂t+1Le−∫E→dt+j→e,Ce0=ε0,Le−=1ωp2Ce0,(17)

что для монохроматических колебаний даёт известную зависимость [Климов, 2025, (2.38)]

ε=ε0(1−ωp2ω2).(18)

Это уравнение тождественно уравнению сетки с индуктивностью L−, которая моделирует εa<ε0 (RLC-схема): «можно сделать вывод об идентичности моделей, которые описываются и импедансными сетками, и плазмой в отсутствие магнитного поля» [Климов, 2025, разд. 2.3].

Что это значит для ядра H. Шлейф КЗ узла с Δε<0 имеет постоянную проводимость y5, т. е. моделирует постоянную индуктивность L− (в приближении ωτ0≪1). Ей соответствует отрицательная добавка к ёмкости, убывающая как 1/ω2. Если в задании на частоте fF=FREQ задана ΔεF<0, то на любой частоте ω сетка ведёт себя как среда

ε(ω)=1+ΔεFωF2ω2=1−ωp2ω2,ωp2=−ΔεFωF2,ωF=2πfF,(19)

т. е. как плазма без внешнего поля с плазменной частотой ωp. Частота FREQ задаёт лишь точку, в которой ε равна заданной; сам расчёт во временной области учитывает дисперсию во всей полосе сигнала. Узлы с Δε≥0 (шлейф ХХ, ёмкость) в том же приближении дисперсии не имеют.

Такая постановка проверена в [Климов, 2007, разд. 9.5.4]: рассеяние переднего фронта радиоимпульса на слое с проницаемостью вида (2.38), равной 0,25 на частоте заполнения 20 ГГц, рассчитанное программой Rt-H, хорошо согласуется с аналитическим решением (точность H).

Аналогично строится среда с магнитной проницаемостью μ=μ0(1−ωF2/ω2) (2.39), (2.40); в ядре H она не реализована. Подмагниченная плазма с тензорной проницаемостью (2.34), (2.35) рассчитывается ядром X — см. учёт частотной зависимости во временной схеме.

Потери

Удельные электрические потери Ye и магнитные потери Rm входят в уравнения [Климов, 2025, (2.28), (2.29)] как проводимость, параллельная ёмкости, и сопротивление, последовательное с индуктивностью. В схеме узла электрические потери — активная проводимость Y, и формула узла с потерями — (4.20) (рассеяние). Положительная проводимость только поглощает энергию и устойчивости не нарушает (устойчивость).

В программе внутренние узлы ядра H считаются без потерь по (4.21); объёмные потери диэлектрика в ядре H не задаются (потери и проводимость среды есть в ядре X — столкновения и проводимость). Активная проводимость в ядре H используется в узлах двух видов:

  • поглотитель — нагрузка y узлов контура, согласованная с плоской волной, падающей по нормали (поглощающая граница):
y=sinβsin(ωτ0),cosβ=(2+|yW|2)cos(ωτ0)−1−yW2,(20)

где yW — шлейф среды (у блока поглотителя yW=0, вакуум); выражение для cosβ — дисперсионное уравнение сетки для плоской волны вдоль оси (дисперсия); - порт — нагрузка, согласованная с основной волной волновода порта (трансформатор).

Вычисление полей из напряжений

Компоненты поля связаны с величинами схемы соотношениями (2.7):

Ez=UΔz,Hy=IxΔy,Hx=IyΔx,(21)

где Ix, Iy — токи в линиях сетки вдоль осей. Ток линии выражается через бегущие по ней волны: I=Y(UP−UO) (рис. 4.18 в [Климов, 2025]). Поэтому, зная напряжения узлов в каждый момент времени, можно определить все не равные нулю компоненты поля [Климов, 2025, разд. 4.1].

В программе ядро H выводит напряжения узлов U, т. е. величину, пропорциональную Ez (в планарной задаче Δz — масштабный множитель, а масштаб U задаётся амплитудой сигнала порта):

  • кадры поля — значения U всех узлов на такте, строками снизу вверх; их показывает FieldView (вывод ядра);
  • накопление для диаграммы направленности — квадратуры U(t) на частоте (контур в ближней зоне);
  • топология — полная ε каждого узла, пересчитанная из y5.

Компоненты Hx, Hy ядро H не вычисляет и не записывает.

Соответствие в коде

Символ / действие Переменная, функция Файл (src/kernels/planarrt_h/)
Uτ−1, Uτ−2 узла n prUNode1[2n], prUNode1[2n+1] (роли чередуются по подтактам) tmcrthrectnode.h
y5 со знаком prYNode[2n] tmcrthrectnode.h
2/(4+|y5|) prYNode[2n+1] tmcrthrectnode.h
формула узла (4.21) RunScatteringNode1line (подтакт 0), RunScatteringNode1line1 (подтакт 1); обход строк — RunScatteringNode, RunScatteringNode1 tmcrthrectnode.cpp
подтакты, порядок операций RunKernel, RunKernel1T; nTCurrent, dTCurrent tmcrthrectnode.cpp
w·Δε в узел CTmcRTHNodeDiel::SetYLineForDiel, SetStatEpsFast (EPSFAST), вес sTmcRTHNodeDielOne::rY tmcrthnodediel.cpp
Δε блока в точке CTmcRTHNodeDiel::CalcEps tmcrthnodediel.cpp
y5 по (4.3), (4.4) CTmcRTHRectNode::SetDielInNodeList: koef =(k0Δ)2/2, koef1 =ωτ0/2 (поправка = 1) tmcrthrectnode.cpp
обратный пересчёт ε PutTopology tmcrthrectnode.cpp
нагрузка поглотителя y=sinβ/sin(ωτ0) SetAbsorberAdmitance tmcrthnodediel.cpp
узлы контура блоков (металл, поглотитель, магнитная стенка) RunBlockNode, RunBlockNode1, коды CTMCRTH_BLCKNTYPE_ABSR_* tmcrthnodediel.cpp, src/Include/tmcgrviw.h
кадр поля (U всех узлов) PutField tmcrthrectnode.cpp
точность чисел _real = double _PREC_DOUBLE src/Include/typerth.h

Подробное описание кода — Счётное ядро H: структура узла (node-data), проводимости шлейфов (admittance), рассеяние (scattering), цикл по времени (time-loop).

Источники

  • [Климов, 2025] — гл. 2: разд. 2.1 ((2.4)–(2.11)), 2.2 ((2.28), (2.29)), 2.3 ((2.30)–(2.40)), 2.4 ((2.43)–(2.49)); гл. 4: разд. 4.1 ((4.1)–(4.21), рис. 4.2–4.8), 4.2 ((4.23)–(4.25), (4.71)–(4.74)), 4.3 ((4.75)–(4.91)), 4.4 (табл. 4.1–4.3).
  • [Климов, 2007] — гл. 2 (разд. 2.1–2.4), гл. 4 (разд. 4.1–4.4, схема узла (4.21)), гл. 9 (разд. 9.5.4).

H-polarized waves

The PlanarRT_H kernel (Tamic Rt-H in the dissertation) computes, in the time domain, H-polarized waves in a region with an arbitrary permittivity distribution. This page derives the node circuit of the Rτ-grid and the formula by which the kernel updates the node voltages at every time step, and shows how material is assigned to a node. The basis is the Rτ circuit of a space element from the method page. How this is implemented in the program is described in H compute kernel.

Problem statement

A two-dimensional problem is considered: the geometry and fields do not depend on the z coordinate. For H-polarized waves the non-zero components are Ez, Hx, Hy (Hz=0, Ex=Ey=0), i.e. the electric field is perpendicular to the computation plane and the magnetic field lies in it. This describes, for example, H-plane waveguide devices — the H10 wave of a rectangular waveguide in the plane of the vector H→ [Klimov, 2007, Fig. 9.8]. For a monochromatic wave, Maxwell's equations reduce to (2.4) and the Helmholtz equation [Klimov, 2025, (2.4), (2.5)]:

(∂2∂x2+∂2∂y2+k2)Ez=0,k2=ω2εaμa.(1)

The task of the kernel: given the signals at the ports, find the time evolution of the voltages of all grid nodes U=EzΔz and the signals reflected to and transmitted to the ports. The medium is specified by the distribution ε(x,y); the permeability in the H kernel equals μ0 (algorithms for magnetic filling are given in the section Magnetic permeability). The boundaries are metal, magnetic wall and absorber (boundary conditions); excitation is through ports (ports).

Node circuit

If there is no magnetic filling (μ=μ0), the element circuit contains no series stubs, and after combining the four parallel stubs connected to a node one obtains a grid in which each node is a parallel connection of [Klimov, 2025, Sec. 4.1, Figs. 4.3, 4.4]:

  • four line sections to the adjacent nodes 1–4 with characteristic admittances Y1…Y4 and delay τ0;
  • one stub with characteristic admittance Y5 and delay τ0/2 — open-circuited (OC) for ε¯>ε0 or short-circuited (SC) for ε¯<ε0;
  • an active conductance Y (losses; in interior nodes Y=0).
                       2  (neighbour above)
                       │
                       │ Y2, τ0
                       │        stub Y5, τ0/2 (OC or SC)
   1 ───────── Y1, τ0 ─●─ Y3, τ0 ───────── 3
  (neighbour left)     │╲                  (neighbour right)
                       │ Y  (losses)
                       │ Y4, τ0
                       │
                       4  (neighbour below)

The type of the stub and its admittance are determined by the average permittivity of the four cells around the node, ε¯ (grid) [Klimov, 2025, (4.3), (4.4)]:

Y5=4Y0ε¯−ε0ε0(ε¯>ε0, OC),Y5=Y0(ωτ0)2ε0−ε¯ε0(ε¯<ε0, SC).(2)

When all grid lines are identical (Yi=Y0), it is convenient to use the normalized quantities y5=Y5/Y0, y=Y/Y0.

In the program, the stub type is stored as a sign: y5>0 is an OC stub, y5<0 is an SC stub (y5=Δε(ωτ0)2 with a negative Δε). Then both branches of the algorithm are written as a single formula with |y5| in the denominator (scattering). Four numbers are stored per node: two voltages and two coefficients:

Cell Contents
prUNode1[2n], prUNode1[2n+1] voltage of node n at the two most recent time steps
prYNode[2n] signed y5
prYNode[2n+1] factor 2/(4+|y5|)

This is exactly the set named in [Klimov, 2025, Sec. 4.1]: "in addition to storing the voltage values for the two previous time steps, it is necessary to store the values ±y5 and 2/(4+y5), i.e. the memory consumption is four real numbers per grid node".

Scattering at a node

Let Uτ, Uτ−1, Uτ−2 be the voltages of the central node 0 at the instants τ, τ−τ0, τ−2τ0, and let Uiτ−1 be the voltages of the adjacent nodes at the instant τ−τ0. The node voltage in terms of the waves UPiτ incident on it from the inputs i=1…5 is [Klimov, 2025, (4.10)]:

Uτ=2(Y1UP1τ+Y2UP2τ+Y3UP3τ+Y4UP4τ+Y5UP5τ)Y1+Y2+Y3+Y4+Y5+Y.(3)

The same expression for the instant τ−2τ0, rewritten in terms of the reflected waves UOiτ−2=Uτ−2−UPiτ−2, gives [Klimov, 2025, (4.13)]

Uτ−2=2(Y1UO1τ−2+…+Y5UO5τ−2)Y1+Y2+Y3+Y4+Y5−Y.(4)

The incident waves are expressed through the neighbours' voltages and the reflected waves (wave exchange). Substituting them and eliminating the reflected waves using (4.13), one obtains a formula that contains only node voltages [Klimov, 2025, (4.16)–(4.19)]:

Uτ=2(Y1U1τ−1+Y2U2τ−1+Y3U3τ−1+Y4U4τ−1±Y5Uτ−1+YUτ−2)Y1+Y2+Y3+Y4+Y5+Y−Uτ−2,(5)

where "+" before Y5 corresponds to an OC stub (ε¯>ε0) and "−" to an SC stub (ε¯<ε0). For identical lines Yi=Y0 [Klimov, 2025, (4.20)]

Uτ=24+y5+y(U1τ−1+U2τ−1+U3τ−1+U4τ−1±y5Uτ−1+yUτ−2)−Uτ−2,(6)

and without losses (y=0) [Klimov, 2025, (4.21)]

Uτ=24+y5(U1τ−1+U2τ−1+U3τ−1+U4τ−1±y5Uτ−1)−Uτ−2.(7)

The algorithm is called two-parameter: the new time step requires the voltage values at the two previous time steps. Per node and per time step, five additions/subtractions and two multiplications are needed.

Formula in the program. With a signed y5, formula (4.21) takes the form

Uτ=24+|y5|(U1τ−1+U2τ−1+U3τ−1+U4τ−1+y5Uτ−1)−Uτ−2,(8)

and in the code it is one line per node (sub-step 0, RunScatteringNode1line):

U[2n] = Y[2n+1] * ( U[2n-1] + U[2n+3] + U[2n+1-2nX] + U[2n+1+2nX] + Y[2n]*U[2n+1] ) - U[2n]

Here U is the prUNode1 array and Y is prYNode; U[2n-1] and U[2n+3] are the odd cells of the left and right neighbours, U[2n+1-2nX] and U[2n+1+2nX] those of the lower and upper neighbours, and U[2n+1] that of the node itself, all at time step τ−1; U[2n] on the right-hand side is Uτ−2 of the node itself, and on the left-hand side it is the new Uτ. The interior nodes (ix=1…nX−2, iy=1…nY−2) are traversed row by row and in pairs. The outermost nodes of the region are not updated (region edges).

Wave exchange between nodes

The nodes are connected by line sections with delay τ0. The wave reflected from node i towards node 0 at the instant τ−τ0 arrives at node 0 at the instant τ as an incident wave [Klimov, 2025, (4.14)]:

UPiτ=UiOτ−1=Uiτ−1−UiPτ−1=Uiτ−1−UOiτ−2,i=1…4,(9)

where UiOτ−1 and UiPτ−1 are the waves reflected from node i towards node 0 and incident on node i from node 0, and UOiτ−2 is the wave reflected from node 0 towards node i one time step earlier.

The stub has a delay of τ0/2: a wave that enters the stub returns after τ0. At an open circuit it is reflected without a change of sign, and at a short circuit with a phase change of 180° [Klimov, 2025, (4.15), (4.17)]:

UP5τ=Uτ−1−UO5τ−2(OC),UP5τ=−Uτ−1+UO5τ−2(SC).(10)

It is this difference in signs that gives the "±" before y5 in the node formula.

In the program, wave exchange is not performed as a separate operation and the waves are not stored: it is already built into the formula (scattering) through the neighbours' voltages at the previous time step and the node's own voltage at the time step before that. Nodes with other circuits — ports, absorbers, magnetic walls — use the same idea with half-lines along the contour and loads (boundary conditions, ports).

Sub-steps of one step

The node formula links three time layers: Uτ, Uτ−1, Uτ−2. There is no need to store three arrays: the new value Uτ is written in place of Uτ−2, which is no longer needed afterwards. Therefore two cells are allocated per node, and the roles of the cells alternate:

Sub-step Written (new Uτ in place of Uτ−2) Read (Uτ−1 of the neighbours and of the node) Functions
0 even cell prUNode1[2n] odd cells RunExciteInputs, RunScatteringNode, RunBlockNode
1 odd cell prUNode1[2n+1] even cells RunExciteInputs1, RunScatteringNode1, RunBlockNode1

Each sub-step advances the computation by one time step τ0. Within a sub-step, the following are performed in order:

  1. port excitation and writing of the port signals to the .t file (ports);
  2. scattering at all interior grid nodes according to (4.21);
  3. block boundary conditions — metal, absorber, magnetic wall (boundary conditions);
  4. output of a field frame (if enabled);
  5. field accumulation for the radiation pattern (RP).

One pass of the RunKernel1T loop consists of two sub-steps. Within a sub-step the nodes are independent: each writes only its own cell and reads only cells of the other parity, so the order of node traversal does not affect the result — this is exploited in GPU computing (GPU). In the X kernel the scheme links more layers, and there are four sub-steps (X sub-steps).

Dielectric (eps) and stub admittance

Task file. Dielectric blocks (RECT_STAT, CIRCLE_STAT, POLYGON_STAT, FILE, etc.) specify an eps expression whose value for the H kernel is the increment over vacuum Δε=ε−1 (relative permittivity minus one). The expression may contain the node coordinates x, y relative to the anchor point of the block, the distance r and the polar angle f.

Average permittivity of a node. The value w·Δε is assigned to the node, where the weight w is the fraction of the cells surrounding the node that lie in the block. The contributions of all blocks are summed, so the node accumulates

Δε¯=ε¯−ε0ε0=∑blockswΔε,(11)

which corresponds to the average over four cells (4.2) (cells outside blocks are vacuum, Δε=0). For a rectangle the weight is 1 inside, 0.5 on a side and 0.25 at a corner. For a circle, an annular sector and a polygon, the program accumulates the weight in increments of 0.25 for each of the four diagonal points (x±Δ, y±Δ) that falls inside the shape. A FILE block reads already weighted values from an .eps file.

Conversion to stub admittance. After all blocks have been built, each accumulated value Δε of a node is converted to a normalized stub admittance according to (4.3), (4.4) [Klimov, 2025]:

y5={4Δε,Δε≥0(OC stub),[4pt]Δε(ωτ0)2=Δε(k0Δ)22,Δε<0(SC stub, y5<0),ω=2πFREQ,(12)

and the factor 2/(4+|y5|) is stored. Here (ωτ0)2=(k0Δ)2/2, since τ0=Δ/(c2).

Program specifics:

  • The conversion formulas are the ωτ0≪1 approximation of the exact relations (2.43), (2.45), in which the stub admittance differs by the factor ωτ0/2tg(ωτ0/2) (OC) or by its inverse (SC). In the program the correction factor equals 1: the variable koef1 (ωτ0/2) is used only to check ωτ0/2≤π/3 (otherwise the error "very big Delta*Frequence" is reported), and the line with the correction koef1/tan(koef1) is commented out.
  • Values of Δε that differ from 4 by less than 0.004 are shifted to 3.996 or 4.004.
  • For Δε≥0 the admittance does not depend on frequency; for Δε<0 it is proportional to the square of the task frequency FREQ: the specified Δε refers to this frequency, and at other frequencies the medium behaves as a frequency-dispersive medium (below).
  • When the topology is written, the inverse conversion is performed: ε=y5/4+1 for y5≥0 and ε=y5/(ωτ0)2+1 for y5<0.
  • The same rule, applied to the W parameter of a port (which is the Δε of the input medium), is used to compute the stub of the port nodes (W parameter).

Propagation. For nodes with an SC stub, waves propagate as long as |y5|<(ωτ0)2, i.e. as long as ε>0 (2.49). For ε≤0 the wave decays in such a medium — the computation nevertheless remains stable (stability).

Magnetic permeability

In the program, the H kernel models only dielectric filling (μ=μ0 at all nodes). The "magnetic wall" block (MAGNETIC) is an open-circuit boundary condition, not a magnetic permeability (boundary conditions). Below, the algorithms for magnetic filling constructed in [Klimov, 2025, Sec. 4.2–4.4] are briefly outlined.

Inhomogeneous magnetic filling (ε=ε0, Sec. 4.2). The element circuit contains no parallel stubs, but it does contain series ones; determining the voltages at the nodes of the parallel line connection is impractical, so the algorithm is built in terms of currents at the nodes of the series stub connection (nodes 01, 02, 03, 04 in Fig. 4.10). Each such node lies at the midpoint of the line between adjacent grid nodes; the stub is determined by the average permeability of the two adjacent cells μ¯=(μ6+μ10)/2 (4.23):

Z01=2Z0μ¯−μ0μ0(μ¯>μ0, SC),Z01=2Z0(ωτ0)2μ0−μ¯μ0(μ¯<μ0, OC),(13)

Z0=1/Y0 (4.24), (4.25). The currents are computed with step τ0, but are shifted relative to the voltages by τ0/2. Without magnetic losses (z=0) and for identical lines [Klimov, 2025, (4.73), (4.74)]:

I01τ+3/2=I11τ+1/2−I12τ+1/2−2I01τ+1/2+I14τ+1/2+I02τ+1/2+I03τ+1/2−I04τ+1/22+z01+2I01τ+1/2−I01τ−1/2(μ¯>μ0),(14)

and for μ¯<μ0 the term −4z012+z01I01τ+1/2 is added to the right-hand side, z01=Z01Y0. Per node and time step, nine additions/subtractions and four multiplications are needed; the stored values are the currents for two time steps, z01 and 4z01/(2+z01). This algorithm is also two-parameter and stable for any μ¯, including μ¯≤0. When two series stubs are combined into one, an assumption is made that they are connected in parallel; according to [Klimov, 2025], the magnitude of the resulting error requires a separate study.

The modified variant without magnetic losses (Sec. 4.3) again computes the voltages of the parallel-connection nodes, and for each series stub stores twice the voltage of the wave reflected into the stub [Klimov, 2025, (4.90), (4.91)]:

U0τ+1=U1τ−U0τ+2UO31τ−1/22+z01+U2τ−U0τ−2UO32τ−1/22+z02+U3τ−U0τ−2UO33τ−1/22+z03+U4τ−U0τ+2UO34τ−1/22+z04+2U0τ−U0τ−1,(15)
2UO3τ+1/2=2·2UO3τ−1/2−2UO3τ−3/2−4z012+z01(U1τ−U0τ+2UO3τ−1/2),(16)

where UO3kτ−1/2=0 for μ¯>μ0 and UO3kτ−1/2=UO3τ−1/2 for μ¯<μ0 (4.78), (4.79).

Comparison of the algorithms [Klimov, 2025, Table 4.3], per elementary volume and per time step:

Region type Stored numbers Additions/subtractions Multiplications Memory writes
magnetic filling with magnetic losses 10 22 10 2
lossless magnetic filling 8 18 8 2
dielectric filling with electric losses 5 6 3 1
lossless dielectric filling 4 5 2 1

The computation speed is determined mainly by the number of real-number writes to memory, so when organizing the program it is important to take into account whether the problem involves dielectric or magnetic filling [Klimov, 2025, Sec. 4.4]. The interior nodes of the H kernel are computed with the most economical algorithm — the last row of the table.

Frequency-dispersive media

The frequency dependence of the permittivity and permeability turns them into integro-differential operators in the time domain [Klimov, 2025, Sec. 2.3, (2.32), (2.33)]. For plasma without an external magnetic field (Ω=0), the first Maxwell equation takes the form [Klimov, 2025, (2.37)]

∇×H→=Ce0∂E→∂t+1Le−∫E→dt+j→e,Ce0=ε0,Le−=1ωp2Ce0,(17)

which for monochromatic oscillations gives the well-known dependence [Klimov, 2025, (2.38)]

ε=ε0(1−ωp2ω2).(18)

This equation is identical to the equation of a grid with the inductance L− that models εa<ε0 (RLC circuit): "one can conclude that the models described by impedance networks and by plasma in the absence of a magnetic field are identical" [Klimov, 2025, Sec. 2.3].

What this means for the H kernel. The SC stub of a node with Δε<0 has a constant admittance y5, i.e. it models a constant inductance L− (in the ωτ0≪1 approximation). It corresponds to a negative capacitance increment that decreases as 1/ω2. If the task file specifies ΔεF<0 at the frequency fF=FREQ, then at any frequency ω the grid behaves as a medium with

ε(ω)=1+ΔεFωF2ω2=1−ωp2ω2,ωp2=−ΔεFωF2,ωF=2πfF,(19)

i.e. as plasma without an external field with plasma frequency ωp. The frequency FREQ only sets the point at which ε equals the specified value; the time-domain computation itself accounts for dispersion over the entire signal band. Nodes with Δε≥0 (OC stub, capacitance) have no dispersion in the same approximation.

This formulation was verified in [Klimov, 2007, Sec. 9.5.4]: the scattering of the leading edge of a radio pulse by a layer with permittivity of the form (2.38), equal to 0.25 at the carrier frequency of 20 GHz, computed by the Rt-H program, agrees well with the analytical solution (H accuracy).

A medium with permeability μ=μ0(1−ωF2/ω2) (2.39), (2.40) is constructed similarly; it is not implemented in the H kernel. Magnetized plasma with tensor permittivity (2.34), (2.35) is computed by the X kernel — see accounting for frequency dependence in the time-domain scheme.

Losses

The specific electric losses Ye and magnetic losses Rm enter the equations [Klimov, 2025, (2.28), (2.29)] as a conductance in parallel with the capacitance and a resistance in series with the inductance. In the node circuit, electric losses are the active conductance Y, and the node formula with losses is (4.20) (scattering). A positive conductance only absorbs energy and does not violate stability (stability).

In the program, the interior nodes of the H kernel are computed without losses according to (4.21); volume losses of a dielectric cannot be specified in the H kernel (losses and medium conductivity are available in the X kernel — collisions and conductivity). The active conductance in the H kernel is used in two kinds of nodes:

  • absorber — a load y at the contour nodes, matched to a plane wave at normal incidence (absorbing boundary):
y=sinβsin(ωτ0),cosβ=(2+|yW|2)cos(ωτ0)−1−yW2,(20)

where yW is the stub of the medium (for an absorber block yW=0, vacuum); the expression for cosβ is the grid dispersion equation for a plane wave along an axis (dispersion); - port — a load matched to the fundamental mode of the port waveguide (transformer).

Computing fields from voltages

The field components are related to the circuit quantities by relations (2.7):

Ez=UΔz,Hy=IxΔy,Hx=IyΔx,(21)

where Ix, Iy are the currents in the grid lines along the axes. The line current is expressed through the waves travelling along it: I=Y(UP−UO) (Fig. 4.18 in [Klimov, 2025]). Therefore, knowing the node voltages at every instant, one can determine all non-zero field components [Klimov, 2025, Sec. 4.1].

In the program, the H kernel outputs the node voltages U, i.e. a quantity proportional to Ez (in a planar problem Δz is a scale factor, and the scale of U is set by the port signal amplitude):

  • field frames — the values of U at all nodes at a time step, row by row from bottom to top; they are displayed by FieldView (kernel output);
  • accumulation for the radiation pattern — the quadratures of U(t) at the frequency (near-field contour);
  • topology — the full ε of each node, recomputed from y5.

The H kernel neither computes nor writes the components Hx, Hy.

Mapping to the code

Symbol / action Variable, function File (src/kernels/planarrt_h/)
Uτ−1, Uτ−2 of node n prUNode1[2n], prUNode1[2n+1] (roles alternate between sub-steps) tmcrthrectnode.h
signed y5 prYNode[2n] tmcrthrectnode.h
2/(4+|y5|) prYNode[2n+1] tmcrthrectnode.h
node formula (4.21) RunScatteringNode1line (sub-step 0), RunScatteringNode1line1 (sub-step 1); row traversal — RunScatteringNode, RunScatteringNode1 tmcrthrectnode.cpp
sub-steps, order of operations RunKernel, RunKernel1T; nTCurrent, dTCurrent tmcrthrectnode.cpp
w·Δε into a node CTmcRTHNodeDiel::SetYLineForDiel, SetStatEpsFast (EPSFAST), weight sTmcRTHNodeDielOne::rY tmcrthnodediel.cpp
Δε of a block at a point CTmcRTHNodeDiel::CalcEps tmcrthnodediel.cpp
y5 according to (4.3), (4.4) CTmcRTHRectNode::SetDielInNodeList: koef =(k0Δ)2/2, koef1 =ωτ0/2 (correction = 1) tmcrthrectnode.cpp
inverse conversion of ε PutTopology tmcrthrectnode.cpp
absorber load y=sinβ/sin(ωτ0) SetAbsorberAdmitance tmcrthnodediel.cpp
block contour nodes (metal, absorber, magnetic wall) RunBlockNode, RunBlockNode1, codes CTMCRTH_BLCKNTYPE_ABSR_* tmcrthnodediel.cpp, src/Include/tmcgrviw.h
field frame (U of all nodes) PutField tmcrthrectnode.cpp
number precision _real = double _PREC_DOUBLE src/Include/typerth.h

A detailed description of the code is given in H compute kernel: node structure (node-data), stub admittances (admittance), scattering (scattering), time loop (time-loop).

Sources

  • [Klimov, 2025] — Ch. 2: Sec. 2.1 ((2.4)–(2.11)), 2.2 ((2.28), (2.29)), 2.3 ((2.30)–(2.40)), 2.4 ((2.43)–(2.49)); Ch. 4: Sec. 4.1 ((4.1)–(4.21), Figs. 4.2–4.8), 4.2 ((4.23)–(4.25), (4.71)–(4.74)), 4.3 ((4.75)–(4.91)), 4.4 (Tables 4.1–4.3).
  • [Klimov, 2007] — Ch. 2 (Sec. 2.1–2.4), Ch. 4 (Sec. 4.1–4.4, node circuit (4.21)), Ch. 9 (Sec. 9.5.4).