ZMatrix¶
- class photonforge.ZMatrix(frequencies, elements, terminals=None)¶
Nodal impedance matrix (Z matrix).
Represents a frequency-dependent nodal impedance matrix where terminals correspond to circuit nodes. Can be returned from
LumpedModel.start_mna(); when aport_mapis specified,LumpedModelwill extract port parameters and convert to S-matrix.- Parameters:
frequencies (Sequence[float]) – Frequency values for the computed elements.
elements (dict[tuple[str, str], Sequence[complex]]) – Mapping from pairs of terminal names to Z matrix elements. The keys must be:
("terminal1", "terminal2").terminals (dict[str, Terminal | None] | None) – Mapping from terminal names to terminals or to
None.
Example
>>> z_matrix = pf.ZMatrix( ... [pf.C_0 / 1.55], ... {("T0", "T0"): [50], ("T0", "T1"): [25]}, ... )
Methods
copy()Create a copy.
Force this Z matrix to be symmetric.
Convert this Z matrix to a Y matrix by inversion.
Attributes
Z matrix elements (read only).
Z matrix frequencies (read only).
Object properties.
Z matrix terminals (read only).
Z matrix wavelengths (read only).
- elements¶
Z matrix elements (read only).
- Type:
dict[tuple[str, str], ndarray]
- force_symmetric()¶
Force this Z matrix to be symmetric.
Reciprocity is ensured by averaging transposed entries (if both are present) or filling in missing elements.
- Returns:
This object.
- Return type:
- frequencies¶
Z matrix frequencies (read only).
- Type:
ndarray
- properties¶
Object properties.
- Type:
- to_y_matrix()¶
Convert this Z matrix to a Y matrix by inversion.
- Returns:
The corresponding admittance matrix.
- Return type:
- Raises:
RuntimeError – If the Z matrix is singular at any frequency.
- wavelengths¶
Z matrix wavelengths (read only).
- Type:
ndarray