SLapSim.jl a Scalabe Laptime Simulator
An open-source, differentiable minimum-lap-time optimal-control framework
Uses large scale non linear programming to find optimal trajectory and optimal controls for a race car.
Scalability of the model allows fast comparison of various vehicle concepts.
Features
- Modular vehicle models
- ALL vehicle parameters can be chosen to be
- control variable
- fixed parameter
- optimizable parameter
- Sensitivity analysis on ALL parameters, computed in seconds using DiffOpt.jl
- Mesh refinment
Implemented vehicle models
One simulator for multiple complexities of vehicle models
Thesis is available here
Thesis (PDF)
Examples
Playlist with video examples of lap time simulation
Youtube playlist
2026 Class Project: Race Car Minimum Lap Time
Demo video (MP4)
modelled according to https://smdogroup.github.io/ae6310/jupyter/2026_project/race_car_problem.html
Demo video (MP4)
Bus with front and rear steering
Demo video (MP4)
Singletrack FWD
This is a demo of front wheel drive vehicle on Formula Student Czech track
Demo video (MP4)
Solving process
Demo demostraing how the NLP solver iteratively converges from the initial guess to the optimal solution.
Demo video(MP4)
Comparison of vehicles
You can also comapre two vehicle concepts visually
Demo video(MP4)
Modeling framework
Power bond graphs inspired by Brown, Forbes T. Engineering System Dynamics: A Unified Graph-Centered Approach. This approach is best visualised on the singletrack model.
Getting Started
Requirements
- Julia 1.10+
- Optional: HSL solvers (
HSL_jll) for faster Ipopt, CUDA + MadNLPGPU for GPU.
Install
Clone and instantiate dependencies:
git clone https://github.com/ceserik/SLapSim.jl.git
cd SLapSim.jl
julia --project=. -e 'using Pkg; Pkg.instantiate()'
Run an example
From the repo root:
julia --project=. src/experiments/runGenericExperiment.jl
Other ready-to-run scripts in src/experiments/:
massPointOpt.jl — mass-point lap optimisation
runGenericExperiment.jl — generic experiment runner (pick car model + track)
formulaE2026.jl — twin-track Formula Electric on Berlin track
Pick a track and car
Inside any experiment script, swap the track:
track = doubleTurn(false, 0.1) # synthetic
track = kml2track("tracks/FSCZ.kml", false, true) # from KML
track = csv2track("src/Track/berlin_2018.csv") # from CSV
and the car model:
car = createSimplestSingleTrack(track)
car = createBus(track)
Output
Solver prints lap time; GLMakie window shows trajectory and states. Animations save to sync/animations/.
Sensitivity analysis
Traditional ways for sensitivity analysis require running the simulation multiple times and then use finite difference for the sensitivity analysis. DiffOpt.jl allows to run the simulation once and get sensitivity anlaysis immidiately!
This is example of such sensitivity analysis, all parameters of vehicle can be cheaply included in this analysis. After solving the lap-time problem, the computation of sensitivity analysis takes couple seconds.
Problem with this analysis is that it is not validated on a real vehicle, also the vehicle model has not been validated, therefore reslts should be taken with a grain of salt.
评论