twpasolver.models.rf_functions module#

Compiled functions for components impedance and abcd matrices.

twpasolver.models.rf_functions.inductance(freqs: ndarray[Any, dtype[float64]], L: float) ndarray[Any, dtype[complex128]][source]#

Calculate the impedance of an inductance as a function of frequency.

Parameters:
  • freqs (FloatArray) – Array of frequencies.

  • L (float) – Inductance value.

Returns:

Impedance of the inductance.

Return type:

np.ndarray

twpasolver.models.rf_functions.capacitance(freqs: ndarray[Any, dtype[float64]], C: float) ndarray[Any, dtype[complex128]][source]#

Calculate the impedance of a capacitor as a function of frequency.

Parameters:
  • freqs (FloatArray) – Array of frequencies.

  • C (float) – Capacitance value.

Returns:

Impedance of the capacitor.

Return type:

np.ndarray

twpasolver.models.rf_functions.stub(freqs: ndarray[Any, dtype[float64]], L: float, C: complex, length: float, open: bool = True) ndarray[Any, dtype[complex128]][source]#

Calculate the impedance of a stub as a function of frequency.

Parameters:
  • freqs (FloatArray) – Array of frequencies.

  • L (float) – Inductance value.

  • C (float) – Capacitance value.

  • length (float) – Length of the stub.

  • open (bool) – If True, calculate for an open stub; otherwise, for a short stub.

Returns:

Impedance of the stub.

Return type:

np.ndarray

twpasolver.models.rf_functions.parallel_admittance_abcd(Y: ndarray[Any, dtype[complex128]]) ndarray[Any, dtype[complex128]][source]#

Calculate the ABCD matrix of a parallel admittance.

Parameters:

Y (ComplexArray) – Array of admittance values.

Returns:

ABCD matrix of the parallel admittance.

Return type:

np.ndarray

twpasolver.models.rf_functions.series_impedance_abcd(Z: ndarray[Any, dtype[complex128]]) ndarray[Any, dtype[complex128]][source]#

Calculate the ABCD matrix of a series impedance.

Parameters:

Z (ComplexArray) – Array of impedance values.

Returns:

ABCD matrix of the series impedance.

Return type:

np.ndarray

twpasolver.models.rf_functions.lossless_line_abcd(freqs: ndarray[Any, dtype[float64]], C: float, L: float, l: float) ndarray[Any, dtype[complex128]][source]#

Calculate the ABCD matrix of a lossless transmission line.

Parameters:
  • freqs (FloatArray) – Array of frequencies.

  • C (float) – Capacitance per unit length.

  • L (float) – Inductance per unit length.

  • l (float) – Length of the transmission line.

Returns:

ABCD matrix of the lossless transmission line.

Return type:

np.ndarray

twpasolver.models.rf_functions.LCLf_abcd(freqs: ndarray[Any, dtype[float64]], C: float, L: float, Lf: float) ndarray[Any, dtype[complex128]][source]#

Calculate the ABCD matrix of an LCLf cell model.

Parameters:
  • freqs (FloatArray) – Array of frequencies.

  • C (float) – Capacitance value.

  • L (float) – Inductance value.

  • Lf (float) – Additional inductance value.

Returns:

ABCD matrix of the LCLf cell model.

Return type:

np.ndarray

twpasolver.models.rf_functions.get_stub_cell(freqs: ndarray[Any, dtype[float64]], C: complex, L: float, l1: float, l2: float) ndarray[Any, dtype[complex128]][source]#

Calculate the ABCD matrix of a stub cell model.

Parameters:
  • freqs (FloatArray) – Array of frequencies.

  • C (float) – Capacitance value.

  • L (float) – Inductance value.

  • l1 (float) – Length of the first section of the stub.

  • l2 (float) – Length of the second section of the stub.

Returns:

ABCD matrix of the stub cell model.

Return type:

np.ndarray