Точность

Rτ-сетка — дискретная модель пространства, и её решения отличаются от решений уравнений Максвелла для непрерывной среды. Главная погрешность метода — сеточная дисперсия: волна в сетке распространяется с фазовой скоростью, немного отличной от точной, и это отличие зависит от отношения шага сетки к длине волны, от проницаемости среды и от направления распространения. К ней добавляются погрешность переноса геометрии на сетку, погрешность граничных условий и портов (граничные условия, порты), конечность окна времени при переходе в частотную область (матрица рассеяния) и конечная разрядность чисел. На странице приведены формулы сеточной дисперсии, правила выбора сетки, результаты тестов ядер H и X против точных решений и сведения о точности арифметики.

Численная дисперсия сетки

Дисперсионное уравнение ядра H. Подставим в формулу узла (4.21) (рассеяние в узле) плоскую сеточную волну U=U0eiωτ0τe−iα(ixcosγ+iysinγ), где α — набег фазы на один шаг сетки, γ — угол между направлением распространения и осью x. Получается связь α с частотой (со знаковым y5 из проводимости шлейфа):

cos(αcosγ)+cos(αsinγ)=(2+|y5|2)cos(ωτ0)−y52.(1)

Длина волны в сетке λ′=2πΔ/α [Климов, 2007, (6.45)]. Для волны вдоль оси (γ=0) и для собственной волны Hm0 волновода из N ячеек уравнение приводится к [Климов, 2007, (6.46)]:

λm′=2πΔarccos((2+y52)cos(ωτ0)−cos(πmN)∓y52),(2)

где в (6.46) y5>0 — модуль проводимости шлейфа, а знак «−» относится к ε>ε0, «+» — к ε<ε0; m=0 — плоская волна. Точная длина волны в волноводе, заполненном диэлектриком ε1, [Климов, 2007, (6.47)]:

λm=λε1/ε01−(λm2NΔε1/ε0)2,ωτ0=2πΔλ(6.49).(3)

Отношение λm′/λm для ε1>ε0 и ε1<ε0 выписано в [Климов, 2007, (6.51)–(6.53)]. Для вакуума и волны вдоль оси

cosα=2cos(ωτ0)−1.(4)

Ошибка фазовой скорости в окне «Статистика». Ядро показывает в поле Tolerance окна статистики величину

Tolerance=arccos(2cos(ωτ0)−1)2ωτ0−1=λ0λ′−1(5)

(в процентах; ω=2πFREQ) — относительное отличие длины волны в сеточном вакууме вдоль оси от точной. Это оценка снизу: в диэлектрике с ε>1 длина волны короче, и ошибка больше (таблица ниже).

Ошибка длины волны в сетке (λ0−λ0′)/λ0, %, для плоской волны (m=0) вдоль оси в среде ε1 при разных отношениях длины волны в вакууме к шагу λ/Δ — выборка из [Климов, 2007, табл. 6.1]:

λ/Δ ε1=0,1 0,5 1 4 9 25
10 11,57 1,62 0,85 6,61 21,95 ***
20 3,35 0,41 0,21 1,48 3,75 12,80
30 1,53 0,18 0,09 0,65 1,60 4,89
50 0,56 0,07 0,03 0,23 0,57 1,66

Знак *** — в источнике значения нет: аргумент арккосинуса выходит за [−1,1], волна в сетке не распространяется. Для волны H10 в волноводе шириной 15 мм при длине волны в вакууме 10 мм ошибки близки к приведённым, а при малых ε1 больше; при ε1=0,1 эта волна ниже критической частоты.

Выводы [Климов, 2007, разд. 6.5]:

  • при ε1>ε0 ошибка растёт, потому что длина волны в среде уменьшается: шаг надо выбирать по длине волны в среде, λ0/ε1;
  • при ε1→0 относительная ошибка тоже велика, но сказывается на результате слабо — она накапливается на длине волны, которая стремится к бесконечности. Её причина — отличие условия распространения в сетке (2.49) от точного; исправить её можно, подбирая проводимость шлейфа из условия λm′=λm (6.54). В программе такая коррекция не применяется (проводимость шлейфа).

Пространственная (угловая) дисперсия. Волны в сетке идут только вдоль рёбер, поэтому изотропное пространство, перенесённое на сетку, становится анизотропным: α зависит от γ (дисперсионное уравнение в начале раздела) [Климов, 2007, разд. 7.4]. Для волн E в подмагниченной плазме максимальная ошибка длины волны наблюдается вдоль рёбер сетки (γ=0° и 90°), минимальная — под углом 45° [Климов, 2007, разд. 7.5]; см. точность X-ядра.

