fix_z0_shape

fix_z0_shape(z0, nfreqs, nports, nnetworks=1)[source]

Broadcast the characteristic impedance z0 to shape (nfreqs, nports) if nnetworks == 1, or (nnetworks, nfreqs, nports) if nnetworks > 1.

Parameters:
  • z0 (NumberLike) – Input impedance. Can be a scalar, a 1D array of length nports, nfreqs, or nnetworks, a 2D array of shape (nfreqs, nports), (nnetworks, nports), or (nnetworks, nfreqs), or a 3D array of shape (nnetworks, nfreqs, nports).

  • nfreqs (int) – The number of frequency points.

  • nports (int) – The number of ports.

  • nnetworks (int, optional) – The number of networks with identical port numbers, by default 1.

Returns:

The broadcasted impedance array. Shape is (nfreqs, nports) if nnetworks == 1, otherwise (nnetworks, nfreqs, nports).

Return type:

jnp.ndarray

Raises:

IndexError – If z0 has an incompatible shape.