pyrk.timer module¶
-
class
pyrk.timer.
Timer
(t0=<Quantity(0.0, 'second')>, tf=<Quantity(1.0, 'second')>, dt=<Quantity(1.0, 'second')>, t_feedback=<Quantity(0.0, 'second')>)[source]¶ Bases:
object
This class holds information about time
-
advance_time
(time)[source]¶ Advances the timer to a specific time
Parameters: time (Quantity units seconds) – the time to advance to
-
idx_from_t
(time, t0, dt)[source]¶ given the any time, in seconds, this returns the index of t.
Parameters: - time (float, units of seconds) – any time to convert
- time – start time for conversion calc
- time – size of the timestep for the conversion calc
Returns: index
-
t
(t_idx)[source]¶ given the index of t, a dimensionless int, this returns the time in seconds
Parameters: t_idx – the index to convert to simulation time
-