AbstractProfile

class pmrf.models.components.lines.profiles.AbstractProfile(*, name: str | None = None, metadata: Any = None)

Bases: Module

Abstract base class for a profile: a shape a parameter follows along a line.

A profile is a pmrf.Module rather than a pmrf.Model. It is parameter-aware, named and validated like any module, but it has no ports and no S-parameters, exactly as materials and the line formulation objects do not.

Subclasses implement evaluate(), which maps a normalised position t to a plain physical value. The value is in the units of whatever the profile is later attached to: a profile is never told which parameter it drives, so an exponential shape applies unchanged to a microstrip width in metres, to a coaxial inner diameter or to a dimensionless relative permittivity. Its coefficients are ordinary pmrf.param() fields, so a plain value and a constrained parameter both work with no profile-specific machinery:

ExponentialProfile(start=2e-3, end=8e-3)
ExponentialProfile(start=prf.Bounded(2e-3, lower=1e-3, upper=5e-3), end=8e-3)

Orientation

t = 0 is at port 1 and t = 1 is at port 2. This convention is fixed, and is restated wherever a profile is attached. There is no orientation flag: reversing a shape swaps its coefficients, because a flag that silently mirrors geometry inside a cascade is a debugging hazard.

Smoothness

Shipped profiles are \(C^2\) in t on the closed interval \([0, 1]\), endpoints included. This is a requirement, not an accident. A profiled line samples its profiles at section midpoints and builds exact hyperbolic sections, which is the exponential midpoint rule, an order-2 Magnus integrator. That integrator is time-symmetric only while the sampled function is smooth, and its error then expands in even powers of the section length, which is what makes Richardson extrapolation of the section count \(O(h^4)\) rather than \(O(h^3)\). A profile with a kink breaks that expansion silently. A deliberate kink is expressed by cascading two profiled lines, not by a discontinuous profile.

abstractmethod evaluate(t: Array | ndarray | bool | number | bool | int | float | complex) → Array | ndarray | bool | number | bool | int | float | complex

Evaluate the profile at a normalised position along the line.

This is elementwise: t may be a scalar or an array of any shape, and the result has that same shape. A caller sampling many positions, such as a profiled line sampling its section midpoints, passes the whole array in one call.

Parameters:

t (ArrayLike) – Normalised position along the line, in \([0, 1]\). t = 0 is at port 1 and t = 1 is at port 2.

Returns:

The profiled value at t, in the physical units of whatever parameter the profile is attached to. Same shape as t.

Return type:

ArrayLike