ProfiledLine

class pmrf.models.components.lines.ProfiledLine(line_fn: Callable, profile_fn: Callable | None = None, *, length: Any = 1, floating: bool = False, method: str = 'stepped', options: dict | None = None, name: str | None = None, z0: complex = 50.0, **line_params)

Bases: Model

A non-uniform transmission line defined by an arbitrary profile.

NB: Not yet tested.

This model wraps any RLGC transmission line model and allows its parameters to vary as a function of length. For example, the line’s characteristic impedance can be varied exponentially for impedance matching purposes.

Any line parameters can be uniform across length or follow a spatial profile defined by user-provided function (e.g., splines). Both the uniform parameters and the coefficients of the profile functions are registered as Parameter objects, making the profile parameters compatible with fitting and sampling.

Supported evaluation methods:
  • ‘stepped’: A discrete cascaded approximation (default).

  • ‘riccati’: A continuous ODE solver using the Matrix Riccati differential equations.

Example

import pmrf as prf
from pmrf.core import PhysicalLine, ProfiledLine

def linear_taper(t, start_val, end_val):
    return start_val + (end_val - start_val) * t

tapered_line = ProfiledLine(
    PhysicalLine,
    linear_taper,
    length=0.1,
    zn={'start_val': 50.0, 'end_val': 100.0},
    epr=2.2,
    method='riccati',
    options={'rtol': 1e-6, 'atol': 1e-6},
)

freq = prf.Frequency(start=1, stop=10, npoints=101, unit='ghz')
s_taper = tapered_line.s(freq)
s(freq: Frequency) Array

Scattering parameter matrix.

If a different parameter type (a, z, y) is primary, this converts it to S.

Note that, in ParamRF, the power wave definition of S-parameters should be used. If you have a formulation in terms of another definition (such as traveling waves), simply use pmrf.rf.s2s() (or pmrf.rf.renormalize_s() if you need to change impedance too).

Parameters:

freq (Frequency) – Frequency grid.

Returns:

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

Return type:

jnp.ndarray

section(dz: float, **profiled_params) RLGCLine
floating: bool = False
length: Parameter
line_fn: Callable[[Any], RLGCLine]
method: str
options: dict
profile_fns: Dict[str, Callable]
profile_params: Dict[str, Dict[str, Parameter]]
uniform_params: Dict[str, Parameter]