Правила сетки

Автор пакета сформулировал два правила задания геометрии:

  1. Блоки геометрии должны лежать на узлах сетки: стороны прямоугольников, вершины многоугольников и точки привязки X0,Y0 должны совпадать с узлами сетки.
  2. Границы блоков кратны шагу сетки, и размеры области X_MIN…X_MAX, Y_MIN…Y_MAX укладываются в целое число шагов DELTA.

Почему это важно:

  • проницаемость узла — среднее четырёх окружающих ячеек (сетка), а пределы блока программа округляет до ближайших узлов сетки; граница блока, не совпадающая с узлами, сдвигается на величину до половины шага, и вес узлов у границы (0,25…1) описывает уже сдвинутую границу;
  • металлический контур и границы поглотителей строятся по узлам; наклонные и криволинейные стенки заменяются ступенчатой линией (ступенчатые стенки);
  • правая и верхняя границы области программа переносит на узел сетки за X_MAX (Y_MAX) и добавляет резервный столбец (строку) (выравнивание по сетке).

Рекомендации автора по выбору шага (руководство пользователя, разд. 4.5 DELTA):

  • для точности около 3 % шаг — около 1/20 длины волны в волноводе на максимальной частоте; точнее — по серии расчётов на сходимость;
  • время анализа растёт пропорционально кубу 1/Δ (шаг по времени), поэтому отработку устройства ведут на крупной сетке, а точный расчёт — на мелкой;
  • шаг выбирают так, чтобы геометрия укладывалась в целое число шагов (при толщине металла 1, 2, 3, 4 мм — шаг 1 или 0,5 мм, а не 1,02 или 0,47 мм).

Жёсткие ограничения программы: Δ≤λ0/5 на частоте FREQ, ωτ0/2≤π/3, не меньше 10 шагов по каждой оси области.

Точность H-ядра

Сходимость к решению в частотной области [Климов, 2007, разд. 9.5.2]. Волна H10 в прямоугольном волноводе шириной 4 мм (стенки — металл) падает на диэлектрическую вставку ε=4 длиной 50 мм; частота 40 ГГц (λ0=7,5 мм). Результат Rt-H сравнивается с программой Tamic H, которая решает ту же задачу в частотной области методом прямых [Климов, 2007, табл. 9.3]:

Tamic H Δ=0,05 мм (≈λ/150) 0,125 мм (≈λ/60) 0,25 мм (≈λ/30) 0,5 мм (≈λ/15)
|S11| 0,923 0,9210 (0,21 %) 0,91724 (0,62 %) 0,8890 (3,68 %) 0,4721 (48,9 %)
|S12| 0,384 0,3935 (2,48 %) 0,4004 (4,28 %) 0,4582 (19,3 %) 0,880 (129 %)

Результаты сходятся к точному решению при уменьшении шага; отклонения фазы, по [Климов, 2007], близки к ожидаемым по сеточной дисперсии. Шаг λ0/15 для этой задачи слишком крупный: длина волны во вставке λ0/ε=3,75 мм — всего 7,5 шага.

Качество возбуждения и согласования [Климов, 2007, разд. 9.5.1]. Волна H10 возбуждается в волноводе шириной 20 мм и длиной 75 мм и поглощается вторым трансформатором; шаг 2 мм, частота 10 ГГц (λ0/Δ≈15). Отражённая волна на первом входе мала, а её уровень ограничен конечной разрядностью вычислений; расчёт вёлся в режиме двойной точности (float и double).

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

Точность X-ядра

Дисперсионное уравнение для волн E-поляризации в подмагниченной плазме получено из четырёхпараметрического алгоритма ядра X [Климов, 2007, (7.40)]:

cos(αγcosγ)+cos(αγsinγ)=cos(2ωτ0)+Bcos(ωτ0)+A22Dcos(ωτ0)−C,(6)

где A, B, C, D — коэффициенты алгоритма, зависящие от ωpτ0 и Ωτ0 ([Климов, 2007, (7.18)–(7.21)]; коэффициенты узла X). Для произвольного угла уравнение решается численно; для волны вдоль рёбер и по диагонали сетки [Климов, 2007, (7.42), (7.43), (7.88), (7.89)]:

α0=arccos(cos(2ωτ0)+Bcos(ωτ0)+A22Dcos(ωτ0)−C−1),απ/4=2arccoscos(2ωτ0)+Bcos(ωτ0)+A24Dcos(ωτ0)−2C,(7)

λγ′=2πΔ/αγ (7.87). Волна в сетке распространяется, когда аргументы арккосинусов не выходят за [−1,1] (7.44), (7.45). Точная длина необыкновенной волны [Климов, 2007, (7.90), (7.91)]:

λ=2πcωω4−ω2(Ω2+ωp2)ω4−ω2(Ω2+2ωp2)+ωp4.(8)

Сравнение при плазменной частоте fp=30 ГГц, циклотронной F=20 ГГц и шаге Δ=0,5 мм [Климов, 2007, табл. 7.1] (длины волн в мм). Частоты отсечек: fL≈21,623 ГГц, fR≈41,622 ГГц, верхняя гибридная fh≈36,056 ГГц; волна распространяется при fL<f<fh и f>fR (отсечки и резонансы).

f, ГГц 23 26 30 33 35 42 45 50 60 70
точная λ 30,63 15,97 10,00 6,89 4,19 31,96 11,97 8,32 5,95 4,80
сетка, вдоль рёбер λ0′ 30,09 15,84 9,89 6,70 3,72 23,81 11,53 8,19 5,88 4,74
сетка, по диагонали λπ/4′ 30,09 15,85 9,91 6,73 3,78 23,82 11,55 8,21 5,91 4,78

Выводы [Климов, 2007, разд. 7.4, 7.5]:

  • при уменьшении шага Δ (1; 0,5; 0,4; 0,3; 0,2; 0,1 мм, рис. 7.6) сеточная длина волны сходится к точной;
  • ошибка растёт вблизи частот отсечек fL, fR (длина волны стремится к бесконечности, ошибка накапливается на большой длине) и вблизи верхней гибридной частоты fh (длина волны в плазме стремится к нулю, растёт Δ/λ);
  • наибольшее отклонение — при распространении вдоль рёбер сетки, наименьшее — под углом 45°; разница δ(0°)−δ(45°) меньше 0,025 % на 23 ГГц и около 0,7 % на 63 ГГц.

Отражение плоской волны от слоя [Климов, 2007, разд. 9.5.3]. Плоская волна падает по нормали на слой толщиной L2 (область между магнитными стенками высотой 2 мм, 40 ГГц, λ0=7,5 мм); результат Rt-X сравнивается с точным коэффициентом отражения. Коэффициент отражения при L2=10 мм [Климов, 2007, табл. 9.4]:

ε1 точное λ/150 λ/60 λ/30 λ/15
0,9 0,0524 0,0523 (0,17 %) 0,0522 (0,38 %) 0,0516 (1,6 %) 0,049 (7 %)
0,5 0,1234 0,1218 (1,26 %) 0,1208 (2,16 %) 0,1169 (5,54 %) 0,1021 (21,02 %)
0,3 0,5355 0,5355 (0,003 %) 0,5344 (0,21 %) 0,5306 (0,92 %) 0,5146 (4,07 %)
0,1 0,558 0,5558 (0,43 %) 0,5467 (2,09 %) 0,5152 (8,34 %) 0,3841 (45,33 %)
0,01 0,965 0,9648 (0,014 %) 0,9641 (0,09 %) 0,9612 (0,39 %) 0,9463 (1,97 %)

При ε1=0,3 и разной толщине слоя [Климов, 2007, табл. 9.5]:

L2, мм точное λ/150 λ/60 λ/30 λ/15
10 0,5355 0,5356 (−0,02 %) 0,5344 (0,20 %) 0,5306 (0,93 %) 0,5147 (4,05 %)
14 0,0893 0,0929 (−3,85 %) 0,0957 (−6,68 %) 0,1061 (−15,79 %) 0,1449 (−38,33 %)
17 0,5379 0,5379 (0,01 %) 0,5367 (0,22 %) 0,5316 (1,19 %) 0,5140 (4,64 %)
20 0,1547 0,1501 (3,10 %) 0,1451 (6,65 %) 0,1276 (21,30 %) 0,0593 (160,7 %)

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

