suboptimumg.compsim.lap#

Core lap simulation functions.

suboptimumg.compsim.lap.lapsim(mycar, track, multilap=False, initial_velocity=-1, use_coast=False, extract_internal_data=False)[source]#

Simulates a lap (TODO: or multiple laps) around a given track with a given car.

Parameters:
  • mycar (Car) – Suboptimumg’s Car object representing the vehicle to simulate

  • track (Track) – Suboptimumg’s Track object representing the track to move around

  • multilap (bool, optional) – Whether to simulate multiple laps, by default False

  • initial_velocity (float, optional) – The initial velocity to start the simulation with, by default -1

  • extract_internal_data (bool, optional) – Whether to extract internal data during simulation, by default False

  • use_coast (bool)

Returns:

The results of the lap simulation, including lap times, velocities, accelerations, etc.

Return type:

LapsimResults

Notes

Overview of Algorithm: Based on the track curvature, we find points of velocity minima (or middles of constant radius turns), and use those as seeds to simulate both forwards and backwards along the track.

Then, we construct “proposals” from each seed. The velocity we choose is the lowest velocity simulation out of all the seeds. Acceleration, power, and force profiles correspond to the velocity profile chosen.