Spa: Single-Track Lap¶
This page explains examples/spa/spa_lap_single_track.py.
Learning goal¶
Use the highest-fidelity quasi-steady vehicle model in the current library and interpret its outputs correctly.
What the script does¶
- Loads Spa track data.
- Builds vehicle + tire +
SingleTrackModel. - Runs
simulate_lap(...)with default runtime config. - Exports KPI JSON and standard plots.
Key code path¶
track = load_track_csv(spa_track_path())
vehicle = example_vehicle_parameters()
tires = default_axle_tire_parameters()
model = build_single_track_model(vehicle=vehicle, tires=tires, physics=SingleTrackPhysics())
config = build_simulation_config()
result = simulate_lap(track=track, model=model, config=config)
Why start with single-track¶
- It captures lateral tire behavior with load sensitivity.
- It provides axle-load diagnostics and supports transient yaw-residual analysis.
- It is a strong baseline before simplifying to point-mass.
Outputs to inspect first¶
examples/output/spa/single_track/kpis.jsonexamples/output/spa/single_track/speed_trace.pngexamples/output/spa/single_track/gg_diagram.pngexamples/output/spa/single_track/yaw_moment_vs_ay.png
Theoretical foundation¶
The single-track model is a reduced planar vehicle model with front/rear axle representation. In quasi-steady use, the key balances are:
Lateral acceleration balance:
\[
a_y = \frac{F_{y,f} + F_{y,r}}{m}
\]
In quasi-static mode, yaw-moment output is zero by steady-state model assumption. Dynamic yaw residuals are available in transient mode.
Path-kinematics coupling:
\[
a_y = v^2 \kappa
\]
Tire forces are generated from the Pacejka-style lateral model with load sensitivity. This makes axle-load distribution and aero effects directly relevant for cornering limits.
Assumptions and limits¶
- Quasi-steady envelope solving does not capture full transient tire relaxation.
- The model is 3-DOF planar and omits full multibody compliance.
- Powertrain and control strategy are represented through simplified envelopes.
Potential learnings from the data¶
- Check lap-time and speed-trace shape together, not separately.
- Validate that high \(|a_y|\) regions align with curved track sectors.
- In transient runs, use yaw-residual traces as consistency diagnostics for dynamic balance.
- If output magnitudes are implausible, re-check physical inputs before changing numerics.