GlobalMNACircuitSolver

class pmrf.models.composite.interconnected.circuit.solvers.nodal.GlobalMNACircuitSolver(eps: float = 1e-12, linear_solver: AbstractLinearSolver = AutoLinearSolver(well_posed=True))

Bases: AbstractMNACircuitSolver

Global Modified Nodal Analysis (MNA) circuit solver.

Generalizes standard Nodal Analysis to gracefully handle ideal components by augmenting the Y-matrix with auxiliary variables (currents/voltages). Loads each external port with the probe reference impedance and solves the whole system at once, returning S at that reference (ADR-0007). Ports shorted together have no finite Y, but the loaded system stays non-singular, so their S and its gradient are exact.

Mathematical Formulation

The global system is regularised physically, so it is never singular: a conductance \(G_{min}\) = eps from every internal node to ground, and a series resistance of eps ohms in every auxiliary branch,

\[\begin{split}\begin{bmatrix} Y + G_{min} P_{int} & B \\ C & D - \epsilon I \end{bmatrix},\end{split}\]

where \(P_{int}\) is 1 on the diagonal of internal nodes and 0 elsewhere. External nodes need no GMIN: pmrf.rf.mna2s() loads each with \(Z_r^{-1}\), so they never float, and S at the ports carries no regularisation from them. Internal nodes join the auxiliary variables, and pmrf.rf.mna2s() gives S from the resulting stamp at the external nodes.

References

C.-W. Ho, A. E. Ruehli and P. A. Brennan, “The modified nodal approach to network analysis,” IEEE Trans. Circuits Syst., vol. 22, no. 6, pp. 504-509, 1975.

run(y_flattened: Array, b_flattened: Array, c_flattened: Array, d_flattened: Array, z0: Array, topology: MNARepresentation) → ScatteringResult

Executes the Modified Nodal Analysis circuit solving algorithm.

The result is S at the probe reference z0, found by loading each external port with it (ADR-0007), so that ports shorted together stay exact.

Parameters:
  • y_flattened (jnp.ndarray) – A 1D array of flattened Y-block elements.

  • b_flattened (jnp.ndarray) – A 1D array of flattened B-block elements.

  • c_flattened (jnp.ndarray) – A 1D array of flattened C-block elements.

  • d_flattened (jnp.ndarray) – A 1D array of flattened D-block elements.

  • z0 (jnp.ndarray) – The probe reference impedance, one per external port. May be complex.

  • topology (MNARepresentation) – The static map dictating the MNA assembly and partition logic.

Returns:

The external S-parameters at z0.

Return type:

ScatteringResult

eps: float = 1e-12

GMIN to ground on every internal node, and the series resistance (ohms) of every auxiliary branch.

linear_solver: AbstractLinearSolver = AutoLinearSolver(well_posed=True)

the system is never singular.

Type:

The lineax solver for the loaded MNA system. Defaults to LU