stem.table module

class stem.table.Table(values: Sequence[float] | ndarray[tuple[Any, ...], dtype[float64]], times: Sequence[float] | ndarray[tuple[Any, ...], dtype[float64]], _Table__id: int | None = None)

Bases: object

Class to write time-dependent functions for imposed load and constraints. If analysis runs outside the specified time-steps, the function is linearly extrapolated. If load/constraint is required to remain constant, please specify the same load/constraint value for the last two point of the sequence/array.

Attributes:
  • values (Union[Sequence[float], npty.NDArray[np.float64]]): values of the load/constraint.

  • times (Union[Sequence[float], npty.NDArray[np.float64]]): time [s] corresponding to the values specified.

  • __id (Optional[int]): unique identifier for the table.

property id: int | None

Getter for the id of the table.

Returns:
  • Optional[int]: The id of the table.

interpolate_value_at_time(time: float) float

Interpolates the value at a given time. If the time is < times[0], the value at times[0] is returned. If the time is > times[-1], the value at times[-1] is returned.

Args:
  • time (float): time [s] at which the value is interpolated.

Returns:
  • float: interpolated value at the given time.

times: Sequence[float] | ndarray[tuple[Any, ...], dtype[float64]]
values: Sequence[float] | ndarray[tuple[Any, ...], dtype[float64]]