Direct Integration of Index-3 Multibody DAEs with a Complex Rosenbrock Scheme
Modelling closed-loop mechanisms in redundant coordinates yields a system of index-3 differential-algebraic equations (DAEs) through the Lagrange equations of the first kind. The usual remedy is to differentiate the position constraints, which lowers the index but no longer enforces the constraint at the position level, so that Baumgarte stabilization or projection onto the constraint manifold becomes necessary to control the resulting drift. This paper examines another choice: direct integration of the index-3 form by a complex Rosenbrock scheme, without any index reduction, stabilization or projection. The scheme is single-stage and does not require inner iterations, so the cost of a step is fixed and predictable, which makes it especially interesting for hardware-in-the-loop (HIL) applications where execution time is more important than accuracy. On planar benchmarks of multibody dynamics covering passive and active positional constraints it is shown that the proposed approach satisfies the constraints to second order in the step size, with no secular drift over sixty-second simulations and without tuning any parameters. On the same mechanisms and with the same constraint residual, the index-1 form written as a DAE and integrated with a second-order Rosenbrock method requires a consistent start in the multipliers and, over a thirty-second interval, yields a constraint violation 2.7–22 times larger than the direct form; its stabilized and projected variants reduce the violation further, but by less than one order of magnitude (a factor of 3–12) and at the price of gain selection and of an additional solve per step, respectively. Because the whole right-hand side is a single residual function of the state, its Jacobian is available by automatic differentiation, which removes the most error-prone part of a multibody implementation. The Lagrange multipliers are obtained from the same solution: the actuated multiplier is verified to coincide with the derivative of the potential energy with respect to the generalized coordinate in closed form. The practical limitation is also reported: the initial state must satisfy the constraint equations, since a finite violation of the constraints at the start gives the multipliers a spurious component of order \(1/h\) and the integration diverges.
multibody dynamics, differential-algebraic equations, index-3 DAE, Rosenbrock methods, redundant coordinates, automatic differentiation, constraint stabilization
1 Introduction
Multibody simulation of closed-loop mechanisms — parallel manipulators [1], [2], linkages, walking machines, test rigs for identifying the properties of real joints [3] — is most naturally posed in redundant coordinates, where every rigid body carries its own position and orientation and the joints are imposed as algebraic constraints. The alternative, deriving the equations of motion in a set of minimal coordinates, requires the analytical elimination of dependent coordinates and produces mechanism-specific expressions that must be re-derived whenever the topology changes. For parallel mechanisms with several closed kinematic chains this derivation is the dominant part of the modelling effort.
The redundant-coordinate route leads, via the Lagrange equations of the first kind, to a system of differential-algebraic equations of index 3:
\[ \begin{cases} \mathbf{M}\ddot{\mathbf{q}} = \mathbf{Q}(\mathbf{q},\dot{\mathbf{q}},t) + \boldsymbol{\Phi}_{q}^{\mathsf T}(\mathbf{q})\,\boldsymbol{\lambda},\\[2pt] \boldsymbol{\Phi}(\mathbf{q},t) = \mathbf{0}, \end{cases} \tag{1}\] where \(\mathbf{q}\in\mathbb{R}^{n}\) collects the Cartesian coordinates of all bodies, \(\mathbf{M}\) is the block-diagonal mass matrix, \(\boldsymbol{\Phi}_{q}=\partial\boldsymbol{\Phi}/\partial\mathbf{q}\) is the constraint Jacobian, and \(\boldsymbol{\lambda}\) are the Lagrange multipliers, which physically represent joint reactions and drive efforts [4]. The constraint equations \(\boldsymbol{\Phi}(\mathbf{q},t)=\mathbf{0}\) constitute the position problem, which for mechanisms with redundant drives is solved separately, by kinematic means [5]; here it is solved together with the equations of motion, Equation 1.
Index-3 DAEs pose significant numerical challenges for standard ODE integrators [6], [7]; in particular, the DifferentialEquations.jl library [8] does not allow integrating DAEs of index higher than 1. The established practice is to reduce the index: differentiating \(\boldsymbol{\Phi}=\mathbf{0}\) once and twice produces a velocity- and acceleration-level constraint,
\[ \begin{aligned} \dot{\boldsymbol{\Phi}}&=\boldsymbol{\Phi}_{q}\dot{\mathbf{q}}+\boldsymbol{\Phi}_{t},\\ \ddot{\boldsymbol{\Phi}}&=\boldsymbol{\Phi}_{q}\ddot{\mathbf{q}}+\boldsymbol{\Phi}_{qq}\bigl[\dot{\mathbf{q}},\dot{\mathbf{q}}\bigr]+\dot{\boldsymbol{\Phi}}_{t}, \end{aligned} \tag{2}\]
where \(\boldsymbol{\Phi}_{t}=\partial\boldsymbol{\Phi}/\partial t\) vanishes for the scleronomic joints and is non-zero for the actuators, \(\boldsymbol{\Phi}_{qq}=\partial^{2}\boldsymbol{\Phi}/\partial\mathbf{q}^{2}\) is the second derivative evaluated on the pair of velocities, and \(\dot{\boldsymbol{\Phi}}_{t}\) is the total time derivative of \(\boldsymbol{\Phi}_{t}\) (the mixed derivative \(\boldsymbol{\Phi}_{qt}\) vanishes for the actuators used here, whose time dependence enters additively through the commanded profile); the resulting index-1 DAE can be integrated by standard implicit methods without further difficulty [9]. The price is that the position constraint is no longer enforced, so the numerical solution leaves the constraint manifold. Two remedies are standard:
Baumgarte stabilization [10], which replaces \(\boldsymbol{\Phi}=\mathbf{0}\) by a damped feedback
\[\ddot{\boldsymbol{\Phi}}+2\alpha\dot{\boldsymbol{\Phi}}+\beta^{2}\boldsymbol{\Phi}=\mathbf{0} \tag{3}\]
and requires gains that trade constraint violation against stiffness;
projection or coordinate partitioning [11], [12], which re-orthogonalizes the state onto the constraint manifold after each step, at the cost of an additional solve per step.
Both remedies add machinery, and both interact with the error control of the underlying integrator.
This paper considers a direct alternative: the integration of the index-3 system as it stands, without prior index reduction, by means of a single-step complex Rosenbrock scheme of the CROS family [13]. Although this method is A- and L-stable and was originally developed for stiff and differential-algebraic systems of index 1, numerical experiments have indicated that it is capable of solving standard multibody dynamics DAEs directly, that is, without index reduction. This observation forms the subject of the present study. The implementation is written in Julia [14] and covers both the direct index-3 form and the index-1 variants used for comparison.
The presentation is two-dimensional, and the constraint library covers holonomic joints and position actuators. Unilateral contacts and non-holonomic constraints lie outside the scope of this work and would require the apparatus of inequality constraints or of complementarity. Problems in which friction and the wear of mating surfaces are essential [15] also remain outside.
2 Methods
2.1 Equations of motion in redundant coordinates
Consider \(n_b\) planar rigid bodies. Body \(i\) has mass \(m_i\), centroidal moment of inertia \(J_i\), and coordinates \(\mathbf{q}_i=(x_i,y_i,\theta_i)^{\mathsf T}\) in the absolute frame. Stacking all bodies gives \(\mathbf{q}\in\mathbb{R}^{3n_b}\). The unconstrained Newton–Euler equations are
\[ \mathbf{M}\ddot{\mathbf{q}}=\mathbf{Q}_{\mathrm{ext}}(\mathbf{q},\dot{\mathbf{q}},t) \tag{4}\] where \(\mathbf{M}=\mathrm{blockdiag}\bigl(\mathrm{diag}(m_i,m_i,J_i)\bigr)\) is the matrix of inertial terms and \(\mathbf{Q}_{\mathrm{ext}}\) collects gravity and applied forces. Joints are holonomic constraints \(\boldsymbol{\Phi}(\mathbf{q},t)=\mathbf{0}\in\mathbb{R}^{n_c}\); adding their reactions through Lagrange multipliers gives the index-3 DAE, Equation 1. Since constraint forces do no work on virtual displacements, \(\boldsymbol{\lambda}\) is recovered as part of the solution.
2.2 Constraint library
The formulation is generic in \(\boldsymbol{\Phi}\); only the residual and its Jacobian are needed. Table 1 lists the planar joints used here. Body-local points are \(\mathbf{p}^{b}_c=(x_c,y_c)^{\mathsf T}\) for a body \(b\in\{i,j\}\) and \(\mathbf{R}(\theta)\) is the planar rotation matrix.
| Joint | \(\boldsymbol{\Phi}\) | \(n_c\) |
|---|---|---|
| Attachment to ground | \(\mathbf{r}_1-\mathbf{r}^{\mathrm{ref}}\) and \(\theta_1-\theta^{\mathrm{ref}}\) | 3 |
| Revolute pair (hinge) | \(\mathbf{r}_i+\mathbf{R}_i\mathbf{p}^{i}_c-\mathbf{r}_j-\mathbf{R}_j\mathbf{p}^{j}_c\) | 2 |
| Prismatic pair (slider) | \((\mathbf{r}_j-\mathbf{r}_i)\cdot\hat{\mathbf{n}}_i\) and \((\theta_j+\alpha_j)-(\theta_i+\alpha_i)\) | 2 |
| Rotary position motor | \((\theta_j-\theta_i)-u(t)\) | 1 |
| Linear position actuator | \((\mathbf{r}_j-\mathbf{r}_i)\cdot\hat{\mathbf{t}}_i-u(t)\) | 1 |
Here \(\hat{\mathbf{n}}_i\) and \(\hat{\mathbf{t}}_i\) are the unit normal and tangent of the sliding axis on body \(i\), both rotated with the body, and \(\alpha_i\) is the constant local angle of the sliding direction.
Position actuators are treated as additional holonomic constraints appended to \(\boldsymbol{\Phi}\) with their own multiplier. A commanded trajectory \(u(t)\) makes the constraint rheonomic, \(\Phi(\mathbf{q},t)=a(\mathbf{q})-u(t)=0\). Therefore the drive limits and the commanded profiles enter exactly in the same way as joints, and the same multiplier carries the drive effort. The corresponding entry of the Jacobian with respect to time is \(\partial\Phi/\partial t=-\dot u(t)\), which must be supplied so that the discretization stays consistent.
2.3 The CROS step
The second-order system of Equation 1 is rewritten in first-order form by introducing the velocity \(\mathbf{v}=\dot{\mathbf{q}}\):
\[ \begin{aligned} \dot{\mathbf{q}}&=\mathbf{v},\\ \mathbf{M}\dot{\mathbf{v}}&=\mathbf{Q}(\mathbf{q},\mathbf{v},t)+\boldsymbol{\Phi}_{q}^{\mathsf T}(\mathbf{q})\,\boldsymbol{\lambda},\\ \boldsymbol{\Phi}(\mathbf{q},t)&=\mathbf{0}, \end{aligned} \tag{5}\]
or, in matrix form,
\[ \mathbf{M}_{\mathrm{aug}}\dot{\mathbf{z}}=\mathbf{F}(\mathbf{z}),\\ \tag{6}\] where \(\mathbf{z}=(\mathbf{q},\dot{\mathbf{q}},\boldsymbol{\lambda},t)^{\mathsf T}\) is an extended state vector and \(\mathbf{M}_{\mathrm{aug}}\) is the extended mass matrix of Equation 4 with an identity block for the kinematic coordinates, zeros in the multiplier rows, and a single \(1\) for the time component; the residual \(\mathbf{F}\) contains the momentum equations, the constraint equations \(\boldsymbol{\Phi}(\mathbf{q},t)\) and \(\dot t=1\). The CROS step has the form
\[ \begin{aligned} \boldsymbol{\zeta}&=\Bigl(\mathbf{M}_{\mathrm{aug}}-\tfrac{1+\mathrm{i}}{2}\,h\,\mathbf{J}(\mathbf{z}_k)\Bigr)^{-1}\mathbf{F}(\mathbf{z}_k),\\ \mathbf{z}_{k+1}&=\mathbf{z}_k+h\,\mathrm{Re}\,\boldsymbol{\zeta}, \end{aligned} \tag{7}\] where \(\mathbf{J}=\partial\mathbf{F}/\partial\mathbf{z}\) is the Jacobian of the residual of Equation 6.
The CROS scheme, like the whole family to which it belongs [13], is A-stable and L-stable: the stiff decaying modes are not preserved but suppressed entirely. This statement refers to the linearized problem with a regular and well-conditioned Jacobian; on nonlinear DAEs it yields stability but not accuracy, because the discretization order is determined here in addition by the index and by the treatment of the algebraic rows [9], [16]. Stability removes the step-size restriction suffered by an explicit index-reduced integrator under the stiff constraint dynamics of an index-3 DAE, and permits the step to be chosen from the required accuracy alone; the order measured on the problems considered here is given in Section 3.
2.4 Automatic differentiation of the residual
Since the whole right-hand side is assembled as a single residual function of \(\mathbf{z}\) in Equation 6, the Jacobian \(\mathbf{J}\) is obtained by forward-mode automatic differentiation [17]. For a residual built from trigonometric expressions such as those given in Table 1 this is exact to working precision and removes the need to program \(\partial\mathbf{F}/\partial\mathbf{z}\) by hand, which for a mechanism with several closed loops is the most error-prone part of the implementation. Adding a new joint means writing only its constraint residual. Automatic differentiation eliminates only the derivation of the derivatives: if the application of the reactions is programmed incorrectly — with a sign error or with a missing term — the residual remains incorrect, while its Jacobian is computed exactly, that is, consistently with precisely that error. Therefore the check that the constraint reactions enter the residual through the constraint Jacobian transpose, and not through some other matrix, remains a necessary part of the debugging of any implementation.
2.5 The index-1 form: the variants compared
To isolate the effect of the differential index explicitly, the direct index-3 approach is evaluated against traditional index-1 formulations. The index-1 DAEs are obtained by differentiating the position constraints to the acceleration level, Equation 2, with the derivative terms computed by differentiation along the flow, so that no separate constraint Jacobian is programmed here either. Alongside the unstabilized index-1 equations, two standard drift-mitigation strategies are implemented: Baumgarte stabilization, Equation 3, and mass-orthogonal projection of the velocities onto \(\dot{\boldsymbol{\Phi}}=\mathbf{0}\) after each step. The projection is the correction
\[ \Delta\mathbf{v}=-\mathbf{M}^{-1}\boldsymbol{\Phi}_{q}^{\mathsf T}\bigl(\boldsymbol{\Phi}_{q}\mathbf{M}^{-1}\boldsymbol{\Phi}_{q}^{\mathsf T}\bigr)^{-1}\dot{\boldsymbol{\Phi}}, \tag{8}\]
applied to the velocities after each step; it does not change the positions. To ensure that the comparison reflects the underlying formulation rather than the order of the solver, all index-1 variants are integrated with ROS2S [8], a second-order L-stable Rosenbrock method from the same numerical family as the proposed CROS scheme.
Unlike the direct index-3 method, the index-1 formulations require a strictly consistent initialization of the Lagrange multipliers; at \(\boldsymbol{\lambda}=\mathbf{0}\) the residual of the acceleration-level equations is \(9.8\) and the integration does not start at all, and making the multipliers consistent removes this residual. Velocity projection in addition requires, at every time step, an auxiliary linear system of size \(n_c\times n_c\) formed from \(n_c\times n_{\mathrm{vel}}\) products.
3 Results
All results were obtained with the implementation described above. The comparisons were performed on two benchmarks: an open-loop double pendulum with passive joints (see Figure 1) and a closed-loop slider-crank mechanism with an actuator and a spring element (see Figure 6). A detailed description with the parameters of each benchmark is given in the corresponding sections.
3.1 Passive two-link chain
The first benchmark represents a double pendulum (a two-link chain). The benchmark consists of a massive ground body and two uniform links, \(m=1\) kg, \(L=1\) m, \(J=mL^{2}/12\), released from \(q_1=0.3\) and \(q_2=-1.0\) rad with zero velocity. The mechanism has \(n_b=3\) bodies and \(n_c=7\) constraints (three for the attachment to ground, two for each hinge), so that \(n=6\cdot 3+7+1=26\).
3.1.1 Absence of secular drift
The first set of numerical experiments investigated the effect of constraint drift, which motivates the whole approach. Figure 2 shows the closure error as a function of time over 60 s at \(h=10^{-3}\) s for the four schemes of Section 2.5. For the direct form the violation increases up to a plateau determined by the step size and then remains on it: it does not grow with time, and the state remains bounded (\(\max|\mathbf{z}|=187.5\) over 60 s). For the index-1 form without stabilization the closure error grows monotonically over the same interval — from about \(10^{-6}\) to \(4\cdot10^{-4}\) m: there is no positional feedback in that form, and the accumulated offset grows without bound. Baumgarte stabilization and projection of the velocities return the closure error to a plateau, but the former requires gains and the latter an additional solve at every step. Consequently, for the direct form neither a Baumgarte term nor a projection step is needed in order to keep the algebraic constraints under control.
3.1.2 Trajectory accuracy
The position of the output link was compared with the reference solution over \(t\in[0,4]\) s. Figure 3 shows the maximal deviation of the direct form from the reference as a function of the step size for both benchmarks; the reference of that figure is the index-1 form with Baumgarte feedback integrated by a fourth-order method at \(h=2.5\cdot10^{-5}\) s, five times finer than the finest CROS step on the grid, so that it is accurate to about \(10^{-13}\) m and can be treated as exact. On halving the step the errors of the two-link chain form the ratios 2.06, 3.21, 3.64, 3.83 and 3.92 over the range \(h=4\cdot10^{-3}\ldots1.25\cdot10^{-4}\) s, so that the observed order reaches 1.97 as the step is refined; the coarse-end ratios are lower because the maximum of the norm is attained at different instants for different steps. The trajectory of the output link is shown in Figure 4.
3.1.3 Comparison with index reduction
The maximal closure error of the second hinge over \(t\in[0,30]\) s is shown in Figure 5.
The direct form converges at second order: on halving the step the closure error decreases by factors of 3.72 and 4.02 (\(h=4\cdot10^{-3}\to2\cdot10^{-3}\to10^{-3}\) s). The index-1 form without stabilization is outperformed over this interval: its closure error is larger than that of the direct form by factors of 2.7, 8 and 22 at \(h=10^{-3}\), \(2\cdot10^{-3}\) and \(4\cdot10^{-3}\) s, respectively. The reason is the absence of positional feedback: the position constraint is not imposed in the index-1 form, and the accumulated offset grows faster with the step than \(h^{2}\) — on coarse steps the ratios obtained on halving the step reach 10 instead of 4. However, over a short interval (5 s) that form has the smaller local error and appears 4–5 times more accurate than the direct one, because the drift has no time to manifest itself; without positional feedback that error accumulates, so over the 30 s window used here and below the direct form is the more accurate of the two.
Baumgarte stabilization and projection of the velocities remove this drift and give a closure error smaller than that of the direct form, but within one order of magnitude: at \(h=10^{-3}\) s, \(1.4\cdot10^{-5}\) and \(2.1\cdot10^{-5}\) m against \(7.7\cdot10^{-5}\) m, that is, by factors of 5.5 and 3.6; over the whole grid of steps the gain of stabilization lies within 5.3–6.1 and that of projection within 3.1–6.4. The price is known: stabilization requires gain selection, projection the solution of an \(n_c\times n_c\) system at every step.
The feedback gains affect the closure error weakly and the energy strongly (Table 2): even the weakest feedback \((2\alpha,\beta^{2})=(2,1)\) reduces the closure error by a factor of 14 relative to the form without stabilization, while a further strengthening of the gains gives only a factor of 3 more. The drift of the mechanical energy grows monotonically in this process — from \(1.7\cdot10^{-4}\) at the weakest coupling to \(1.3\cdot10^{-3}\) at the strongest (without stabilization it is \(1.2\cdot10^{-4}\)) as fractions of \((m_1+m_2)gL\): the feedback performs work
\[ \boldsymbol{\lambda}^{\mathsf T}\dot{\boldsymbol{\Phi}}\neq0 \tag{9}\]
and is not energy-conserving. The mass-orthogonal projection of the velocities gives a closure error close to that of stabilization at a substantially smaller energy drift (\(4.4\cdot10^{-5}\) against \(6.6\cdot10^{-4}\) at \(h=10^{-3}\) s), but it does not change the positions; the velocity correction of Equation 8 changes the kinetic energy by
\[ \Delta T=-\tfrac12\dot{\boldsymbol{\Phi}}^{\mathsf T}\bigl(\boldsymbol{\Phi}_{q}\mathbf{M}^{-1}\boldsymbol{\Phi}_{q}^{\mathsf T}\bigr)^{-1}\dot{\boldsymbol{\Phi}}. \tag{10}\]
The direct form, in addition, requires neither a consistent start in the multipliers nor gain selection, and it needs no external DAE solver with its consistency checks: both formulations carry the same singular augmented mass matrix, but the CROS step is written explicitly through the inverse of the pencil \(\mathbf{M}_{\mathrm{aug}}-\tfrac{1+\mathrm{i}}{2}h\mathbf{J}(\mathbf{z}_k)\) of Equation 7, so that the algebraic rows are resolved together with the differential ones.
| \(2\alpha\) | \(\beta^{2}\) | closure error, m | energy drift |
|---|---|---|---|
| 0 | 0 | \(2.11\cdot10^{-4}\) | \(1.2\cdot10^{-4}\) |
| 2 | 1 | \(1.50\cdot10^{-5}\) | \(1.7\cdot10^{-4}\) |
| 10 | 25 | \(1.41\cdot10^{-5}\) | \(6.6\cdot10^{-4}\) |
| 40 | 400 | \(8.89\cdot10^{-6}\) | \(1.2\cdot10^{-3}\) |
| 100 | 2500 | \(5.03\cdot10^{-6}\) | \(1.3\cdot10^{-3}\) |
3.2 A closed kinematic chain with an actuator and a spring
The second example is a slider-crank mechanism with a closed kinematic chain (see Figure 6). The mechanism consists of a massive ground, a crank, a connecting rod and a slider. The crank has mass \(m_1=10\) kg, centroidal inertia \(J_1=1.0\) kg\(\cdot\)m\(^2\) and a pin-to-pin length \(r=1.0\) m; the connecting rod has mass \(m_2=5\) kg, \(J_2=0.5\) kg\(\cdot\)m\(^2\) and a pin-to-pin length \(l=2.0\) m; the slider has mass \(m_3=5\) kg and \(J_3=0.1\) kg\(\cdot\)m\(^2\), its orientation being fixed by the prismatic pair. The ground is fixed, the crank is connected to it by a hinge at the origin, the connecting rod closes the chain between the crank and the slider, the slider is held on a horizontal guide, and a rotary position actuator prescribes the absolute crank angle \(\theta=\pi t\). With \(r=1.0\) m and \(l=2.0\) m the slider travels between \(x=1\) m and \(x=3\) m; at \(\theta=0\) the chain lies along the guide and the slider sits at \(x=3\) m. The mechanism has four bodies and twelve constraints: three for fixing the ground, two for each of the three hinges, two for the prismatic pair and one for the actuator. The mobility of the mechanism is zero: the motion is fully prescribed by the actuator, and the meaningful output is the set of forces. A linear spring of stiffness \(k=20\) N/m acts along the guide and is unstretched at the slider coordinate \(x=3\) m — a force element that introduces no additional constraints. The constraint Jacobian has full rank in the configurations examined (\(12\) of \(12\)), including the dead-centre position of the crank, that is, the mechanism nowhere approaches a singular configuration [18].
The initial state is made fully consistent with the constraints: the positions are taken from the assembled configuration of the example, the velocities are projected mass-orthogonally onto \(\dot{\boldsymbol{\Phi}}=\mathbf{0}\) (so that the prescribed angular velocity of the crank \(\omega=\pi\) rad/s holds from the first step), and the multipliers are chosen consistent with the acceleration-level equations. Consistency of the velocities and of the multipliers is required by the index-1 formulations only, but it is applied to the direct form as well, so that all four schemes start from one and the same state.
Table 3 reports the maximal closure error of the closed loop and the tracking error of the prescribed angle for the direct index-3 form.
| \(h\) | max closure error, m | ratio | \(\max|\theta-\pi t|\), rad |
|---|---|---|---|
| \(4\cdot10^{-3}\) | \(5.92\cdot10^{-5}\) | – | \(1.1\cdot10^{-11}\) |
| \(2\cdot10^{-3}\) | \(1.48\cdot10^{-5}\) | 4.00 | \(1.8\cdot10^{-11}\) |
| \(10^{-3}\) | \(3.71\cdot10^{-6}\) | 4.00 | \(4.3\cdot10^{-11}\) |
| \(5\cdot10^{-4}\) | \(9.25\cdot10^{-7}\) | 4.00 | \(7.7\cdot10^{-11}\) |
The closure error of the loop decreases at second order (ratios 4.00, 4.00, 4.00), although the chain is closed and contains four bodies: the Jacobian is constructed by automatic differentiation of the entire residual, so that the addition of a closing loop, a spring and an actuator changes no single element of the implementation. The same order is seen in the deviation of the solution itself: for this mechanism Figure 3 gives a ratio of 4.00 at every halving of the step over \(h=4\cdot10^{-3}\ldots1.25\cdot10^{-4}\) s, so that the second order of the closure error reflects the second order of the solution rather than a property of the closure metric. The prescribed angle is tracked at the level of \(10^{-11}\) rad, since it is imposed by an algebraic row.
The same three variants of the index-1 form (Section 2.5) are applied to the closed chain with an actuator (Figure 7).
Here the picture is the same as in the passive chain: the index-1 form without stabilization is outperformed by the direct form — at \(h=4\cdot10^{-3}\) and \(10^{-3}\) s its closure error is \(2.5\cdot10^{-4}\) and \(1.7\cdot10^{-5}\) m against \(5.9\cdot10^{-5}\) and \(3.7\cdot10^{-6}\) m, that is, larger by factors of 4.2 and 4.6 — and both forms decrease at second order (ratios 3.7–4.0 on halving the step). Stabilization and projection reduce the closure error relative to the unstabilized form by about an order of magnitude (\(5.2\cdot10^{-6}\) and \(3.2\cdot10^{-7}\) m with stabilization, \(7.0\cdot10^{-6}\) and \(4.4\cdot10^{-7}\) m with projection, that is, smaller than the direct form by factors of 11.5 and 8.4), but neither improves the tracking of the prescribed motion: in all four schemes the error \(\max|\theta-\pi t|\) lies at the level of \(10^{-11}\)–\(10^{-10}\) rad, since the prescribed angle is imposed by an algebraic row.
4 Discussion and limitations
Comparing the formulations with second-order L-stable Rosenbrock integrators isolates the role of the differential index. Without positional feedback, the unstabilized index-1 DAE accumulates geometric offset and yields a closure error 2.7–22 times larger than the direct index-3 form over a 30 s window (though on short intervals under 5 s its local error is smaller before drift manifests). Baumgarte stabilization and mass-orthogonal velocity projection bound this drift and reduce the violation below that of the direct form by a factor of 3–12. However, stabilization requires empirical gain tuning and introduces artificial energy drift, whereas velocity projection requires solving an auxiliary \(n_c \times n_c\) linear system after every step without correcting positional offset. Neither remedy improves the tracking of prescribed actuator trajectories, which are satisfied to \(10^{-11}\)–\(10^{-10}\) rad across all four schemes via the algebraic rows.
A primary practical advantage of the direct CROS approach is its low and deterministic per-step computational cost. Both integrators operate here at a fixed step without inner Newton iterations, yet CROS is a single-stage complex scheme requiring only one residual evaluation, one automatic differentiation pass for the Jacobian, and one complex linear solve per step. By contrast, the three-stage ROS2S solver used for the index-1 variants requires three linear solves and three residual evaluations per step, plus the consistent initialization of Lagrange multipliers at \(t=0\) (and an extra linear solve per step when velocity projection is enabled). Wall-clock times are intentionally omitted because the prototype code is not optimized against allocations, which would bias a timing comparison toward implementation details rather than algorithmic complexity. The minimal, fixed operation count per step makes the direct index-3 scheme attractive for HIL simulations, where a strict real-time cycle budget outweighs high-order asymptotic accuracy.
The Lagrange multipliers obtained directly from the index-3 state remain physically accurate. In a static verification over crank angles \(\theta\in[0.4,\,2.2]\) rad on the closed-loop mechanism, the actuator multiplier matched the analytical potential energy gradient \(dU/d\theta\) along the constraint manifold to a relative error of \(2.9\cdot10^{-15}\). Joint reactions and drive efforts required for structural and actuator sizing [19], [20] are thus recovered directly from the time integration without a separate kinetostatic pass.
Several limitations of the proposed approach must be noted:
- Consistent initial positions: While initial Lagrange multipliers need not be consistent (unlike in index-1 DAEs), the initial coordinates must strictly satisfy \(\boldsymbol{\Phi}(\mathbf{q}_0, t_0)=\mathbf{0}\). A finite initial position violation induces a spurious multiplier response of order \(O(1/h)\), causing rapid divergence as the step size decreases.
- Discretization-level constraint satisfaction: Position constraints are enforced to \(O(h^{2})\) rather than machine precision. While secular drift is eliminated, the residual geometric tolerance scales with the step size.
- Fixed step size: The implementation lacks adaptive step-size control, requiring a conservative step choice for rapidly varying drive profiles. Constructing an embedded error estimator for CROS on index-3 DAEs is non-trivial, as standard index-0 Rosenbrock order conditions do not directly carry over to algebraic variables [9], [16].
- Rank deficiency and scaling: The step matrix becomes singular if the constraint Jacobian loses full row rank near kinematic singularities, and the current dense linear algebra routines would need to be replaced by sparse solvers for large-scale spatial systems.
5 Conclusion
This work has demonstrated that index-3 DAEs of multibody dynamics in redundant coordinates can be integrated directly using the single-stage CROS scheme without index reduction, Baumgarte stabilization, or state projection. Across planar open- and closed-loop benchmarks with passive joints and rheonomic actuators, the scheme achieves second-order accuracy in both trajectories and position constraints while preventing secular constraint drift over 60 s simulations.
When evaluated against index-1 formulations integrated with the three-stage second-order ROS2S method, the direct index-3 scheme outperforms unstabilized index reduction over 30 s intervals and avoids the parameter tuning of Baumgarte feedback and the extra linear solve of velocity projection. Its single-stage, iteration-free structure requires only one linear system solution and one Jacobian evaluation per step, providing a predictable computational load well-suited for real-time and hardware-in-the-loop applications.
Because the equations of motion and constraints form a single unified residual, forward-mode automatic differentiation supplies the exact system Jacobian directly. Extending the joint library requires defining only the constraint residual, and physically accurate joint reactions and actuator efforts are recovered simultaneously with the kinematic state. For closed-loop mechanisms where moderate fixed time steps and \(O(h^2)\) geometric tolerances are acceptable, direct index-3 integration via CROS offers a compact, parameter-free alternative to standard index-reduction pipelines, provided the initial positions are assembled consistently.