Skip to content

ceserik/SLapSim.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

322 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SLapSim.jl a Scalabe Laptime Simulator

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

FSCZ_singletrack.mp4

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

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.