Порты и возбуждение

Чтобы получить матрицу рассеяния устройства, на его входах нужно задавать не напряжения узлов, а падающие волны, и выделять отражённые. Для этого на входном сечении к узлам сетки подключается трансформатор возбуждения и поглощения: генераторы с внутренней проводимостью, согласованной с собственной волной входного волновода [Климов, 2007, разд. 6.4]. Он одновременно возбуждает падающую волну и без отражения поглощает волну, пришедшую из устройства. На этой странице выведены собственные волны волновода в Rτ-сетке, условия согласования трансформатора, описан сигнал на порту и показано, откуда берётся ошибка порта при широкополосном возбуждении и как она снимается. Исходные работы — [Климов, 2007, гл. 6, 7] и [Климов, Сестрорецкий, 2001, № 9].

В задании порт — блок INPUT_X (вход на левой или правой границе) или INPUT_Y (на нижней или верхней) с параметрами: тип стенок (METAL или MAGNETIC), пределы апертуры, окно времени Tmin…Tmax, амплитуда Amp, фаза Faza и W (разбор входов). На каждом такте порт пишет в файл .t падающую Up и отражённую Uo волны; по ним строится матрица рассеяния (S-матрица по сигналам).

Собственные волны волновода

Волновод в сетке [Климов, 2007, разд. 6.3.1]. Сетка ограничена сверху и снизу металлом (условие КЗ в узлах ny=0 и ny=N, металл), слева и справа не ограничена; волновод шириной NΔ заполнен диэлектриком ε1. К каждому узлу подключён шлейф длиной τ0/2: при ε1>ε0 — шлейф ХХ, при ε1<ε0 — шлейф КЗ [Климов, 2007, (6.4), (6.6)]:

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

Собственное решение — напряжение узла как функция номеров узла nx, ny и такта τ [Климов, 2007, (6.7)]:

Uτ(nx,ny)=f(ny)sin(ωττ0+αnx),(2)

т. е. вдоль оси x фаза растёт на α за шаг сетки при постоянной амплитуде, а вдоль оси y фаза постоянна, а амплитуда распределена по закону f(ny). Подстановка (6.7) в формулу узла (4.21) (рассеяние H) даёт уравнение (6.17), откуда (f(ny+1)+f(ny−1))/f(ny)=const (6.19). С граничными условиями f(0)=f(N)=0 (6.20) ему удовлетворяют N−1 дискретных функций [Климов, 2007, (6.21)]

fm(ny)=sin(πnyNm),m=1…N−1,(3)

— сеточные аналоги волн Hm0, и каждой соответствует свой набег фазы на шаг сетки [Климов, 2007, (6.22)]:

αm=arccos((2+y52)cos(ωτ0)−cos(πmN)∓y52),(4)

где y5=Y5/Y0>0, «−» — шлейф ХХ, «+» — шлейф КЗ. Функции (6.21) образуют полный ортогональный базис: любое решение в волноводе — их линейная комбинация Uτ=∑mAmfm(ny)sin(ωττ0+αmnx) (6.23), где Am задаёт мощность моды.

Плоская волна — случай m=0 [Климов, 2007, (6.24), (6.25)]:

f0(ny)=1,α0=arccos((2+y52)cos(ωτ0)−1∓y52).(5)

Условие распространения. Набег фазы вещественный, и волна распространяется, только если аргумент арккосинуса по модулю меньше единицы [Климов, 2007, (6.26)]:

−1<(2+y52)cos(ωτ0)−cos(πmN)∓y52<1.(6)

Это сеточный аналог критической частоты: при невыполнении (6.26) волна Hm0 не распространяется. Сравнение длины волны 2πΔ/αm с точной — оценка точности сетки (численная дисперсия).

В программе порт работает с одной волной:

  • порт со стенками-металлом (METAL или тип не задан) — основная волна m=1, профиль sin(πi/(Np−1)) по узлам апертуры i=0…Np−1 (Np−1 интервалов, крайние узлы лежат на стенках и равны нулю);
  • порт MAGNETIC — плоская волна m=0 с постоянным профилем между магнитными стенками.

Если на частоте FREQ аргумент (6.22) выходит за [−1,1], частота ниже критической для апертуры, и программа выдаёт ошибку «Frequency … is below cutoff of port». Апертура должна содержать не меньше трёх узлов.

