Skip to content

YMatrix

YMatrix(frequencies, elements, terminals=None)

Nodal admittance matrix (Y matrix).

Represents a frequency-dependent nodal admittance matrix where terminals correspond to circuit nodes. Can be returned from LumpedModel.start_mna; when a port_map is specified, LumpedModel will extract port parameters and convert to S-matrix.

Args

  • frequencies (Sequence[float]): Frequency values for the computed elements.
  • elements (dict[tuple[str, str], Sequence[complex]]): Mapping from pairs of terminal names to Y matrix elements. The keys must be: ("terminal1", "terminal2").
  • terminals (dict[str, Terminal | None] | None): Mapping from terminal names to terminals or to None.

Example

>>> import numpy as np
>>> frequencies = [1e9, 2e9, 5e9]
>>> R, C = 100.0, 1e-12
>>> omega = 2 * np.pi * np.array(frequencies)
>>> Y_R = np.full(len(frequencies), 1 / R, dtype=complex)
>>> Y_C = 1j * omega * C
>>> y_matrix = pf.YMatrix(frequencies, {
... ("in", "in"): Y_R,
... ("in", "out"): -Y_R,
... ("out", "in"): -Y_R,
... ("out", "out"): Y_R + Y_C,
... })
MethodDescription
copyCreate a copy.
force_symmetricForce this Y matrix to be symmetric.
to_z_matrixConvert this Y matrix to a Z matrix by inversion.

copy(self)

Create a copy.

Returns

YMatrix: New copy.

force_symmetric(self)

Force this Y matrix to be symmetric.

Reciprocity is ensured by averaging transposed entries (if both are present) or filling in missing elements.

Returns

YMatrix: This object.

to_z_matrix(self)

Convert this Y matrix to a Z matrix by inversion.

Z = Y^(-1)

Returns

ZMatrix: The inverted impedance matrix.

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

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

ndarray: Y matrix frequencies (read only).

Properties: Object properties.

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

ndarray: Y matrix wavelengths (read only).