LinearProfile

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

Bases: AbstractProfile

A profile varying linearly between two endpoint values.

The simplest taper, and the one whose endpoints mean exactly what they say: evaluate(0) == start and evaluate(1) == end.

Mathematical Formulation

\[p(t) = p_0 + (p_1 - p_0)\,t, \qquad 0 \leq t \leq 1\]

where \(p_0\) is start and \(p_1\) is end. It is \(C^\infty\) in \(t\), so the smoothness requirement on AbstractProfile holds trivially.

Coefficients are unconstrained: a linear interpolation is well defined for any real endpoints, and whatever positivity the driven parameter requires is enforced by that parameter’s own constraint.

Example

from pmrf.models import LinearProfile

taper = LinearProfile(start=2e-3, end=8e-3)
taper.evaluate(0.5)   # 5e-3

References

Pozar, D. M. (2011). Microwave Engineering (4th ed.), Section 5.8. Wiley.

Parameters:
  • start (Param) – Value at t = 0, the port-1 end.

  • end (Param) – Value at t = 1, the port-2 end.

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

end: Param

Value at t = 1, the port-2 end

start: Param

Value at t = 0, the port-1 end