Подмагниченная плазма во временной области [Климов, 2007, разд. 9.5.4]. Тот же слой (проницаемость 0,25 на 20 ГГц, плазменная частота около 17 ГГц) рассчитан программой Rt-X во внешнем поле 0,25 Тл. По соотношениям гл. 3 волна E-поляризации в таком слое распространяется при 14 ГГц < f < 19 ГГц и f > 21 ГГц, т. е. волна 20 ГГц должна от слоя отражаться; прошедший и отражённый сигналы приведены на рис. 9.14–9.18 [Климов, 2007].

float и double

Расчёт ведётся в числах двойной точности. Тип вещественных чисел ядер _real задаётся в общем заголовке typerth.h (_PREC_DOUBLE): double, 8 байт. В нём хранятся напряжения узлов и коэффициенты; узел ядра H занимает 32 байта (4 числа), узел ядра X — 96 байт (12 чисел). Файлы поля записывают размер числа в заголовке (Accuracy), так что программы просмотра читают их правильно.

Почему не float: схема консервативна и устойчива в точной арифметике, но в арифметике одинарной точности ошибки округления на каждом такте могут накапливаться. В одной из прежних сборок числа хранились в float, и на задании с многоугольником (ядро X) поле после прохождения импульса не затухало, а росло. Сборка с double совпала с расчётом прежней версии программы (2006 г.), и импульс в ней затухает; после этого обе программы считают в double. Также и уровень отражения в тесте согласования [Климов, 2007, разд. 9.5.1] ограничен конечной разрядностью вычислений.

Одинаковые результаты разных сборок. Результаты Qt6-версии совпадают с прежней Windows-версией пакета побайтно. Для этого сборка:

  • запрещает компилятору объединять умножение и сложение в одну операцию FMA (-ffp-contract=off): FMA округляет один раз вместо двух, и последние биты результата отличались бы;
  • берёт математические функции (sin, cos, exp …) из той же библиотеки ucrtbase.dll, что и программы, собранные MSVC.

Подробности — Главный принцип: расчёт не переписывается. Расчёт на видеокарте тоже даёт те же биты, что и на процессоре (совпадение с расчётом на процессоре).

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

Величина / действие Переменная, функция Файл (src/)
Tolerance =arccos(2cosωτ0−1)/(2ωτ0)−1 CTmcDialogStatistics::PrepareData: dwt0 =ωτ0, dTolerance kernels/planarrt_h/tmcdialogstatistics.cpp, то же в kernels/planarrt_x/
ωτ0 m_cParam.rt*m_cParam.rFreq*2*PI___ там же
y5 из Δε (без поправки (6.54)) CTmcRTHRectNode::SetDielInNodeList kernels/planarrt_h/tmcrthrectnode.cpp
cosβ=(2+|yW|/2)cosωτ0−1−yW/2 (дисперсионное уравнение при γ=0) SetAbsorberAdmitance; с cos(πΔ/b) — SetInputAdmitance kernels/planarrt_h/tmcrthnodediel.cpp
Δ≤λ0/5 CTmcRTH_IndanParam::IsCorrectly libs/tmcindan/tmcrth_indanparam.cpp
ωτ0/2≤π/3 SetDielInNodeList (koef1) kernels/planarrt_h/tmcrthrectnode.cpp
выравнивание области, резервный столбец IsCorrectly (nXGrid, nYGrid) libs/tmcindan/tmcrth_indanparam.cpp
вес узла блока (0,25…1) SetRect, SetCirc, SetPoly, EpsFastNode (rY) kernels/planarrt_h/tmcrthnodediel.cpp
_real = double #define _PREC_DOUBLE include/typerth.h
размер числа в файле поля TMC_GROFLD_DOCFILE_ID_Accuracy, sizeof(_real) (PutField) kernels/planarrt_h/tmcrthrectnode.cpp
запрет FMA, математика UCRT -ffp-contract=off, compat/ucrt_libm_win.cpp CMakeLists.txt (корень Qt6-версии), src/compat/ucrt_libm_win.cpp

Источники

  • [Климов, 2007] — гл. 6, разд. 6.5 ((6.45)–(6.54), табл. 6.1); гл. 7, разд. 7.1 ((7.37)–(7.45)), 7.4 ((7.87)–(7.91), табл. 7.1, рис. 7.6), 7.5 (рис. 7.7); гл. 9, разд. 9.5 (табл. 9.3–9.5).
  • [Климов, 2025] — гл. 2 ((2.38), (2.49)), гл. 4 ((4.2), (4.21)).
  • Руководство пользователя TMC Suite, «Язык заданий», разд. 4.5 DELTA (рекомендации автора).
  • Правила сетки — сообщены автором пакета.

