pmrf.models.lumped

Classes

Capacitor([C, name, separator, _z0, ...])

Overview

Inductor([L, name, separator, _z0, ...])

Overview

Load(gamma[, nports, name, separator, _z0, ...])

Overview

Resistor([R, name, separator, _z0, ...])

Overview

ShuntCapacitor([C, name, separator, _z0, ...])

Overview

ShuntInductor([L, name, separator, _z0, ...])

Overview

ShuntResistor([R, name, separator, _z0, ...])

Overview

class pmrf.models.lumped.Load(gamma, nports=1, *, name=None, separator='_', _z0=(50+0j), _param_groups=<factory>)[source]

Bases: Model

Overview

An abstract base class for N-port loads defined by their reflection coefficient.

Parameters:
  • gamma (float)

  • nports (int)

  • name (str | None)

  • separator (str)

  • _z0 (complex)

  • _param_groups (list[ParameterGroup])

gamma: float
nports: int = 1
s(freq)[source]

Calculates the 1-port S-parameter matrix.

Args:

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

Returns:

np.ndarray: The resultant 1x1 S-parameter matrix.

Parameters:

freq (Frequency)

Return type:

Array

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

Bases: Model

Overview

A 2-port model of a series capacitor.

Example

```python import pmrf as prf

# Create a 1 pF series capacitor c_series = prf.models.Capacitor(C=1e-12)

# Terminate the capacitor in a short to create a 1-port shunt capacitor c_shunt = c_series.terminated(prf.models.Short())

freq = prf.Frequency(start=1, stop=10, npoints=101, unit=’ghz’) s = c_shunt.s(freq)

print(f”Shunt capacitor has {c_shunt.nports} port.”) ```

Parameters:
  • C (Any)

  • name (str | None)

  • separator (str)

  • _z0 (complex)

  • _param_groups (list[ParameterGroup])

C: Parameter = 1.0
s(freq)[source]

Calculates the S-parameters of a series capacitor.

Args:

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

Returns:

np.ndarray: The resultant 2x2 S-parameter matrix.

Parameters:

freq (Frequency)

Return type:

Array

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

Bases: Model

Overview

A 2-port model of a series inductor.

Example

```python import pmrf as prf

# Create a 1 nH series inductor l_series = prf.models.Inductor(L=1e-9)

freq = prf.Frequency(start=1, stop=10, npoints=101, unit=’ghz’) s = l_series.s(freq)

print(f”Series inductor has {l_series.nports} ports.”) ```

Parameters:
  • L (Any)

  • name (str | None)

  • separator (str)

  • _z0 (complex)

  • _param_groups (list[ParameterGroup])

L: Parameter = 1.0
s(freq)[source]

Calculates the S-parameters of a series inductor.

Args:

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

Returns:

np.ndarray: The resultant 2x2 S-parameter matrix.

Parameters:

freq (Frequency)

Return type:

Array

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

Bases: Model

Overview

A 2-port model of a series resistor.

Example

```python import pmrf as prf

# Create a 25-ohm series resistor (e.g., for an attenuator pad) r_series = prf.models.Resistor(R=25.0)

freq = prf.Frequency(start=1, stop=10, npoints=101, unit=’ghz’) s = r_series.s(freq)

print(f”Series resistor has {r_series.nports} ports.”) ```

Parameters:
  • R (Any)

  • name (str | None)

  • separator (str)

  • _z0 (complex)

  • _param_groups (list[ParameterGroup])

R: Parameter = 1.0
s(freq)[source]

Calculates the S-parameters of a series resistor.

Args:

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

Returns:

np.ndarray: The resultant 2x2 S-parameter matrix.

Parameters:

freq (Frequency)

Return type:

Array

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

Bases: Model

Overview

A 2-port model of a shunt capacitor.

This model represents a capacitor connected from the signal path to the ground reference, placed between port 1 and port 2.

Example

