MEKAWIRE
ExpertarXiv

A 2-DOF MultiBody Track Joint for Race Car Optimization

Srikanth Sivaramakrishnan, Behzad Danaei, Adwait Verulkar, Ryan Trinter
From the abstract

TrackJoint is a Modelica MultiBody component that turns a three-dimensional road surface into a joint with two degrees of freedom. The two joint coordinates are the distance travelled along a reference line and the sideways offset from that line.

From the abstract. Our summary is in progress.

Full paper

A 2-DOF MultiBody Track Joint for Race Car Optimization

Srikanth Sivaramakrishnan, Behzad Danaei, Adwait Verulkar, Ryan Trinter

Published under CC BY 4.0. Reproduced with attribution; original at arXiv:2610.36407 (PDF).

Abstract

TrackJoint is a Modelica MultiBody component that turns a three-dimensional road surface into a joint with two degrees of freedom. The two joint coordinates are the distance travelled along a reference line and the sideways offset from that line. Together they give the position, orientation and angular velocity of a single frame_b connector. All road geometry reaches the joint as a small set of periodic piecewise-quintic splines, so one component can represent any circuit whose splines have been fitted beforehand. The road constraint is closed with d’Alembert’s principle. The two generalized forces that belong to the joint coordinates are set to zero, so no Lagrange multipliers are needed. The joint is connected to a multibody race car in Dymola and the pair is exported as one FMI 3.0 FMU. The same FMU is then used for time-domain simulation and for CasADi/IPOPT minimum lap-time optimization, with no change to the model in between. This works because the joint keeps the arc-length coordinate as a real state and publishes its time derivative, which is the quantity that lets the problem be rewritten with distance We report results for minimum lap time simulations on the Singapore Formula 1 circuit.

Keywords: Modelica, MultiBody, Functional Mockup Unit, race car simulation,minimum lap time, track model, Monge patch, kinematic joint, d’Alembert principle, optimal control, optimization, CasADi, FMIOPT

1 Introduction

Race-car simulation in Modelica relies on a road model that generates accurate surface geometry in terms of position, orientation and angular velocity for each tire contact patch. Inside a generic MultiBody vehicle simulation this is naturally expressed by a Modelica joint that constrains the chassis of the vehicle to lie on the road surface while leaving the in-plane road coordinates free. For ideal flat surfaces this role is filled by Modelica.Mechanics.MultiBody.Joints.Planar. Although analytically defined ribbons have been used in earlier race-car work Perantoni and Limebeer (2015); Lovato et al. (2021), they are typically hand-coded inside a surrogate optimization model rather than packaged as a reusable MultiBody component. The idea of a reusable path-following joint that constrains motion to a spline-parametrized curve has been formulated symbolically in a graph-theoretic multibody setting by Hall et al. (2014). This method is used to reduce complex automotive suspension linkages into a single degree-of-freedom joint for computational efficiency. A more closely related precedent is the Claytex.Mechanics.MultiBody.Joints.Rail joint of the commercial Claytex library Briant (2021), which constrains a frame_b to follow a one-dimensional B-spline rail parametrized by arc length s and resolves the wrench through the spline-derivative projection that we also adopt below. The Claytex component is, however, restricted to a curve: it leaves a single translational degree of freedom and exposes the orientation either as a heading frame slaved to the rail tangent or as three independent angle splines.

This paper presents TrackJoint, a Modelica MultiBody joint that takes the Claytex Rail idea as its starting point and extends it from a 1-DOF rail to a 2-DOF Monge-patch racetrack surface. The body is now free to move both along a planar reference line (s) and laterally across it (w); the orientation triad is constructed analytically from the surface partials rather than from a separate angle table; and the wrench is closed by two d’Alembert relations rather than one. The underlying surface model is the Monge patch Limebeer and van de Merwe (2025); do Carmo (1976)

\bm{r}_{b}(s,w)=\bm{r}(s)+w\,\bm{n}_{\!g}(s)+z(s,w)\,\bm{e}_{z},
(1)

where \bm{r}_{b}(s,w) is the world-frame position of the track point identified by (s,w), \bm{r}(s)=(r_{x}(s),r_{y}(s),0) is the planar reference line, \bm{n}_{\!g}(s)=(-\partial_{s}r_{y}(s),\partial_{s}r_{x}(s),0) its ground-plane left normal and

z(s,w)=r_{z}(s)+z_{1}(s)\,w+z_{2}(s)\,w^{2}+z_{3}(s)\,w^{3}
(2)

the lateral cubic in w proposed by Limebeer and van de Merwe (2025) for elevation. The six channel splines \{r_{x},r_{y},r_{z},z_{1},z_{2},z_{3}\} are obtained from a separate fitting pipeline that processes a measured racetrack point cloud and exports them as periodic piecewise-quintic (C^{4} at the knots) B-splines anchored on the minimum-curvature line of the circuit Verulkar et al. (2026); Heilmeier et al. (2020); Braghin et al. (2008). Here (\bm{e}_{x},\bm{e}_{y},\bm{e}_{z}) denotes the fixed world Cartesian basis. The present paper takes those splines as given and concentrates on the Modelica joint that consumes them.

The contribution of this paper is a Modelica implementation of a track joint that exposes the road surface as a single reusable MultiBody component suitable for both time-domain simulation and optimization. For efficiency the per-step evaluation is implemented with Horner expansion of the Monge cubic, constant-time segment lookup on the uniform break vector and a shared spline evaluator, so that the same component is cheap to evaluate at every collocation point of a CasADi/IPOPT Andersson et al. (2019); Wächter and Biegler (2006) minimum lap-time problem. The model also ensures sufficient accuracy to the LiDAR measurements of the track and can be used in time-domain simulation of a multibody race car driven around a closed circuit.

