Abstract
The formulation of constrained system dynamics using coordinate projection onto a subspace locally tangent to the constraint manifold is revisited using the QR factorization of the constraint Jacobian matrix to extract a suitable subspace and integrating the evolution of the QR factorization along with that of the constraint Jacobian matrix, as the solution evolves. A true continuation algorithm is thus proposed to track the evolution of the subspace of independent coordinates. It does not visibly affect the quality of the solution but avoids the artificial algorithmic irregularities or discontinuities in the generalized velocities that could otherwise result from arbitrary reparameterizations of the coordinate set. The characteristics of the proposed subspace evolution approach are exemplified by solving simple single- and multi-degree-of-freedom problems.
Similar content being viewed by others
Avoid common mistakes on your manuscript.
1 Introduction
In mechanical system dynamics, unconstrained dynamics problems are usually formulated as a set of second-order ordinary differential equations (ODE) that depend on a corresponding set of coordinates. A convenient approximation to describe the interaction between the parts of the system is often their idealization at a purely kinematic level, as algebraic relationships between the coordinates of those parts. The addition of these algebraic equations turns the problem into a system of differential-algebraic equations (DAE). The original coordinates are no longer independent; the actual number of independent coordinates reduces to that of the truly independent degrees of freedom. The enforcement of the constraints results in constraint reaction generalized forces, usually formulated as Lagrange multipliers. They represent the (unknown) internal forces whose value is whatever is required to guarantee the constraints’ enforcement. A review of the possible approaches can be found in [1].
The constrained dynamics problem can be solved either directly, as a system of DAEs, where the original coordinates, augmented by the Lagrange multipliers, represent the unknowns in the so-called redundant coordinate set (RCS) formulation or, through manipulations that will be detailed in a later section, it can be transformed into the corresponding underlying ODE problem, reducing the set of coordinates to the truly independent (Lagrangian) ones, following the so-called minimal coordinate set (MCS) formulation. For a review of the possible approaches, see for example [2]. This paper focuses on this latter approach.
It is worth noticing that a third approach is possible, i.e., to somehow embed the constraints in the unconstrained problem, formally preserving its original structure and unknowns. See for example the so-called augmented Lagrangian approach [3] or the force projection method [4], as discussed in [5]. In this case, the problem formally reduces as well to ODE, with all the related implications, opportunities, and limitations in terms of approaches for its numerical integration: explicit methods can be used, subjected to conditional stability limitations.
It is recognized that the reduction of the original coordinates into the MCS may be a challenging task and that their nature is local, i.e., there may not exist a generally valid choice, which works for all configurations of the system [6]. Such a choice being local, when the coordinates need to be redefined with respect to a new configuration, discontinuities are expected in the generalized coordinates (specifically, in their derivatives), although such discontinuities are not related to any physical discontinuity in the kinematics or dynamics of the system. Indeed, the motion with respect to the original coordinates is not expected to show any discontinuity, the latter being mere artifacts of a redefinition of the local coordinates across time steps.
As originally discussed in [7], this work presents a well-known and effective method for selecting a subspace of independent coordinates that is intrinsically tangent to the constraint manifold at a specific configuration, based on the QR factorization of the constraint Jacobian matrix, and discusses how to operate the redefinition of the coordinates’ subspace in a continuous manner, whenever possible, to eliminate those unnecessary, formal discontinuities.
What this work does not is advocate any superiority of the MCS over other approaches, nor any superiority of the proposed coordinate selection algorithm over others, especially in terms of performances. Being at its core a mere recombination of the coordinates, it does not substantially impact the effectiveness nor the efficiency of the solution, the required or allowed time step, nor the computational time, with the possible exception of the additional operations needed by the proposed coordinate selection, which likely add some minimal computational burden.
2 Problem description
2.1 Constrained dynamics problem formulation
A generic constrained system dynamics problem is formulated by adding \(m\) (holonomic in the present case, without excessive loss of generality, and ideal) independent kinematic constraints as the set of algebraic equations
with , to a set of \(n\) ordinary differential equations (\(n \ge m\), but usually \(n > m\)) that express the dynamics of an unconstrained system of \(n\) coordinates ,
subjected to a set of generalized forces , energetically conjugated to a virtual perturbation of the coordinates \(\delta \mathbf {x}\), where is the symmetric, positive-definite mass matrix. These equations are modified by the addition of the constraint reactions \(\mathbf {f}_{c} = - \mathbf {c}_{/\mathbf {x}}^{T} \mathrm {\boldsymbol {\lambda}}\) as follows:
where is the partial derivative of the constraint equations \(\mathbf {c}\) with respect to the coordinates \(\mathbf {x}\), namely the constraint Jacobian matrix, which is expected to be full-rank thanks to the previously assumed independence of the constraints, and is the vector of the corresponding Lagrange multipliers.
The rank of the constraint Jacobian matrix could reduce in case singular configurations are reached. This condition would be critical irrespective of the formulation in use, and thus it is not specific to the present discussion. For this reason, it is not explicitly treated.
2.2 Minimal coordinate set approach
The minimal coordinate set approach consists in defining a suitable subspace of the space spanned by the coordinates \(\mathbf {x}\) that is tangent to the constraint manifold, namely , such that
where are local, truly independent coordinates, with \(\mathrm {\boldsymbol {\beta}}'\) and \(\mathrm {\boldsymbol {\beta}}''\) defined accordingly, the former being nonzero only in case of rheonomous constraints such that
as \(\mathbf {c}_{/\mathbf {x}} {\mathbf {T}} = {\mathbf {A}} {\mathbf {T}} \equiv {\mathbf {0}}\) holds, and analogously
Suitable expressions of \(\mathrm {\boldsymbol {\beta}}'\) and \(\mathrm {\boldsymbol {\beta}}''\) are determined later.
The constrained dynamics problem, projected in such a subspace, yields
The solution is sought by first integrating Eq. (7) to obtain the generalized velocities \(\dot{\mathbf {q}}\); then, Eq. (4a) is integrated to obtain an estimate of \(\mathbf {x}\), which needs to be subsequently refined by enforcing the constraint at the position level, Eq. (1).
The cancellation of the term \({\mathbf {T}}^{T} {\mathbf {A}}^{T}\) in Eq. (7) is guaranteed by the constraint ideality assumption. When this is not the case, e.g., in the presence of friction, the Lagrange multipliers need to be computed from local equilibria. This problem is common to all MCS formulations and not specific to the present discussion.
2.3 QR factorization for optimal minimal coordinate set selection
Among the several approaches proposed in the literature [8], a suitable choice for matrix \({\mathbf {T}}\) is obtained through the QR factorization [9] of the transpose of the constraint Jacobian matrix
where matrix is orthogonal and submatrix is upper triangular. Submatrix , although not uniquely determined, represents an optimal choice for \({\mathbf {T}}\), as discussed in the following.
The velocities can then be expressed as
with \({\mathbf {Q}}_{1} \mathbf {p}' = \mathrm {\boldsymbol {\beta}}'\), such that
which yields
whereas the accelerations can be expressed as
with \({\mathbf {Q}}_{1} \mathbf {p}'' = \mathrm {\boldsymbol {\beta}}''\), such that
which yields
Notice that the inversion of matrix \({\mathbf {R}}_{1}\) is straightforward since it is triangular and nonsingular when the constraints are independent; thus, only a back substitution is needed.
According to Eqs. (7) and (9), the problem becomes
a form that resembles the one originally devised by Maggi [10, 11] and subsequently reproposed by Kane [12], nowadays known as Maggi–Kane equations.
Its integration from time \(t_{k}\) to \(t_{k+1}\) yields
where the superscript \((\cdot )^{(0)}\) indicates an estimate of the final value, pending verification that it complies with the constraint of Eq. (1). The final value of the unknown \(\mathbf {p}\) results from the iterative solution of
namely
i.e.,
where \(\left ( \mathbf {c}_{/\mathbf {x}} \right ) _{k+1}^{(i)}\) is the constraint Jacobian matrix at time \(t_{k+1}\) during the \(i\)th constraint enforcement iteration, evaluated as a function of \(\mathbf {x}_{k+1}^{(i)}\). Operator \(\text{ $+${}$=$ }\) signifies the incremental update of the left-hand side by way of the right-hand side.
2.4 Other choices for subspace selection
Other methods have been conceived to determine a suitable subspace of the unconstrained coordinates space that is intrinsically tangent to the constraint manifold. Two of them are reported here for completeness. The continuation algorithm proposed in Sect. 2.5 could be easily adapted to them.
Singular value decomposition (SVD)
The singular value decomposition [13] decomposes a matrix \({\mathbf {A}}^{T}\) into three matrices:
where matrices \({\mathbf {U}}\) and \({\mathbf {V}}\) are orthonormal (namely \({\mathbf {U}}^{T} {\mathbf {U}} \equiv {\mathbf {I}}\), \({\mathbf {V}}^{T} {\mathbf {V}} \equiv {\mathbf {I}}\)), whereas submatrix \(\mathrm {\boldsymbol {\Sigma}}_{1}\) is square and diagonal and contains the singular values of \({\mathbf {A}}\) on the main diagonal. Submatrix \({\mathbf {U}}_{2}\) plays the role of the projection matrix \({\mathbf {T}}\), as originally presented in [14].
Zero-eigenvalue theorem
Consider the spectral representation of matrix \({\mathbf {A}}^{T} {\mathbf {A}}\),
where the eigenvalue and eigenvector matrices \({\mathbf {U}}\) and \(\mathrm {\boldsymbol {\Lambda}}\) have been partitioned to isolate the blocks related to zero-valued eigenvalues from those of the nonzero ones. Submatrix \({\mathbf {U}}_{2}\) plays the role of the projection matrix \({\mathbf {T}}\) [15].
2.5 Tangent subspace selection and continuation
Submatrices \({\mathbf {Q}}_{1}\) and \({\mathbf {R}}_{1}\) are uniquely determinedFootnote 1 once matrix \({\mathbf {A}}\) is known. Submatrix \({\mathbf {Q}}_{2}\), instead, is only subjected to matrix \({\mathbf {Q}}\)’s general constraint of being orthogonal, namely and , but otherwise undefined; the dashed lines originating from the solution at point \(O\) in Fig. 1(a) represent a possible, arbitrary choice of the directions represented by the columns of submatrix \({\mathbf {Q}}_{2}\) in a 3D point mass pendulum problem. Specifically, it is defined in excess of post-multiplication by an arbitrary orthogonal matrix, : \(\tilde{{\mathbf {Q}}}_{2} = {\mathbf {Q}}_{2} {\mathbf {P}}\) also complies with the orthogonality requirement since \(\tilde{{\mathbf {Q}}}_{2}^{T} \tilde{{\mathbf {Q}}}_{2} = {\mathbf {P}}^{T} {\mathbf {Q}}_{2}^{T} {\mathbf {Q}}_{2} {\mathbf {P}} = {\mathbf {P}}^{T} {\mathbf {P}} \equiv {\mathbf {I}}\) and \(\tilde{{\mathbf {Q}}}_{2}^{T} {\mathbf {Q}}_{1} = {\mathbf {P}}^{T} {\mathbf {Q}}_{2}^{T} {\mathbf {Q}}_{1} = {\mathbf {P}}^{T} {\mathbf {0}} = {\mathbf {0}}\).
In fact, the QR factorization produces a “local” representation of the constraint Jacobian matrix; as such, the generalized coordinates associated with the subspace \({\mathbf {T}} = {\mathbf {Q}}_{2}\), which do not have any specific physical meaning, represent a local reparameterization of the subspace of the coordinates that is tangent to the constraint manifold; for example, local axes \(x\) and \(y\) originating from point \(O\) in Fig. 1(b). When the QR factorization is computed at different time steps \(t_{k}\), if \(n - m > 1\), then the columns of the resulting \({\mathbf {Q}}_{2_{k}}\) are completely unrelated, their resulting value being solely dictated by the internal intricacies of the QR factorization algorithm.
This work proposes a simple and intuitive algorithm that tracks the evolution of the subspace spanned by \({\mathbf {Q}}_{2}\) using a form of differential “continuation” to preserve some sort of spatial continuity of the generalized coordinates \(\mathbf {q}\) by minimizing the amount of deviation of the subspace that is intrinsically required to maintain \({\mathbf {Q}}_{2}\) tangent to the constraint manifold across time steps; for example, the axes originating from point \(O'\) after the solution moved there from point \(O\) in Fig. 1(c), without altering the quality of the solution.
Consider the time derivative of the transpose of the constraint Jacobian matrix in its QR factorized form:
The derivative of matrix \({\mathbf {Q}}\) may be expressed as \(\dot{{\mathbf {Q}}} = {\mathbf {Q}} \mathrm {\boldsymbol {\Omega}}\), where the skew-symmetric nature of matrix , namely \(\mathrm {\boldsymbol {\Omega}}^{T} = - \mathrm {\boldsymbol {\Omega}}\), descends from the orthogonality of matrix \({\mathbf {Q}}\):
When the problem is integrated numerically, the solution from time step \(t_{k}\) to time step \(t_{k+1}\) is computed. The QR factorization at time \(t_{k}\) yields submatrices \({\mathbf {Q}}_{1_{k}}\) and \({\mathbf {R}}_{1_{k}}\). The generalized velocities at time \(t_{k}\) are computed with reference to the subspace spanned by \({\mathbf {Q}}_{2_{k}}\). After computing the solution at the new time step, the Jacobian matrix at time \(t_{k+1}\), \({\mathbf {A}}_{k+1}\), is known. As such, through the economy QR factorization of its transpose, submatrices \({\mathbf {Q}}_{1_{k+1}}\) and \({\mathbf {R}}_{1_{k+1}}\) are determined. Instead of computing also submatrix \({\mathbf {Q}}_{2_{k+1}}\) through the full QR factorization, the proposed continuation algorithm is used as illustrated in the following. Consider
Matrix \(\dot{{\mathbf {R}}}_{1} {\mathbf {R}}_{1}^{-1}\) is the product of two upper triangular matrices, thus it is itself an upper triangular matrix. Matrix is skew-symmetric for the orthogonality of matrix \({\mathbf {Q}}_{1}\); it can be seen as \(\mathrm {\boldsymbol {\Omega}}_{1} = \mathrm {\boldsymbol {\Omega}}_{1_{L}} - \mathrm {\boldsymbol {\Omega}}_{1_{L}}^{T}\), where \(\mathrm {\boldsymbol {\Omega}}_{1_{L}} = \mathrm{stril}(\mathrm {\boldsymbol {\Omega}}_{1})\) is the strictly lower triangular part of matrix \(\mathrm {\boldsymbol {\Omega}}_{1}\), which can be obtained as
since \(\mathrm{stril} \left ( \dot{{\mathbf {R}}}_{1} {\mathbf {R}}_{1}^{-1} \right ) \equiv {\mathbf {0}}\) by definition, \(\dot{{\mathbf {R}}}_{1} {\mathbf {R}}_{1}^{-1}\) being upper triangular. From Eq. (23), one can show that the derivative of matrix \({\mathbf {Q}}\),
is entirely known (the top right block of the rightmost matrix \(\mathrm {\boldsymbol {\Omega}}\) contains matrix \(- \mathrm {\boldsymbol {\Omega}}_{21}^{T}\) instead of matrix \(\mathrm {\boldsymbol {\Omega}}_{12}\) since \(\mathrm {\boldsymbol {\Omega}}_{12} \equiv - \mathrm {\boldsymbol {\Omega}}_{21}^{T}\) owing to the skew-symmetry of \(\mathrm {\boldsymbol {\Omega}}\)). In fact, the bottom right block of matrix \(\mathrm {\boldsymbol {\Omega}}\) should contain an unknown skew-symmetric contribution . Such a matrix is arbitrarily set to zero, which corresponds to requiring that the subspace \({\mathbf {Q}}_{2}\) is modified as little as possible; specifically,
\(\mathrm {\boldsymbol {\Omega}}_{2}\) may be interpreted as the angular velocity of subspace \({\mathbf {Q}}_{2}\), the rate of reorientation with respect to itself, whereas \(\mathrm {\boldsymbol {\Omega}}_{21}\) expresses the rate of reorientation with respect to \({\mathbf {Q}}_{1}\) that is required to remain orthogonal to it during its evolution.
Thus, the subspace \({\mathbf {Q}}_{2}\) can be integrated starting from an arbitrary value, provided it is orthogonal to the initial value of \({\mathbf {Q}}_{1}\) (the value resulting from Matlab’s implementation of the QR factorization was used in the numerical examples of Sect. 3), taking appropriate measures (e.g., using Munthe–Kaas’ method [16]) to guarantee that the resulting matrix \({\mathbf {Q}}\) preserves orthogonality and submatrix \({\mathbf {Q}}_{1}\) matches that resulting from the factorization of the transpose of the constraint Jacobian matrix. For example, for \(\mathrm {\boldsymbol {\Omega}}\) constant across a time step of duration \(t_{k+1} - t_{k} = h\),
or
the latter being only a first-order approximation of the former since the intrinsic skew-symmetric structure of the exponent matrix \(\mathrm {\boldsymbol {\Omega}}\) is lost.
Submatrix \({\mathbf {Q}}_{2_{k+1}}\) resulting from the proposed integration, e.g., from Eq. (28), may need to be corrected to guarantee its orthogonality with respect to submatrix \({\mathbf {Q}}_{1_{k+1}}\) obtained from the economy QR factorization of \({\mathbf {A}}_{k+1}^{T}\); a Gram–Schmidt reorthogonalization [9] may be used.
3 Results
Simple examples are analyzed to illustrate how the proposed method produces a more regular and intuitive choice of the projection subspace during the integration of the solution.
Single-degree-of-freedom problems represent a trivial case in the context of the present discussion; in fact, the corresponding submatrix \({\mathbf {Q}}_{2}\) consists of a single column, which is thus exactly determined, except for its sign.
3.1 Single-degree-of-freedom problems: planar pendulum
A simple, single-degree-of-freedom example is considered to exemplify how the continuation algorithm avoids the occasional reversing of the sign of \({\mathbf {Q}}_{2}\) that occurs when the QR factorization of matrix \({\mathbf {A}}^{T}\) is blindly performed.
Consider the equations of motion of a simple point mass pendulum of mass \(M\) and length \(\ell \), subjected to a uniform gravity field \(g\) along the negative \(z\) direction:
where \(x\) and \(z\) are the horizontal and vertical components of the point mass position, the unconstrained coordinates in the present context, and \(\lambda \) is the Lagrange multiplier associated with the constraint of Eq. (30c). The corresponding constraint Jacobian matrix is
The QR factorization of its transpose can be written as
where matrix \({\mathbf {Q}}\) is structurally orthonormal and defined by the single parameter \(\theta \), with
as a possible determination of the parameters \(\theta \) and \(R_{1}\). Submatrices \({\mathbf {Q}}_{1}\) and \({\mathbf {Q}}_{2}\) can then be written as
The velocity and acceleration vectors of the point mass are thus
The projected equation of motion is
One may observe that redefining \(\dot{q} = \ell \dot{\theta}\) the velocity vector can be written as
which is integrable, yielding
It is worth recalling that when solving for \(\theta \) and \(R_{1}\) from Eq. (32), \({\mathbf {A}}^{T} = {\mathbf {Q}} {\mathbf {R}}\) yields
To extract \(R_{1}\), consider the norm of both sides
or
where we arbitrarily chose \(R_{1} = + 2 \ell \), but the choice with the negative sign is also legitimate. To extract \(\theta \), consider the ratio of the second and first elements:
The culprit lies in the fact that in Eq. (32) matrix \({\mathbf {Q}}\) could have been alternatively defined as
i.e., changing the sign of its second column, submatrix \({\mathbf {Q}}_{2}\), at the only cost of no longer representing a rotation matrix (since its determinant would now be −1 instead of \(+1\)), but without impacting its ability to represent the transpose of the constraint Jacobian matrix as \({\mathbf {Q}}_{1} {\mathbf {R}}_{1}\), nor that of \({\mathbf {Q}}_{2}\) to represent a suitable subspace tangent to the constraint manifold.
If an intermittent change of sign occurs between consecutive QR factorizations, the sign of the derivative of the generalized coordinate \(\dot{q}\) also changes, resulting in unnecessary discontinuities, although harmless for what concerns the result in terms of physical variables. Consider \(s_{1} = \pm 1\) as the (arbitrary) sign of \(R_{1}\) and \(s_{2} = \pm 1\) as the (arbitrary, independent from \(s_{1}\)) sign of submatrix \({\mathbf {Q}}_{2}\) such that \(s_{1}^{2} = s_{2}^{2} = 1\). The QR factorization of \({\mathbf {A}}^{T}\) then becomes
In this case, the proposed continuation algorithm yields the “angular velocity” submatrix
Considering, from Eq. (37),
one obtains
As a consequence, matrix \(\mathrm {\boldsymbol {\Omega}}\) from Eq. (23) by construction becomes
and the continued integration of matrix \({\mathbf {Q}}\) simply consists in choosing the sign of the new vector \({\mathbf {Q}}_{2}\) such that it forms the smallest possible angle with the previous one without any indetermination nor arbitrariness in the choice of \(s_{2}\) and regardless of the choice of \(s_{1}\).
3.2 Single-degree-of-freedom problems: three-dimensional slider crank
Here the proposed continuation scheme is applied to the simulation of the spatial slider-crank mechanism shown in Fig. 2. This is a rigid multibody benchmark proposed by IFToMM’s Technical Committee for Multibody DynamicsFootnote 2 [17] (https://www.iftomm-multibody.org/) and analyzed for example in [18]. The mechanism consists of a rigid crank AB of length 0.08 m, a connecting rod BC of length 0.3 m, and a rigid sliding block. The crank, connected to the ground by revolute joint A, can rotate freely from the initial position, corresponding to an angle \(\theta = 0\text{ rad}\) with an initial angular velocity of 6 rad/s. The block is constrained to the ground by a translational joint D that allows it to slide along the \(x\) axis. A spherical joint at B and a universal joint at C connect the link to the crank and the slider, respectively. A uniform gravity field of magnitude \(9.81\text{ m}/\text{s}{^{2}}\) is assumed in the negative \(z\) direction. No other load is applied to the system. The crank and sliding block masses are \(m_{c} = 0.12\text{ kg}\) and \(m_{s} = 2.0\text{ kg}\), respectively. The mass moments of inertia of the two bodies are
the mass of the connecting rod is \(m_{r} = 0.5\text{ kg}\), and its mass moments of inertia are
The problem is described by 21 coordinates, and (\(n = 1,2,3\)), and 20 constraint equations, thus possesses one degree of freedom \(q_{1}\). During the simulation, a time step size \(h = 0.00001\text{ s}\) is considered. The motion of the slider along the \(x\) direction is compared to the result proposed by Ramin Masoudi in the mentioned website and to those obtained with the traditional implementation of the QR projection method, also with \(h = 0.00001\text{ s}\), which is shown in Fig. 3. The corresponding crank angle is shown in Fig. 4. The resulting \(q_{1}\) and \(\dot{q}_{1}\) are compared in Fig. 5 and Fig. 6 to those obtained with the traditional implementation of the QR projection method. One can notice that the result of the traditional implementation differs from the proposed one only by occasional sign changes. Since the two algorithms were initialized in the same manner, using Matlab’s QR factorization and the same constraint Jacobian matrix, the initial value of \(q_{1}\) is negative in both solutions. With the proposed implementation it remains such, whereas with the traditional one it occasionally turns positive and then again negative, as dictated by the intricacies of the blind execution of the QR factorization algorithm.
3.3 Multi-degree-of-freedom problems: spatial pendulum
Consider a simple point mass spherical pendulum of mass \(M\) and length \(\ell \), subjected to a uniform gravity field \(g = 9.81\text{ m}/\text{s}^{2}\), directed along the negative \(z\) axis. Its equations of motion are
The unconstrained problem has three degrees of freedom \(x\), \(y\), and \(z\), and one constraint, Eq. (49a); thus, the constrained problem has two degrees of freedom. Consequently, and . The constraint Jacobian matrix and its time derivative are
The QR factorization of \({\mathbf {A}}^{T}\) in a given initial configuration \((x,y,z) = (x_{0},y_{0},z_{0})\) yields
where the six coefficients \(q_{ij}\), \(i=1,2,3\), \(j=2,3\) are related by five orthogonality conditions, leaving only one undetermined parameter.
Without loss of generality, let us assume that \((x_{0},y_{0},z_{0}) = (\ell ,0,0)\), which complies with the constraint equation; this yields
where \(\alpha _{0}\) is an arbitrary parameter. Clearly, when \(\alpha _{0} = 0\), the two vectors that span the subspace of \({\mathbf {Q}}_{2}\) are the coordinate axes \(y\) and \(z\).
The projected equations of motion in the initial configuration are
Without loss of generality, it is assumed that \((\dot{x}_{0},\dot{y}_{0},\dot{z}_{0}) = (0, v_{0}, 0)\), which complies with the derivative of the constraint equation in the initial configuration
in this case, one obtains
as one would expect for a diagonal element of a skew-symmetric matrix, and
thus
and
with \(\Delta \theta = v_{0} h / \ell \), which, for \(\alpha _{0} = 0\), reduces to
namely, a finite rotation about the \(z\) axis by an angle \(\Delta \theta \).
In the present example, the pendulum’s mass is \(M = 1.0\text{ kg}\) and its length is \(\ell = 0.08\text{ m}\). The initial position of the mass is \(\mathbf {r}_{0} = [0.08, 0, 0]^{T}\text{ m}\), and the initial condition on the velocity is set as \(v_{0} = 0.7895\text{ m}/\text{s}\).
The trajectory of the mass simulated using the explicit Runge–Kutta scheme proposed by Dormand and Prince [19] and implemented in Matlab’s ode45 function with \(h = 0.001\text{ s}\) is compared to that resulting from the integration of the original DAE governing equations with the free general-purpose multibody solver MBDynFootnote 3 [20] using a second-order accurate implicit linear multistep integration method with algorithmic dissipation (asymptotic spectral radius \(\rho _{\infty }= 0.6\)) [21, 22] and a projection method based on the QR factorization of the transpose of the Jacobian matrix performed at each time step, without any knowledge of its evolution, using ode45 with a time step \(h = 0.000005\text{ s}\) to act as a reference solution, as shown in Fig. 7. The resulting minimal set generalized coordinates \(q_{1}\) and \(q_{2}\) and the projected generalized velocities \(\dot{q}_{1}\) and \(\dot{q}_{2}\) (\(\dot{q}_{i} = {\mathbf {Q}}_{2}(:, i)^{T} \dot{\mathbf {x}}\)) are compared to the results obtained from what is here termed “traditional QR method” (i.e., without subspace continuation), as shown in Fig. 8 and Fig. 9, respectively. The same time step is used for integration with both the traditional and proposed coordinate selections not only for fairness of comparison, but also because the latter merely consists of a recombination of the coordinates’ subspace, without any impact on the characteristics of the equations that are integrated. One may observe that the coordinates \(q_{i}\) resulting from the proposed method are much more regular than those resulting from the traditional QR factorization. Specifically, those resulting from the proposed method appear to be continuous and differentiable, whereas those resulting from the traditional QR factorization show discontinuities in their first derivatives \(\dot{q}_{i}\).
This is well explained by the continuity and regularity of the evolution of each column of matrix \({\mathbf {Q}}_{2}\) for the proposed method, compared to the discontinuity of those resulting from the traditional QR factorization, as depicted in Fig. 10.
Furthermore, from Fig. 10 one can observe that for \(t = 0\) the first column of matrix \({\mathbf {Q}}_{2}\) corresponds to \([0, 1, 0]^{T}\), i.e., the unit vector along the \(y\) axis, whereas the second column of matrix \({\mathbf {Q}}_{2}\) corresponds to \([0, 0, 1]^{T}\), i.e., the unit vector along the \(z\) axis, i.e., the QR algorithm chose \(\alpha _{0} = 0\) in Eq. (53) when initializing the subspace \({\mathbf {Q}}_{2}\). Indeed, considering the initial velocity of the mass, one can observe that \(\dot{q}_{1}(0) \equiv v_{0}\) and \(\dot{q}_{2}(0) \equiv 0\), which is consistent with the given initial conditions.
3.4 Multi-degree-of-freedom problems: spin top
Consider an axisymmetric spin top whose tip is constrained to be at unit distance from the origin of the global coordinate system, i.e., lying on a sphere of unit radius centered in the origin. This problem was recently proposed by Haug [6]. The tip of the spin top is \(1\text{ m}\) far away from its center of mass. The problem is sketched in Fig. 11. The inertia properties of the spin top are \(m = 30\text{ kg}\) and \(\mathbf {J} = \mathrm {diag} (90,90,30)\text{ kg}\cdot \text{ m}^{2}\). The initial position of the spin top is \(\mathbf {r}_{0} = [0,-1,0]^{T}\text{ m}\). The local coordinate system \(x'\)-\(y'\)-\(z'\) is initially coincident with the global coordinate system \(x\)-\(y\)-\(z\). A uniform gravity field of magnitude \(9.81\text{ m}/\text{s}{^{2}}\) is assumed in the negative \(z\) direction. In this model, the Euler parameters \(\mathbf {e}\) are used to describe the rotation of the spin top; their initial value is \(\mathbf {e}_{0} = [1,0,0,0]^{T}\). The initial velocity is \(\dot{\mathbf {r}}_{0} = \mathbf {0}\text{ m}/\text{s}\) and the initial angular velocity is \({\mathbf {\omega}}_{0} = [0.1, 0.1, 0.3]^{T}\text{ rad}/\text{s}\). The initial derivative of the Euler parameters \(\dot{\mathbf {e}}_{0}\) is computed from \(1/2\cdot {\mathbf {E}}(\mathbf {e}_{0})\mathbf {\omega}_{0}\). The constrained equations of motion of the spin top are
where \(\mathbf {f}\) and \(\mathbf {t}\) are the applied force and torque at the mass center, respectively. Since only gravity is applied, \(\mathbf {f} = (0,0,-9.81 m)\) and \(\mathbf {t} = \mathbf {0}\) with
\(c\) denotes the constraint equation, \({\mathbf {\lambda}}\) and \(\mathbf {\mu}\) are the Lagrange multipliers corresponding to the constraint equation \(c\), Eq. (61c) and the Euler parameter normalization, Eq. (61d), respectively. The absolute position of the tip is \(\mathbf {r}_{\mathrm{T}} = \mathbf {r} + {\mathbf {A}}\mathbf {u}_{0}\), where \(\mathbf {u}_{0} = [0, 0, -1]^{T}\text{ m}\) and \(\mathbf{A}=\bar{\mathbf{E}}\mathbf{E}^{T}\) is the orientation matrix with
Therefore, the constraint equation can be expressed as
since \(\mathbf {u}_{0}^{T} \mathbf {u}_{0} \equiv 1\). The problem is described by seven coordinates, and , and two constraint equations, Eqs. (62) and (61d), thus possesses five degrees of freedom, \(q_{i}\) (\(i = 1, \ldots , 5\)).
The trajectory of the centroid resulting from the simulation using the previously mentioned method with \(h = 0.0001\text{ s}\) is compared in Fig. 12 to those obtained by integrating the original DAE system using MBDyn and by using the traditional QR method, also with \(h = 0.0001\text{ s}\). The projection motion of \(q_{i}\) (\(i = 1,\ldots ,5\)) is compared to the results of the traditional QR method without any projection in Fig. 13, whereas that of \(\dot{q}_{i}\) (\(i = 1,\ldots ,5\)) is compared to the results of the traditional QR method without any projection in Fig. 14. Again, one can notice the much greater regularity of the coordinates and their derivatives as they result from the proposed method.
4 Conclusions
This paper presented a continuation algorithm for the redefinition of the subspace of minimal coordinates that is tangent to the constraint manifold. It is based on the full QR factorization of the constraint Jacobian matrix to initialize the subspace through the portion of the space defined by the orthogonal matrix Q that is orthogonal to the constraint Jacobian matrix. The economy QR factorization is then used to exactly factor the subspace in which the constraint Jacobian matrix lies, while the evolution of the tangent subspace is tracked by integrating the time derivative of matrix Q, eventually re-orthogonalizing the result to eliminate possible drift from the integrated tangent subspace. Numerical examples show that the analysis results are unchanged, but the generalized velocities no longer show the discontinuities that occasionally characterize them when the tangent subspace is recomputed without considering its value at the previous time step.
Notes
To this end, we need to choose the diagonal elements of \({\mathbf {R}}_{1}\) to be nonnegative, for example, a zero value indicating indetermination.
See https://www.iftomm-multibody.org/benchmark/problem/Spatial_rigid_slider-crank_mechanism/ for further details.
References
Bauchau, O.A., Laulusa, A.: Review of contemporary approaches for constraint enforcement in multibody systems. J. Comput. Nonlinear Dyn. 3(1), 011005 (2008). https://doi.org/10.1115/1.2803258
Laulusa, A., Bauchau, O.A.: Review of classical approaches for constraint enforcement in multibody systems. J. Comput. Nonlinear Dyn. 3(1), 011004 (2008). https://doi.org/10.1115/1.2803257
Bayo, E., García de Jalón, J., Serna, M.A.: A modified Lagrangian formulation for the dynamic analysis of constrained mechanical systems. Comput. Methods Appl. Mech. Eng. 71(2), 183–195 (1988). https://doi.org/10.1016/0045-7825(88)90085-0
Masarati, P.: Adding kinematic constraints to purely differential dynamics. Comput. Mech. 47(2), 187–203 (2011). https://doi.org/10.1007/s00466-010-0539-4
González, F., Masarati, P., Cuadrado, J., Naya, M.A.: Assessment of linearization approaches for multibody dynamics formulations. J. Comput. Nonlinear Dyn. 12(4), 041009 (2017). https://doi.org/10.1115/1.4035410
Haug, E.J.: Multibody dynamics on differentiable manifolds. J. Comput. Nonlinear Dyn. 16(4), 041003 (2021). https://doi.org/10.1115/1.4049995.
Zhou, P., Zanoni, A., Masarati, P.: Projection continuation for minimal coordinate set dynamics of constrained systems. In: ECCOMAS Thematic Conference on Multibody Dynamics, Budapest, Hungary (online), December 12–15 2021
Mariti, L., Belfiore, N.P., Pennestrì, E., Valentini, P.P.: Comparison of solution strategies for multibody dynamics equations. Int. J. Numer. Methods Eng. (2011). https://doi.org/10.1002/nme.3190
Golub, G.H., Van Loan, C.F.: Matrix Computations, 3rd edn. The Johns Hopkins University Press, Baltimore and London (1996)
Maggi, G.A.: Principii della teoria matematica del movimento dei corpi. Ulrico Hoepli, Milano (1896)
Maggi, G.A.: Principii di stereodinamica: Corso sulla formazione, l’interpretazione e l’integrazione delle equazioni del movimento dei solidi. Hoepli, Milano (1903). In Italian
Kane, T.R., Wang, C.F.: On the derivation of equations of motion. J. Soc. Ind. Appl. Math. 13(2), 487–492 (1965)
Van Loan, C.F.: Generalizing the singular value decomposition. SIAM J. Numer. Anal. 13(1), 76–83 (1976). https://doi.org/10.1137/0713009
Mani, N.K., Haug, E.J., Atkinson, K.E.: Application of singular value decomposition for analysis of mechanical system dynamics. J. Mech. Transm. Autom. Des. 107(1), 82–87 (1985). https://doi.org/10.1115/1.3258699
Steeves, E.C., Walton, W.C. Jr.: A new matrix theorem and its application for establishing independent coordinates for complex dynamical systems with constraints. TR R-326, NASA (1969)
Munthe-Kaas, H.: High order Runge-Kutta methods on manifolds. Appl. Numer. Math. 29(1), 115–127 (1999). https://doi.org/10.1016/S0168-9274(98)00030-0
Masoudi, R., Uchida, T., Vilela, D., Luaces, A., Cuadrado, J., McPhee, J.: A library of computational benchmark problems for the multibody dynamics community. In: Multibody 2013, Zagreb, Croatia, July 1–4 2013
Sonneville, M., Brüls, O.: A formulation on the special Euclidean group for dynamic analysis of multibody systems. J. Comput. Nonlinear Dyn. 9(4), 041002 (2014). https://doi.org/10.1115/1.4026569
Dormand, J.R., Prince, P.J.: A family of embedded Runge-Kutta formulae. J. Comput. Appl. Math. 6(1), 19–26 (1980). https://doi.org/10.1016/0771-050X(80)90013-3
Masarati, P., Morandini, M., Mantegazza, P.: An efficient formulation for general-purpose multibody/multiphysics analysis. J. Comput. Nonlinear Dyn. 9(4), 041001 (2014). https://doi.org/10.1115/1.4025628
Zhang, H., Zhang, R., Masarati, P.: Improved second-order unconditionally stable schemes of linear multi-step and equivalent single-step integration methods. Comput. Mech. 67(1), 289–313 (2021). https://doi.org/10.1007/s00466-020-01933-y
Zhang, H., Zhang, R., Zanoni, A., Masarati, P.: Performance of implicit A-stable time integration methods for multibody system dynamics. Multibody Syst. Dyn. 54(3), 263–301 (2022). https://doi.org/10.1007/s11044-021-09806-9
Acknowledgements
The first author acknowledges support from the China Scholarship Council.
Funding
Open access funding provided by Politecnico di Milano within the CRUI-CARE Agreement.
Author information
Authors and Affiliations
Corresponding author
Ethics declarations
Competing Interests
The authors declare that they have no conflict of interest.
Additional information
Publisher’s Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.
About this article
Cite this article
Zhou, P., Zanoni, A. & Masarati, P. A projection continuation approach for minimal coordinate set constrained dynamics. Multibody Syst Dyn 57, 237–257 (2023). https://doi.org/10.1007/s11044-023-09882-z
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s11044-023-09882-z