В ядре X узловая величина — Hz, поэтому смысл стенок порта обратный (двойственность): профиль sin порта METAL — волна с Hz=0 на стенках, т. е. между магнитными стенками; постоянный профиль порта MAGNETIC — плоская волна между металлическими стенками.

Трансформатор возбуждения и поглощения

Схема [Климов, 2007, разд. 6.4, рис. 6.6]. К узлам входного сечения подключаются генераторы с внутренней проводимостью Ym0, одинаковой для всех узлов входа, а линии вдоль сечения и шлейфы узлов входа берутся половинными — так же, как в поглощающей границе (поглощающая граница). При

ym0=Ym0Y0=sinαmsin(ωτ0),Bm=Cm=12(7)

[Климов, 2007, (6.37), (6.39)] волна Hm0, приходящая из устройства, поглощается без отражения. Падающая волна на узел k входа [Климов, 2007, (6.40)]:

UPmτ(k)=Amfm(k)sin(ωττ0).(8)

Нормировка. Чтобы матрица рассеяния была нормированной, мощность падающей волны не должна зависеть от размера сечения и типа волны [Климов, 2007, (6.41)–(6.43)]:

∑k=1N−1Am2fm2(k)=1,Am=1∑k=1N−1fm2(k),UPmτ(k)=fm(k)sin(ωττ0)∑k=1N−1fm2(k).(9)

Отражённая волна — проекция отражённых напряжений узлов входа на профиль моды [Климов, 2007, (6.44)]:

UOτ=1∑k=1N−1fm2(k)∑k=1N−1fm(k)UOmτ(k).(10)

Выражения (6.43) и (6.44) раскладывают собственное решение на входе на падающую и отражённую волны и позволяют считать матрицу рассеяния относительно волн Hm0. Нормировка по мощности и проекция на профиль следуют [Баскаков, 2000].

Для волн E [Климов, 2007, разд. 7.3] трансформатор устроен так же: генераторы с внутренней проводимостью y0γ по (7.54), коэффициенты Bγ=Cγ=1/2 по (7.53), падающая плоская волна UPγτ(k)=Aγ(k)sin(ωττ0) (7.82), нормировка (7.83), (7.84) и обратное преобразование (7.85), (7.86) (поглощение для волн E).

В программе. При подготовке порта вычисляются шлейф среды порта yW по параметру W (ниже), проводимость генератора, профиль падающей волны и его нормирующий множитель.

Проводимость генератора y1 — по (6.22), (6.37) для m=1:

y1=sinα1sin(ωτ0),cosα1=(2+|yW|2)cos(ωτ0)−yW2−cosπΔb,ωτ0=2πΔFREQc,(11)

где b=(Np−1)Δ — ширина апертуры, πΔ/b=π/N. У порта MAGNETIC — то же по (6.25), т. е. формула нагрузки поглотителя с yW порта.

Профиль ri=Unpi, где pi=sin(πi/(Np−1)) (порт METAL) или pi=1 (порт MAGNETIC), с нормирующим множителем

Un=1y1Δ2∑ipi2.(12)

В нормировку программы, в отличие от (6.42), входят ещё y1 и Δ2. На коэффициенты отражения Snn это не влияет: падающая волна в .t записывается как сигнал a(t), а отражённая делится на ∑iri2 (ниже). Множитель y1 выравнивает мощность, вводимую единичной волной, для портов разной ширины и среды, поэтому |Smn|2 между такими портами — доля мощности (подробнее — Матрица рассеяния).

На каждом такте падающее напряжение узла i равно riaτ, где a(t) — сигнал порта (сигнал). Узел апертуры пересчитывается по схеме граничного узла (6.34) с B=C=1/2, нагрузкой y1 и источником (сосед внутрь области Uin, соседи вдоль апертуры Ua, Ub):

Uτ=22+y1+|yW|/2(12Uaτ−1+Uinτ−1+12Ubτ−1+yW2Uτ−1+y1(Uτ−2+riaτ−riaτ−2))−Uτ−2.(13)

Без сигнала (a=0) это узел поглощающей границы с нагрузкой y1. У крайних узлов порта MAGNETIC линии, шлейф и нагрузка вдвое меньше, а отсутствующий сосед вдоль апертуры равен нулю; у порта METAL крайние узлы лежат на стенках и не пересчитываются. Если порт стоит не на краю области, узел позади порта обнуляется — область за портом отделена от сетки.

Отражённая волна — проекция по (6.44) отражённых напряжений Ui−ria узлов апертуры на профиль:

Uo=∑iri(Ui−ria)∑iri2,(14)

и в .t записываются номер блока, Up=a(t) и Uo.

Поскольку проводимость генератора согласована только с одной модой (6.37), порт поглощает без отражения только основную волну на частоте FREQ. Высшие моды, дошедшие до порта (например, от неоднородности, стоящей слишком близко к входу), частично отражаются.

Ядро X. Узел порта пересчитывается той же двухслойной формулой, без слагаемых плазмы, на каждом из четырёх подтактов; падающее напряжение двухтактной давности хранится отдельно для каждого подтакта. Значения узлов порта задаёт только порт: после общего прохода рассеяния они восстанавливаются из сохранённой копии (узлы порта ядра X).

Сторона входа определяется по точке привязки блока в #LINK_LIST: вход INPUT_X у левой границы (или в левой половине области) — левый, у правой — правый; INPUT_Y — нижний или верхний (размещение блоков). Апертура не подходит к краям области ближе двух шагов.

Сигнал на порту: амплитуда и фаза как функции t, f

Падающая волна порта — радиоимпульс на частоте задания [Климов, 2007, (6.43)] с огибающей и фазой, заданными выражениями:

a(t)={Amp(t,f)sin(2πFREQ·t+φ(t,f)),Tmin≤t≤Tmax,0,иначе,φ=−Faza(t,f)·uangle.(15)
  • Amp и Faza — не числа, а выражения, которые вычисляются заново на каждом такте. В них доступны переменные t — текущее время в единицах TIME_UNIT и f — частота FREQ шага в единицах FREQ_UNIT (интерпретатор выражений). Пустой Amp — 1, пустая Faza — 0; если задан Amp, Faza обязательна.
  • Faza задаётся в единицах ANGLE_UNIT (uangle — множитель перевода в радианы) и входит со знаком «−»: положительная фаза — задержка.
  • Окно Tmin…Tmax прямоугольное: сигнал включается и выключается скачком. Для гладкого импульса окно берут широким, а огибающую задают в Amp, например гауссову exp(-((t-20)/5)*((t-20)/5)).
  • Масштаб. Amp безразмерна: абсолютной шкалы напряжения в языке заданий нет. Матрица рассеяния — отношение отражённой волны к падающей, и масштаб в ней сокращается.
  • Частота FREQ — одновременно несущая сигнала и частота, на которой согласованы порты (проводимость генератора) и поглотители.

Подводный камень: степень. Операция ^ в выражениях требует осторожности. В версиях программы до октября 2026 г. любое основание ≤0 было ошибкой: выражение огибающей exp(-((t-t0)/tau)^2) давало ошибку на всём фронте импульса (там t−t0<0) и в его центре (основание равно нулю), и расчёт останавливался на сообщении об ошибке. В текущей версии отрицательное основание допустимо при целом показателе ((−2)3=−8, 02=0); ошибкой остаются дробный показатель при отрицательном основании, 00 и 0y при y<0 (операции). Ошибка в выражении сигнала останавливает расчёт. Для переносимых заданий чётные степени записывают умножением: ((t-t0)/tau)*((t-t0)/tau).

Параметр W порта

W — добавка проницаемости среды в сечении входа, W=Δε=ε−1, безразмерная, по умолчанию 0; должно быть ε=1+W>0. В выражении W нельзя использовать переменные t и f. Шлейф узлов порта вычисляется по тому же правилу, что для узлов диэлектрика (диэлектрик H), т. е. по (6.4) и (6.6):

yW=4W(W≥0),yW=W(ωτ0)2=W(k0Δ)22(W<0),k0=2πFREQc(16)

(значения W в пределах 0,004 от 4 сдвигаются до 3,996 или 4,004, как у блоков). yW входит в дисперсионное уравнение для y1 — проводимость генератора согласуется с волной в сетке, заполненной этой средой, — и в формулу узла порта как шлейф yW/2. В диссертации это соответствует вычислению внутренней проводимости генератора по дисперсионному уравнению среды на входе (7.54) [Климов, 2007, разд. 7.3].

Отсюда правило: W должно совпадать с Δε блока, в котором стоит вход. Если вход стоит в диэлектрике, а W не задано, генератор согласован с вакуумом и вход отражает.

Ядро X. Для W<0 шлейф yW=W(ωτ0)2 совпадает с коэффициентом Y1 узла неподмагниченной плазмы с ωp2=−WωF2, поэтому порт согласуется и со средой ε<1 (ε < 1 и W). Внешнее поле B и потери узел порта не учитывает.

Ошибка порта и поправка на рассогласование

Откуда ошибка. Проводимость генератора y1 вычисляется один раз, на частоте FREQ. Пока сигнал узкополосный, это верно. Если падающая волна несёт много частот (короткий импульс, многочастотный сигнал, файл .sig), на частоте f≠f0 порт с нагрузкой y1(f0) уже не согласован с волной и сам отражает с коэффициентом

Γ(f)=y1(f)−y1(f0)y1(f)+y1(f0),(17)

где y1(f) — та же формула на частоте f.

Ошибка не зависит от шага сетки. При Δ→0 (ωτ0→0, πΔ/b→0) из формулы для y1 для порта со стенками-металлом в вакууме

y1→21−(fcf)2,fc=c2b,(18)

т. е. Γ(f) стремится к пределу, определяемому только отношением f/fc: это не ошибка дискретизации, а рассогласование частотно-независимой нагрузки с волной H10, волновая проводимость которой зависит от частоты. Измельчение сетки её не уменьшает — расчёты с шагом от 2 до 0,25 мм дали одну и ту же ошибку до четвёртого знака. У порта MAGNETIC (плоская волна, fc=0) y1→2 и от частоты практически не зависит — у такого порта этой ошибки почти нет.

Поправка. Ядро даёт S-матрицу Sизм относительно опорной проводимости y1(f0), а нужна матрица относительно y1(f). Переход — обычная перенормировка опорной проводимости:

Sист=(Sизм+G)(I+GSизм)−1,G=diag(Γ1(f),Γ2(f),…).(19)

Для одного порта это дробно-линейное преобразование S′=(S+Γ)/(1+ΓS). Калибровочные расчёты не нужны: Γ вычисляется по шагу сетки, ширине апертуры и частоте FREQ. В проверочных расчётах паразитный |S11| пустого волноводного канала с поправкой снизился с −14 дБ до −146 дБ и ниже.

Что реализовано в программе. Поправка выполняется при многочастотной обработке файла .t (CTmcWideband, вьювер TMCROS и запись .s ядром) — когда хотя бы у одного порта падающая волна задана файлом .sig (ниже). Ядро дописывает в заголовок .t для каждого порта шаг сетки, апертуру b и частоту согласования f0, и Γ(f) считается по формуле для Γ. Один расчёт даёт один столбец матрицы, поэтому реализованы частные случаи (поправка):

  • два порта: структура считается симметричной (S22=S11, S12=S21), обоим портам приписывается Γ возбуждённого; тогда матрица распадается на чётную и нечётную волны Ge,o=S11±S21, каждая исправляется скалярно G′=(G+Γ)/(1+ΓG), и S11=(Ge′+Go′)/2, S21=(Ge′−Go′)/2;
  • другое число портов: исправляется только отражение возбуждённого порта Snn′=(Snn+Γ)/(1+ΓSnn).

Полная матричная поправка для несимметричной структуры (нужны оба возбуждения) в программе не реализована. Γ(f) считается по формуле порта со стенками-металлом с W=0: тип стенок порта и W в заголовок .t не записываются, и для порта MAGNETIC или с W≠0 применяется та же формула. При одночастотном расчёте (f=f0) Γ=0, и поправка не нужна. Подробно — поправка в коде.

Падающая волна из файла .sig

Вместо выражения Amp можно указать имя файла в квадратных скобках — тогда весь сигнал a(t) берётся из файла падающей волны:

INPUT_X ; ylo; yhi; 0; 40; [wg_multi]; 0;
  • к имени без точки дописывается .sig, файл без пути ищется в папке задания;
  • файл — текст в две колонки: время в единицах TIME_UNIT задания и значение сигнала; строки, начинающиеся с ! или #, пропускаются; время строго возрастает, точек — не меньше двух;
  • между точками — линейная интерполяция, вне диапазона файла — 0; окно Tmin…Tmax порта тоже действует; поэтому шаг таблицы берут не крупнее шага по времени τ0 (шаг по времени);
  • фаза Faza с файлом не используется: её задают равной 0 (обязательный параметр после Amp), на любое другое значение выводится предупреждение;
  • строка #FREQ f1 f2 … (в FREQ_UNIT) называет частоты многочастотного сигнала: ядро переносит их в заголовок .t в герцах, и обработка берёт их готовыми, не разыскивая пики в спектре.

FREQ задания при этом по-прежнему нужна: на ней согласуются порты (проводимость генератора) и поглотители; её ставят внутри полосы сигнала.

Один проход — свип по частоте. Широкополосная падающая волна возбуждает устройство сразу на всех своих частотах, и по одной записи .t строится S-матрица на каждой из них (многочастотный расчёт). Обработка различает два вида сигнала: непрерывный многотон (тоны разделяются подгонкой гармоник на установившемся участке) и импульс (спектр — интеграл по всей записи), — и снимает рассогласование портов (выше). Время расчёта при этом то же, что у одного одночастотного прохода. На проверочных заданиях samples/MULTIFREQ (один широкополосный проход против покадрового свипа по частоте) расхождение составило тысячные доли децибела. В одном расчёте — не больше 99 частот.

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

Символ / действие Переменная, функция Файл (src/)
yW по W (6.4), (6.6) CalculateYForInput → dYInput kernels/planarrt_h/tmcrthnodediel.cpp, kernels/planarrt_x/tmcrthnodediel.cpp
y1 по (6.22), (6.37), m=1; ошибка ниже отсечки SetInputAdmitance → dY1_InputAdmitance то же
y1 порта MAGNETIC по (6.25), (6.37) SetAbsorberAdmitance то же
b — ширина апертуры dWidthWaveg, GetWidthWaveg() kernels/planarrt_*/tmcrthnodediel.h
профиль ri (6.21), (6.24) и множитель Un SetYForInput: sTmcRTHNodeDielOne::rY, dUnormir kernels/planarrt_*/tmcrthnodediel.cpp
Amp, Faza (выражения) csVx, csVy; dAmplitude, dFaza то же
2πFREQ·t dWT в RunExciteInputs, RunExciteInputs1 kernels/planarrt_h/tmcrthrectnode.cpp
окно Tmin…Tmax dTmin, dTmax kernels/planarrt_*/tmcrthnodediel.h
узел порта ExciteInputs, ExciteInputs1 (H); ExciteInputs…ExciteInputs3 (X) kernels/planarrt_*/tmcrthnodediel.cpp
riaτ−2 rU (H); rU2, rU3, rU, rU1 (X, по подтактам) kernels/planarrt_*/tmcrthnodediel.h
Uo (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
Γ(f) (коэффициент отражения порта) 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 Tmin…Tmax, amplitude Amp, phase Faza and W (input parsing). At every time step the port writes to the .t file the incident wave Up and the reflected wave Uo; 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 ny=0 and ny=N, metal) and is unbounded on the left and right; a waveguide of width NΔ is filled with a dielectric ε1. A stub of length τ0/2 is connected to each node: an OC stub for ε1>ε0 and an SC stub for ε1<ε0 [Klimov, 2007, (6.4), (6.6)]:

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

The eigensolution is the node voltage as a function of the node indices nx, ny and the time step τ [Klimov, 2007, (6.7)]:

Uτ(nx,ny)=f(ny)sin(ωττ0+αnx),(2)

i.e. along the x axis the phase increases by α per grid step at constant amplitude, while along the y axis the phase is constant and the amplitude is distributed according to f(ny). Substituting (6.7) into the node formula (4.21) (H scattering) gives equation (6.17), whence (f(ny+1)+f(ny−1))/f(ny)=const (6.19). With the boundary conditions f(0)=f(N)=0 (6.20), it is satisfied by N−1 discrete functions [Klimov, 2007, (6.21)]

fm(ny)=sin(πnyNm),m=1…N−1,(3)

— the grid analogues of the Hm0 waves, each with its own phase shift per grid step [Klimov, 2007, (6.22)]:

αm=arccos((2+y52)cos(ωτ0)−cos(πmN)∓y52),(4)

where y5=Y5/Y0>0, "−" 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 Uτ=∑mAmfm(ny)sin(ωττ0+αmnx) (6.23), where Am sets the mode power.

Plane wave — the case m=0 [Klimov, 2007, (6.24), (6.25)]:

f0(ny)=1,α0=arccos((2+y52)cos(ωτ0)−1∓y52).(5)

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)]:

−1<(2+y52)cos(ωτ0)−cos(πmN)∓y52<1.(6)

This is the grid analogue of the cutoff frequency: if (6.26) is not satisfied, the Hm0 wave does not propagate. Comparing the wavelength 2πΔ/αm 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 (METAL or type not specified) — the fundamental mode m=1, with the profile sin(πi/(Np−1)) over the aperture nodes i=0…Np−1 (Np−1 intervals; the outermost nodes lie on the walls and are zero);
  • a MAGNETIC port — a plane wave m=0 with a constant profile between magnetic walls.

If at the frequency FREQ the argument of (6.22) falls outside [−1,1], 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 Hz, so the meaning of the port walls is reversed (duality): the sin profile of a METAL port is a wave with Hz=0 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 Ym0, 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

ym0=Ym0Y0=sinαmsin(ωτ0),Bm=Cm=12(7)

[Klimov, 2007, (6.37), (6.39)], the Hm0 wave arriving from the device is absorbed without reflection. The incident wave at input node k is [Klimov, 2007, (6.40)]:

UPmτ(k)=Amfm(k)sin(ωττ0).(8)

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)]:

∑k=1N−1Am2fm2(k)=1,Am=1∑k=1N−1fm2(k),UPmτ(k)=fm(k)sin(ωττ0)∑k=1N−1fm2(k).(9)

