transmission_line ¤
Passive, causal RLC transmission-line factories from sampled RLGC data.
Classes:
| Name | Description |
|---|---|
FosterFit | Positive-real response |
RLGCTransmissionLine | Reusable fitted line; call with a length in metres to create a Circuit. |
Functions:
| Name | Description |
|---|---|
mode_transmission_line | Generate a passive RLC line factory from uniform-mode propagation data. |
reduced_rlgc_transmission_line | Create a compact, transient-capable uniform line from RLGC versus Hz. |
rlgc_transmission_line | Fit frequency-dependent RLGC per metre and return a line factory. |
FosterFit dataclass ¤
FosterFit(
constant: float,
linear: float,
weights: ndarray,
poles: ndarray,
normalized_rmse: float,
maximum_relative_error: float,
)
Positive-real response constant + s*linear + sum(weights*s/(s+poles)).
poles are positive rates in rad/s, not signed Laplace poles. The actual branch poles are -poles. Coefficients are per metre for a line fit.
Methods:
| Name | Description |
|---|---|
evaluate | Evaluate the fitted impedance or admittance per metre, in Hz. |
evaluate ¤
Evaluate the fitted impedance or admittance per metre, in Hz.
Source code in circulax/components/transmission_line.py
RLGCTransmissionLine dataclass ¤
Reusable fitted line; call with a length in metres to create a Circuit.
Both fits use nonnegative RLC values, ensuring a passive, causal finite ladder. This does not certify that the supplied sampled data is causal, nor that the approximation is accurate outside frequency_range.
Methods:
| Name | Description |
|---|---|
netlist | Build an unterminated symmetric-T ladder from R, L and C primitives. |
netlist ¤
Build an unterminated symmetric-T ladder from R, L and C primitives.
Ports p1 and p2 are single-ended relative to the internal common ground. tap_0 ... tap_{n_sections-1} expose section midpoints for junction loading. No source, termination, optical model or delay is added. Increasing n_sections reduces the spatial discretization error.
Source code in circulax/components/transmission_line.py
mode_transmission_line ¤
mode_transmission_line(
frequencies: ArrayLike,
*,
attenuation_db_per_m: ArrayLike | Callable[[ndarray], ArrayLike],
n_eff: ArrayLike | Callable[[ndarray], ArrayLike],
impedance: ArrayLike | Callable[[ndarray], ArrayLike],
n_poles: int = 12,
poles: ArrayLike | None = None,
tolerance: float = 0.01
) -> RLGCTransmissionLine
Generate a passive RLC line factory from uniform-mode propagation data.
Each input may be a scalar, a sampled array, or a function of frequency in Hz returning either. attenuation_db_per_m is nonnegative loss in dB/metre. n_eff is the positive real RF phase effective index, not group index. impedance is the modal characteristic impedance in ohms and may be complex/frequency dependent, with positive real part.
Converts gamma = log(10)/20 * attenuation + 1j*2*pi*f*n_eff/c and Z'=gamma*impedance, Y'=gamma/impedance to per-metre RLGC. The generated model and all fit settings follow :func:rlgc_transmission_line. Loss, phase and impedance data must describe a mutually consistent mode; an independent choice of arbitrary curves need not admit this passive, causal Foster realization. Errors exceeding tolerance raise ValueError.
Group velocity is c/(n_eff + f*dn_eff/df). When designing a MZM, compare the RF phase index of the loaded electrode at each modulation frequency with the optical group index: the walk-off phase is 2*pi*f*L*(n_rf(f) - n_g_opt)/c. Avoid adding a junction R/C twice if it is already included in mode data. No additional loads are included by this factory.
Source code in circulax/components/transmission_line.py
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 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 | |
reduced_rlgc_transmission_line ¤
reduced_rlgc_transmission_line(
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
) -> Circuit
Create a compact, transient-capable uniform line from RLGC versus Hz.
Fit the distributed two-port, rather than discretizing it into RLC sections. The default fit enforces sampled passivity; stable proper poles and nonnegative optional port delays make the realization causal. Invalid or insufficiently accurate fits raise instead of returning an unchecked model. Passivity is sampled, not globally certified; input causality is not certified.
Ports p1 and p2 are single-ended to ground. There are no internal taps: use :func:rlgc_transmission_line when distributed loading is needed. Fitting depends on length; refit for a different length. Use circulax.fitting.fit_rlgc to inspect, evaluate or save the coefficients. For electrically long lines, :func:characteristic_rlgc_transmission_line removes the propagation delay exactly and needs far fewer poles.
Source code in circulax/components/transmission_line.py
rlgc_transmission_line ¤
rlgc_transmission_line(
frequencies: ArrayLike,
*,
R: ArrayLike,
L: ArrayLike,
G: ArrayLike,
C: ArrayLike,
n_poles: int = 12,
poles: ArrayLike | None = None,
tolerance: float = 0.01
) -> RLGCTransmissionLine
Fit frequency-dependent RLGC per metre and return a line factory.
frequencies must be increasing, nonnegative Hz with a positive maximum. R, L, G, C are real nonnegative scalars or arrays on that grid, in ohm/m, H/m, S/m and F/m. The series impedance R+sL and shunt admittance G+sC are fitted independently; constant characteristic impedance is not assumed. Skin-effect responses can be approximated over a finite band, but not every passive response belongs to this branch family.
poles optionally supplies positive branch rates in rad/s. Otherwise n_poles logarithmically spaced rates are chosen. tolerance is the maximum weighted relative RMS fitting error for each response. The relative weighting has a floor of 1% of the maximum response magnitude. Excess error raises ValueError rather than returning a poor fit silently. Inspect series and shunt for coefficients and errors. Spatial discretization is separate: verify convergence as n_sections increases.
Example::
line = rlgc_transmission_line(f, R=r, L=l, G=g, C=c)
section = line(length=200e-6, n_sections=2)
# Use section as models_map["line"] in a parent circuit.
Fitting runs once in NumPy/SciPy. Generated Circulax component values are ordinary real RLC parameters; no S-to-state-space conversion is used.