Accuracy

The Rτ-grid is a discrete model of space, and its solutions differ from the solutions of Maxwell's equations for a continuous medium. The main error of the method is grid dispersion: a wave in the grid propagates with a phase velocity slightly different from the exact one, and this difference depends on the ratio of the grid step to the wavelength, on the permittivity of the medium and on the direction of propagation. To this are added the error of mapping the geometry onto the grid, the error of boundary conditions and ports (boundary conditions, ports), the finite time window in the transition to the frequency domain (scattering matrix) and the finite precision of numbers. This page gives the grid dispersion formulas, the rules for choosing the grid, the results of tests of the H and X kernels against exact solutions, and information on the accuracy of the arithmetic.

Numerical dispersion of the grid

Dispersion equation of the H kernel. Substituting into the node formula (4.21) (scattering at a node) a plane grid wave U=U0eiωτ0τe−iα(ixcosγ+iysinγ), where α is the phase shift per grid step and γ is the angle between the propagation direction and the x axis, we obtain a relation between α and the frequency (with the signed y5 from the stub admittance):

cos(αcosγ)+cos(αsinγ)=(2+|y5|2)cos(ωτ0)−y52.(1)

The wavelength in the grid is λ′=2πΔ/α [Klimov, 2007, (6.45)]. For a wave along an axis (γ=0) and for the Hm0 eigenmode of a waveguide of N cells, the equation reduces to [Klimov, 2007, (6.46)]:

λm′=2πΔarccos((2+y52)cos(ωτ0)−cos(πmN)∓y52),(2)

where in (6.46) y5>0 is the magnitude of the stub admittance, and the "−" sign refers to ε>ε0 and "+" to ε<ε0; m=0 is the plane wave. The exact wavelength in a waveguide filled with a dielectric ε1 is [Klimov, 2007, (6.47)]:

λm=λε1/ε01−(λm2NΔε1/ε0)2,ωτ0=2πΔλ(6.49).(3)

The ratio λm′/λm for ε1>ε0 and ε1<ε0 is written out in [Klimov, 2007, (6.51)–(6.53)]. For vacuum and a wave along an axis

cosα=2cos(ωτ0)−1.(4)

Phase-velocity error in the "Statistics" window. The kernel displays in the Tolerance field of the statistics window the quantity

Tolerance=arccos(2cos(ωτ0)−1)2ωτ0−1=λ0λ′−1(5)

(in percent; ω=2πFREQ) — the relative difference between the wavelength in the grid vacuum along an axis and the exact one. This is a lower bound: in a dielectric with ε>1 the wavelength is shorter, and the error is larger (see the table below).

Wavelength error in the grid (λ0−λ0′)/λ0, %, for a plane wave (m=0) along an axis in a medium ε1 for different ratios of the free-space wavelength to the step λ/Δ — a selection from [Klimov, 2007, Table 6.1]:

λ/Δ ε1=0,1 0,5 1 4 9 25
10 11.57 1.62 0.85 6.61 21.95 ***
20 3.35 0.41 0.21 1.48 3.75 12.80
30 1.53 0.18 0.09 0.65 1.60 4.89
50 0.56 0.07 0.03 0.23 0.57 1.66

The *** mark means that the source gives no value: the arccosine argument falls outside [−1,1], and the wave does not propagate in the grid. For the H10 wave in a 15 mm wide waveguide with a free-space wavelength of 10 mm, the errors are close to those given, and larger for small ε1; for ε1=0,1 this wave is below the cutoff frequency.

Conclusions [Klimov, 2007, Sec. 6.5]:

  • for ε1>ε0 the error grows because the wavelength in the medium decreases: the step must be chosen according to the wavelength in the medium, λ0/ε1;
  • for ε1→0 the relative error is also large, but it has little effect on the result — it accumulates over a wavelength that tends to infinity. Its cause is the difference between the propagation condition in the grid (2.49) and the exact one; it can be corrected by choosing the stub admittance from the condition λm′=λm (6.54). The program does not apply such a correction (stub admittance).

Spatial (angular) dispersion. Waves in the grid travel only along the edges, so isotropic space mapped onto the grid becomes anisotropic: α depends on γ (the dispersion equation at the beginning of this section) [Klimov, 2007, Sec. 7.4]. For E waves in magnetized plasma, the maximum wavelength error is observed along the grid edges (γ=0° and 90°), and the minimum at an angle of 45° [Klimov, 2007, Sec. 7.5]; see X-kernel accuracy.

