Module fastsim_core::cycle

source ·
Expand description

Module containing drive cycle struct and related functions.

Structs§

Functions§

  • Apply accel_for_constant_jerk to full
  • Calculate the acceleration n timesteps away
  • Calculate the average step speed at step i in m/s (i.e., from sample point i-1 to i)
  • Calculate the average speed per each step in m/s
  • Arguments
  • Create distance and target speeds by microtrip This helper function splits a cycle up into microtrips and returns a list of 2-tuples of: (distance from start in meters, target speed in meters/second)
  • Reports back information of the first point where cyc passes cyc0, starting at step i until the next stop of cyc.
  • Calculate distance (m) after n timesteps
  • cyc: fastsim.cycle.Cycleabsolute_time_s: float, the seconds to extendtime_fraction: float, the fraction of the original cycle time to add onuse_rust: bool, if True, return a RustCycle instance, else a normal Python Cycle RETURNS: fastsim.cycle.Cycle (or fastsimrust.RustCycle), the new cycle with stopped time appended NOTE: additional time is rounded to the nearest second
  • Calculate speed (m/s) n timesteps away via a constant-jerk acceleration
  • Calculate the time in a cycle spent moving
  • Split a cycle into an array of microtrips with one microtrip being a start to subsequent stop plus any idle (stopped time). Arguments:
  • The distance traveled during step i in meters (i.e., from sample point i-1 to i)
  • Calculate the distance from step i_start to the start of step i_end (i.e., distance from sample point i_start-1 to i_end-1)
  • Sum of the distance traveled over each step using trapezoidal integration
  • The distance traveled from start at the beginning of step i (i.e., distance traveled up to sample point i-1) Distance is in meters.