torchgpe.utils.potentials.linear_ramp#

torchgpe.utils.potentials.linear_ramp(v0=0, t0=0, v1=1, t1=1)[source]#

Implements a linear ramp from \(v_0\) to \(v_1\) between \(t_0\) and \(t_1\). The ramp is constant outside of the interval.

Parameters:
  • v0 (float, optional) – The initial value of the ramp. Defaults to \(0\).

  • t0 (float, optional) – The initial time of the ramp. Defaults to \(0\).

  • v1 (float, optional) – The final value of the ramp. Defaults to \(1\).

  • t1 (float, optional) – The final time of the ramp. Defaults to \(1\).

Returns:

A function that returns the value of the ramp at time \(t\)

Return type:

callable