pmrf.models.topological

Classes

BoxCLCC(C1, L, C2, C3, four_port, *, name, ...)

PiCLC([C1, L, C2, three_port, name, ...])

Overview

class pmrf.models.topological.PiCLC(C1=1e-12, L=1e-09, C2=1e-12, three_port=False, *, name=None, separator='_', _z0=(50+0j), _param_groups=<factory>)[source]

Bases: Model

Overview

A 2-port model of a Pi-network with a Capacitor-Inductor-Capacitor topology.

This model consists of a shunt capacitor (C1), a series inductor (L), and a second shunt capacitor (C2). It is a fundamental building block for various filters and matching networks, and is also commonly used to model the parasitic effects of physical components like SMD resistors.

To ensure numerical stability when using with JAX, this model provides a special case for when the series inductance L is zero, where the network behaves as a single shunt capacitor.

Example

```python import pmrf as prf

# Create a Pi-network model, for example to represent parasitics parasitics = prf.models.PiCLC(

C1=0.05e-12, # 50 fF L=0.1e-9, # 100 pH C2=0.05e-12 # 50 fF

)

# Calculate its response over a frequency range freq = prf.Frequency(start=1, stop=20, npoints=201, unit=’ghz’) s_params = parasitics.s(freq)

print(f”S21 at 10 GHz: {abs(s_params[freq.center_idx, 1, 0]):.2f}”) ```

Parameters:
  • C1 (Any)

  • L (Any)

  • C2 (Any)

  • three_port (bool)

  • name (str | None)

  • separator (str)

  • _z0 (complex)

  • _param_groups (list[ParameterGroup])

C1: Parameter = 1e-12
L: Parameter = 1e-09
C2: Parameter = 1e-12
three_port: bool = False
y(freq)[source]
Parameters:

freq (Frequency)

Return type:

Array

a(freq)[source]

Calculates the ABCD-matrix of the Pi-network.

This method dynamically chooses an appropriate calculation based on whether the inductance L is zero, making it safe for JAX-based optimization.

Args:

freq (Frequency): The frequency axis for the calculation.

Returns:

np.ndarray: The resultant ABCD-matrix.

Parameters:

freq (Frequency)

Return type:

Array

a_general(freq)[source]
Parameters:

freq (Frequency)

a_zero_inductance(freq)[source]
Parameters:

freq (Frequency)

s(freq)[source]

Scattering parameter matrix.

If only a() is implemented, converts via pmrf.functions.conversions.a2s().

Parameters:

freq (Frequency) – Frequency grid.

Returns:

S-parameter matrix with shape (nf, n, n).

Return type:

jnp.ndarray

Raises:

NotImplementedError – If neither a nor s is implemented in a subclass.

class pmrf.models.topological.BoxCLCC(C1: pmrf.parameters.Parameter = 1e-12, L: pmrf.parameters.Parameter = 1e-09, C2: pmrf.parameters.Parameter = 1e-12, C3: pmrf.parameters.Parameter = 1e-12, four_port: bool = False, *, name: str | None = None, separator: str = '_', _z0: complex = (50+0j), _param_groups: list[pmrf.parameters.ParameterGroup] = <factory>)[source]

Bases: Model

Parameters:
  • C1 (Any)

  • L (Any)

  • C2 (Any)

  • C3 (Any)

  • four_port (bool)

  • name (str | None)

  • separator (str)

  • _z0 (complex)

  • _param_groups (list[ParameterGroup])

C1: Parameter = 1e-12
L: Parameter = 1e-09
C2: Parameter = 1e-12
C3: Parameter = 1e-12
four_port: bool = False
y(freq)[source]
Parameters:

freq (Frequency)

Return type:

Array

y_general(freq)[source]
Parameters:

freq (Frequency)

Return type:

Array

y_zero_inductance(freq)[source]
Parameters:

freq (Frequency)

Return type:

Array

s(freq)[source]

Scattering parameter matrix.

If only a() is implemented, converts via pmrf.functions.conversions.a2s().

Parameters:

freq (Frequency) – Frequency grid.

Returns:

S-parameter matrix with shape (nf, n, n).

Return type:

jnp.ndarray

Raises:

NotImplementedError – If neither a nor s is implemented in a subclass.