Skip to content

feat: skidpad score sensitivity experiment - #3

Merged
rafaelborges5 merged 1 commit into
skidpad-ltofrom
skidpad-sensitivity-analysis
Jul 1, 2026
Merged

rafaelborges5 merged 1 commit into
skidpad-ltofrom
skidpad-sensitivity-analysis

Conversation

@rafaelborges5

Copy link
Copy Markdown
Owner

Summary

Adds a one-at-a-time (OAT) local sensitivity study for the skidpad LTO, measuring how the average timed-lap time (the FS score, profiling.skidpad_score_s = mean of the two timed laps) responds to the four-wheel model and solver parameters.

  • Experiment (src/experiments/skidpad_sensitivity.py): builds the skidpad track once, then re-solves the four-wheel OCP for each perturbation in parallel (ProcessPoolExecutor). Each parameter is moved ±15% around the baseline, one at a time; grouped knobs (D_rear = D_rr & D_rl, D_front = D_fl & D_fr) scale together. Reports absolute lap-time swing and dimensionless elasticity E = (Δscore/score)/(Δp/p), and emits a tornado plot, a per-solve CSV, and a JSON summary.
  • Results (data/sensitivity/): tornado plot, raw CSV, JSON summary, and a README documenting method and takeaways.

Reproduce:

OMP_NUM_THREADS=1 OPENBLAS_NUM_THREADS=1 MKL_NUM_THREADS=1 \
PYTHONPATH=src python src/experiments/skidpad_sensitivity.py \
    --config configs/skidpad.yaml --delta 0.15 --jobs 4

Results

Baseline average timed-lap score 4.740 s; all 19 solves returned Solve_Succeeded.

Rank Parameter Base −15% +15% swing [s] elasticity
1 rear grip D_rear 1.20 5.095 4.457 0.638 −0.449
2 front grip D_front 1.20 4.902 4.629 0.273 −0.192
3 mass m 170 4.615 4.835 0.219 +0.154
4 downforce C_l 5.54 4.844 4.634 0.210 −0.148
5 margin boundary_margin 0.20 4.732 4.748 0.016 +0.011
6 drag C_d 1.58 4.733 4.748 0.015 +0.011
7 reg_u_l2 0.015 4.734 4.748 0.014 +0.010
8 CG height h 0.246 4.737 4.744 0.007 +0.005
9 yaw inertia Iz 250 4.738 4.742 0.004 +0.003

Takeaways

  • Rear tyre peak grip D_rear dominates — ~3× the next parameter. Skidpad is a steady-state, grip-limited corner, and the rear-biased static load (lf > lr) makes the rears the limiting pair.
  • Among tunable design knobs, mass and downforce C_l are the meaningful levers (~0.2 s each, opposite signs); C_l's benefit is v²-scaled and modest at skidpad speeds (~12 m/s).
  • reg_u_l2, boundary_margin, C_d, h, and Iz are negligible (<0.02 s over ±15%).

These are local ±15% OAT sensitivities about one operating point; widen --delta or run a coupled sweep to probe non-linearities and interactions.


Generated by Claude Code

OAT (one-at-a-time) +-15% sensitivity of the average timed-lap score
(skidpad_score_s) to the four-wheel model and solver parameters. Builds
the skidpad track once, re-solves the OCP per perturbation in parallel,
and ranks parameters by lap-time swing and elasticity. Outputs a tornado
plot, per-solve CSV, and JSON summary.

Findings (baseline score 4.740 s, all solves converged): rear tyre peak
grip D_rear dominates (0.64 s over +-15%), then front grip, mass, and
downforce C_l (~0.2 s each); margin, drag, reg_u_l2, CG height, and Iz
are negligible (<0.02 s).
Copilot AI review requested due to automatic review settings July 1, 2026 07:01

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a one-at-a-time (OAT) local sensitivity experiment for the skidpad LTO, quantifying how the skidpad FS score (profiling.skidpad_score_s) responds to key four-wheel model and solver parameters, along with captured output artifacts for reproducibility and reporting.

Changes:

  • Introduces src/experiments/skidpad_sensitivity.py to run baseline + ±delta perturbation solves (optionally parallel) and emit CSV/PNG/JSON outputs.
  • Adds recorded experiment outputs under data/sensitivity/ (raw per-solve CSV + machine-readable JSON summary).
  • Adds a data/sensitivity/README.md describing method, results table, and takeaways.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.

File Description
src/experiments/skidpad_sensitivity.py New OAT sensitivity experiment runner (job construction, parallel solving, elasticity/swing ranking, CSV/PNG/JSON outputs).
data/sensitivity/skidpad_sensitivity.csv Captured raw per-solve results for baseline and perturbations.
data/sensitivity/skidpad_sensitivity_summary.json Captured summarized sensitivities (base value, lo/hi scores, swing, elasticity) for downstream use.
data/sensitivity/README.md Documents reproduction command, methodology, results table, and conclusions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +164 to +166
def _make_integrator(name: str):
return RK4Integrator() if name == "rk4" else EulerIntegrator()

elif knob.name == "boundary_margin":
boundary_margin = new_val

tag = f"{knob.name}_x{multiplier:.2f}".replace(".", "p")
Comment on lines +411 to +412
lo_tag = f"{knob.name}_x{multipliers[0]:.2f}".replace(".", "p")
hi_tag = f"{knob.name}_x{multipliers[1]:.2f}".replace(".", "p")
@rafaelborges5
rafaelborges5 merged commit 7f6810f into skidpad-lto Jul 1, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants