PYTHON

SENSITIVITY STUDY

Automated parameter sweeps to quantify lap time sensitivity to mass, CG height, aero balance, and spring rates. Identifies highest-value design changes.

Get Module — £24 Try Demo ↓
CL +0.5
−0.58s
Mass −10kg
−0.42s
CoG −10mm
−0.31s
Aero balance +5%F
−0.18s
Front spring +5 N/mm
+0.08s
Rear ARB +50%
+0.12s

Sensitivity analysis quantifies how much a design parameter change affects lap time. The module sweeps each parameter independently while holding others at baseline:

∂t_lap/∂p ≈ (t(p + Δp) − t(p − Δp)) / (2·Δp)(1)

For a full vehicle, the key parameters are mass, CoG height, aero balance (% front downforce), total downforce, spring rates, and ARB stiffness.

Sensitivity = Δt_lap / Δp   [s/kg, s/mm, s/%](2)

Results are normalised and ranked to identify which parameter gives the most lap time for the least design effort — the engineering ROI.

sensitivity_sweep.py — Main sweep engine
  ████████░░░░░██████████████████░░░░
    ██████████████████████░░░░░░░░██████
  ████████████░░░░██████████████████████░░░
  ██████░░░░██████████████████████░░░████
      ████████████████████████░░░░░░██████
  ██████████░░░██████████████████████░░████
    ████████████████████████░░░░░░░░░██████
  ████░░░░██████████████████████░░░██████
  ██████████████████░░░░██████████████████
    ██████████████████████░░░░░░░░██████████
Included with purchase
Tornado chart generator
  ████████░░░░░██████████████████░░░░
    ██████████████████████░░░░░░░░██████
  ████████████░░░░██████████████████████░░░
  ██████░░░░██████████████████████░░░████
      ████████████████████████░░░░░░██████
  ██████████░░░██████████████████████░░████
    ████████████████████████░░░░░░░░░██████
  ████░░░░██████████████████████░░░██████
  ██████████████████░░░░██████████████████
    ██████████████████████░░░░░░░░██████████
Included with purchase
Interpreting sensitivity results for design reviews
  ████████░░░░░██████████████████░░░░
    ██████████████████████░░░░░░░░██████
  ████████████░░░░██████████████████████░░░
  ██████░░░░██████████████████████░░░████
      ████████████████████████░░░░░░██████
  ██████████░░░██████████████████████░░████
    ████████████████████████░░░░░░░░░██████
  ████░░░░██████████████████████░░░██████
  ██████████████████░░░░██████████████████
    ██████████████████████░░░░░░░░██████████
Included with purchase
Pythonsensitivity_sweep.py
LOCKED
import numpy as np
from dataclasses import dataclass
from typing import Dict, List, Callable

@dataclass
class SweepConfig:
    param_name: str
    baseline: float
    delta: float
    unit: str
    n_steps: int = 11

def run_sensitivity(configs: List[SweepConfig],
                    lap_sim: Callable,
                    baseline_params: Dict) -> Dict:
    results = {}
    t_base = lap_sim(baseline_params)
    
    for cfg in configs:
        values = np.linspace(
            cfg.baseline - cfg.delta,
            cfg.baseline + cfg.delta,
            cfg.n_steps
        )
        lap_times = []
        for v in values:
            p = baseline_params.copy()
            p[cfg.param_name] = v
            lap_times.append(lap_sim(p))
        
        sens = (lap_times[-1] - lap_times[0]) / (2 * cfg.delta)
        results[cfg.param_name] = {
            'values': values,
            'lap_times': np.array(lap_times),
            'sensitivity': sens,
            'unit': f's/{cfg.unit}'
        }
    
    return results

Full source code

Purchase to unlock code, docs & examples

Unlock — £24
sensitivity_sweep.pyMain sweep engine
PYTHON
tornado_chart.pyRanked sensitivity bar chart
PYTHON
interaction_matrix.pyTwo-parameter interaction effects
PYTHON
config_template.yamlSweep configuration template
PYTHON
report_generator.pyAuto-generate sensitivity report
PYTHON
1
Install dependencies
pip install numpy matplotlib pyyaml. No other dependencies — works with Python 3.8+.
2
Define your sweeps
Edit config_template.yaml with parameters, ranges, and step counts. Example configs for mass, CoG, aero are included.
3
Connect your lap sim
Point the sweep engine to your QSLT function or the T2T Lap Simulator .mat output. Both interfaces supported.
4
Run & present
Execute sensitivity_sweep.py. Outputs: tornado chart, individual sweep plots, and a ranked sensitivity table.
FS Student
£24 / team

Full source code, documentation, and email support. Unlimited use within your FS team.

Get Started
With Setup
£79 / team

Full source + 1hr setup call + priority support. Custom vehicle config and tyre fitting included.

Contact Us

No toolboxes required. All optimisation uses custom solvers — no Optimization Toolbox, no Curve Fitting Toolbox. Works on base MATLAB R2020a+ / Python 3.8+.