The remainder of the paper is organized as follows. Section 2 recalls the Monge-patch surface formulation and fixes the notation used by the joint. Section 3 derives the joint equations from (1)–(2). Section 4 discusses the Modelica implementation and the FMI export. Section 5 reports the two downstream use cases.

2 Surface model

The road is modeled as a smooth orientable two-dimensional manifold \mathcal{M}\subset\mathbb{R}^{3} parametrized by (1). We reproduce here only the relations needed by the Modelica implementation. A full geometric discussion is given in Limebeer and van de Merwe (2025) and the companion fitting paper Verulkar et al. (2026).

Differentiating the surface position once gives the in-surface tangent vectors

\displaystyle\partial_{s}\bm{r}_{b} \\ \displaystyle=\bigl(\partial_{s}r_{x}-w\,\partial_{ss}r_{y}\bigr)\bm{e}_{x}+\bigl(\partial_{s}r_{y}+w\,\partial_{ss}r_{x}\bigr)\bm{e}_{y}+\partial_{s}z\,\bm{e}_{z}, \\ \displaystyle\partial_{w}\bm{r}_{b} \\ \displaystyle=-\partial_{s}r_{y}\,\bm{e}_{x}+\partial_{s}r_{x}\,\bm{e}_{y}+\partial_{w}z\,\bm{e}_{z},
(3) (4)

in which the lateral derivatives \partial_{s}z and \partial_{w}z follow from the cubic (2),

\displaystyle\partial_{s}z \\ \displaystyle=\partial_{s}r_{z}+\partial_{s}z_{1}\,w+\partial_{s}z_{2}\,w^{2}+\partial_{s}z_{3}\,w^{3}, \\ \displaystyle\partial_{w}z \\ \displaystyle=z_{1}+2\,z_{2}\,w+3\,z_{3}\,w^{2}.
(5) (6)

The surface unit normal is

\bm{n}_{z}=\frac{\partial_{s}\bm{r}_{b}\times\partial_{w}\bm{r}_{b}}{\|\partial_{s}\bm{r}_{b}\times\partial_{w}\bm{r}_{b}\|},
(7)

and a right-handed surface triad is (\bm{n}_{x},\bm{n}_{y},\bm{n}_{z})=\bigl(\partial_{s}\bm{r}_{b}/\|\partial_{s}\bm{r}_{b}\|,\;\bm{n}_{z}\times\partial_{s}\bm{r}_{b}/\|\partial_{s}\bm{r}_{b}\|,\;\bm{n}_{z}\bigr), identical to that adopted in Limebeer and van de Merwe (2025).

The constraint that keeps the attached body on \mathcal{M} leaves two degrees of freedom, namely the parameters s and w. The Modelica joint carries (s,w) and their first time derivatives (\dot{s},\dot{w}) as states, and works everything else out from the splines \{r_{x},r_{y},r_{z},z_{1},z_{2},z_{3}\} at the current s.

2.1 Regularity of the parametrization

The joint only works where the patch (1) is locally invertible. That puts a condition on the reference line. Let \kappa(s) be the signed planar curvature of \bm{r}(s). The cross product of the in-surface tangents (3)–(4) then has magnitude

\|\partial_{s}\bm{r}_{b}\times\partial_{w}\bm{r}_{b}\|\;=\;\bigl|1-\kappa(s)\,w\bigr|\,\sqrt{1+\|\nabla z\|^{2}}\;+\;\mathcal{O}(\partial_{s}z),
(8)

so the patch breaks down on the fold

w_{\mathrm{fold}}(s)=\frac{1}{\kappa(s)},
(9)

which is the centre of curvature of the reference line. Suppose the reference line is the geometric centre-line. In any corner whose radius of curvature drops below the local half-width b(s) of the road we get |w_{\mathrm{fold}}(s)|<b(s), so the fold sits inside the drivable strip. There the map (s,w)\mapsto\bm{r}_{b} stops being one-to-one, and the joint hands back two different points for the same (s,w) along with a Jacobian that goes to zero. This happens in the slow corners, which are the ones that decide lap time. Anchoring the splines on the minimum-curvature line lowers the curvature peaks and moves the fold outside the strip. The joint therefore needs its input data to satisfy

\min_{s}\ \frac{1}{|\kappa(s)|\,b(s)}\;>\;1,
(10)

which we check for every circuit used in this paper in Section 5.3.

2.2 Continuity required of the splines

The joint needs high derivatives of its inputs. The rotation rates in Section 3.2 use the third s-derivative of the planar channels r_{x} and r_{y}. The Modelica tool then differentiates the angular-velocity equation once more while it reduces the DAE index, which takes the requirement up to a fourth derivative. A piecewise quintic with C^{4} continuity at the interior knots and at the wrap is the lowest degree that keeps all of these continuous across a knot. A cubic spline leaves \partial_{ss}\bm{r}_{b} jumping at every knot, which makes the integrator chatter at the segment boundaries. That is why the fitting pipeline Verulkar et al. (2026) exports quintics even though cubics would be enough for the surface on its own.

3 Joint formulation

Figure 1: Schematic of the TrackJoint. The body frame_b is constrained to the Monge-patch surface \mathcal{M} and is free to move along the reference line (s) and laterally across it (w). At the current (s,w) the joint evaluates the six channel splines \{r_{x},r_{y},r_{z},z_{1},z_{2},z_{3}\} to build the surface position \bm{r}_{b}(s,w) and the right-handed surface triad (\bm{n}_{x},\bm{n}_{y},\bm{n}_{z}), whose tangent \bm{n}_{x} follows the reference line and whose normal \bm{n}_{z} is the surface normal. The reaction wrench is resolved onto the two free directions through the d’Alembert projection.