Grid rules

The package author formulated two rules for specifying the geometry:

  1. Geometry blocks must lie on grid nodes: the sides of rectangles, the vertices of polygons and the anchor points X0,Y0 must coincide with grid nodes.
  2. Block boundaries are multiples of the grid step, and the region dimensions X_MIN…X_MAX, Y_MIN…Y_MAX fit an integer number of DELTA steps.

Why this matters:

  • the permittivity of a node is the average of the four surrounding cells (grid), and the program rounds the block limits to the nearest grid nodes; a block boundary that does not coincide with nodes is shifted by up to half a step, and the weights of the nodes near the boundary (0.25…1) then describe the shifted boundary;
  • metal contours and absorber boundaries are built on nodes; oblique and curved walls are replaced by a staircase line (staircase walls);
  • the program moves the right and top boundaries of the region to the grid node beyond X_MAX (Y_MAX) and adds a reserve column (row) (grid alignment).

The author's recommendations for choosing the step (user manual, Sec. 4.5 DELTA):

  • for an accuracy of about 3 %, the step should be about 1/20 of the guided wavelength at the maximum frequency; more precisely, it is determined by a series of convergence runs;
  • the analysis time grows in proportion to the cube of 1/Δ (time step), so a device is developed on a coarse grid, and the accurate computation is done on a fine one;
  • the step is chosen so that the geometry fits an integer number of steps (for metal thicknesses of 1, 2, 3, 4 mm, a step of 1 or 0.5 mm, not 1.02 or 0.47 mm).

Hard limits of the program: Δ≤λ0/5 at the frequency FREQ, ωτ0/2≤π/3, at least 10 steps along each axis of the region.

H-kernel accuracy

Convergence to the frequency-domain solution [Klimov, 2007, Sec. 9.5.2]. An H10 wave in a rectangular waveguide 4 mm wide (metal walls) is incident on a dielectric insert ε=4 that is 50 mm long; the frequency is 40 GHz (λ0=7,5 mm). The Rt-H result is compared with the Tamic H program, which solves the same problem in the frequency domain by the method of lines [Klimov, 2007, Table 9.3]:

Tamic H Δ=0,05 mm (≈λ/150) 0,125 mm (≈λ/60) 0,25 mm (≈λ/30) 0,5 mm (≈λ/15)
|S11| 0.923 0.9210 (0.21 %) 0.91724 (0.62 %) 0.8890 (3.68 %) 0.4721 (48.9 %)
|S12| 0.384 0.3935 (2.48 %) 0.4004 (4.28 %) 0.4582 (19.3 %) 0.880 (129 %)

The results converge to the exact solution as the step decreases; the phase deviations, according to [Klimov, 2007], are close to those expected from grid dispersion. The step λ0/15 is too coarse for this problem: the wavelength in the insert, λ0/ε=3,75 mm, is only 7.5 steps.

Quality of excitation and matching [Klimov, 2007, Sec. 9.5.1]. An H10 wave is excited in a waveguide 20 mm wide and 75 mm long and absorbed by a second transformer; the step is 2 mm and the frequency 10 GHz (λ0/Δ≈15). The reflected wave at the first input is small, and its level is limited by the finite precision of the computations; the computation was performed in double precision (float and double).

Frequency-dispersive medium [Klimov, 2007, Sec. 9.5.4]. The leading edge of a radio pulse (20 GHz) is scattered by a layer with permittivity of the form (2.38), equal to 0.25 at the carrier frequency (dispersive media). The transmitted and reflected signals computed by Rt-H agree well with the analytical solution (taking into account the additional permittivity steps in the computed geometry).

X-kernel accuracy

The dispersion equation for E-polarized waves in magnetized plasma is obtained from the four-parameter algorithm of the X kernel [Klimov, 2007, (7.40)]:

cos(αγcosγ)+cos(αγsinγ)=cos(2ωτ0)+Bcos(ωτ0)+A22Dcos(ωτ0)−C,(6)

where A, B, C, D are the coefficients of the algorithm, which depend on ωpτ0 and Ωτ0 ([Klimov, 2007, (7.18)–(7.21)]; X node coefficients). For an arbitrary angle the equation is solved numerically; for a wave along the edges and along the diagonal of the grid [Klimov, 2007, (7.42), (7.43), (7.88), (7.89)]:

