rlgc ¤
Compact causal two-port models of uniform, frequency-dependent RLGC lines.
Classes:
| Name | Description |
|---|---|
CharacteristicLineModel | Uniform line as characteristic admittance and delayed propagation. |
RationalResponse | Scalar |
Functions:
| Name | Description |
|---|---|
fit_rlgc | Fit a reduced uniform-line model, checked before admission to simulation. |
fit_rlgc_characteristic | Fit a uniform line by its characteristic admittance and de-embedded delay. |
rlgc_sparameters | Evaluate an exact uniform line on the supplied frequency grid. |
CharacteristicLineModel dataclass ¤
CharacteristicLineModel(
length: float,
delay: float,
resistance_floor: float,
conductance_floor: float,
admittance: RationalResponse,
propagation: RationalResponse,
metadata: dict,
)
Uniform line as characteristic admittance and delayed propagation.
With port currents I1, I2 flowing into the line,
Yc*V1 - I1 = H * (Yc*V2 + I2) and Yc*V2 - I2 = H * (Yc*V1 + I1),
where H(s) = exp(-gamma*length) = exp(-s*delay) * propagation(s). The exact delay is removed before fitting, so propagation and admittance are smooth and need few poles even for long lines.
Methods:
| Name | Description |
|---|---|
circuit | Realize the model as a transient/AC/HB-capable two-port |
propagation_function | Fitted |
sparameters | S-parameters of the fitted model, shape |
circuit ¤
Realize the model as a transient/AC/HB-capable two-port Circuit.
propagation_function ¤
Fitted exp(-gamma*length), including the exact delay.
Source code in circulax/fitting/rlgc.py
sparameters ¤
S-parameters of the fitted model, shape (frequencies, 2, 2).
Source code in circulax/fitting/rlgc.py
RationalResponse dataclass ¤
Scalar constant + sum(residues / (s - poles)) with poles in rad/s.
Complex poles are stored with their conjugates, so the response is real for real s.
Methods:
| Name | Description |
|---|---|
evaluate | Evaluate the response at frequencies in Hz. |
evaluate ¤
Evaluate the response at frequencies in Hz.
Source code in circulax/fitting/rlgc.py
fit_rlgc ¤
fit_rlgc(
frequencies: ArrayLike,
*,
R: ArrayLike | Callable[[ndarray], ArrayLike],
L: ArrayLike | Callable[[ndarray], ArrayLike],
G: ArrayLike | Callable[[ndarray], ArrayLike],
C: ArrayLike | Callable[[ndarray], ArrayLike],
length: float,
z0: float = 50.0,
options: ModelFitOptions | None = None
) -> ModelCoefficients
Fit a reduced uniform-line model, checked before admission to simulation.
Fit the exact distributed two-port, reserving every fifth interior sample for validation. At least six frequency samples are required. Defaults use reciprocal vector fitting with sampled passivity enforcement. The proper stable realization is causal; this does not certify arbitrary input data or extrapolation. Passivity is enforced/tested on a grid, not globally certified.
Supplied options can choose order, tolerances and optional native delays (delay_mode='supplied' or 'infer'). Reciprocity is required. Disabling enforcement still requires the resulting fit to pass passivity validation. Returned coefficients can be saved or passed to circuit_from_coefficients.
Source code in circulax/fitting/rlgc.py
fit_rlgc_characteristic ¤
fit_rlgc_characteristic(
frequencies: ArrayLike,
*,
R: ArrayLike | Callable[[ndarray], ArrayLike],
L: ArrayLike | Callable[[ndarray], ArrayLike],
G: ArrayLike | Callable[[ndarray], ArrayLike],
C: ArrayLike | Callable[[ndarray], ArrayLike],
length: float,
tolerance: float = 0.001,
max_order: int = 40,
delay_fraction: float = 0.98,
z0: float = 50.0
) -> CharacteristicLineModel
Fit a uniform line by its characteristic admittance and de-embedded delay.
The propagation delay delay_fraction times the phase delay at the highest frequency is removed exactly, rather than approximated by poles. The characteristic admittance Yc = sqrt(Y/Z) and the remaining propagation exp(-gamma*length + s*delay) are fitted separately with the same order, increased from 4 until every check passes:
- maximum absolute S error (reference
z0) on all samples, including held-out ones, against the supplied, unfloored RLGC is withintolerance; - stable poles;
- sampled passivity (largest singular value of S at most 1),
Re(Yc) >= 0and|propagation| <= 1on a grid from DC to ten times the band.
A DC sample is required and the fitted DC values are pinned exactly, so the floored model is exact at DC. With G = 0 (or R = 0) the DC resistance is the ratio of two vanishing quantities. Conductance and resistance are therefore floored at 2*pi*f_low*C and 2*pi*f_low*L, where f_low is the lowest nonzero frequency, putting the floors' corner inside the grid. Their effect is included in the S check. Lower f_low if it fails. Sampled passivity is not a global certificate, and input causality is not certified.
Source code in circulax/fitting/rlgc.py
200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 | |
rlgc_sparameters ¤
rlgc_sparameters(
frequencies: ArrayLike,
*,
R: ArrayLike | Callable[[ndarray], ArrayLike],
L: ArrayLike | Callable[[ndarray], ArrayLike],
G: ArrayLike | Callable[[ndarray], ArrayLike],
C: ArrayLike | Callable[[ndarray], ArrayLike],
length: float,
z0: float = 50.0
) -> ndarray
Evaluate an exact uniform line on the supplied frequency grid.
RLGC are nonnegative per-metre scalars, arrays or functions of Hz, in ohm/m, H/m, S/m and F/m. This frequency-domain calculation does not make arbitrary input curves causal. No junction loading or termination is added.