MNAMatrix
MNAMatrix(frequencies, elements, terminals=None)Modified Nodal Analysis (MNA) matrix.
Represents a frequency-dependent MNA stamp where terminals correspond to circuit nodes or auxiliary branch-current variables. Entries may be admittance-valued, impedance-valued, or dimensionless (+/-1) depending on the terminal type.
Returned by LumpedModel.start_mna; used internally to extract
S-parameters via port-augmented MNA solve.
Args
- frequencies (Sequence[float]): Frequency values for the computed elements.
- elements (dict[tuple[str, str], Sequence[complex]]): Mapping from pairs of terminal names to MNA matrix elements. The keys must be:
("terminal1", "terminal2"). - terminals (dict[str, Terminal | None] | None): Mapping from terminal names to terminals or to
None.
Example
>>> R, n, freqs = 50.0, 3, [1e9, 5e9, 10e9]>>> G = 1 / R>>> mna_elements = {... ("t1", "t1"): np.full(n, G, dtype=complex),... ("t1", "t2"): np.full(n, -G, dtype=complex),... ("t2", "t1"): np.full(n, -G, dtype=complex),... ("t2", "t2"): np.full(n, G, dtype=complex),... }>>> mna_matrix = pf.MNAMatrix(freqs, mna_elements)Methods
Section titled “Methods”| Method | Description |
|---|---|
copy | Create a copy. |
force_symmetric | Force this MNA matrix to be symmetric. |
copy(self)Create a copy.
Returns
MNAMatrix: New copy.
force_symmetric
Section titled “force_symmetric”force_symmetric(self)Force this MNA matrix to be symmetric.
Reciprocity is ensured by averaging transposed entries (if both are present) or filling in missing elements.
Returns
MNAMatrix: This object.
Attributes
Section titled “Attributes”| Attribute | Description |
|---|---|
elements | dict[tuple[str, str], ndarray]: MNA matrix elements (read only). |
frequencies | ndarray: MNA matrix frequencies (read only). |
properties | Properties: Object properties. |
terminals | dict[str, Terminal | None]: MNA matrix terminals (read only). |
wavelengths | ndarray: MNA matrix wavelengths (read only). |
elements
Section titled “elements”dict[tuple[str, str], ndarray]: MNA matrix elements (read only).
frequencies
Section titled “frequencies”ndarray: MNA matrix frequencies (read only).
properties
Section titled “properties”Properties: Object properties.
terminals
Section titled “terminals”dict[str, Terminal | None]: MNA matrix terminals (read only).
wavelengths
Section titled “wavelengths”ndarray: MNA matrix wavelengths (read only).