Figure 1 illustrates the overall working principle of the joint. The body frame_b is pinned to the road surface \mathcal{M} and retains exactly the two in-plane degrees of freedom (s,w). From these coordinates the joint reconstructs the full pose and angular velocity of the connector and projects the constraint forces onto the surface, as detailed in the subsections below.

3.1 States and frame outputs

The joint has two free coordinates \bm{q}=(s,w) with derivatives \bm{\dot{q}}=(\dot{s},\dot{w}). Their values at any instant determine the position, orientation and angular velocity of the frame_b connector. The position is given directly by (1) as \bm{r}_{b}(s,w), while orientation and angular velocity follow

\displaystyle\mathbf{R}_{b} \\ \displaystyle=[\,\bm{n}_{x}\;\;\bm{n}_{y}\;\;\bm{n}_{z}\,]^{\!\top}, \\ \displaystyle\bm{\omega}_{b} \\ \displaystyle=\mathbf{R}_{b}\bigl(\partial_{s}\bm{\phi}\,\dot{s}+\partial_{w}\bm{\phi}\,\dot{w}\bigr),
(11) (12)

where \partial_{s}\bm{\phi},\partial_{w}\bm{\phi}\in\mathbb{R}^{3} are the parametric rotation-rate vectors of the surface triad with respect to s and w, and \mathbf{R}_{b} is the rotation matrix associated with that frame; and \bm{\omega}_{b} is its world-frame angular velocity. Equation (12) expresses the world-frame angular velocity as a linear combination of two parametric angular velocities, exactly as in the standard MultiBody treatment of any two-parameter rigid kinematic chain.

3.2 Parametric rotation rates

The rotation-rate vectors are obtained in closed form from the surface partials. Let \bm{\xi}\in\{s,w\} denote either parameter. Since the triad \mathbf{R}_{b}=[\bm{n}_{x}\;\bm{n}_{y}\;\bm{n}_{z}]^{\!\top} is orthonormal for every (s,w), its parametric derivative is skew-symmetric, so there exists a unique vector \partial_{\xi}\bm{\phi} with

\partial_{\xi}\bm{n}_{i}=\partial_{\xi}\bm{\phi}\times\bm{n}_{i},\qquad i\in\{x,y,z\},
(13)

and \partial_{\xi}\bm{\phi} may be recovered from any two columns by \partial_{\xi}\bm{\phi}=\tfrac{1}{2}\sum_{i}\bm{n}_{i}\times\partial_{\xi}\bm{n}_{i}. Building it from the two pieces that the surface partials already give is cheaper and better conditioned, and is implemented in this code.

Write \bm{c}=\partial_{s}\bm{r}_{b}\times\partial_{w}\bm{r}_{b} for the un-normalized binormal, so that \bm{n}_{z}=\bm{c}/\|\bm{c}\|. Differentiating this quotient gives

\partial_{\xi}\bm{n}_{z}=\frac{\partial_{\xi}\bm{c}}{\|\bm{c}\|}-\frac{(\bm{n}_{z}\!\cdot\!\partial_{\xi}\bm{c})}{\|\bm{c}\|}\,\bm{n}_{z}=\frac{1}{\|\bm{c}\|}\,\bigl(\mathbf{I}-\bm{n}_{z}\bm{n}_{z}^{\!\top}\bigr)\partial_{\xi}\bm{c},
(14)

the component of \partial_{\xi}\bm{c} tangent to the surface. Compare (14) with (13) for i=z and use \bm{n}_{z}\times(\bm{n}_{z}\times\bm{v})=-(\mathbf{I}-\bm{n}_{z}\bm{n}_{z}^{\!\top})\bm{v}. This identifies the two in-plane components of \partial_{\xi}\bm{\phi} as \bm{n}_{z}\times\partial_{\xi}\bm{c}/\|\bm{c}\|. That term turns the triad about axes lying in the surface, so it is the roll and pitch part. It says nothing about the component along \bm{n}_{z}, because turning about \bm{n}_{z} does not move \bm{n}_{z}.

That remaining component is fixed by the tangent column. From \bm{n}_{x}=\partial_{s}\bm{r}_{b}/\|\partial_{s}\bm{r}_{b}\| and (13) for i=x,

\partial_{\xi}\bm{\phi}\!\cdot\!\bm{n}_{z}=\bigl(\bm{n}_{x}\times\partial_{\xi}\bm{n}_{x}\bigr)\!\cdot\!\bm{n}_{z}=\frac{(\partial_{\xi}\partial_{s}\bm{r}_{b})\!\cdot\!\bm{n}_{y}}{\|\partial_{s}\bm{r}_{b}\|},
(15)

where the normalization factor drops out because only the part of \partial_{\xi}\partial_{s}\bm{r}_{b} orthogonal to \bm{n}_{x} survives the projection onto \bm{n}_{y}. This is the turn about the surface normal, so it is the yaw part. Adding the two contributions and setting \xi to s and then to w gives

\displaystyle\partial_{s}\bm{\phi} \\ \displaystyle=\frac{\bm{n}_{z}\times\partial_{s}\bm{c}}{\|\bm{c}\|}+\frac{(\partial_{ss}\bm{r}_{b})\!\cdot\!\bm{n}_{y}}{\|\partial_{s}\bm{r}_{b}\|}\,\bm{n}_{z}, \\ \displaystyle\partial_{w}\bm{\phi} \\ \displaystyle=\frac{\bm{n}_{z}\times\partial_{w}\bm{c}}{\|\bm{c}\|}+\frac{(\partial_{sw}\bm{r}_{b})\!\cdot\!\bm{n}_{y}}{\|\partial_{s}\bm{r}_{b}\|}\,\bm{n}_{z}.
(16) (17)

The required derivatives of \bm{c} follow from the product rule,

