Spa: Performance Envelope¶
This page explains examples/spa/spa_performance_envelope.py.
Learning goal¶
Generate and interpret velocity-dependent G-G envelopes for both model families.
What the script does¶
- Builds single-track and calibrated point-mass models.
- Computes
compute_performance_envelope(...)for both. - Exports envelope arrays (
.npz) and summary JSON. - Exports a comparison plot of envelope slices across speeds.
- Optionally exports CSV when pandas is installed.
Why this is useful¶
- Separates vehicle capability analysis from one specific lap profile.
- Supports parameter studies and sensitivity sweeps.
- Makes speed dependence explicit in longitudinal/lateral coupling.
Theoretical definition¶
For each speed sample \(v_j\), the script evaluates a feasible acceleration set:
\[
\mathcal{E}(v_j)=
\left\{(a_y,a_x)\,\middle|\,
a_y\in\left[-a_{y,\mathrm{lim}}(v_j),+a_{y,\mathrm{lim}}(v_j)\right],\;
a_x\in\left[a_{x,\min}(v_j),a_{x,\max}(v_j)\right]
\right\}
\]
In the exported arrays, this becomes a discretized family of G-G slices indexed by speed. The point-mass and single-track models provide \(a_{y,\mathrm{lim}}(v)\) and longitudinal bounds via their own physical assumptions.
Main artifacts¶
examples/output/spa/performance_envelope/single_track_envelope.npzexamples/output/spa/performance_envelope/point_mass_envelope.npzexamples/output/spa/performance_envelope/envelope_family_comparison.pngexamples/output/spa/performance_envelope/summary.json- optional CSV files (if pandas is installed)
Potential learnings from the data¶
- At each speed, interpret the upper/lower \(a_x\) bounds at equal \(a_y\).
- Compare drive and braking envelopes separately.
- Identify speed ranges where model disagreement is systematically largest.
- Use these ranges as focused inputs for lap-level model comparisons.
Common pitfalls¶
- Comparing envelopes at different speed grids.
- Mixing up signed \(a_x\) convention (braking is negative in exported minimum trace).
- Assuming envelope superiority at one speed implies lap-time superiority everywhere.