α0=arccos(cos(2ωτ0)+Bcos(ωτ0)+A22Dcos(ωτ0)−C−1),απ/4=2arccoscos(2ωτ0)+Bcos(ωτ0)+A24Dcos(ωτ0)−2C,(7)

λγ′=2πΔ/αγ (7.87). A wave propagates in the grid when the arccosine arguments do not fall outside [−1,1] (7.44), (7.45). The exact wavelength of the extraordinary wave is [Klimov, 2007, (7.90), (7.91)]:

λ=2πcωω4−ω2(Ω2+ωp2)ω4−ω2(Ω2+2ωp2)+ωp4.(8)

Comparison for a plasma frequency fp=30 GHz, a cyclotron frequency F=20 GHz and a step Δ=0,5 mm [Klimov, 2007, Table 7.1] (wavelengths in mm). Cutoff frequencies: fL≈21,623 GHz, fR≈41,622 GHz, upper hybrid fh≈36,056 GHz; the wave propagates for fL<f<fh and f>fR (cutoffs and resonances).

f, GHz 23 26 30 33 35 42 45 50 60 70
exact λ 30.63 15.97 10.00 6.89 4.19 31.96 11.97 8.32 5.95 4.80
grid, along edges λ0′ 30.09 15.84 9.89 6.70 3.72 23.81 11.53 8.19 5.88 4.74
grid, along the diagonal λπ/4′ 30.09 15.85 9.91 6.73 3.78 23.82 11.55 8.21 5.91 4.78

Conclusions [Klimov, 2007, Sec. 7.4, 7.5]:

  • as the step Δ decreases (1, 0.5, 0.4, 0.3, 0.2, 0.1 mm, Fig. 7.6), the grid wavelength converges to the exact one;
  • the error grows near the cutoff frequencies fL, fR (the wavelength tends to infinity, and the error accumulates over a long length) and near the upper hybrid frequency fh (the wavelength in the plasma tends to zero, and Δ/λ grows);
  • the largest deviation occurs for propagation along the grid edges, and the smallest at an angle of 45°; the difference δ(0°)−δ(45°) is less than 0.025 % at 23 GHz and about 0.7 % at 63 GHz.

Reflection of a plane wave from a layer [Klimov, 2007, Sec. 9.5.3]. A plane wave is normally incident on a layer of thickness L2 (a region between magnetic walls 2 mm high, 40 GHz, λ0=7,5 mm); the Rt-X result is compared with the exact reflection coefficient. Reflection coefficient for L2=10 mm [Klimov, 2007, Table 9.4]:

ε1 exact λ/150 λ/60 λ/30 λ/15
0.9 0.0524 0.0523 (0.17 %) 0.0522 (0.38 %) 0.0516 (1.6 %) 0.049 (7 %)
0.5 0.1234 0.1218 (1.26 %) 0.1208 (2.16 %) 0.1169 (5.54 %) 0.1021 (21.02 %)
0.3 0.5355 0.5355 (0.003 %) 0.5344 (0.21 %) 0.5306 (0.92 %) 0.5146 (4.07 %)
0.1 0.558 0.5558 (0.43 %) 0.5467 (2.09 %) 0.5152 (8.34 %) 0.3841 (45.33 %)
0.01 0.965 0.9648 (0.014 %) 0.9641 (0.09 %) 0.9612 (0.39 %) 0.9463 (1.97 %)

For ε1=0,3 and different layer thicknesses [Klimov, 2007, Table 9.5]:

L2, mm exact λ/150 λ/60 λ/30 λ/15
10 0.5355 0.5356 (−0.02 %) 0.5344 (0.20 %) 0.5306 (0.93 %) 0.5147 (4.05 %)
14 0.0893 0.0929 (−3.85 %) 0.0957 (−6.68 %) 0.1061 (−15.79 %) 0.1449 (−38.33 %)
17 0.5379 0.5379 (0.01 %) 0.5367 (0.22 %) 0.5316 (1.19 %) 0.5140 (4.64 %)
20 0.1547 0.1501 (3.10 %) 0.1451 (6.65 %) 0.1276 (21.30 %) 0.0593 (160.7 %)

The data show convergence to the exact solution. The relative error is large where the reflection coefficient itself is small (the layer thickness is close to resonant): a small quantity is hard to obtain with a small relative error.