\displaystyle\partial_{s}\bm{c} \\ \displaystyle=(\partial_{ss}\bm{r}_{b})\times\partial_{w}\bm{r}_{b}+\partial_{s}\bm{r}_{b}\times(\partial_{sw}\bm{r}_{b}), \\ \displaystyle\partial_{w}\bm{c} \\ \displaystyle=(\partial_{sw}\bm{r}_{b})\times\partial_{w}\bm{r}_{b}+\partial_{s}\bm{r}_{b}\times(\partial_{ww}\bm{r}_{b}),
(18) (19)

which combined with (3)–(4) only require the spline values up to the third s-derivative (\partial_{sss}r_{x}, \partial_{sss}r_{y}), the second s-derivative of the height channels (\partial_{ss}r_{z},\partial_{ss}z_{k}) and the lateral derivatives of z(s,w) up to second order (k\in\{1,2,3\} for z_{k}).

3.3 Time-to-space transformation for minimum lap-time problems

A minimum lap-time problem is naturally posed with the arc-length coordinate s rather than physical time t as the independent variable, so that the integration domain s\in[0,L] is fixed and the lap time T=\int_{0}^{L}\mathrm{d}t becomes the cost (L is the track length). The change of variable rests on the single scalar relation

\frac{\mathrm{d}t}{\mathrm{d}s}=\frac{1}{\dot{s}},\qquad\dot{s}=\frac{v_{t}\cos\chi-v_{n}\sin\chi}{1-\kappa(s)\,w},
(20)

where (v_{t},v_{n}) are the chassis velocity components in the track triad, \chi the chassis yaw relative to the reference-line tangent, and \kappa(s) the planar curvature of the reference line. Every other state derivative \dot{\bm{x}} in the vehicle model is then rescaled as \mathrm{d}\bm{x}/\mathrm{d}s=\dot{\bm{x}}/\dot{s} before being handed to the collocation transcription. The factor \dot{s} is therefore the single quantity through which the road geometry enters the time-to-space transformation.

The present joint exports \dot{s} as the state variable vsTrack = der(sTrack), declared with StateSelect.always so that any Modelica tool retains it as a continuous output of the FMU into which the host vehicle model and the joint are exported together. The FMIOPT transcription reads this variable directly from the exported FMI 3.0 interface and uses it to rescale every other state derivative without any further model modification. It supplies the one quantity the time-to-space transformation needs, which makes it a prerequisite for the minimum lap-time application reported in Section 5.

3.4 D’Alembert constraint

Rather than introducing two Lagrange multipliers for the orthogonal directions to \mathcal{M}, we close the kinematic chain by setting the two generalized forces conjugate to (s,w) to zero. Resolving the body-frame wrench (\bm{f}_{b},\bm{\tau}_{b}) on the frame_b connector to the world orientation, \bm{f}^{w}_{b}=\mathbf{R}_{b}^{\!\top}\bm{f}_{b},\bm{\tau}^{w}_{b}=\mathbf{R}_{b}^{\!\top}\bm{\tau}_{b}, the principle of virtual work gives

\displaystyle 0 \\ \displaystyle=\bm{f}^{w}_{b}\!\cdot\!\partial_{s}\bm{r}_{b}+\bm{\tau}^{w}_{b}\!\cdot\!\partial_{s}\bm{\phi}, \\ \displaystyle 0 \\ \displaystyle=\bm{f}^{w}_{b}\!\cdot\!\partial_{w}\bm{r}_{b}+\bm{\tau}^{w}_{b}\!\cdot\!\partial_{w}\bm{\phi}.
(21) (22)

Equations (21)–(22) provide the two algebraic equations needed to close the index-1 DAE in (\dot{s},\dot{w}) once the vehicle dynamics couple the wrench to the states. They are linear in the six wrench components (\bm{f}^{w}_{b},\bm{\tau}^{w}_{b}) and can be written as \mathbf{A}\,[\bm{f}^{w}_{b};\bm{\tau}^{w}_{b}]=\bm{0} with the 2\times 6 matrix

\mathbf{A}=\begin{bmatrix}(\partial_{s}\bm{r}_{b})^{\!\top}&(\partial_{s}\bm{\phi})^{\!\top}\\[2.0pt]
(\partial_{w}\bm{r}_{b})^{\!\top}&(\partial_{w}\bm{\phi})^{\!\top}\end{bmatrix}.
(23)

The DAE is solvable when \operatorname{rank}\mathbf{A}=2, and that depends only on the surface geometry.

Proposition 1.

\operatorname{rank}\mathbf{A}=2 if and only if \partial_{s}\bm{r}_{b} and \partial_{w}\bm{r}_{b} are linearly independent, i.e. if and only if \|\partial_{s}\bm{r}_{b}\times\partial_{w}\bm{r}_{b}\|\neq 0.

Proof.

The first three columns of \mathbf{A} are [\partial_{s}\bm{r}_{b},\partial_{w}\bm{r}_{b}]^{\!\top}. If these two vectors are independent that block already has rank two, so \operatorname{rank}\mathbf{A}=2. Conversely, suppose \partial_{w}\bm{r}_{b}=\lambda\,\partial_{s}\bm{r}_{b} for some \lambda\in\mathbb{R}. Then \bm{c}=\bm{0}, the triad is undefined, and by (16)–(17) the rate vectors degenerate to \partial_{w}\bm{\phi}=\lambda\,\partial_{s}\bm{\phi} as well, so the second row of \mathbf{A} is \lambda times the first and \operatorname{rank}\mathbf{A}\leq 1. ∎

By (8) the condition in Proposition 1 fails exactly on the fold (9). So the Frenet fold reported in Verulkar et al. (2026) is more than an awkward piece of geometry. It is the configuration in which the joint’s constraint Jacobian loses rank and the DAE can no longer be solved. Condition (10) on the input splines is what keeps \mathbf{A} at full rank across the whole drivable strip.

3.5 Compact form of the implementation