```python import pmrf as prf import matplotlib.pyplot as plt import numpy as np

# Create a 1 pF shunt capacitor c_shunt = prf.models.ShuntCapacitor(C=1e-12)

# Define the frequency range for analysis freq = prf.Frequency(start=1, stop=10, npoints=101, unit=’ghz’)

# Calculate the S-parameters s = c_shunt.s(freq) ```

Parameters:
  • C (Any)

  • name (str | None)

  • separator (str)

  • _z0 (complex)

  • _param_groups (list[ParameterGroup])

C: Parameter = 1.0
s(freq)[source]

Calculates the S-parameters of a 2-port shunt capacitor.

Args:

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

Returns:

jnp.ndarray: The resultant 2x2 S-parameter matrix.

Parameters:

freq (Frequency)

Return type:

Array

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

Bases: Model

Overview

A 2-port model of a shunt resistor.

This model represents a resistor connected from the signal path to the ground reference, placed between port 1 and port 2.

Example

```python import pmrf as prf import matplotlib.pyplot as plt

# Create a 50 Ohm shunt resistor r_shunt = prf.models.ShuntResistor(R=50.0)

# Define the frequency range for analysis freq = prf.Frequency(start=1, stop=10, npoints=101, unit=’ghz’)

# Calculate the S-parameters s = r_shunt.s(freq)

# Plot the magnitude of S11 and S21 in dB s11_db = 20 * np.log10(np.abs(s[:, 0, 0])) s21_db = 20 * np.log10(np.abs(s[:, 1, 0]))

plt.figure() plt.plot(freq.f_ghz, s11_db, label=’S11 (Return Loss)’) plt.plot(freq.f_ghz, s21_db, label=’S21 (Insertion Loss)’) plt.title(‘S-Parameters of a 50 Ohm 2-Port Shunt Resistor’) plt.xlabel(‘Frequency (GHz)’) plt.ylabel(‘Magnitude (dB)’) plt.legend() plt.grid(True) plt.show() ```

Parameters:
  • R (Any)

  • name (str | None)

  • separator (str)

  • _z0 (complex)

  • _param_groups (list[ParameterGroup])

nports = 2
R: Parameter = 50.0
s(freq)[source]

Calculates the S-parameters of a 2-port shunt resistor.

Args:

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

Returns:

jnp.ndarray: The resultant 2x2 S-parameter matrix.

Parameters:

freq (Frequency)

Return type:

Array

class pmrf.models.lumped.ShuntInductor(L=1e-09, *, name=None, separator='_', _z0=(50+0j), _param_groups=<factory>)[source]

Bases: Model

Overview

A 2-port model of a shunt inductor.

This model represents an inductor connected from the signal path to the ground reference, placed between port 1 and port 2.

Example

```python import pmrf as prf import matplotlib.pyplot as plt

# Create a 1 nH shunt inductor l_shunt = prf.models.ShuntInductor(L=1e-9)

# Define the frequency range for analysis freq = prf.Frequency(start=1, stop=10, npoints=101, unit=’ghz’)

# Calculate the S-parameters s = l_shunt.s(freq)

# Plot the magnitude of S11 and S21 in dB s11_db = 20 * np.log10(np.abs(s[:, 0, 0])) s21_db = 20 * np.log10(np.abs(s[:, 1, 0]))

plt.figure() plt.plot(freq.f_ghz, s11_db, label=’S11 (Return Loss)’) plt.plot(freq.f_ghz, s21_db, label=’S21 (Insertion Loss)’) plt.title(‘S-Parameters of a 1 nH 2-Port Shunt Inductor’) plt.xlabel(‘Frequency (GHz)’) plt.ylabel(‘Magnitude (dB)’) plt.legend() plt.grid(True) plt.show() ```

Parameters:
  • L (Any)

  • name (str | None)

  • separator (str)

  • _z0 (complex)

  • _param_groups (list[ParameterGroup])

nports = 2
L: Parameter = 1e-09
s(freq)[source]

Calculates the S-parameters of a 2-port shunt inductor.

Args:

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

Returns:

jnp.ndarray: The resultant 2x2 S-parameter matrix.

Parameters:

freq (Frequency)

Return type:

Array