Порты и возбуждение
Чтобы получить матрицу рассеяния устройства, на его входах нужно задавать не напряжения узлов, а падающие волны, и выделять отражённые. Для этого на входном сечении к узлам сетки подключается трансформатор возбуждения и поглощения: генераторы с внутренней проводимостью, согласованной с собственной волной входного волновода [Климов, 2007, разд. 6.4]. Он одновременно возбуждает падающую волну и без отражения поглощает волну, пришедшую из устройства. На этой странице выведены собственные волны волновода в Rτ-сетке, условия согласования трансформатора, описан сигнал на порту и показано, откуда берётся ошибка порта при широкополосном возбуждении и как она снимается. Исходные работы — [Климов, 2007, гл. 6, 7] и [Климов, Сестрорецкий, 2001, № 9].
В задании порт — блок INPUT_X (вход на левой или правой границе) или INPUT_Y (на нижней
или верхней) с параметрами: тип стенок (METAL или MAGNETIC), пределы апертуры, окно
времени , амплитуда Amp, фаза Faza и W
(разбор входов). На каждом такте порт пишет в файл .t
падающую и отражённую волны; по ним строится матрица рассеяния
(S-матрица по сигналам).
Собственные волны волновода
Волновод в сетке [Климов, 2007, разд. 6.3.1]. Сетка ограничена сверху и снизу металлом (условие КЗ в узлах и , металл), слева и справа не ограничена; волновод шириной заполнен диэлектриком . К каждому узлу подключён шлейф длиной : при — шлейф ХХ, при — шлейф КЗ [Климов, 2007, (6.4), (6.6)]:
Собственное решение — напряжение узла как функция номеров узла , и такта [Климов, 2007, (6.7)]:
т. е. вдоль оси фаза растёт на за шаг сетки при постоянной амплитуде, а вдоль оси фаза постоянна, а амплитуда распределена по закону . Подстановка (6.7) в формулу узла (4.21) (рассеяние H) даёт уравнение (6.17), откуда (6.19). С граничными условиями (6.20) ему удовлетворяют дискретных функций [Климов, 2007, (6.21)]
— сеточные аналоги волн , и каждой соответствует свой набег фазы на шаг сетки [Климов, 2007, (6.22)]:
где , «−» — шлейф ХХ, «+» — шлейф КЗ. Функции (6.21) образуют полный ортогональный базис: любое решение в волноводе — их линейная комбинация (6.23), где задаёт мощность моды.
Плоская волна — случай [Климов, 2007, (6.24), (6.25)]:
Условие распространения. Набег фазы вещественный, и волна распространяется, только если аргумент арккосинуса по модулю меньше единицы [Климов, 2007, (6.26)]:
Это сеточный аналог критической частоты: при невыполнении (6.26) волна не распространяется. Сравнение длины волны с точной — оценка точности сетки (численная дисперсия).
В программе порт работает с одной волной:
- порт со стенками-металлом (
METALили тип не задан) — основная волна , профиль по узлам апертуры ( интервалов, крайние узлы лежат на стенках и равны нулю); - порт
MAGNETIC— плоская волна с постоянным профилем между магнитными стенками.
Если на частоте FREQ аргумент (6.22) выходит за , частота ниже критической для
апертуры, и программа выдаёт ошибку «Frequency … is below cutoff of port». Апертура должна
содержать не меньше трёх узлов.
В ядре X узловая величина — , поэтому смысл стенок порта обратный
(двойственность): профиль порта METAL — волна с
на стенках, т. е. между магнитными стенками; постоянный профиль порта
MAGNETIC — плоская волна между металлическими стенками.
Трансформатор возбуждения и поглощения
Схема [Климов, 2007, разд. 6.4, рис. 6.6]. К узлам входного сечения подключаются генераторы с внутренней проводимостью , одинаковой для всех узлов входа, а линии вдоль сечения и шлейфы узлов входа берутся половинными — так же, как в поглощающей границе (поглощающая граница). При
[Климов, 2007, (6.37), (6.39)] волна , приходящая из устройства, поглощается без отражения. Падающая волна на узел входа [Климов, 2007, (6.40)]:
Нормировка. Чтобы матрица рассеяния была нормированной, мощность падающей волны не должна зависеть от размера сечения и типа волны [Климов, 2007, (6.41)–(6.43)]:
Отражённая волна — проекция отражённых напряжений узлов входа на профиль моды [Климов, 2007, (6.44)]:
Выражения (6.43) и (6.44) раскладывают собственное решение на входе на падающую и отражённую волны и позволяют считать матрицу рассеяния относительно волн . Нормировка по мощности и проекция на профиль следуют [Баскаков, 2000].
Для волн E [Климов, 2007, разд. 7.3] трансформатор устроен так же: генераторы с внутренней проводимостью по (7.54), коэффициенты по (7.53), падающая плоская волна (7.82), нормировка (7.83), (7.84) и обратное преобразование (7.85), (7.86) (поглощение для волн E).
В программе. При подготовке порта вычисляются шлейф среды порта по параметру W (ниже), проводимость генератора, профиль падающей волны и его нормирующий множитель.
Проводимость генератора — по (6.22), (6.37) для :
где — ширина апертуры, . У порта MAGNETIC — то же
по (6.25), т. е. формула нагрузки поглотителя с
порта.
Профиль , где (порт METAL) или
(порт MAGNETIC), с нормирующим множителем
В нормировку программы, в отличие от (6.42), входят ещё и . На коэффициенты
отражения это не влияет: падающая волна в .t записывается как сигнал , а
отражённая делится на (ниже). Множитель выравнивает
мощность, вводимую единичной волной, для портов разной ширины и среды, поэтому
между такими портами — доля мощности (подробнее — Матрица рассеяния).
На каждом такте падающее напряжение узла равно , где — сигнал порта (сигнал). Узел апертуры пересчитывается по схеме граничного узла (6.34) с , нагрузкой и источником (сосед внутрь области , соседи вдоль апертуры , ):
Без сигнала () это узел поглощающей границы с
нагрузкой . У крайних узлов порта MAGNETIC линии, шлейф и нагрузка вдвое меньше, а
отсутствующий сосед вдоль апертуры равен нулю; у порта METAL крайние узлы лежат на стенках
и не пересчитываются. Если порт стоит не на краю области, узел позади порта обнуляется —
область за портом отделена от сетки.
Отражённая волна — проекция по (6.44) отражённых напряжений узлов апертуры на профиль:
и в .t записываются номер блока, и .
Поскольку проводимость генератора согласована только с одной модой (6.37), порт поглощает без
отражения только основную волну на частоте FREQ. Высшие моды, дошедшие до порта
(например, от неоднородности, стоящей слишком близко к входу), частично отражаются.
Ядро X. Узел порта пересчитывается той же двухслойной формулой, без слагаемых плазмы, на каждом из четырёх подтактов; падающее напряжение двухтактной давности хранится отдельно для каждого подтакта. Значения узлов порта задаёт только порт: после общего прохода рассеяния они восстанавливаются из сохранённой копии (узлы порта ядра X).
Сторона входа определяется по точке привязки блока в #LINK_LIST: вход INPUT_X у левой
границы (или в левой половине области) — левый, у правой — правый; INPUT_Y — нижний или
верхний (размещение блоков). Апертура не подходит к краям
области ближе двух шагов.
Сигнал на порту: амплитуда и фаза как функции t, f
Падающая волна порта — радиоимпульс на частоте задания [Климов, 2007, (6.43)] с огибающей и фазой, заданными выражениями:
- Amp и Faza — не числа, а выражения, которые вычисляются заново на каждом такте.
В них доступны переменные
t— текущее время в единицахTIME_UNITиf— частотаFREQшага в единицахFREQ_UNIT(интерпретатор выражений). Пустой Amp — 1, пустая Faza — 0; если задан Amp, Faza обязательна. - Faza задаётся в единицах
ANGLE_UNIT( — множитель перевода в радианы) и входит со знаком «−»: положительная фаза — задержка. - Окно прямоугольное: сигнал включается и выключается скачком. Для
гладкого импульса окно берут широким, а огибающую задают в Amp, например гауссову
exp(-((t-20)/5)*((t-20)/5)). - Масштаб. Amp безразмерна: абсолютной шкалы напряжения в языке заданий нет. Матрица рассеяния — отношение отражённой волны к падающей, и масштаб в ней сокращается.
- Частота
FREQ— одновременно несущая сигнала и частота, на которой согласованы порты (проводимость генератора) и поглотители.
Подводный камень: степень. Операция ^ в выражениях требует осторожности. В версиях
программы до октября 2026 г. любое основание было ошибкой: выражение огибающей
exp(-((t-t0)/tau)^2) давало ошибку на всём фронте импульса (там ) и в его центре
(основание равно нулю), и расчёт останавливался на сообщении об ошибке. В текущей версии
отрицательное основание допустимо при целом показателе (, ); ошибкой
остаются дробный показатель при отрицательном основании, и при
(операции). Ошибка в выражении сигнала останавливает расчёт. Для
переносимых заданий чётные степени записывают умножением: ((t-t0)/tau)*((t-t0)/tau).
Параметр W порта
W — добавка проницаемости среды в сечении входа, ,
безразмерная, по умолчанию 0; должно быть . В выражении W нельзя
использовать переменные t и f. Шлейф узлов порта вычисляется по тому же правилу, что для
узлов диэлектрика (диэлектрик H), т. е. по (6.4) и (6.6):
(значения W в пределах 0,004 от 4 сдвигаются до 3,996 или 4,004, как у блоков). входит в дисперсионное уравнение для — проводимость генератора согласуется с волной в сетке, заполненной этой средой, — и в формулу узла порта как шлейф . В диссертации это соответствует вычислению внутренней проводимости генератора по дисперсионному уравнению среды на входе (7.54) [Климов, 2007, разд. 7.3].
Отсюда правило: W должно совпадать с блока, в котором стоит вход. Если вход стоит в диэлектрике, а W не задано, генератор согласован с вакуумом и вход отражает.
Ядро X. Для шлейф совпадает с коэффициентом узла неподмагниченной плазмы с , поэтому порт согласуется и со средой (ε < 1 и W). Внешнее поле и потери узел порта не учитывает.
Ошибка порта и поправка на рассогласование
Откуда ошибка. Проводимость генератора вычисляется один раз, на
частоте FREQ. Пока сигнал узкополосный, это верно. Если падающая волна несёт много частот
(короткий импульс, многочастотный сигнал, файл .sig), на частоте
порт с нагрузкой уже не согласован с волной и сам отражает с коэффициентом
где — та же формула на частоте .
Ошибка не зависит от шага сетки. При (, ) из формулы для для порта со стенками-металлом в вакууме
т. е. стремится к пределу, определяемому только отношением : это не ошибка
дискретизации, а рассогласование частотно-независимой нагрузки с волной , волновая
проводимость которой зависит от частоты. Измельчение сетки её не уменьшает — расчёты с шагом
от 2 до 0,25 мм дали одну и ту же ошибку до четвёртого знака. У порта MAGNETIC (плоская
волна, ) и от частоты практически не зависит — у такого порта этой
ошибки почти нет.
Поправка. Ядро даёт S-матрицу относительно опорной проводимости , а нужна матрица относительно . Переход — обычная перенормировка опорной проводимости:
Для одного порта это дробно-линейное преобразование .
Калибровочные расчёты не нужны: вычисляется по шагу сетки, ширине апертуры и
частоте FREQ. В проверочных расчётах паразитный пустого волноводного канала с
поправкой снизился с −14 дБ до −146 дБ и ниже.
Что реализовано в программе. Поправка выполняется при многочастотной обработке файла .t
(CTmcWideband, вьювер TMCROS и запись .s ядром) — когда хотя бы у одного порта падающая
волна задана файлом .sig (ниже). Ядро дописывает в заголовок .t для
каждого порта шаг сетки, апертуру и частоту согласования , и считается
по формуле для . Один расчёт даёт один столбец матрицы, поэтому реализованы частные
случаи (поправка):
- два порта: структура считается симметричной (, ), обоим портам приписывается возбуждённого; тогда матрица распадается на чётную и нечётную волны , каждая исправляется скалярно , и , ;
- другое число портов: исправляется только отражение возбуждённого порта .
Полная матричная поправка для несимметричной структуры (нужны оба возбуждения) в программе не
реализована. считается по формуле порта со стенками-металлом с : тип стенок
порта и W в заголовок .t не записываются, и для порта MAGNETIC или с применяется
та же формула. При одночастотном расчёте () , и поправка не нужна.
Подробно — поправка в коде.
Падающая волна из файла .sig
Вместо выражения Amp можно указать имя файла в квадратных скобках — тогда весь сигнал берётся из файла падающей волны:
INPUT_X ; ylo; yhi; 0; 40; [wg_multi]; 0;
- к имени без точки дописывается
.sig, файл без пути ищется в папке задания; - файл — текст в две колонки: время в единицах
TIME_UNITзадания и значение сигнала; строки, начинающиеся с!или#, пропускаются; время строго возрастает, точек — не меньше двух; - между точками — линейная интерполяция, вне диапазона файла — 0; окно порта тоже действует; поэтому шаг таблицы берут не крупнее шага по времени (шаг по времени);
- фаза Faza с файлом не используется: её задают равной 0 (обязательный параметр после Amp), на любое другое значение выводится предупреждение;
- строка
#FREQ f1 f2 …(вFREQ_UNIT) называет частоты многочастотного сигнала: ядро переносит их в заголовок.tв герцах, и обработка берёт их готовыми, не разыскивая пики в спектре.
FREQ задания при этом по-прежнему нужна: на ней согласуются порты (проводимость генератора) и
поглотители; её ставят внутри полосы сигнала.
Один проход — свип по частоте. Широкополосная падающая волна возбуждает устройство сразу
на всех своих частотах, и по одной записи .t строится S-матрица на каждой из них
(многочастотный расчёт). Обработка различает два вида сигнала:
непрерывный многотон (тоны разделяются подгонкой гармоник на установившемся участке) и
импульс (спектр — интеграл по всей записи), — и снимает рассогласование портов
(выше). Время расчёта при этом то же, что у одного одночастотного прохода. На
проверочных заданиях samples/MULTIFREQ (один широкополосный проход против покадрового свипа
по частоте) расхождение составило тысячные доли децибела. В одном расчёте — не больше 99
частот.
Соответствие в коде
| Символ / действие | Переменная, функция | Файл (src/) |
|---|---|---|
| по W (6.4), (6.6) | CalculateYForInput → dYInput |
kernels/planarrt_h/tmcrthnodediel.cpp, kernels/planarrt_x/tmcrthnodediel.cpp |
| по (6.22), (6.37), ; ошибка ниже отсечки | SetInputAdmitance → dY1_InputAdmitance |
то же |
порта MAGNETIC по (6.25), (6.37) |
SetAbsorberAdmitance |
то же |
| — ширина апертуры | dWidthWaveg, GetWidthWaveg() |
kernels/planarrt_*/tmcrthnodediel.h |
| профиль (6.21), (6.24) и множитель | SetYForInput: sTmcRTHNodeDielOne::rY, dUnormir |
kernels/planarrt_*/tmcrthnodediel.cpp |
| Amp, Faza (выражения) | csVx, csVy; dAmplitude, dFaza |
то же |
dWT в RunExciteInputs, RunExciteInputs1 |
kernels/planarrt_h/tmcrthrectnode.cpp |
|
| окно | dTmin, dTmax |
kernels/planarrt_*/tmcrthnodediel.h |
| узел порта | ExciteInputs, ExciteInputs1 (H); ExciteInputs…ExciteInputs3 (X) |
kernels/planarrt_*/tmcrthnodediel.cpp |
rU (H); rU2, rU3, rU, rU1 (X, по подтактам) |
kernels/planarrt_*/tmcrthnodediel.h |
|
(6.44), запись в .t |
dUo в ExciteInputs*, OutputUpUo |
kernels/planarrt_*/tmcrthnodediel.cpp |
| узлы порта в ядре X | RunSaveInputs, RunRestoreInputs |
kernels/planarrt_x/tmcrthrectnode.cpp |
разбор INPUT_X/INPUT_Y, запрет t, f в W |
ReadInputX, ReadInputY, TmcExprUsesTorF |
libs/tmcindan/tmcrth_bolcklist.cpp |
| сторона входа | CTmcRTH_IndanTopology::ReadLink |
libs/tmcindan/tmcrth_indantopology.cpp |
операция ^ |
ERROR_POW |
libs/expr/expr_com.cpp |
файл .sig |
SeachSignalFileName, ReadSignalFile, dSignalFromFile; bSigFile, csSigFreq |
kernels/planarrt_*/tmcrthnodediel.cpp |
заголовок .t: #TMC_GROTS_Wideband, _SigFreq, _Port |
CTmcRTHRectNode::PutPortInfo |
kernels/planarrt_*/tmcrthrectnode.cpp |
| (коэффициент отражения порта) | CTmcWideband::PortGamma |
viewers/tmcrtout/tmcwideband.cpp, include/tmcwideband.h |
| поправка, частные случаи | CTmcWideband::FixMismatch, TmcWbBilinear |
то же |
| многочастотная обработка | CTmcWideband::Process, MakeAndSave |
то же |
Подробное описание кода — порты ядра H, падающая волна из файла, порты ядра X, многочастотная обработка, поправка на рассогласование.
Источники
- [Климов, 2007] — гл. 6: разд. 6.3.1 ((6.3)–(6.26)), 6.3.2 ((6.27)–(6.39)), 6.4 ((6.40)–(6.44), рис. 6.6); гл. 7: разд. 7.2 ((7.53), (7.54)), 7.3 ((7.82)–(7.86), рис. 7.5); гл. 4: (4.21).
- [Климов, Сестрорецкий, 2001, № 9] — граничные условия поглощения и возбуждения плоских и собственных волн прямоугольного волновода в планарной Rτ-сетке.
- [Баскаков, 2000] — нормировка падающей волны и обратное преобразование (6.41), (6.44).
- [Климов, 2025] — гл. 4, разд. 4.1; гл. 5, разд. 5.2 (активная проводимость узла для граничных условий возбуждения и согласования).
- Полный список литературы — Литература.
Ports and excitation
To obtain the scattering matrix of a device, one must specify at its inputs not node voltages but incident waves, and extract the reflected ones. For this purpose, an excitation and absorption transformer is connected to the grid nodes at the input cross-section: generators with an internal admittance matched to the eigenmode of the input waveguide [Klimov, 2007, Sec. 6.4]. It simultaneously excites the incident wave and absorbs without reflection the wave arriving from the device. This page derives the waveguide eigenmodes in the Rτ-grid and the matching conditions of the transformer, describes the port signal and shows where the port error comes from under wideband excitation and how it is removed. The original works are [Klimov, 2007, Ch. 6, 7] and [Klimov, Sestroretsky, 2001, No. 9].
In the task file, a port is an INPUT_X block (an input on the left or right boundary) or an INPUT_Y block (on the bottom
or top boundary) with the parameters: wall type (METAL or MAGNETIC), aperture limits, time
window , amplitude Amp, phase Faza and W
(input parsing). At every time step the port writes to the .t file
the incident wave and the reflected wave ; the scattering matrix is built from them
(S-matrix from signals).
Waveguide eigenmodes
A waveguide in the grid [Klimov, 2007, Sec. 6.3.1]. The grid is bounded above and below by metal (SC condition at the nodes and , metal) and is unbounded on the left and right; a waveguide of width is filled with a dielectric . A stub of length is connected to each node: an OC stub for and an SC stub for [Klimov, 2007, (6.4), (6.6)]:
The eigensolution is the node voltage as a function of the node indices , and the time step [Klimov, 2007, (6.7)]:
i.e. along the axis the phase increases by per grid step at constant amplitude, while along the axis the phase is constant and the amplitude is distributed according to . Substituting (6.7) into the node formula (4.21) (H scattering) gives equation (6.17), whence (6.19). With the boundary conditions (6.20), it is satisfied by discrete functions [Klimov, 2007, (6.21)]
— the grid analogues of the waves, each with its own phase shift per grid step [Klimov, 2007, (6.22)]:
where , "−" for an OC stub, "+" for an SC stub. The functions (6.21) form a complete orthogonal basis: any solution in the waveguide is their linear combination (6.23), where sets the mode power.
Plane wave — the case [Klimov, 2007, (6.24), (6.25)]:
Propagation condition. The phase shift is real, and the wave propagates, only if the absolute value of the arccosine argument is less than one [Klimov, 2007, (6.26)]:
This is the grid analogue of the cutoff frequency: if (6.26) is not satisfied, the wave does not propagate. Comparing the wavelength with the exact one gives an estimate of the grid accuracy (numerical dispersion).
In the program, a port works with one wave:
- a port with metal walls (
METALor type not specified) — the fundamental mode , with the profile over the aperture nodes ( intervals; the outermost nodes lie on the walls and are zero); - a
MAGNETICport — a plane wave with a constant profile between magnetic walls.
If at the frequency FREQ the argument of (6.22) falls outside , the frequency is below cutoff for the
aperture, and the program reports the error "Frequency … is below cutoff of port". The aperture must
contain at least three nodes.
In the X kernel the nodal quantity is , so the meaning of the port walls is reversed
(duality): the profile of a METAL port is a wave with
on the walls, i.e. between magnetic walls; the constant profile of a
MAGNETIC port is a plane wave between metal walls.
Excitation and absorption transformer
Circuit [Klimov, 2007, Sec. 6.4, Fig. 6.6]. Generators with an internal admittance , the same for all input nodes, are connected to the nodes of the input cross-section, and the lines along the cross-section and the stubs of the input nodes are halved — in the same way as in the absorbing boundary (absorbing boundary). For
[Klimov, 2007, (6.37), (6.39)], the wave arriving from the device is absorbed without reflection. The incident wave at input node is [Klimov, 2007, (6.40)]:
Normalization. For the scattering matrix to be normalized, the power of the incident wave must not depend on the cross-section size or the wave type [Klimov, 2007, (6.41)–(6.43)]:
The reflected wave is the projection of the reflected voltages of the input nodes onto the mode profile [Klimov, 2007, (6.44)]:
Expressions (6.43) and (6.44) decompose the eigensolution at the input into incident and reflected waves and make it possible to compute the scattering matrix with respect to the waves. The power normalization and the projection onto the profile follow [Baskakov, 2000].
For E waves [Klimov, 2007, Sec. 7.3], the transformer is arranged in the same way: generators with an internal admittance according to (7.54), coefficients according to (7.53), an incident plane wave (7.82), normalization (7.83), (7.84) and the inverse transformation (7.85), (7.86) (absorption for E waves).
In the program. When a port is prepared, the following are computed: the stub of the port medium from the W parameter (below), the generator admittance, the incident-wave profile and its normalizing factor.
Generator admittance — according to (6.22), (6.37) for :
where is the aperture width, . For a MAGNETIC port, the same is done
according to (6.25), i.e. using the absorber load formula with the of the
port.
Profile , where (METAL port) or
(MAGNETIC port), with the normalizing factor
Unlike (6.42), the program's normalization also includes and . This does not affect the reflection
coefficients : the incident wave is written to .t as the signal , and
the reflected wave is divided by (below). The factor equalizes
the power delivered by a unit wave for ports of different widths and media, so
between such ports is a power fraction (for details, see Scattering matrix).
At every time step, the incident voltage of node equals , where is the port signal (signal). An aperture node is updated according to the boundary-node circuit (6.34) with , the load and a source (the neighbour towards the region interior , the neighbours along the aperture , ):
Without a signal (), this is an absorbing-boundary node with
the load . For the outermost nodes of a MAGNETIC port, the lines, the stub and the load are halved, and
the missing neighbour along the aperture is zero; for a METAL port the outermost nodes lie on the walls
and are not updated. If the port is not at the region edge, the node behind the port is set to zero —
the region behind the port is separated from the grid.
The reflected wave is the projection, according to (6.44), of the reflected voltages of the aperture nodes onto the profile:
and the block number, and are written to .t.
Since the generator admittance is matched to only one mode (6.37), the port absorbs without
reflection only the fundamental mode at the frequency FREQ. Higher-order modes that reach the port
(for example, from a discontinuity placed too close to the input) are partially reflected.
X kernel. The port node is updated by the same two-layer formula, without the plasma terms, at each of the four sub-steps; the incident voltage from two time steps earlier is stored separately for each sub-step. The port node values are set only by the port: after the common scattering pass they are restored from a saved copy (X-kernel port nodes).
The input side is determined by the anchor point of the block in #LINK_LIST: an INPUT_X input at the left
boundary (or in the left half of the region) is a left input, at the right boundary a right one; INPUT_Y is a bottom or
top input (block placement). The aperture must not come closer than two steps to the
region edges.
Port signal: amplitude and phase as functions of t, f
The incident wave of a port is a radio pulse at the task frequency [Klimov, 2007, (6.43)] with an envelope and a phase specified by expressions:
- Amp and Faza are not numbers but expressions that are re-evaluated at every time step.
They can use the variables
t— the current time inTIME_UNITunits, andf— the step frequencyFREQinFREQ_UNITunits (expression interpreter). An empty Amp means 1 and an empty Faza means 0; if Amp is specified, Faza is mandatory. - Faza is specified in
ANGLE_UNITunits ( is the conversion factor to radians) and enters with a "−" sign: a positive phase is a delay. - The window is rectangular: the signal is switched on and off abruptly. For
a smooth pulse, the window is made wide and the envelope is specified in Amp, for example a Gaussian
exp(-((t-20)/5)*((t-20)/5)). - Scale. Amp is dimensionless: the task language has no absolute voltage scale. The scattering matrix is the ratio of the reflected wave to the incident one, and the scale cancels out in it.
- The frequency
FREQis both the signal carrier and the frequency at which the ports (generator admittance) and absorbers are matched.
Pitfall: exponentiation. The ^ operation in expressions requires care. In program versions
before October 2026, any base was an error: the envelope expression
exp(-((t-t0)/tau)^2) produced an error over the entire leading edge of the pulse (where ) and at its centre
(the base is zero), and the computation stopped with an error message. In the current version
a negative base is allowed with an integer exponent (, ); a fractional exponent with a negative base,
and for remain errors
(operations). An error in a signal expression stops the computation. For
portable task files, even powers are written as multiplication: ((t-t0)/tau)*((t-t0)/tau).
The W parameter of a port
W is the permittivity increment of the medium in the input cross-section, ,
dimensionless, 0 by default; is required. The variables t and f cannot be used
in the W expression. The stub of the port nodes is computed by the same rule as for
dielectric nodes (H dielectric), i.e. according to (6.4) and (6.6):
(values of W within 0.004 of 4 are shifted to 3.996 or 4.004, as for blocks). enters the dispersion equation for — the generator admittance is matched to the wave in a grid filled with this medium — and the port node formula as the stub . In the dissertation, this corresponds to computing the internal admittance of the generator from the dispersion equation of the medium at the input (7.54) [Klimov, 2007, Sec. 7.3].
Hence the rule: W must coincide with the of the block in which the input is located. If the input is located in a dielectric and W is not specified, the generator is matched to vacuum and the input reflects.
X kernel. For , the stub coincides with the coefficient of an unmagnetized plasma node with , so the port is also matched to a medium with (ε < 1 and W). The port node does not take into account the external field or losses.
Port error and mismatch correction
Where the error comes from. The generator admittance is computed once, at
the frequency FREQ. As long as the signal is narrowband, this is correct. If the incident wave carries many frequencies
(a short pulse, a multi-frequency signal, a .sig file), then at a frequency
the port with load is no longer matched to the wave and itself reflects with the coefficient
where is the same formula at the frequency .
The error does not depend on the grid step. As (, ), the formula for for a port with metal walls in vacuum gives
i.e. tends to a limit determined only by the ratio : this is not a discretization
error but the mismatch of a frequency-independent load with the wave, whose characteristic
admittance depends on frequency. Refining the grid does not reduce it — computations with steps
from 2 to 0.25 mm gave the same error to the fourth digit. For a MAGNETIC port (plane
wave, ), and is practically independent of frequency — such a port has almost none of this
error.
Correction. The kernel gives the S-matrix with respect to the reference admittance , whereas the matrix with respect to is needed. The transition is an ordinary renormalization of the reference admittance:
For a single port, this is the bilinear (Möbius) transformation .
No calibration runs are needed: is computed from the grid step, the aperture width and
the frequency FREQ. In verification runs, the spurious of an empty waveguide channel
decreased with the correction from −14 dB to −146 dB and below.
What is implemented in the program. The correction is applied during multi-frequency processing of the .t file
(CTmcWideband, the TMCROS viewer and the writing of .s by the kernel) — when the incident wave of at least one port
is specified by a .sig file (below). The kernel appends to the .t header, for
each port, the grid step, the aperture and the matching frequency , and is computed
by the formula for . One computation gives one column of the matrix, so special
cases are implemented (correction):
- two ports: the structure is assumed to be symmetric (, ), and both ports are assigned the of the excited port; the matrix then splits into even and odd waves , each corrected as a scalar , and , ;
- any other number of ports: only the reflection of the excited port is corrected, .
The full matrix correction for an asymmetric structure (which requires both excitations) is not implemented
in the program. is computed using the formula for a port with metal walls and : the wall type of
the port and W are not written to the .t header, and for a MAGNETIC port or one with
the same formula is applied. In a single-frequency computation (), and no correction is needed.
In detail: correction in the code.
Incident wave from a .sig file
Instead of an Amp expression, a file name in square brackets can be given — then the entire signal is taken from the incident-wave file:
INPUT_X ; ylo; yhi; 0; 40; [wg_multi]; 0;
.sigis appended to a name without a dot; a file without a path is searched for in the task-file folder;- the file is text in two columns: time in the
TIME_UNITunits of the task file and the signal value; lines beginning with!or#are skipped; time must be strictly increasing, with at least two points; - linear interpolation is used between points, and outside the file range the signal is 0; the port window also applies; therefore the table step is chosen no coarser than the time step (time step);
- the phase Faza is not used with a file: it is set to 0 (a mandatory parameter after Amp), and a warning is issued for any other value;
- the line
#FREQ f1 f2 …(inFREQ_UNIT) names the frequencies of a multi-frequency signal: the kernel transfers them to the.theader in hertz, and the processing takes them as given, without searching for peaks in the spectrum.
The task frequency FREQ is still needed in this case: the ports (generator admittance) and
absorbers are matched at it; it is placed within the signal band.
One pass is a frequency sweep. A wideband incident wave excites the device at all of its
frequencies at once, and an S-matrix at each of them is built from a single .t record
(multi-frequency computation). The processing distinguishes two kinds of signal:
a continuous multitone (the tones are separated by harmonic fitting over the steady-state interval) and
a pulse (the spectrum is an integral over the entire record) — and removes the port mismatch
(above). The computation time is the same as for a single single-frequency pass. On
the verification tasks samples/MULTIFREQ (one wideband pass versus a frequency-by-frequency sweep),
the discrepancy was a few thousandths of a decibel. A single computation can include no more than 99
frequencies.
Mapping to the code
| Symbol / action | Variable, function | File (src/) |
|---|---|---|
| from W (6.4), (6.6) | CalculateYForInput → dYInput |
kernels/planarrt_h/tmcrthnodediel.cpp, kernels/planarrt_x/tmcrthnodediel.cpp |
| according to (6.22), (6.37), ; below-cutoff error | SetInputAdmitance → dY1_InputAdmitance |
same files |
of a MAGNETIC port according to (6.25), (6.37) |
SetAbsorberAdmitance |
same files |
| — aperture width | dWidthWaveg, GetWidthWaveg() |
kernels/planarrt_*/tmcrthnodediel.h |
| profile (6.21), (6.24) and factor | SetYForInput: sTmcRTHNodeDielOne::rY, dUnormir |
kernels/planarrt_*/tmcrthnodediel.cpp |
| Amp, Faza (expressions) | csVx, csVy; dAmplitude, dFaza |
same files |
dWT in RunExciteInputs, RunExciteInputs1 |
kernels/planarrt_h/tmcrthrectnode.cpp |
|
| window | dTmin, dTmax |
kernels/planarrt_*/tmcrthnodediel.h |
| port node | ExciteInputs, ExciteInputs1 (H); ExciteInputs…ExciteInputs3 (X) |
kernels/planarrt_*/tmcrthnodediel.cpp |
rU (H); rU2, rU3, rU, rU1 (X, per sub-step) |
kernels/planarrt_*/tmcrthnodediel.h |
|
(6.44), writing to .t |
dUo in ExciteInputs*, OutputUpUo |
kernels/planarrt_*/tmcrthnodediel.cpp |
| port nodes in the X kernel | RunSaveInputs, RunRestoreInputs |
kernels/planarrt_x/tmcrthrectnode.cpp |
parsing of INPUT_X/INPUT_Y, prohibition of t, f in W |
ReadInputX, ReadInputY, TmcExprUsesTorF |
libs/tmcindan/tmcrth_bolcklist.cpp |
| input side | CTmcRTH_IndanTopology::ReadLink |
libs/tmcindan/tmcrth_indantopology.cpp |
^ operation |
ERROR_POW |
libs/expr/expr_com.cpp |
.sig file |
SeachSignalFileName, ReadSignalFile, dSignalFromFile; bSigFile, csSigFreq |
kernels/planarrt_*/tmcrthnodediel.cpp |
.t header: #TMC_GROTS_Wideband, _SigFreq, _Port |
CTmcRTHRectNode::PutPortInfo |
kernels/planarrt_*/tmcrthrectnode.cpp |
| (port reflection coefficient) | CTmcWideband::PortGamma |
viewers/tmcrtout/tmcwideband.cpp, include/tmcwideband.h |
| correction, special cases | CTmcWideband::FixMismatch, TmcWbBilinear |
same files |
| multi-frequency processing | CTmcWideband::Process, MakeAndSave |
same files |
A detailed description of the code: H-kernel ports, incident wave from a file, X-kernel ports, multi-frequency processing, mismatch correction.
Sources
- [Klimov, 2007] — Ch. 6: Sec. 6.3.1 ((6.3)–(6.26)), 6.3.2 ((6.27)–(6.39)), 6.4 ((6.40)–(6.44), Fig. 6.6); Ch. 7: Sec. 7.2 ((7.53), (7.54)), 7.3 ((7.82)–(7.86), Fig. 7.5); Ch. 4: (4.21).
- [Klimov, Sestroretsky, 2001, No. 9] — absorbing and excitation boundary conditions for plane waves and rectangular-waveguide eigenmodes in a planar Rτ-grid.
- [Baskakov, 2000] — normalization of the incident wave and the inverse transformation (6.41), (6.44).
- [Klimov, 2025] — Ch. 4, Sec. 4.1; Ch. 5, Sec. 5.2 (active conductance of a node for excitation and matching boundary conditions).
- The full reference list is given in References.