Listing 1 reproduces the equation block of the Modelica component. It evaluates the spline channels at the current s, expands the Monge cubic in Horner form, assembles the surface partials (3)–(4) and their parametric derivatives, builds the triad and the parametric angular velocity vectors (16)–(17), and asserts the constraints (21)–(22).

Listing 1: Equation block of TrackJoint. The reference line and height channels are evaluated by a piecewise spline function bound to the current segment index ix. The Monge cubic and its partial derivatives are computed in Horner form. The surface triad and the parametric rotation-rate vectors follow directly, and the d’Alembert relations close the 2-DOF DAE without Lagrange multipliers.

Several design choices in the listing are worth noting.

  • Ground-plane lateral direction. The lateral offset direction is the ground-plane normal \{-\partial_{s}r_{y},\partial_{s}r_{x},0\} to the reference-line tangent, so the orientation of frame_b is determined entirely by the spline first and second s-derivatives. No additional yaw spline is needed and there is no quaternion or Euler-angle integration in the joint.
  • Horner evaluation. The Monge cubic and its s- and w-partials are evaluated in Horner form. Horner’s method is the backward-stable way to evaluate a polynomial, so it keeps the relative error small in the high-order derivatives that feed the surface triad and the acceleration-level constraint. It is not the cheapest form here, though. The Modelica tool expands integer powers and then shares common subexpressions across the local coordinate that all channels have in common, so an explicitly expanded polynomial compiles to faster code. Section 5.3 measures both effects. We keep Horner form for the conditioning of the derivative chain, not for speed.
  • D’Alembert constraint. The two generalized forces in the (s,w) directions are set to zero by projecting the resolved body-frame wrench (\bm{f}^{b},\bm{\tau}^{b}) onto the virtual displacements \partial_{s}\bm{r}_{b} and \partial_{w}\bm{r}_{b}. This is equivalent to the principle of virtual work and closes the 2-DOF DAE in the form expected by a Modelica DAE solver without introducing auxiliary multiplier variables.
  • C^{4} continuity requirement. The DAE solver differentiates the angular-velocity equation to form the acceleration-level constraint, which requires the second s-derivatives of every spline channel and the first mixed sw-derivatives. These exist because the export step of the companion fitting pipeline Verulkar et al. (2026) enforces C^{4} continuity at every interior knot and at the periodic wrap.

4 Implementation and FMI export

4.1 Parameter record and spline storage

All road geometry enters TrackJoint through a single parameter record. Each of the six channels (r_{x},r_{y},r_{z},z_{1},z_{2},z_{3}) is stored as a coefficient matrix of size N_{\mathrm{seg}}\times(d{+}1) with d=5, plus a single break vector \{s_{i}\}_{i=0}^{N_{\mathrm{seg}}} shared by all channels. The break vector is uniform in s in the present implementation, which lets the break segment index \mathrm{ix} lookup at a query s be done in constant time using a custom Modelica function. For nonuniform breaks, the same lookup can be replaced by a binary search without any change to the rest of the joint equations. Once \mathrm{ix} is known, every spline evaluation is

y^{(q)}(s)=\sum_{j=q}^{d}\frac{j!}{(j-q)!}\,a_{\mathrm{ix},j}\,(s-s_{\mathrm{ix}})^{\,j-q},
(24)

performed in Horner form through a custom Modelica function, with the requested derivative order q\in\{0,1,2,3\} passed as an argument. The function is declared locally with the common segment index \mathrm{ix}, s, the polynomial degree and the break vector partially applied, so each per-channel evaluation call only selects its coefficient matrix and its derivative order.

4.2 State selection and initialization

The joint declares the four state variables (s,\dot{s},w,\dot{w}) with StateSelect.always so that a Modelica compiler chooses them as continuous states regardless of the surrounding vehicle topology, eliminating state-aliasing failures observed when the chassis floor was otherwise free in \bm{e}_{z}. Initial values are exposed as parameters and propagated to the start attribute of the corresponding states. A boolean override is provided to relax the state selection in cases where the user prefers the tool to choose.

4.3 MultiBody integration

The joint exposes a single MultiBody Frame_b connector (from Modelica.Mechanics.MultiBody.Interfaces). A Connections.root(frame_b.R) statement establishes the joint as the root of the orientation graph of the kinematic subtree it heads, mirroring the pattern used by the standard MultiBody joints. The body-frame wrench arriving on the connector is rotated to world orientation by the inverse of the triad,

⬇

fFrameB = resolve1(frame_b.R, frame_b.f);

tFrameB = resolve1(frame_b.R, frame_b.t);

and used in the d’Alembert relations (21)–(22).

In a complete vehicle assembly the joint never carries the chassis on its own. The frame_b of TrackJoint is followed by a standard Modelica.Mechanics.MultiBody.Joints.Prismatic heave joint oriented along the surface binormal \bm{n}_{z}, and by three revolute joints that realize roll, pitch and yaw of the chassis relative to the track triad rather than relative to the world frame. Note that \bm{n}_{z} is the vertical, out-of-plane direction of the patch. It is not the in-surface lateral normal \bm{n}_{y}, along which the joint coordinate w is already measured. The chassis therefore retains its full six degrees of freedom, but each one is naturally aligned with the road: the heave coordinate is the vertical ride height above the patch along \bm{n}_{z}, and the three angles are the chassis attitude as a driver would describe it. This decomposition is what enables the initialization strategy discussed in Section 5.

4.4 FMI 3.0 export

