Skip to content

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)
MethodDescription
copyCreate a copy.
force_symmetricForce this MNA matrix to be symmetric.

copy(self)

Create a copy.

Returns

MNAMatrix: New copy.

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.

AttributeDescription
elementsdict[tuple[str, str], ndarray]: MNA matrix elements (read only).
frequenciesndarray: MNA matrix frequencies (read only).
propertiesProperties: Object properties.
terminalsdict[str, Terminal | None]: MNA matrix terminals (read only).
wavelengthsndarray: MNA matrix wavelengths (read only).

dict[tuple[str, str], ndarray]: MNA matrix elements (read only).

ndarray: MNA matrix frequencies (read only).

Properties: Object properties.

dict[str, Terminal | None]: MNA matrix terminals (read only).

ndarray: MNA matrix wavelengths (read only).