pmrf.models.topological

Classes

BoxCLCC([C1, L, C2, C3, four_port, name, ...])

A 3-port or 4-port model of a Box-network with a Capacitor-Inductor-Capacitor-Capacitor topology.

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

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

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

Bases: Model

A 2-port or 3-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.

The parameter three_port determines whether all four ports are exposed or not.

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.

Parameters:
  • C1 (Any)

  • L (Any)

  • C2 (Any)

  • three_port (bool)

  • name (str | None)

  • separator (str)

  • metadata (dict)

  • _z0 (complex)

  • _param_groups (list[ParameterGroup])

C1

The value of the first shunt capacitor in Farads.

Type:

Parameter, default=1.0e-12

L

The value of the series inductor in Henrys.

Type:

Parameter, default=1.0e-9

C2

The value of the second shunt capacitor in Farads.

Type:

Parameter, default=1.0e-12

three_port

If True, treats the network as a 3-port device (where the ground reference is implicit or shared). If False, treats it as a standard 2-port network.

Type:

bool, default=False

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 parameter matrix.

If only s() is implemented, this is calculated using the conversion pmrf.functions.conversions.s2a().

Parameters:

freq (Frequency) – Frequency grid.

Returns:

ABCD matrix with shape (nf, 2, 2).

Return type:

jnp.ndarray

Raises:

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

a_general(freq)[source]

Internal calculation for the general case (L != 0).

Parameters:

freq (Frequency) – The frequency points.

Returns:

The ABCD matrix.

Return type:

jnp.ndarray

a_zero_inductance(freq)[source]

Internal calculation for the zero inductance case (L == 0).

The network simplifies to a single shunt capacitor C = C1 + C2.

Parameters:

freq (Frequency) – The frequency points.

Returns:

The ABCD matrix.

Return type:

jnp.ndarray

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.

__init__(C1=1e-12, L=1e-09, C2=1e-12, three_port=False, *, name=None, separator='_', metadata=<factory>, _z0=(50+0j), _param_groups=<factory>)
Parameters:
  • C1 (Any)

  • L (Any)

  • C2 (Any)

  • three_port (bool)

  • name (str | None)

  • separator (str)

  • metadata (dict)

  • _z0 (complex)

  • _param_groups (list[ParameterGroup])

Return type:

None

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

Bases: Model

A 3-port or 4-port model of a Box-network with a Capacitor-Inductor-Capacitor-Capacitor topology.

This model consists of a shunt capacitor (C1), a series inductor (L), and a second shunt capacitor (C2), and a bridging capacitor (C3).

The parameter four_port determines whether all four ports are exposed or not.

Parameters:
  • C1 (Any)

  • L (Any)

  • C2 (Any)

  • C3 (Any)

  • four_port (bool)

  • name (str | None)

  • separator (str)

  • metadata (dict)

  • _z0 (complex)

  • _param_groups (list[ParameterGroup])

C1

First shunt capacitor.

Type:

Parameter, default=1.0e-12

L

Series inductor.

Type:

Parameter, default=1.0e-9

C2

Second shunt capacitor.

Type:

Parameter, default=1.0e-12

C3

Bridging capacitor.

Type:

Parameter, default=1.0e-12

four_port

If True, exposes the network as a 4-port model.

Type:

bool, default=False

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]

Internal calculation for the general case (L > 1e-18).

Parameters:

freq (Frequency) – The frequency points.

Returns:

The Y matrix.

Return type:

jnp.ndarray

y_zero_inductance(freq)[source]

Internal calculation for the zero inductance case.

Uses a small epsilon for L to avoid division by zero while approximating the behavior.

Parameters:

freq (Frequency) – The frequency points.

Returns:

The Y matrix.

Return type:

jnp.ndarray

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.

__init__(C1=1e-12, L=1e-09, C2=1e-12, C3=1e-12, four_port=False, *, name=None, separator='_', metadata=<factory>, _z0=(50+0j), _param_groups=<factory>)
Parameters:
  • C1 (Any)

  • L (Any)

  • C2 (Any)

  • C3 (Any)

  • four_port (bool)

  • name (str | None)

  • separator (str)

  • metadata (dict)

  • _z0 (complex)

  • _param_groups (list[ParameterGroup])

Return type:

None