In use, the joint is connected inside Dymola to a Modelica MultiBody vehicle model and the closed system is exported as a single FMI 3.0 model exchange FMU. The joint contributes the four continuous states (s,\dot{s},w,\dot{w}) to the exported state vector; the heave prismatic along the surface binormal \bm{n}_{z} (vertical, out-of-plane) and the three track-relative roll/pitch/yaw revolute joints stacked on top of frame_b contribute a further four position states and their derivatives, so that the chassis exposes its six degrees of freedom relative to the road surface. The remaining states, inputs and outputs of the FMU are those of the host vehicle model. The spline coefficient matrices of the joint appear as tunable parameters of the combined FMU so that a single FMU binary can be re-targeted to a new circuit at run-time without re-compilation. This is the form consumed by the FMIOPT direct-collocation transcription described in Section 5.

5 Results

We illustrate the use of TrackJoint in two settings.

5.1 Time-domain simulation

A Modelica experiment is constructed as shown in Figure 2 in order to validate the track surface produced by TrackJoint. In this experiment, a point-mass is driven around the Singapore Grand Prix Circuit along the minimum curvature line from the companion pipeline Verulkar et al. (2026) with the joint as the only constraint. The resultant road surface is compared against the meshed terrain from the LiDAR point cloud of the Singapore Grand Prix Circuit using rFPro Terrain Server.

Figure 2: Modelica validation experiment of a point mass driven around the track using TrackJoint.
Figure 3: Validation of the TrackJoint surface output against the measured track geometry of the Singapore Grand Prix Circuit from LiDAR point cloud.
Figure 4: Path of the point mass driven through the TrackJoint and the error in absolute height against the 3D mesh track surface of the Singapore Grand Prix Circuit constructed from LiDAR point cloud.

Figures 3 and 4 show the simulation results from Dymola 2026x Refresh 1, which compare the reconstructed track surface geometry produced by the joint with the 3D mesh road geometry from the LiDAR point cloud. The reconstructed surface at \bm{r}_{b}(s,w) closely tracks the 3D mesh road geometry in absolute height, grade and bank angles across the lap, which confirms that the joint faithfully reproduces the measured road surface in time-domain simulation.

5.2 Minimum lap-time direct collocation

Figure 5: Optimized velocity profile of a multibody vehicle model driven around the Singapore Grand Prix Circuit using TrackJoint in a FMIOPT minimum lap-time problem.
Figure 6: Optimized racing line of a multibody vehicle model driven around the Singapore Grand Prix Circuit using TrackJoint in a FMIOPT minimum lap-time problem.

The multibody vehicle-plus-track-joint FMU described in Section 4.4 is then handed to the FMIOPT toolchain, which wraps it inside a CasADi direct-collocation NLP Andersson et al. (2019) solved by IPOPT Wächter and Biegler (2006) with the MUMPS linear solver. Because the joint exposes the parametric Jacobian factor through \partial_{s}\bm{r}_{b}, the standard time-to-space transformation (20) is built directly from the splines without any further model modification. On every circuit on which the splines are anchored on the minimum-curvature line of Verulkar et al. (2026), the denominator of (20) stays bounded away from zero on the full track strip and the NLP converges to the IPOPT tolerances; on circuits on which the splines are anchored on the geometric center-line, the same NLP exhibits the convergence failure documented in the companion paper. This is what Proposition 1 means in practice. The denominator of (20) is the same factor 1-\kappa w that sets the rank of the constraint Jacobian (23), so a reference line that breaks (10) hurts the transcription and the joint at the same time. Section 5.3 gives the margin for all 23 circuits and the solve statistics for Singapore.

A second, equally important role of TrackJoint in the direct-collocation pipeline is the initialization of the NLP. Because the chassis degrees of freedom are expressed relative to the track triad through the heave prismatic and the three track-relative revolute joints stacked on top of frame_b, a feasible initial guess for an entire lap is produced by setting every chassis coordinate (heave, roll, pitch, yaw, lateral offset w) and every velocity except \dot{s} to zero, and prescribing s(\tau) as a linear ramp from 0 to L over the normalized time horizon \tau\in[0,1]. This guess is trivial to generate, requires no preliminary simulation and no knowledge of the circuit beyond its length, yet it places the vehicle exactly on the road surface with its body axes aligned to the track triad at every collocation point. For Singapore the guess is 324 copies of the same zero vector for every chassis coordinate together with a linear ramp s(\tau)=\tau L, and from that IPOPT reaches Optimal Solution Found in 264 iterations (Table 2). It works because the track-relative decomposition makes the guess satisfy the road constraint by construction. With all chassis coordinates at zero the vehicle sits on \bm{r}_{b}(s,0) with \mathbf{R}_{b} equal to the surface triad, so the two d’Alembert relations already hold at the first iterate and only the vehicle dynamics are left to resolve. In our experience this is what allows IPOPT to take its first steps without running into the orientation-singular regions that plague world-frame chassis parametrizations, and it is the practical reason why the same NLP converges on every circuit fitted by the companion pipeline.

Figures 5 and 6 show the result of a minimum lap-time optimization problem of a full-detail multibody vehicle model driven around the Singapore Grand Prix Circuit through TrackJoint. Figure 6 plots the optimized racing line on the track strip generated by the joint splines, and Figure 5 the corresponding optimized velocity profile along the lap. Both quantities are produced in a single converged solve of the FMIOPT direct-collocation NLP, illustrating that the TrackJoint component yields a well-conditioned NLP suitable for full-circuit minimum lap-time optimization of a detailed multibody vehicle.

5.3 Quantitative benchmarks

All measurements below were taken on one desktop workstation with Dymola 2026x Refresh 1. Timings are medians of five repetitions.

Circuit coverage.

The joint has been run on the 23 Formula 1 circuits of the 2026 calendar. Every circuit is fitted with a uniform 5 m knot spacing, which gives 657–1387 quintic segments for track lengths of 3283–6934 m. A complete spline parameter record is about 1.2 MB of JSON. Table 1 lists the extremes. The injectivity margin (10) is above one on all 23 circuits. The tightest is 1.03 at Monaco, where the reference line comes down to a 9.3 m radius. The set covers both very tight corners (Monaco, Singapore) and steep camber (Zandvoort, up to 16.2^{\circ} of bank).

