rational ¤
Factory functions for creating Circulax components from rational fitting models.
Functions:
| Name | Description |
|---|---|
rational_component | Create a time-domain component from a rational-fitting SSModel. |
rational_delay_component | Create an fdomain component from SSModel + per-port delay. |
rational_fdomain_component | Create a frequency-domain oracle component from a rational-fitting SSModel. |
rational_component ¤
rational_component(
ss: Any, name: str = "RationalModel", z0: complex = 50.0, holomorphic: bool = True
) -> type[CircuitComponent]
Create a time-domain component from a rational-fitting SSModel.
Maps the state-space transfer function H(s) = C diag(1/(s-A)) B + D + s E onto circulax's DAE formulation F(y) + dQ/dt = 0:
Port i: f[port_i] = (C @ x + D @ v)_i q[port_i] = (E @ v)_i
State j: f[x_j] = -(A_j x_j + (B @ v)_j) q[x_j] = x_j
The resulting component works in AC sweep, harmonic balance, and transient with zero solver changes. The SS arrays are stored as JAX-traceable Equinox fields, enabling differentiation through the model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ss | Any | :class: | required |
name | str | Class name for the generated component. | 'RationalModel' |
z0 | complex | Reference impedance (stored for documentation; not used in stamp). | 50.0 |
holomorphic | bool | Whether to use the fast N×N Wirtinger AC path. | True |
Returns:
| Type | Description |
|---|---|
type[CircuitComponent] | A CircuitComponent subclass with Nc ports and Nc*N states. |
Note
Currently requires is_complex=True in analyze_circuit and setup_ac_sweep, even for electrical (real-valued) circuits. A future real-pair block form (_ss_to_real_pairs) would halve the system size for circuits with conjugate pole pairs.
Source code in circulax/components/rational.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 | |
rational_delay_component ¤
rational_delay_component(
ss: Any, tau: Any, name: str = "RationalDelayModel", z0: float = 50.0
) -> type[CircuitComponent]
Create an fdomain component from SSModel + per-port delay.
Evaluates the full cascade delay(tau/2) * rational * delay(tau/2) in the frequency domain via reference-plane re-embedding::
S_full(f) = P(f) @ S_deembed(f) @ P(f)
where P = diag(exp(-j*2*pi*f*tau_k/2)), S_deembed comes from the rational model's Y(s), and the result is converted back to Y for the circuit solver.
AC sweep and harmonic balance only — not usable in transient (fdomain component). For transient, use :func:rational_component alone and wire delay elements separately.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ss | Any | :class: | required |
tau | Any | Per-port group delay in seconds, shape | required |
name | str | Class name for the generated component. | 'RationalDelayModel' |
z0 | float | Reference impedance for S/Y conversion. | 50.0 |
Returns:
| Type | Description |
|---|---|
type[CircuitComponent] | A CircuitComponent subclass with |
Source code in circulax/components/rational.py
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 302 303 304 305 306 307 308 309 | |
rational_fdomain_component ¤
rational_fdomain_component(
ss: Any, name: str = "RationalFdomainModel"
) -> type[CircuitComponent]
Create a frequency-domain oracle component from a rational-fitting SSModel.
Evaluates H(j2pif) directly. Works in AC sweep and harmonic balance but not transient. Used as a test reference for rational_component.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ss | Any | :class: | required |
name | str | Class name for the generated component. | 'RationalFdomainModel' |
Returns:
| Type | Description |
|---|---|
type[CircuitComponent] | A CircuitComponent subclass with _is_fdomain = True. |