The reflected wave is the projection of the reflected voltages of the input nodes onto the mode profile [Klimov, 2007, (6.44)]:

UOτ=1∑k=1N−1fm2(k)∑k=1N−1fm(k)UOmτ(k).(10)

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 Hm0 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 y0γ according to (7.54), coefficients Bγ=Cγ=1/2 according to (7.53), an incident plane wave UPγτ(k)=Aγ(k)sin(ωττ0) (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 yW from the W parameter (below), the generator admittance, the incident-wave profile and its normalizing factor.

Generator admittance y1 — according to (6.22), (6.37) for m=1:

y1=sinα1sin(ωτ0),cosα1=(2+|yW|2)cos(ωτ0)−yW2−cosπΔb,ωτ0=2πΔFREQc,(11)

where b=(Np−1)Δ is the aperture width, πΔ/b=π/N. For a MAGNETIC port, the same is done according to (6.25), i.e. using the absorber load formula with the yW of the port.

Profile ri=Unpi, where pi=sin(πi/(Np−1)) (METAL port) or pi=1 (MAGNETIC port), with the normalizing factor

Un=1y1Δ2∑ipi2.(12)

Unlike (6.42), the program's normalization also includes y1 and Δ2. This does not affect the reflection coefficients Snn: the incident wave is written to .t as the signal a(t), and the reflected wave is divided by ∑iri2 (below). The factor y1 equalizes the power delivered by a unit wave for ports of different widths and media, so |Smn|2 between such ports is a power fraction (for details, see Scattering matrix).

At every time step, the incident voltage of node i equals riaτ, where a(t) is the port signal (signal). An aperture node is updated according to the boundary-node circuit (6.34) with B=C=1/2, the load y1 and a source (the neighbour towards the region interior Uin, the neighbours along the aperture Ua, Ub):

Uτ=22+y1+|yW|/2(12Uaτ−1+Uinτ−1+12Ubτ−1+yW2Uτ−1+y1(Uτ−2+riaτ−riaτ−2))−Uτ−2.(13)

Without a signal (a=0), this is an absorbing-boundary node with the load y1. 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 Ui−ria of the aperture nodes onto the profile:

Uo=∑iri(Ui−ria)∑iri2,(14)

and the block number, Up=a(t) and Uo 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:

a(t)={Amp(t,f)sin(2πFREQ·t+φ(t,f)),Tmin≤t≤Tmax,0,otherwise,φ=−Faza(t,f)·uangle.(15)
  • 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 in TIME_UNIT units, and f — the step frequency FREQ in FREQ_UNIT units (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_UNIT units (uangle is the conversion factor to radians) and enters with a "−" sign: a positive phase is a delay.
  • The window Tmin…Tmax 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 FREQ is 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 ≤0 was an error: the envelope expression exp(-((t-t0)/tau)^2) produced an error over the entire leading edge of the pulse (where t−t0<0) 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 ((−2)3=−8, 02=0); a fractional exponent with a negative base, 00 and 0y for y<0 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, W=Δε=ε−1, dimensionless, 0 by default; ε=1+W>0 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):

yW=4W(W≥0),yW=W(ωτ0)2=W(k0Δ)22(W<0),k0=2πFREQc(16)

(values of W within 0.004 of 4 are shifted to 3.996 or 4.004, as for blocks). yW enters the dispersion equation for y1 — the generator admittance is matched to the wave in a grid filled with this medium — and the port node formula as the stub yW/2. 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 W<0, the stub yW=W(ωτ0)2 coincides with the coefficient Y1 of an unmagnetized plasma node with ωp2=−WωF2, so the port is also matched to a medium with ε<1 (ε < 1 and W). The port node does not take into account the external field B or losses.

Port error and mismatch correction

Where the error comes from. The generator admittance y1 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 f≠f0 the port with load y1(f0) is no longer matched to the wave and itself reflects with the coefficient

Γ(f)=y1(f)−y1(f0)y1(f)+y1(f0),(17)

where y1(f) is the same formula at the frequency f.

The error does not depend on the grid step. As Δ→0 (ωτ0→0, πΔ/b→0), the formula for y1 for a port with metal walls in vacuum gives

y1→21−(fcf)2,fc=c2b,(18)

i.e. Γ(f) tends to a limit determined only by the ratio f/fc: this is not a discretization error but the mismatch of a frequency-independent load with the H10 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, fc=0), y1→2 and is practically independent of frequency — such a port has almost none of this error.

Correction. The kernel gives the S-matrix Smeas with respect to the reference admittance y1(f0), whereas the matrix with respect to y1(f) is needed. The transition is an ordinary renormalization of the reference admittance:

Strue=(Smeas+G)(I+GSmeas)−1,G=diag(Γ1(f),Γ2(f),…).(19)

For a single port, this is the bilinear (Möbius) transformation S′=(S+Γ)/(1+ΓS). No calibration runs are needed: Γ is computed from the grid step, the aperture width and the frequency FREQ. In verification runs, the spurious |S11| 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 b and the matching frequency f0, and Γ(f) 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 (S22=S11, S12=S21), and both ports are assigned the Γ of the excited port; the matrix then splits into even and odd waves Ge,o=S11±S21, each corrected as a scalar G′=(G+Γ)/(1+ΓG), and S11=(Ge′+Go′)/2, S21=(Ge′−Go′)/2;
  • any other number of ports: only the reflection of the excited port is corrected, Snn′=(Snn+Γ)/(1+ΓSnn).

The full matrix correction for an asymmetric structure (which requires both excitations) is not implemented in the program. Γ(f) is computed using the formula for a port with metal walls and W=0: the wall type of the port and W are not written to the .t header, and for a MAGNETIC port or one with W≠0 the same formula is applied. In a single-frequency computation (f=f0), Γ=0 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 a(t) is taken from the incident-wave file:

INPUT_X ; ylo; yhi; 0; 40; [wg_multi]; 0;
  • .sig is 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_UNIT units 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 Tmin…Tmax also applies; therefore the table step is chosen no coarser than the time step τ0 (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 … (in FREQ_UNIT) names the frequencies of a multi-frequency signal: the kernel transfers them to the .t header 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/)
yW from W (6.4), (6.6) CalculateYForInput → dYInput kernels/planarrt_h/tmcrthnodediel.cpp, kernels/planarrt_x/tmcrthnodediel.cpp
y1 according to (6.22), (6.37), m=1; below-cutoff error SetInputAdmitance → dY1_InputAdmitance same files
y1 of a MAGNETIC port according to (6.25), (6.37) SetAbsorberAdmitance same files
b — aperture width dWidthWaveg, GetWidthWaveg() kernels/planarrt_*/tmcrthnodediel.h
profile ri (6.21), (6.24) and factor Un SetYForInput: sTmcRTHNodeDielOne::rY, dUnormir kernels/planarrt_*/tmcrthnodediel.cpp
Amp, Faza (expressions) csVx, csVy; dAmplitude, dFaza same files
2πFREQ·t dWT in RunExciteInputs, RunExciteInputs1 kernels/planarrt_h/tmcrthrectnode.cpp
window Tmin…Tmax dTmin, dTmax kernels/planarrt_*/tmcrthnodediel.h
port node ExciteInputs, ExciteInputs1 (H); ExciteInputs…ExciteInputs3 (X) kernels/planarrt_*/tmcrthnodediel.cpp
riaτ−2 rU (H); rU2, rU3, rU, rU1 (X, per sub-step) kernels/planarrt_*/tmcrthnodediel.h
Uo (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
Γ(f) (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.