Table 1: Geometry of the fitted circuits: track length L, number of quintic segments, minimum reference-line radius, maximum bank angle and injectivity margin \min_{s}1/(|\kappa|b). Extremes of the 23-circuit set.
  • Monaco
    L [m]
    3283
    N_{\mathrm{seg}}
    657
    R_{\mathrm{min}} [m]
    9.3
    bank [∘]
    5.2
    margin
    1.03
  • Zandvoort
    L [m]
    4185
    N_{\mathrm{seg}}
    837
    R_{\mathrm{min}} [m]
    31.2
    bank [∘]
    16.2
    margin
    2.32
  • Singapore
    L [m]
    4858
    N_{\mathrm{seg}}
    972
    R_{\mathrm{min}} [m]
    23.0
    bank [∘]
    2.1
    margin
    1.56
  • Spa
    L [m]
    6934
    N_{\mathrm{seg}}
    1387
    R_{\mathrm{min}} [m]
    22.5
    bank [∘]
    4.6
    margin
    1.42
  • Silverstone
    L [m]
    5798
    N_{\mathrm{seg}}
    1160
    R_{\mathrm{min}} [m]
    41.2
    bank [∘]
    1.9
    margin
    2.38
  • all 23
    L [m]
    3283
    N_{\mathrm{seg}}
    657
    R_{\mathrm{min}} [m]
    9.3
    bank [∘]
    1.5
    margin
    1.03
  • (range)
    L [m]
    6934
    N_{\mathrm{seg}}
    1387
    R_{\mathrm{min}} [m]
    41.2
    bank [∘]
    16.2
    margin
    2.89
Per-step evaluation cost.

To measure the cost of the joint on its own, a unit point mass was driven one full lap through it with a fixed-step fourth-order Runge–Kutta integrator over 180{,}000 steps, so that every variant makes exactly 720{,}000 model evaluations. The released Horner version costs 3.54 s of integration CPU time, which is 4.9\,\mus per model evaluation for the whole 2-DOF joint including the triad and both rotation-rate vectors. Writing every polynomial out in expanded power form, and changing nothing else, gives bit-identical trajectories for 2.63 s, or 26\% less. The expanded form wins because Dymola turns integer powers into repeated multiplications and then shares x^{2},\dots,x^{5} across all eight channels and all four derivative orders. The Horner recursion instead gives each of the 26 evaluations its own chain of dependent multiply–adds. We keep Horner form for the accuracy reason below, not for speed.

Evaluation accuracy.

We evaluated both forms in double precision at every segment of the Singapore fit and compared them against a 60-digit reference evaluation of the same polynomial. Over 972 segments, all six channels and derivative orders 0–3, the largest relative error is 2.6\times 10^{-12} for Horner and 5.0\times 10^{-12} for the expanded form. So Horner is at best a factor 1.9 more accurate, and on some channels the order reverses. Both sit far below any tolerance that matters physically at this knot spacing. The difference only starts to count for much coarser knots.

FMU size and NLP performance.

The vehicle-plus-joint model exports to an FMI 3.0 model-exchange FMU with a 35.5 MB shared library (10.9 MB archived). On the Singapore circuit the transcription uses 323 intervals (324 collocation points) and the solve is warm-started only by the trivial guess described above. Table 2 reports the back-to-back result for the two FMUs, which differ only in the body of the spline evaluation function; both consumed byte-identical problem data. Both reach Optimal Solution Found, and the lap times agree to 3.3 ms out of 90.6 s, a relative difference of 4\times 10^{-5}. The iteration counts differ by 6\%. We read that as the sensitivity of a nonconvex interior-point path to perturbations of order 10^{-12}, not as a real advantage either way. On this evidence the choice of evaluation form makes no measurable difference to convergence.

Table 2: Singapore minimum lap-time NLP with the two FMU builds, which differ only in the spline evaluation function. Identical track, setup, guess, mesh and solver options.
  • IPOPT status
    Horner
    optimal
    expanded
    optimal
  • Iterations
    Horner
    264
    expanded
    249
  • IPOPT time [s]
    Horner
    464.4
    expanded
    442.5
  • Final NLP error
    Horner
    8.0\times 10^{-4}
    expanded
    3.8\times 10^{-4}
  • Lap time [s]
    Horner
    90.6462
    expanded
    90.6429

The FMU, not the linear algebra, dominates the cost of a solve. Of the 464 s total, 167 s go into 266 objective-gradient evaluations (627 ms each), 120 s into 389 constraint evaluations (310 ms each) and 23 s into 266 constraint-Jacobian evaluations (85 ms each). Making the road model cheaper to evaluate therefore pays off directly, which is why the 26\% figure above is worth having.

Comparison with the Claytex Rail joint.

Table 3 sets the present component beside the 1-DOF rail joint Briant (2021). The differences are about what the two components can represent. Rail holds a body on a curve and has to be told its orientation, either by tying it to the tangent or through three extra angle tables. TrackJoint holds a body on a surface and works the whole orientation triad out from the surface partials. Timing the two against each other would not mean much, since they solve different problems. The point is that the second degree of freedom, the analytic triad and the second d’Alembert relation all come from six scalar splines and no extra tabulated data.

Table 3: Claytex Rail versus TrackJoint.
  • Free DOF
    Rail
    1 (s)
    TrackJoint
    2 (s,w)
  • Geometry
    Rail
    space curve
    TrackJoint
    Monge-patch surface
  • Orientation
    Rail
    rail tangent or
    TrackJoint
    analytic triad from
  • No data
    Rail
    3 angle tables
    TrackJoint
    surface partials
  • Input data
    Rail
    xyz or xyz\phi
    TrackJoint
    6 quintic splines
  • No data
    Rail
    sample table
    TrackJoint
    + shared knots
  • Constraint
    Rail
    1 projection
    TrackJoint
    2 d’Alembert relations
  • Camber/crown
    Rail
    Constant (centerline)
    TrackJoint
    z(s,w) polynomial

