JuliaCon 2026

Optimizing race car track times in Dyad
2026-08-12 , Room 6

In this talk we will present how DyadModelOptimizer is solving free final time problems using ModelingToolkit, BoundaryValueDiffEq and OptimizationMadNLP, showing the full julia stack that powers the Dyad analyses. Specifically we examine the solution in the context of minimum lap time optimization for a race car. The solution assumes a continuous lap optimizing throttle and braking under dynamical constraints.  We formulate the problem as a nonlinear optimal control problem with free terminal time, where the objective is to minimize total lap time subject to coupled vehicle dynamics, tire force limits, and path constraints along a prescribed track centerline. The vehicle model captures longitudinal and lateral dynamics, load transfer effects, and tire saturation through nonlinear algebraic relationships, resulting in a differential-algebraic system expressed symbolically. The talk walks through the entire process end to end: building the symbolic model, converting it into a boundary value formulation, choosing a discretization strategy, assembling the nonlinear program, and configuring the solver. We will also share practical lessons on mesh refinement, scaling for numerical stability, and what solve times and convergence actually look like in practice.


The support for optimal control problems in the SciML ecosystem has been expanding recently, with new additions for both external solvers like InfiniteOpt or CasADi and also the more recently added support for BoundaryValueDiffEq in ModelingToolkit.

The new BVPProblem interface is allows users to specify constraints and cost functions symbolically, which are then internally used for the formulation of the problem in terms of generalized boundary value problems. Moreover, the parameters of the system can also be tuned while solving, by appending the tunable parameters to the mesh points that we are solving for, allowing us to find both the required trajectory and the optimal parameters at the same time.

One of the advantages of using the generalized boundary problem solvers over usual collocation methods is that we can use an adaptive mesh instead of a discretization that uses a fixed time step.

The boundary value problem is formulated internally using an optimization problem when tuning parameters. The BVP solvers expose an Optimization.jl compatible interface, where we can use solvers such as Ipopt (via OptimizationIpopt) or MadNLP (via OptimizationMadNLP). The OptimizationMadNLP package is also a more recent addition to the Optimziation ecosystem, exposing an advanced and high performance constrained optimization solver in pure julia.

All of this describes the full julia stack that powers DyadModelOptimizer and we will show how this performs on a concrete problem by targeting the optimization of the race car track times.

Rajeev holds a Ph.D. in Aerospace Engineering with expertise in dynamical systems, controls, and numerical optimization. At JuliaHub, he works on advanced modeling and simulation workflows using Dyad, ModelingToolkit and the broader Julia ecosystem, focusing on large-scale dynamical systems and optimal control.

This speaker also appears in: