pmrf.models.nonideal

Classes

CLCResistor([res, clc, name, separator, ...])

Overview

NonIdealResistor(*[, name, separator, _z0, ...])

Overview

class pmrf.models.nonideal.NonIdealResistor(*, name=None, separator='_', _z0=(50+0j), _param_groups=<factory>)[source]

Bases: Model

Overview

An abstract base class for creating realistic resistor models that include parasitic effects.

This class provides a framework for representing a physical resistor as a combination of an ideal resistive element and a network of parasitic components (like series inductance and parallel capacitance).

Subclasses are required to implement the ideal and parasitics properties to define the specific topology of the non-ideal model.

Parameters:
  • name (str | None)

  • separator (str)

  • _z0 (complex)

  • _param_groups (list[ParameterGroup])

abstract property ideal: Model

An abstract property representing the ideal part of the component.

Returns:

Model: The model for the ideal resistor.

abstract property parasitics: Model

An abstract property representing the parasitic network of the component.

Returns:

Model: The model for the parasitic network.

class pmrf.models.nonideal.CLCResistor(res=<factory>, clc=<factory>, *, name=None, separator='_', _z0=(50+0j), _param_groups=<factory>)[source]

Bases: NonIdealResistor

Overview

A model for a non-ideal resistor with parasitic capacitance and inductance.

This model represents a physical resistor as an ideal resistive element cascaded with a Pi-network (Capacitor-Inductor-Capacitor). This topology is common for modeling SMD resistors at high frequencies.

Example

```python import pmrf as prf

# Create a model for a 100-ohm resistor with parasitics non_ideal_r = prf.models.CLCResistor(

res=prf.models.Resistor(R=100), clc=prf.models.PiCLC(C1=0.05e-12, L=0.1e-9, C2=0.05e-12)

)

# You can access the ideal and parasitic parts print(f”Ideal Resistance: {non_ideal_r.ideal.R.value} Ohms”)

# Calculate the S-parameters of the complete non-ideal model freq = prf.Frequency(start=0.1, stop=20, npoints=201, unit=’ghz’) s = non_ideal_r.s(freq)

print(f”S11 at 10 GHz: {s[freq.center_idx, 0, 0]:.2f}”) ```

Parameters:
res: Resistor
clc: PiCLC
property ideal: Model

The ideal Resistor part of the model.

Returns:

Model: The ideal resistor component.

property parasitics: Model

The parasitic PiCLC network part of the model.

Returns:

Model: The PiCLC parasitic network.

a(freq)[source]

Calculates the ABCD-matrix of the complete non-ideal resistor model.

Args:

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

Returns:

np.ndarray: The resultant ABCD-matrix.

Parameters:

freq (Frequency)

Return type:

Array