Magnetized plasma in the time domain [Klimov, 2007, Sec. 9.5.4]. The same layer (permittivity 0.25 at 20 GHz, plasma frequency about 17 GHz) was computed with the Rt-X program in an external field of 0.25 T. According to the relations of Ch. 3, an E-polarized wave in such a layer propagates for 14 GHz < f < 19 GHz and f > 21 GHz, i.e. a 20 GHz wave should be reflected by the layer; the transmitted and reflected signals are shown in Figs. 9.14–9.18 [Klimov, 2007].

float and double

The computation is performed in double-precision numbers. The real-number type of the kernels, _real, is defined in the shared header typerth.h (_PREC_DOUBLE): double, 8 bytes. It is used to store the node voltages and coefficients; an H-kernel node occupies 32 bytes (4 numbers), and an X-kernel node 96 bytes (12 numbers). Field files record the number size in the header (Accuracy), so the viewers read them correctly.

Why not float: the scheme is conservative and stable in exact arithmetic, but in single-precision arithmetic the rounding errors at every time step can accumulate. In one of the earlier builds the numbers were stored as float, and on a task with a polygon (X kernel) the field after the passage of the pulse did not decay but grew. The double build matched the computation of the earlier version of the program (2006), and the pulse decays in it; since then both programs compute in double. Likewise, the reflection level in the matching test [Klimov, 2007, Sec. 9.5.1] is limited by the finite precision of the computations.

Identical results from different builds. The results of the Qt6 version match the earlier Windows version of the package byte for byte. To achieve this, the build:

  • prohibits the compiler from fusing multiplication and addition into a single FMA operation (-ffp-contract=off): FMA rounds once instead of twice, and the last bits of the result would differ;
  • takes the mathematical functions (sin, cos, exp …) from the same ucrtbase.dll library as the programs built with MSVC.

Details: Main principle: the computation is not rewritten. GPU computing also yields the same bits as computation on the CPU (agreement with the CPU computation).

Mapping to the code

Quantity / action Variable, function File (src/)
Tolerance =arccos(2cosωτ0−1)/(2ωτ0)−1 CTmcDialogStatistics::PrepareData: dwt0 =ωτ0, dTolerance kernels/planarrt_h/tmcdialogstatistics.cpp, likewise in kernels/planarrt_x/
ωτ0 m_cParam.rt*m_cParam.rFreq*2*PI___ same file
y5 from Δε (without the correction (6.54)) CTmcRTHRectNode::SetDielInNodeList kernels/planarrt_h/tmcrthrectnode.cpp
cosβ=(2+|yW|/2)cosωτ0−1−yW/2 (dispersion equation for γ=0) SetAbsorberAdmitance; with cos(πΔ/b) — SetInputAdmitance kernels/planarrt_h/tmcrthnodediel.cpp
Δ≤λ0/5 CTmcRTH_IndanParam::IsCorrectly libs/tmcindan/tmcrth_indanparam.cpp
ωτ0/2≤π/3 SetDielInNodeList (koef1) kernels/planarrt_h/tmcrthrectnode.cpp
region alignment, reserve column IsCorrectly (nXGrid, nYGrid) libs/tmcindan/tmcrth_indanparam.cpp
block node weight (0.25…1) SetRect, SetCirc, SetPoly, EpsFastNode (rY) kernels/planarrt_h/tmcrthnodediel.cpp
_real = double #define _PREC_DOUBLE include/typerth.h
number size in a field file TMC_GROFLD_DOCFILE_ID_Accuracy, sizeof(_real) (PutField) kernels/planarrt_h/tmcrthrectnode.cpp
FMA prohibition, UCRT math -ffp-contract=off, compat/ucrt_libm_win.cpp CMakeLists.txt (root of the Qt6 version), src/compat/ucrt_libm_win.cpp

Sources

  • [Klimov, 2007] — Ch. 6, Sec. 6.5 ((6.45)–(6.54), Table 6.1); Ch. 7, Sec. 7.1 ((7.37)–(7.45)), 7.4 ((7.87)–(7.91), Table 7.1, Fig. 7.6), 7.5 (Fig. 7.7); Ch. 9, Sec. 9.5 (Tables 9.3–9.5).
  • [Klimov, 2025] — Ch. 2 ((2.38), (2.49)), Ch. 4 ((4.2), (4.21)).
  • TMC Suite user manual, "Task language", Sec. 4.5 DELTA (author's recommendations).
  • Grid rules — communicated by the package author.