MATLAB / SIMULINK

LAP SIMULATOR

Quasi-steady-state and transient lap simulation. Track discretisation, braking optimisation, and sector analysis — directly fed from GGV envelopes.

Get Module — £39 Try Demo ↓

The quasi-static lap time simulator (QSLT) uses a three-phase approach to find the minimum-time speed profile along a discretised racing line:

Phase 1: v_corner = max v s.t. Ay(v) ≤ GGV_lat(v)(1)
Phase 2: backward braking pass — friction ellipse coupling(2)
Phase 3: forward acceleration pass — power limit P_max/(m·v)(3)

At each track station, available acceleration is bounded by the GGV envelope. The friction ellipse couples longitudinal and lateral demands:

(Ax/Ax_max)² + (Ay/Ay_max)² ≤ 1(4)
run_qslt.m — Three-phase lap time solver
  ████████░░░░░██████████████████░░░░
    ██████████████████████░░░░░░░░██████
  ████████████░░░░██████████████████████░░░
  ██████░░░░██████████████████████░░░████
      ████████████████████████░░░░░░██████
  ██████████░░░██████████████████████░░████
    ████████████████████████░░░░░░░░░██████
  ████░░░░██████████████████████░░░██████
  ██████████████████░░░░██████████████████
    ██████████████████████░░░░░░░░██████████
Included with purchase
Track preparation guide
  ████████░░░░░██████████████████░░░░
    ██████████████████████░░░░░░░░██████
  ████████████░░░░██████████████████████░░░
  ██████░░░░██████████████████████░░░████
      ████████████████████████░░░░░░██████
  ██████████░░░██████████████████████░░████
    ████████████████████████░░░░░░░░░██████
  ████░░░░██████████████████████░░░██████
  ██████████████████░░░░██████████████████
    ██████████████████████░░░░░░░░██████████
Included with purchase
Interpreting sector analysis output
  ████████░░░░░██████████████████░░░░
    ██████████████████████░░░░░░░░██████
  ████████████░░░░██████████████████████░░░
  ██████░░░░██████████████████████░░░████
      ████████████████████████░░░░░░██████
  ██████████░░░██████████████████████░░████
    ████████████████████████░░░░░░░░░██████
  ████░░░░██████████████████████░░░██████
  ██████████████████░░░░██████████████████
    ██████████████████████░░░░░░░░██████████
Included with purchase
REF Tremlett et al. (2014) · Brayshaw & Harrison · Siegler & Crolla (2002)
MATLABrun_qslt.m
LOCKED
function [t_lap, v_profile, results] = run_qslt(track, ggv, veh)
% Three-phase quasi-static lap time simulation
%
% Phase 1: Cornering speed from lateral GGV limit
% Phase 2: Backward braking with friction ellipse
% Phase 3: Forward acceleration with power limit
%
% Inputs: track - struct: s, kappa (curvature), width
%         ggv   - GGV lookup: ax_max(v, ay), ay_max(v)
%         veh   - struct: m, Pmax, Cd, CL, Aref

N = length(track.s);
ds = diff(track.s);

% Phase 1 - cornering speed
v_corner = zeros(N, 1);
for i = 1:N
    v_lo = 1; v_hi = 80;
    for k = 1:25
        v_mid = (v_lo + v_hi) / 2;
        ay_demand = v_mid^2 * abs(track.kappa(i));
        ay_avail = interp_ggv_lat(ggv, v_mid);
        if ay_demand <= ay_avail
            v_lo = v_mid;
        else
            v_hi = v_mid;
        end
    end
    v_corner(i) = v_lo;
end

% Phase 2 - backward braking pass
% Phase 3 - forward acceleration pass
% ... (full implementation in source)

Full source code

Purchase to unlock code, docs & examples

Unlock — £39
run_qslt.mThree-phase lap time solver
MATLAB
interp_ggv_lat.mGGV lateral limit interpolation
MATLAB
interp_ggv_lon.mGGV longitudinal limit with ellipse
MATLAB
parse_raceline.mTrack discretisation from racing line
MATLAB
sector_analysis.mSector time breakdown
MATLAB
plot_speed_trace.mSpeed profile + track map overlay
MATLAB
sensitivity_wrapper.mBatch QSLT for parameter sweeps
MATLAB
1
Prepare track data
Import your racing line as (x, y) coordinates. The parser computes curvature, arc length, and station spacing automatically.
2
Generate GGV data
Run the GGV Envelope module first to produce .mat files across your speed range. The lap sim interpolates between these.
3
Set powertrain limits
Configure max motor power, gear ratio, and battery power limit in VehParam.m.
4
Run & analyse
Execute run_qslt.m. Outputs: total lap time, speed trace, sector breakdown, and time-delta plots.
FS Student
£39 / team

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

Get Started
With Setup
£129 / 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+.