Expand description
Module containing drive cycle struct and related functions.
Structs§
- Passing
Info - Rust
Cycle - Struct for containing:
- Rust
Cycle Cache - Rust
Cycle Element
Functions§
- accel_
array_ for_ constant_ jerk - Apply
accel_for_constant_jerkto full - accel_
for_ constant_ jerk - Calculate the acceleration n timesteps away
- average_
step_ speed_ at - Calculate the average step speed at step i in m/s (i.e., from sample point i-1 to i)
- average_
step_ speeds - Calculate the average speed per each step in m/s
- calc_
constant_ jerk_ trajectory - Arguments
- create_
dist_ and_ target_ speeds_ by_ microtrip - 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)
- detect_
passing - Reports back information of the first point where cyc passes cyc0, starting at step i until the next stop of cyc.
- dist_
for_ constant_ jerk - Calculate distance (m) after n timesteps
- extend_
cycle - 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
- speed_
for_ constant_ jerk - Calculate speed (m/s) n timesteps away via a constant-jerk acceleration
- time_
spent_ moving - Calculate the time in a cycle spent moving
- to_
microtrips - Split a cycle into an array of microtrips with one microtrip being a start to subsequent stop plus any idle (stopped time). Arguments:
- trapz_
distance_ for_ step - The distance traveled during step i in meters (i.e., from sample point i-1 to i)
- trapz_
distance_ over_ range - 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)
- trapz_
step_ distances - Sum of the distance traveled over each step using trapezoidal integration
- trapz_
step_ distances_ primitive - trapz_
step_ start_ distance - 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.