lapsim_taster.ipynbOxford University Racing · Simulation

One lap of Silverstone

OUR was 11th fastest in Sprint at FSUK 2026. Let's compute that lap. Press ▶ on each cell, in order.

# 1. The track: a line with a curvature every 10 cm
track = load_track("FSUK_2026.gpx")
# 2. The car: one rigid body on four tyres
car = load_car("car_default.yaml")
car

  
# 4. Build the speed profile, one slice of track at a time
v_corner = corner_limits(track, ggv)            # ① v = √(a_lat/κ)v_fwd    = forward_pass(track, ggv, v_corner)   # ② acceleratev_bwd    = backward_pass(track, ggv, v_corner)  # ③ brakelap      = np.minimum(v_fwd, v_bwd)               # ④ the lower curve
# 5. Drive it: add up the time of every slice, then replay the lap
lap_time = np.sum(ds / lap)
print(f"Lap time: {lap_time:.2f} s")
replay(lap, ggv)

    

What would you improve?

Think first: what is this model missing? Then look at some examples.

Show some examples
Fixed aero

Downforce, drag and where the downforce acts are fixed numbers. On track they change with ride height, pitch and yaw.

Fix: use an aero map from CFD or testing, and check the numbers with the aero team: the front/rear balance is one we are confirming right now.

A phone-GPS track

Phone GPS is only good to a few metres, and the line was walked, not driven.

Fix: rebuild the track from GPS and speed data logged on the car, or optimise the line inside the track edges.

Simple tyres

Every tyre has one grip number and an ellipse. Real tyres change their grip with slip angle, load, temperature and pressure.

Fix: fit a proper tyre model, for example Pacejka's Magic Formula, to Tire Test Consortium (TTC) test data, and use it in place of the ellipse.

No suspension

The car is one rigid block, so weight shifts between the tyres instantly and nothing rolls or pitches. On the real car, springs and anti-roll bars decide how much load each tyre gets, and that changes the grip.

Fix: add roll and pitch stiffness front and rear, so load transfer is split the way the suspension splits it, then compare spring and anti-roll bar setups.

No heat

One lap barely warms the battery. Over the 22 km endurance event it heats up and the car has to cut power; motors and inverters heat up too.

Fix: the sim already tracks battery temperature; adding motor and inverter temperatures and cooling would let us plan power limits for endurance.

A perfect driver

The car is always exactly at the limit, on one fixed line. No real driver does that.

Fix: add a driver model that keeps a margin, or optimise the racing line itself, and compare with lap data from our drivers.

No transients

Each 10 cm slice is treated as steady, as if the car could switch from braking to cornering instantly.

Fix: build a dynamic model that steps forward in time, with yaw and weight transfer, for corner entry and slaloms.

Got an idea? That is what the simulation team works on. Come and talk to us.