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,... })Methods
Section titled “Methods”| Method | Description |
|---|---|
copy | Create a copy. |
force_symmetric | Force this Y matrix to be symmetric. |
to_z_matrix | Convert this Y matrix to a Z matrix by inversion. |
copy(self)Create a copy.
Returns
YMatrix: New copy.
force_symmetric
Section titled “force_symmetric”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
Section titled “to_z_matrix”to_z_matrix(self)Convert this Y matrix to a Z matrix by inversion.
Z = Y^(-1)
Returns
ZMatrix: The inverted impedance matrix.
Attributes
Section titled “Attributes”| Attribute | Description |
|---|---|
elements | dict[tuple[str, str], ndarray]: Y matrix elements (read only). |
frequencies | ndarray: Y matrix frequencies (read only). |
properties | Properties: Object properties. |
terminals | dict[str, Terminal | None]: Y matrix terminals (read only). |
wavelengths | ndarray: Y matrix wavelengths (read only). |
elements
Section titled “elements”dict[tuple[str, str], ndarray]: Y matrix elements (read only).
frequencies
Section titled “frequencies”ndarray: Y matrix frequencies (read only).
properties
Section titled “properties”Properties: Object properties.
terminals
Section titled “terminals”dict[str, Terminal | None]: Y matrix terminals (read only).
wavelengths
Section titled “wavelengths”ndarray: Y matrix wavelengths (read only).