Skip to content

About

Software that tells race engineers the fastest way to drive a car before it's built — using the same class of math (nonlinear optimization) that powers autonomous vehicle motion planning and aerospace guidance.

Topics

Resources

Stars

7 stars

Watchers

0 watching

Forks

Latest commit

 

History

339 Commits

Folders and files

Repository files navigation

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.

testotogif

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

image

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

Berlin_formula.mp4

modelled according to https://smdogroup.github.io/ae6310/jupyter/2026_project/race_car_problem.html

Twintrack AWD, Formula Student Germany

FSG_twintrack.mp4

Bus with front and rear steering

FigureEight_bus.mp4

Singletrack FWD

This is a demo of front wheel drive vehicle on Formula Student Czech track

FSCZ_singletrack.mp4

Solving process

Demo demostraing how the NLP solver iteratively converges from the initial guess to the optimal solution.

solve_process.mp4

Comparison of vehicles

You can also comapre two vehicle concepts visually

vehicle_comparison.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.

image

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. image 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.

About

Software that tells race engineers the fastest way to drive a car before it's built — using the same class of math (nonlinear optimization) that powers autonomous vehicle motion planning and aerospace guidance.

Topics

Resources

Stars

7 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages