tensor_pwc

static OperationNamespace.tensor_pwc(durations, values, *, name=None)

Creates a piecewise-constant function of time.

Parameters
  • durations (np.ndarray (1D, real)) – The durations \(\{\delta t_n\}\) of the constant segments.

  • values (np.ndarray or Tensor) – The values \(\{v_n\}\) of the function on the constant segments. The first dimension must be the same length as durations.

  • name (str, optional) – The name of the node.

Returns

The piecewise-constant function of time \(v(t)\), satisfying \(v(t)=v_n\) for \(t_{n-1}\leq t\leq t_n\), where \(t_0=0\) and \(t_n=t_{n-1}+\delta t_n\).

Return type

TensorPwc