6 Limitations

There are limits to what the component does today, and to what the measurements above can show.

Dependence on the fitting pipeline. The joint uses splines it does not produce, and it cannot tell at run time that a reference line was badly anchored. If (10) is broken, the constraint Jacobian quietly loses rank in the offending corner. A cheap guard would be to export \min_{s}1/(|\kappa|b) with the splines and assert on it at initialization. The present version does not do this.

Validation scope. We validated the surface against LiDAR terrain for one circuit and one point-mass run, and the optimization results use one vehicle, one setup and one initial guess per circuit. We have not run a spline-resolution sensitivity study or a multi-seed convergence study, so our comments about robustness are experience rather than measurement.

Availability. TrackJoint is proprietary. We give the formulation in full here so that it can be reimplemented, but the component, the vehicle models and the fitted circuit data are not public.

Implementation restrictions. The break vector is uniform, so non-uniform knots would need a search in place of the constant-time index lookup. The joint assumes a closed circuit and reduces s modulo the lap length. It exposes one frame_b, so four-wheel contact-patch queries need four instances sharing one parameter record.

7 Conclusions

Packaging a racetrack surface as an ordinary MultiBody joint works well in Modelica. TrackJoint exposes only a frame_b connector and two joint coordinates, so it plugs into the standard library like any elementary joint, and the whole road model comes down to six scalar splines and a shared knot vector.

Three things came out of this work. First, the regularity of the patch is not a modelling detail. It is the condition under which the joint can be solved at all: Proposition 1 shows the constraint Jacobian loses rank exactly on the Frenet fold, so \min_{s}1/(|\kappa|b)>1 on the input splines is what makes the DAE well posed. All 23 circuits fitted here meet it, the tightest being 1.03 at Monaco. Second, writing the chassis coordinates relative to the track triad makes the minimum lap-time problem easy to start. Setting every chassis coordinate to zero and ramping s puts the vehicle on the road with its axes aligned at every collocation point, with no preliminary simulation. Third, about two thirds of a 464 s Singapore solve happens inside the FMU. The 26\% gap we measured between two mathematically identical polynomial forms is a reminder that what counts is the generated code, not the operation count on paper.

The next steps come straight out of Section 6: assert the injectivity margin at initialization, find out what the cubic lateral term buys on a circuit that needs it, swap the uniform-knot storage for an adaptive one, and build a contact-patch variant in which four instances share one parameter record.

Acknowledgements

The component builds on the geometric formulation of Limebeer and van de Merwe (2025), with input splines from the companion fitting work Verulkar et al. (2026). We gratefully acknowledge the Modelica Standard Library MultiBody package, CasADi Andersson et al. (2019) and IPOPT Wächter and Biegler (2006).

References

  1. Andersson et al. (2019) J. A. E. Andersson, J. Gillis, G. Horn, J. B. Rawlings, and M. Diehl CasADi – a software framework for nonlinear optimization and optimal control. Mathematical Programming Computation 11 (1), pp. 1–36. External Links: Document
  2. Braghin et al. (2008) F. Braghin, F. Cheli, S. Melzi, and E. Sabbioni Race driver model. Computers & Structures 86 (13–14), pp. 1503–1516. External Links: Document
  3. Briant (2021) D. Briant Universal rail joint. Claytex. Note: https://www.claytex.com/tech-blog/universal-rail-joint/Accessed 31 May 2026
  4. do Carmo (1976) M. P. do Carmo Differential geometry of curves and surfaces. Prentice Hall, Englewood Cliffs, NJ.
  5. Hall et al. (2014) A. Hall, C. Schmitke, and J. McPhee Symbolic formulation of a path-following joint for multibody dynamics. In Proceedings of the ASME 2014 International Design Engineering Technical Conferences and Computers and Information in Engineering Conference (IDETC/CIE), Volume 3: 16th International Conference on Advanced Vehicle Technologies, pp. V003T01A025. External Links: Document
  6. Heilmeier et al. (2020) A. Heilmeier, A. Wischnewski, L. Hermansdorfer, J. Betz, M. Lienkamp, and B. Lohmann Minimum curvature trajectory planning and control for an autonomous race car. Vehicle System Dynamics 58 (10), pp. 1497–1527. External Links: Document
  7. Limebeer and van de Merwe (2025) D. J. N. Limebeer and C. V. van de Merwe Another look at 3D road surface modelling. Vehicle System Dynamics. Note: Published online 7 July 2025 External Links: Document
  8. Lovato et al. (2021) S. Lovato, M. Massaro, and D. J. N. Limebeer Curved-ribbon-based track modelling for minimum lap-time optimisation. Meccanica 56 (8), pp. 2139–2152. External Links: Document
  9. Perantoni and Limebeer (2015) G. Perantoni and D. J. N. Limebeer Optimal control of a formula one car on a three-dimensional track—Part 1: track modelling and identification. ASME Journal of Dynamic Systems, Measurement, and Control 137 (5), pp. 051018. External Links: Document
  10. Verulkar et al. (2026) A. Verulkar, B. Danaei, S. Sivaramakrishnan, and R. Trinter A singularity avoiding track model for race car optimization. In Proceedings of the North American Modelica and FMI Conference, Atlanta, GA, USA.
  11. Wächter and Biegler (2006) A. Wächter and L. T. Biegler On the implementation of an interior-point filter line-search algorithm for large-scale nonlinear programming. Mathematical Programming 106 (1), pp. 25–57. External Links: Document