1 Introduction

Investigation of the dynamics of multibody mechanical systems subject to motion constraints is necessary for enhancing the understanding of their behavior through an improvement of their theoretical formulation. This, in turn, leads to development of more efficient and robust numerical techniques, which are useful in solving challenging engineering problems and yielding better designs in several technical areas, including mechanisms, biomechanics, automotive, railway, marine and aerospace structures [1,2,3,4,5,6]. Usually, the equations of motion governing the behavior of such systems are represented by a set of differential-algebraic equations (DAEs) of high index. Since the treatment of these equations is a delicate task [7], much research effort has been devoted to the subject in the past, in order to cure the problems related to a DAE modeling. Essentially, all the previous efforts are based on application of index reduction or coordinate partitioning techniques [5, 6]. In contrast, the main objective of the present work is to first employ a better theoretical foundation and then proceed to the development of more advanced numerical schemes for treating this particular class of dynamical systems in a more effective manner.

In the new approach, the equations of motion employed are a coupled set of second-order nonlinear ordinary differential equations (ODEs) in both the generalized coordinates and the Lagrange multipliers related to the constraint action. This is achieved by combining some fundamental concepts of analytical dynamics and differential geometry, which causes a natural elimination of singularities associated with DAE formulations from the onset [8, 9]. This leads to major advantages compared to previous work in the area of computational multibody dynamics [5, 6]. In the present work, since the ulterior motive is the development of an efficient numerical integration scheme, these equations are first put in a convenient weak form. Moreover, the position, velocity and momentum type quantities are assumed to be independent, yielding a three-field set of equations [10,11,12]. It is then shown that the final set of equations of motion can be obtained by application of an alternative augmented Lagrangian formulation, after adding appropriate penalty terms to a suitably selected objective function. For this, a theoretical connection to a min–max unconstrained optimization problem is first revealed and investigated in depth [13,14,15]. Next, this formulation is employed as a basis for producing a numerically effective time integration scheme. The validity of this scheme is then investigated and illustrated by applying it to several example systems. Based on these results, it is demonstrated that the new scheme passes successfully all the tests related to a special set of challenging benchmark problems in multibody dynamics, involving redundant constraints or singular configurations [16]. Finally, the new scheme was also applied to a complex industrial application, referring to a model of a real ground vehicle, with equal success.

The material of this paper is organized as follows. First, the equations of motion of an unconstrained mechanical system are presented briefly in Sect. 2. Then, a similar set of equations arising after imposing a system of equality motion constraints is included in Sect. 3. In both cases, these equations appear first in a strong form and are subsequently presented in an appropriate three-field weak form. Then, after introducing a suitable penalty and a Lagrange multiplier formulation, in Sects. 4 and 5, respectively, these equations are put eventually in an augmented Lagrangian form in Sect. 6. In the same section, it is shown that an equivalent form can also be obtained by just adding the same penalty terms to a selected objective function, expressing the dynamics in a complete manner. Using this form, a temporal discretization scheme is then developed and selected numerical results are presented for several mechanical examples in Sect. 7. Finally, a summary of the main results, together with possible future extensions, are included in the last section.

2 Strong and weak form of equations of motion for systems with no constraints

This work employs a new set of equations of motion, obtained for a class of multibody mechanical systems, consisting of rigid or discretized deformable bodies and subject to equality motion constraints, by applying tools of analytical dynamics [9]. First, the location of the members of these systems is determined by a finite number of generalized coordinates \(q=(q^{1}\ldots q^{n})\), for any time t [1, 2]. Then, the motion of the system can be viewed as the motion of a fictitious point p along a special curve of the configuration manifold M. The tangent vector to this curve represents a generalized velocity and belongs to an n-dimensional vector space \(T_p M\), known as the tangent space of manifold M at point p [3]. Consequently, if \({\mathfrak {B}}_e =\{{\begin{array}{ccc} {\underline{e}_{ 1} }&{} \ldots &{} {\underline{e}_{ n} \}} \\ \end{array} }\) is a basis of \(T_p M\), then vector is decomposed in the form , by using the common summation convention on repeated indices [17]. In dynamics, the elements of the dual vector space \(T_p^{*} M\) represent generalized momenta. Also, the correspondence between a vector \(\underline{u}\) and a covector , belonging to \(T_p M\) and \(T_p^{*} M\), respectively, is established through the duality pairing

(1)

where \(\langle \cdot ,\cdot \rangle \) is the inner product of \(T_p M\) [18]. Then, a dual basis to \({\mathfrak {B}}_e \) can be constructed for \(T_p^{*} M\) by using the condition , where the last term is a Kronecker’s delta.

In this section, it is assumed next that there are no motion constraints, so that the set of coordinates is minimal, for convenience in introducing some of the main ideas. In such a case, determination of the natural (true) path on manifold M is performed by applying Newton’s law of motion in the form

(2)

The quantities represent generalized momenta and applied forces, respectively [3, 8]. In fact, application of Eq. (1) leads to the equation

(3)

relating the components of the generalized momenta to those of the corresponding generalized velocities through the components \(g_{{\textit{ij}}} \) of the metric tensor at point p. Typically, the quantities \(g_{{\textit{ij}}} \) are selected to coincide with the elements of the mass matrix of the system, defined by its kinetic energy. Also, the derivative term in Eq. (2) can be expressed in the component form

(4)

where \(\nabla \) represents the affine connection of the manifold, having components \(\Lambda _{{\textit{ij}}}^k \) in the selected basis, which are known as affinities [17].

Next, starting from the equations of motion (2) one arrives easily first at the result

(5)

Moreover, integrating along the natural trajectory, within any time interval \([t_1 ,t_2 ]\), yields

(6)

which represents a weak form of the equations of motion. Also, in order to exploit certain advantages of a weak formulation, the position, velocity and momentum variables are considered as independent quantities [10]. For this, a new velocity field \(\underline{\upsilon }\) is introduced on manifold M, which is forced to become identical to the true velocity field . Eventually, the weak form appears as

(7)

where the term \(\tau _{{\textit{ij}}}^\ell \) represents components of the torsion of the connection selected on manifold M, the quantities \(\sigma _{{\textit{ij}}}^\ell \) are components of an antisymmetric tensor, with \(\sigma _{j i}^\ell =-\sigma _{{\textit{ij}}}^\ell \), the terms \(\delta \pi _i \) and \(\pi _i \) are components of covectors belonging to the cotangent space \(T_p^{*} M\) (see [12] for more details), while

$$\begin{aligned} \frac{D\pi _i }{D t}=\dot{\pi }_i -\Lambda _{j i}^\ell \pi _\ell \upsilon ^{j}. \end{aligned}$$
(8)

The quantities \(w^{i}\), \(\delta \upsilon ^{i}\) and \(\delta \pi _i \) are evaluated by taking into account that a variation of any scalar function f(q) on M is defined as the derivative of f along an arbitrary vector \(\underline{w}\), according to

$$\begin{aligned} \delta f\equiv \underline{w}(f)=\frac{\partial f}{\partial q^{i}} w^{i}. \end{aligned}$$
(9)

For each holonomic coordinate, this yields \(w^{i}=\delta q^{i}\), while a little more involved relation is obtained in case of nonholonomic coordinates [12, 19]. Then, the equations of motion can be recovered in first-order strong form by collecting terms multiplying the variations \(w^{i}\), \(\delta \upsilon ^{i}\) and \(\delta \pi _i \), which are independent for all \(i=1,\ldots ,n\), by construction. Alternatively, Eq. (7) provides a foundation for developing an appropriate time integration scheme.

3 Strong and weak form of equations of motion for systems with bilateral constraints

The mechanical systems examined in this section belong to a class of multibody systems subject to a set of motion constraints. For simplicity in the presentation, these constraints are assumed to be scleronomic and are put in the form

(10)

where \(A=[a_i^R ]\) is a \(k\times n\) matrix with known elements. In particular, for a holonomic constraint, the corresponding equation can be integrated and put in the form

$$\begin{aligned} \phi ^{R}(q)=0. \end{aligned}$$
(11)

Then, it was shown in an earlier study that the equations of motion on manifold M, expressed by Eq. (2) originally are replaced by

(12)

where

(13)

with

(14)

and

(15)

with

$$\begin{aligned} h_R =({\bar{m}}_{{\textit{RR}}} \dot{\lambda }^{R})^{{\varvec{\cdot }}}+{\bar{c}}_{{\textit{RR}}} \dot{\lambda }^{R}+{\bar{k}}_{{\textit{RR}}} \lambda ^{R}-{\bar{f}}_R . \end{aligned}$$
(16)

Each linear operator

(17)

in Eq. (15) acts from the cotangent space of a single dimensional manifold \(M_R \), defined for each constraint (\(R=1,\ldots ,k\)), with a base vector , to \(T_p^*M\) [9]. Also, the convention on repeated indices does not apply to index R, while the coefficients

(18)

are obtained through a projection along special directions \(\underline{c}_{ R} \) on \(T_p M\), determined by the constraints. Namely, the components of the n-vector \(\underline{c}_{ R} \) are chosen so that

$$\begin{aligned} a_i^R c_R^i =1. \end{aligned}$$
(19)

Finally, the only condition in selecting the coefficients \({\bar{c}}_{{\textit{RR}}} \) and \({\bar{k}}_{{\textit{RR}}} \) is that they must cause a force bringing the figurative point back to the natural trajectory, when a violation tends to develop along direction \(\underline{c}_{ R} \) [9]. For instance, when the applied forces depend on q and , a convenient choice is

(20)

By introducing the matrix notation

$$\begin{aligned}&\underline{q}=({\begin{array}{ccc} {q^{1}}&\cdots&{q^{n}}\end{array}})^{T}, \quad \underline{\lambda }=({\begin{array}{ccc} {\lambda ^{1}}&\cdots&{\lambda ^{k}}\end{array}})^{T} ,\\&M=[g_{{\textit{ij}}} ]\quad \mathrm{and}\quad \underline{f}=({\begin{array}{ccc} {f_1 }&\cdots&{f_n}\end{array}})^{T}, \end{aligned}$$

Equations (12)–(16) can be combined and put in the general form

$$\begin{aligned}&(M(\underline{q}) \dot{\underline{q}})^{{\varvec{\cdot }}}+\underline{h} (\underline{q},\dot{\underline{q}})\nonumber \\&\quad \qquad =\underline{f}(\underline{q},\dot{\underline{q}},t)\!+\!A^{T}(\underline{q})[({\bar{M}}\dot{\underline{\lambda }})^{{\varvec{\cdot }} }\!+\!{\bar{C}}\dot{\underline{\lambda }}+{\bar{K}}\underline{\lambda }-{\bar{\underline{f}}}],\nonumber \\ \end{aligned}$$
(21)

when holonomic coordinates are employed. The term \(\underline{h}(\underline{q},{\dot{\underline{q}}})\) includes the classical quadratic velocity terms [1, 5], while the elements of the diagonal matrices

$$\begin{aligned}&{\bar{M}}={\textit{diag}}({\begin{array}{ccc} {{\bar{m}}_{11} }&{} \cdots &{} {{\bar{m}}_{kk} } \\ \end{array} }), \quad {\bar{C}}={\textit{diag}}({\begin{array}{ccc} {{\bar{c}}_{11} }&{} \cdots &{} {{\bar{c}}_{kk} } \\ \end{array} }),\\&{\bar{K}}={\textit{diag}}({\begin{array}{ccc} {{\bar{k}}_{11} }&{} \cdots &{} {{\bar{k}}_{kk} } \\ \end{array} }) \end{aligned}$$

and array \({{\bar{f}}}\) are determined by Eqs. (18) and (20). The major difference with the classical approaches lies in the last term of Eq. (21), representing the constraint forces. Specifically, in all current analytical formulations, only the “static” term \(A^{\mathrm{T}}\underline{\lambda }\) appears in its place. In addition, Eq. (21) represents a set of n second-order coupled strongly nonlinear ODEs in the \(n+k\) unknowns \(q^{i}\) and \(\lambda ^{R}\). The cases involving quasi-coordinates are also covered by the same equations [12, 19]. Moreover, a complete mathematical formulation is obtained after including the k equations of the constraints, which are expressed originally by Eq. (10). In particular, it was shown analytically that each holonomic or nonholonomic constraint is represented by a second-order ODE in the form

$$\begin{aligned}&g_R =({\bar{m}}_{{\textit{RR}}} \dot{\phi }^{R})^{{\varvec{\cdot }} }+{\bar{c}}_{{\textit{RR}}} \dot{\phi }^{R}+{\bar{k}}_{{\textit{RR}}} \phi ^{R}=0\quad {\mathrm{or}} \nonumber \\&g_R =({\bar{m}}_{{\textit{RR}}} \dot{\psi }^{R})^{{\varvec{\cdot }} }+{\bar{c}}_{{\textit{RR}}} \dot{\psi }^{R}=0. \end{aligned}$$
(22)

Theoretically, this forces \(\phi ^{R}\) or \(\dot{\psi }^{R}\), respectively, to become zero for \(R=1,\ldots ,k\) [9]. Therefore, each holonomic and nonholonomic constraint is satisfied at the position and velocity level, respectively. The last equations appear in a form which presents some similarity to the Baumgarte stabilization approach [4,5,6]. However, besides the more general form of the second-order term, the fundamental difference is that the coefficient \({\bar{m}}_{{\textit{RR}}}\) is selected analytically by Eq. (18) and is not set equal to one (\({\bar{m}}_{{\textit{RR}}} =1\)) arbitrarily for all constraints. This parameter is shown to play a critical role in the presentation of the numerical results. In addition, Baumgarte stabilization applies to the constraint equations only and does not add any term in Eq. (21), which thus remains a DAE.

The theoretical approach employed brings significant advantages when compared to other approaches applied so far in the field of analytical mechanics and multibody dynamics in particular. These advantages are related to a physically consistent and correct elimination of the singularities associated with the usual sets of high-index DAEs of motion, in the sense that the presence of algebraic equations for holonomic constraints or first-order ODEs for nonholonomic constraints are related to dynamics of degrees of freedom with no mass [5, 6]. Taking into account Eq. (12) and following the same steps that gave rise to Eq. (6), leads first to

(23)

Eventually, by performing lengthy manipulations, it was shown in [12] that this leads to the following equation

(24)

The derivative \({D\pi _i }/{D t}\) is given by Eq. (8), while

$$\begin{aligned} \frac{Da_i^R }{D t}=\dot{a}_{ i}^R -\Lambda _{j i}^\ell a_\ell ^R \upsilon ^{j}. \end{aligned}$$
(25)

Moreover, the variations \(w^{i}\) (representing \(\delta q^{i}\) or \(\delta \vartheta ^{i}\) for a true or a pseudo-coordinate, respectively), \(\delta \lambda ^{R}\), \(\delta \upsilon ^{i}\), \(\delta \mu ^{R}\), \(\delta \pi _i \) and \(\delta \sigma _R \) are independent for all \(i=1,\ldots ,n\) and \(R=1,\ldots ,k\). Therefore, collecting the terms in Eq. (24) multiplied by \(\delta \upsilon ^{i}\) and \(\delta \mu ^{R}\) yields first

$$\begin{aligned} \int _{t_1 }^{t_2 } {(\pi _i -p_i +\sum \nolimits _{R=1}^k {a_{ i}^R {\bar{m}}_{{\textit{RR}}} \mu ^{R}} )\delta \upsilon ^{i} \mathrm{d} t} =0 \end{aligned}$$
(26)

and

$$\begin{aligned} \int _{t_1 }^{t_2 } {(\sigma _R -{\bar{m}}_{{\textit{RR}}} \dot{\phi }^{R})\delta \mu ^{R}\mathrm{d} t} =0, \end{aligned}$$
(27)

respectively. Likewise, selecting the terms in Eq. (24) multiplied by \(\delta \pi _i \) and \(\delta \sigma _R \) leads to

(28)

and

$$\begin{aligned} \int _{t_1 }^{t_2 } {\delta \sigma _R (\mu ^{R}-\dot{\lambda }^{R}) d t} =0, \end{aligned}$$
(29)

respectively. Finally, collecting the terms of Eq. (24) multiplied with the variations \(w^{i}\) and \(\delta \lambda ^{R}\), yields

$$\begin{aligned}&(p_i -\sum \nolimits _{R=1}^k {a_{ i}^R {\bar{m}}_{{\textit{RR}}} \mu ^{R}} -\pi _i )\left. {w^{i}} \right| _{t_1 }^{t_2 } \nonumber \\&\quad -\,\int _{t_1 }^{t_2 } \{(\pi _\ell +\sum \nolimits _{R=1}^k {a_\ell ^R {\bar{m}}_{{\textit{RR}}} \mu ^{R}} -p_\ell ) \nonumber \\&\quad ~~~~~~~~~~~~\, \times (\tau _{{\textit{ij}}}^\ell -\Lambda _{{\textit{ij}}}^\ell +\sigma _{{\textit{ij}}}^\ell )\upsilon ^{j}+f_i -\frac{D\pi _i }{D t} \nonumber \\&\quad ~~~~~~~~~~~~\, +\,\sum \nolimits _{R=1}^k [a_{ i}^R ({\bar{c}}_{{\textit{RR}}} \mu ^{R}+{\bar{k}}_{{\textit{RR}}} \lambda ^{R}-{\bar{f}}_R )\nonumber \\&\qquad \qquad \quad \qquad \qquad \quad \,-{\bar{m}}_{{\textit{RR}}} \mu ^{R}\frac{Da_i^R }{D t}] \}w^{i} \mathrm{d} t=0 \end{aligned}$$
(30)

and

$$\begin{aligned}&({\bar{m}}_{{\textit{RR}}} \dot{\phi }^{R}-\sigma _R )\left. {\delta \lambda ^{R}} \right| _{t_1 }^{t_2 } \nonumber \\&\quad +\int _{t_1 }^{t_2 } {(\dot{\sigma }_R +{\bar{c}}_{{\textit{RR}}} \dot{\phi }^{R}+{\bar{k}}_{{\textit{RR}}} \phi ^{R})\delta \lambda ^{R}\mathrm{d} t} =0, \end{aligned}$$
(31)

respectively. The relations expressed by Eqs. (26)–(31) lead to a coupled set of nonlinear algebraic equations and provide a foundation for developing suitable schemes for the numerical integration of the equations of motion. This process is explained in Sect. 6, after introducing an alternative augmented Lagrangian formulation, leading to a more effective numerical handling of these equations.

Finally, Eq. (7) can be obtained directly by Eq. (24), after eliminating the terms related to the bilateral constraints. This also leads to a simultaneous elimination of Eqs. (27), (29) and (31). In addition, Eqs. (26), (28) and (30) are replaced by the simpler set

and

$$\begin{aligned}&(p_i -\pi _i )\left. {w^{i}} \right| _{t_1 }^{t_2 } +\int _{t_1 }^{t_2 } [(p_\ell -\pi _\ell )(\tau _{{\textit{ij}}}^\ell -\Lambda _{{\textit{ij}}}^\ell +\sigma _{{\textit{ij}}}^\ell )\upsilon ^{j}\nonumber \\&~~~~~~\qquad \qquad \qquad \qquad \qquad +f_i -\frac{D\pi _i }{D t}]w^{i}\mathrm{d} t =0. \end{aligned}$$

4 Systems with bilateral constraints: penalty formulation

Starting from an unconstrained system and after defining the objective function

(32)

it is straightforward to show, by employing first Eq. (13) and then Eq. (9), that

(33)

with \(\delta {\mathcal {F}}_M =\underline{w}(\mathcal {F}_M )\) and \(\delta h_j =\underline{w}(h_j )\), for any vector \(\underline{w}\) of the tangent space \(T_p M\). Since the variations \(\delta h_j \) are independent, the quantities \({\hat{w}}^{i}=g^{{\textit{ij}}}\delta h_j \) represent components of a new arbitrary vector \({\hat{\underline{w}}}\) on \(T_p M\). Consequently, imposing the optimality condition

$$\begin{aligned} \delta {\mathcal {F}}_M =0, \end{aligned}$$
(34)

Equation (33) can be cast in the form

which is equivalent to Eq. (5). Furthermore, taking into account that the inverse metric matrix \(G^{-1}=[g^{{\textit{ij}}}]\) is positive definite, Eq. (34) in conjunction with Eq. (33) implies that

$$\begin{aligned} h_i =0\quad (i=1,\ldots ,n), \end{aligned}$$
(35)

which coincides with the components of the corresponding equation of motion, expressed by Eq. (2).

Application of condition (34) leads to minimization of the objective function defined by Eq. (32) with respect to the covector , i.e., . In this way, the original problem of setting up the equations of motion for the class of systems examined is converted to an equivalent minimization problem, which is an approach taken frequently in Mechanics [20]. In fact, minimization of function \({\mathcal {F}}_M \) with respect to , can be seen as a generalization of the classical Gauss principle [21]. This becomes clear by considering Eqs. (3) and (14), revealing that the components of covector include terms which are time derivatives of the generalized momenta and are thus quantities related to acceleration.

Next, in view of Eq. (32) and taking into account the motion constraints expressed by Eq. (10) or alternatively by Eq. (22), consideration of the motion constraints transforms the previous problem to a constrained optimization problem, seeking a minimum of function \({\mathcal {F}}_M \) subject to the constraints expressed by Eq. (22). Namely, it leads to the problem

(36)

Then, combining the above, the formulation can be converted to the unconstrained problem

(37)

with and , where the positive constants \(\xi _R \) are known as penalty factors and means that \(\xi _R \rightarrow \infty \) for any \(R=1,\ldots ,k\), while

(38)

More specifically, the new composite function \(\mathcal {F}_P \) originates by augmenting \(\mathcal {F}_M \) with a weighted sum of the norms of the special covectors

(39)

Proceeding in a way similar to that leading to Eq. (33), the new objective function is first put in the form

$$\begin{aligned} {\mathcal {F}}_P =\tfrac{1}{2}h_i g^{{\textit{ij}}}h_j +\tfrac{1}{2}\sum \nolimits _{R=1}^k {\xi _R \beta ^{R}g_R^2 } , \end{aligned}$$
(40)

with

(41)

Then, taking a variation of function \(\mathcal {F}_P \), it is a straightforward task to show that

$$\begin{aligned} \delta {\mathcal {F}}_P =\frac{\partial \mathcal {F}_P }{\partial h_{ i} }\delta h_i +\sum \nolimits _{R=1}^k {\frac{\partial \mathcal {F}_P }{\partial g_R }\delta g_R } , \end{aligned}$$
(42)

with

$$\begin{aligned} \frac{\partial {\mathcal {F}}_P }{\partial h_{ i} }=h_j g^{{\textit{ij}}}\quad \mathrm{and}\quad \frac{\partial {\mathcal {F}}_P }{\partial g_R }=g_R \beta ^{R}. \end{aligned}$$
(43)

The second part of the variation in Eq. (42), multiplied by the terms \(\delta g_R \) and arising from the contribution of the covectors defined by Eq. (39), is not independent but is related to the variation of covector through the motion constraints. By definition, these covectors span the vertical space \(V_T^*\) of \(T_p^*M\) [9]. This implies that the covector with components \(\delta h_i -\sum \nolimits _{R=1}^k {a_i^R \delta g_R } \) must belong to the horizontal space \(H_S^*\) of \(T_p^*M\). Consequently, it should be normal to each of the constraint covectors , which span \(V_T^*\). This means that

(44)

and leads eventually to

$$\begin{aligned} \delta g_R ={\delta h_i g^{{\textit{ij}}}a_{ j}^R }/{\beta ^{R}}\quad (R=1,\ldots ,k). \end{aligned}$$
(45)

Next, substitution of Eqs. (43) and (45) in Eq. (42) and imposing the optimality condition

$$\begin{aligned} \delta {\mathcal {F}}_P =0 \end{aligned}$$
(46)

leads first to

$$\begin{aligned} (h_j g^{{\textit{ij}}}+\sum \nolimits _{R=1}^k {\xi _R g_R a_j^R } g^{{\textit{ij}}}) \delta h_i =0 \end{aligned}$$

and subsequently to

$$\begin{aligned} (h_j +\sum \nolimits _{R=1}^k {\xi _R g_R a_j^R } ) g^{{\textit{ij}}}=0, \end{aligned}$$
(47)

since the variations \(\delta h_i \) are independent. Moreover, based on the fact that the matrix \(G^{-1}=[g^{{\textit{ij}}}]\) is positive definite, the last relation yields

$$\begin{aligned} h_j +\sum \nolimits _{R=1}^k {\xi _R g_R a_j^R } =0. \end{aligned}$$
(48)

In the limit \(\xi _R \rightarrow \infty \), the constraint equations satisfy \(g_R \rightarrow 0\), in a way leading to \(\xi _R g_R \rightarrow -h_R \) [13], so that the last result coincides with the component form of the equations of motion (12).

5 Systems with bilateral constraints: Lagrange multiplier formulation

Following steps which are similar to those applied in optimization of ordinary functions under constraints [14, 21, 22], the penalty formulation presented in the previous section can be converted to an unconstrained min–max problem

(49)

through definition of a suitable Lagrangian function

(50)

with , \(h_{\lambda R} =h_R \) and

(51)

Proceeding in a way similar to that leading to Eq. (40), the new objective function is first put in the form

$$\begin{aligned} {\mathcal {F}}_L =\tfrac{1}{2}h_i g^{{\textit{ij}}}h_j -\sum \nolimits _{R=1}^k {\beta ^{R}h_R g_R } . \end{aligned}$$
(52)

Then, taking a variation of this function, it turns out that

$$\begin{aligned} \delta {\mathcal {F}}_L =\frac{\partial {\mathcal {F}}_L }{\partial h_i }\delta h_i +\sum \nolimits _{R=1}^k {(\frac{\partial {\mathcal {F}}_L }{\partial h_R }\delta h_R +\frac{\partial {\mathcal {F}}_L }{\partial g_R }\delta g_R )} ,\nonumber \\ \end{aligned}$$
(53)

with

$$\begin{aligned} \frac{\partial {\mathcal {F}}_L }{\partial h_R }=-g_R \beta ^{R}. \end{aligned}$$
(54)

Next, substituting Eqs. (54) and (45) in Eq. (53) and imposing the optimality condition

$$\begin{aligned} \delta {\mathcal {F}}_L =0 \end{aligned}$$
(55)

leads eventually to

$$\begin{aligned}&(h_j g^{{\textit{ij}}}\!-\!\sum \nolimits _{R=1}^k {h_R a_j^R } g^{{\textit{ij}}}) \delta h_i\!-\!\sum \nolimits _{R=1}^k {\beta ^{R}g_R \delta h_R } =0. \end{aligned}$$

Since the variations \(\delta h_i \) and \(\delta h_R \) are independent, the matrix \(G^{-1}=[g^{{\textit{ij}}}]\) is positive definite and \(\beta ^{R}>0\), the last equation gives rise to the following set of equations

$$\begin{aligned}&h_i -\sum \nolimits _{R=1}^k {h_R a_i^R } =0\quad (i=1,\ldots ,n) \quad \mathrm{and}\nonumber \\&~~~~~~~~~~~~~~~~~~~~~~~\quad g_R =0\quad (R=1,\ldots ,k). \end{aligned}$$
(56)

These equations coincide with the equations of motion for the class of systems examined.

6 Systems with bilateral constraints: augmented Lagrangian formulation

The penalty formulation and the Lagrange multiplier formulation, presented in the last two sections, can be combined in order to take full advantage of their properties and reduce their disadvantages [13, 14]. This leads to a new unconstrained min–max problem

(57)

through definition of the classical augmented Lagrangian function

(58)

Proceeding in a way similar to that leading to Eqs. (33) and (40), the new objective function is first put in the form

$$\begin{aligned} {\mathcal {F}}_A= & {} \tfrac{1}{2}h_i g^{{\textit{ij}}}h_j +\tfrac{1}{2}\sum \nolimits _{R=1}^k {\xi _R \beta ^{R}g_R^2 } \nonumber \\&-\,\sum \nolimits _{R=1}^k {\beta ^{R}h_R g_R } . \end{aligned}$$
(59)

Then, taking variation of this function as in Eq. (50) and making use of Eq. (45), it eventually turns out that

$$\begin{aligned} \delta {\mathcal {F}}_A= & {} [h_j g^{{\textit{ij}}}+\sum \nolimits _{R=1}^k {(\xi _R g_R -h_R )a_j^R } g^{{\textit{ij}}}] \delta h_i \nonumber \\&-\,\sum \nolimits _{R=1}^k {\beta ^{R}g_R \delta h_R } =0. \end{aligned}$$
(60)

Since the variations \(\delta h_i \) and \(\delta h_R \) are independent, the matrix \(G^{-1}=[g^{{\textit{ij}}}]\) is positive definite and \(\beta ^{R}>0\), the last equation yields

$$\begin{aligned}&h_i +\sum \nolimits _{R=1}^k {(\xi _R g_R -h_R )a_i^R } =0\quad (i=1,\ldots ,n)\nonumber \\&\mathrm{and}\quad g_R =0\quad (R=1,\ldots ,k). \end{aligned}$$
(61)

Obviously, the last results coincide with the equations of motion of the class of systems examined, as \(g_R \rightarrow 0\), without the need to approach a limit \(\xi _R \rightarrow \infty \). This leads to significant computational benefits [13, 14].

Alternatively, an identical set of equations of motion emerges by using the objective function

(62)

instead of that given by Eq. (58). To show this, Eq. (62) is first expanded to

$$\begin{aligned} {\hat{{\mathcal {F}}}}_A =\tfrac{1}{2}{\hat{h}}_i g^{{\textit{ij}}}{\hat{h}}_j +\tfrac{1}{2}\sum \nolimits _{R=1}^k {\xi _R \beta ^{R}g_R^2 } , \end{aligned}$$
(63)

after combining Eqs. (12)–(16) and putting covector in the form

(64)

Then, taking the variation of the new objective function leads to

$$\begin{aligned} \delta {\hat{{\mathcal {F}}}}_A ={\hat{h}}_i g^{{\textit{ij}}}\delta {\hat{h}}_j +\sum \nolimits _{R=1}^k {\xi _R \beta ^{R}g_R \delta g_R } . \end{aligned}$$

Finally, after employing Eqs. (45) and (63) and performing some straightforward manipulations, this becomes

$$\begin{aligned} \delta {\hat{{\mathcal {F}}}}_A= & {} ({\hat{h}}_i +\sum \nolimits _{R=1}^k {\xi _R g_R a_j^R } )g^{{\textit{ij}}}\delta h_i \nonumber \\&-\,{\hat{h}}_i g^{{\textit{ij}}}\sum \nolimits _{R=1}^k {a_i^R \delta h_R}. \end{aligned}$$
(65)

When the constraints are linearly independent the variations \(\delta h_i \) and \(\delta h_R \) are also independent. Then, the optimality condition

$$\begin{aligned} \delta {\hat{{\mathcal {F}}}}_A =0, \end{aligned}$$
(66)

implies that

(67)

and

(68)

The last equation shows that covector is orthogonal to all covectors , for \(R=1,\ldots ,k\), which span the vertical space \(V_T^*\) of \(T_p^*M\). Next, if the variation is selected to belong to the horizontal space of \(T_p^*M\) solely, i.e., , Eq. (67) yields

(69)

since the covectors belong to the vertical space of \(T_p^*M\). This implies that covector has no component in the horizontal space of \(T_p^*M\) either. Then, combination of the last result with Eq. (68) leads to

(70)

On the other hand, if the variation is chosen to lie completely in the vertical space of \(T_p^*M\), i.e., , Eq. (67) implies that

(71)

Obviously, Eqs. (70) and (71) are identical to Eqs. (12) and (22), respectively. In this respect, the objective function defined by Eq. (62) is equivalent to that defined by Eq. (58). Furthermore, it is remarkable that the proof of this result is independent on the value of the penalty parameters \(\xi _R \).

Finally, Eq. (70) leads directly to Eq. (23), while Eq. (71) in combination with Eq. (39) yields

(72)

for each motion constraint (\(R=1,\ldots ,k)\) and arbitrary multipliers \(\delta \lambda ^{R}\), satisfying

$$\begin{aligned} \delta \lambda ^{R}=a_i^R {\hat{w}}^{i}. \end{aligned}$$
(73)

Then, by adding up the terms of Eqs. (23) and (72) and performing appropriate mathematical operations, it yields eventually the final weak form obtained for the class of constrained mechanical systems examined. In fact, it is easy to verify that this form becomes identical to that presented by Eq. (24), provided that the terms \(\mu ^{R}\) and \(\lambda ^{R}\) are substituted by

$$\begin{aligned} {\bar{\mu }}^{R}=\mu ^{R}-\xi _R \dot{\psi }^{R} \quad \mathrm{and}\quad {\bar{\lambda }}^{R}=\lambda ^{R}-\xi _R \phi ^{R}, \end{aligned}$$
(74)

when they are multiplied by \({\bar{m}}_{{\textit{RR}}} \) or \({\bar{c}}_{{\textit{RR}}} \) and \({\bar{k}}_{{\textit{RR}}} \), respectively. This weak form provides a convenient and strong basis for developing an appropriate temporal discretization of the equations of motion. For the purposes of the present work, this task was performed within the framework of a typical augmented Lagrangian formulation, as explained in the following paragraphs. In this spirit, this work is related to some earlier attempts to apply this method in the field of multibody dynamics [23,24,25,26,27].

The essential information for understanding the basic features of the numerical scheme developed is summarized in the sequel. According to the three-field augmented Lagrangian formulation of this work, the unknowns of the problem examined consist of the quantities \(q^{i}\) and \(\lambda ^{R}, \upsilon ^{i}\) and \(\mu ^{R}, \pi _i \) and \(\sigma _R \), representing generalized coordinates, velocities and momenta, respectively. These quantities represent a set of \(3(n+k)\) variables, which must be determined by employing the system of Eqs. (26)–(31), in conjunction with Eq. (74). To achieve this goal, a finite element in time, implicit numerical scheme is applied first for performing the associated temporal discretization. This is based on an appropriate linear polynomial expansion of the unknowns of the problem within each time step \([t_m ,t_{m+1} ]\) and leads to a set of nonlinear algebraic equations for them. Solution of this set provides the values of the unknown quantities at the end \(t_{m+1} \) of the time step in terms of their known values at the beginning \(t_m \) of the time step. Following common practice, this set of equations is solved by applying a block-type iterative technique within each time step [28]. More specifically, it is first assumed that the values of all the unknowns but the components of the weak velocity vector \(\underline{\upsilon }=({\begin{array}{ccc} {\upsilon ^{1}}&{} \cdots &{} {\upsilon ^{n})^{T}} \\ \end{array} }\) are fixed. Consequently, application of Eq. (30) leads first to an involved set of n nonlinear algebraic equations, which can be put in the form

$$\begin{aligned} \underline{\eta }(\underline{\upsilon }_{ m+1} ;\underline{\upsilon }_{ m} ,\underline{\mu }_{m} ,\underline{q}_{m} ,\underline{\lambda }_{ m} ,\underline{\pi }_{m} ,\underline{\sigma }_{m} )=\underline{0}, \end{aligned}$$
(75)

with \(\underline{\upsilon }_{ m+1} \) and \(\underline{\upsilon }_{ m} \) representing the values of \(\underline{\upsilon }\) at times \(t_{m+1} \) and \(t_m \), respectively, while a similar meaning is also given to the quantities \(\underline{\mu }=({\begin{array}{ccc} {\mu ^{1}}&{} \cdots &{} {\mu ^{k})^{T}} \\ \end{array} }\), \(\underline{q}=({\begin{array}{ccc} {q^{1}}&{} \cdots &{} {q^{n})^{T}} \\ \end{array} }\), \(\underline{\lambda }=({\begin{array}{ccc} {\lambda ^{1}}&{} \cdots &{} {\lambda ^{k})^{T}} \\ \end{array} }\), \(\underline{\pi }=({\begin{array}{ccc} {\pi _1 }&{} \cdots &{} {\pi _n )^{T}} \\ \end{array} }\) and \(\underline{\sigma }=({\begin{array}{ccc} {\sigma _1 }&{} \cdots &{} {\sigma _k )^{T}} \\ \end{array} }\). As usual, Eq. (75) is solved by applying a Newton–Raphson approach. For this, given an estimate \(\underline{\upsilon }_{ m+1}^i \), a corrected value \(\underline{\upsilon }_{ m+1}^{i+1} \) is obtained, according to

$$\begin{aligned} \underline{\upsilon }_{ m+1}^{i+1} =\underline{\upsilon }_{ m+1}^i +\Delta \underline{\upsilon }^{i}, \end{aligned}$$
(76)

where the correction \(\Delta \underline{\upsilon }^{i}\) is determined by solving the linearized problem

$$\begin{aligned} {\mathbb {J}}_{ m+1}^i \Delta \underline{\upsilon }^{i}=-\underline{\mathfrak {R}}_{ m+1}^i , \end{aligned}$$
(77)

resulting by substituting Eq. (76) into Eq. (75), with

$$\begin{aligned}&{\mathbb {J}}_{ m+1}^i =\frac{\partial \underline{\eta }}{\partial \underline{\upsilon }}(\underline{\upsilon }_{ m+1}^i ;\underline{\upsilon }_{ m} ,\underline{\mu }_{m} , \underline{q}_{m},\underline{\lambda }_{ m} ,\underline{\pi }_{m} ,\underline{\sigma }_{m} )\quad \hbox {and}\nonumber \\&\underline{\mathfrak {R}}_{ m+1}^i =\underline{\eta }(\underline{\upsilon }_{ m+1}^i ;\underline{\upsilon }_{ m} ,\underline{\mu }_{m} ,\underline{q}_{m} ,\underline{\lambda }_{ m} ,\underline{\pi }_{m} ,\underline{\sigma }_{m} ).\nonumber \\ \end{aligned}$$
(78)

The last set of algebraic equations involves only n of the original unknowns and has a Jacobian matrix that appears in the form

$$\begin{aligned} {\mathbb {J}}=M+A^{T}({\bar{M}}+\tfrac{\Delta t}{2}{\bar{C}}) \Xi A-\tfrac{\Delta t}{2}{{\frac{\partial \underline{f}}{\partial \underline{\upsilon }}}}, \end{aligned}$$
(79)

where the n-array \(\underline{f}(\underline{q},\underline{\upsilon },t)\) includes the applied forces in Eq. (21), while \(\Xi \) is the diagonal matrix

$$\begin{aligned} \Xi =diag({\begin{array}{ccc} {\xi _1 }&\cdots&{\xi _k}\end{array}}) , \end{aligned}$$

including the penalty values in its diagonal. Each linear problem, as expressed by Eq. (77), is solved by employing a direct (sparse LU) solver. The computations are stopped when the set of weak velocities \(\underline{\upsilon }\) is determined up to a prespecified accuracy or the iterations exceed a critical number. In the latter case, the time step \(\Delta t\) is reduced and the process is restarted.

After determining a sufficiently accurate set of new values of \(\underline{\upsilon }_{ m+1} \), an augmentation is performed leading to the new values of \(\underline{\mu }\), if a proper augmentation criterion is met. That is, based on Eq. (74),

$$\begin{aligned} \underline{\mu }_{m+1}^{j+1} =\underline{\mu }_{m+1}^j -\Xi {\dot{\underline{\psi } }}_{m+1}^j . \end{aligned}$$
(80)

Otherwise, the values of the penalty parameters are increased according to common practice in similar optimization problems (see [14]) and the process is repeated. This process stops if the convergence criteria set on the accurate satisfaction of the constraints on the velocity level (i.e., \({\dot{\underline{\psi }}})\) are satisfied. Next, the values of the generalized coordinates \(\underline{q}_{m+1} \) and \(\underline{\lambda }_{m+1} \) of the augmented system are determined through a direct update, resulting by Eqs. (28) and (29), respectively. The iteration process is completed when both the residual in the right-hand side of Eq. (77) and the error in the motion constraints, expressed by Eq. (22) become also sufficiently small. Otherwise, the process is repeated after decreasing the time step. Finally, the new values of the momentum variables \(\underline{\pi }_{m+1} \) and \(\underline{\sigma }_{m+1} \) can be obtained after the iterations are finished by using the subsystem of equations resulting from the application of Eqs. (26) and (27), respectively.

For better clarity, the numerical implementation of the algorithm employed for solving the discretized set of equations of motion, given by Eq. (75), is presented next.

figure a

7 Numerical results

The integration scheme developed led to a full exploration of the theoretical and numerical advantages of the new methodology developed. To support this, some characteristic results are presented next for several challenging examples, ranging from systems with a simple geometry to a complex industrial application, involving components exhibiting large rigid body rotation [29].

7.1 Planar pendulum

A simple planar pendulum is chosen as the first numerical example. It consists of a rigid rod with negligible mass and a length of 1 m plus a particle with a mass of 1 kg, attached to one of its ends. The other end of the rod is connected to the ground through a revolute joint. In this way, the system motion is confined to take place in the xy plane. Moreover, the pendulum is released from rest, from the initial position shown in the inset of Fig. 1a and executes large amplitude oscillations, due to the action of gravity along the \(-y\) direction, with gravity acceleration equal to \(9,81\,\hbox {m/s}^{2}\).

Initially, in Fig. 1 are depicted results obtained by applying the new method (labeled by LMD). Also, these results are compared with similar results, obtained by using a state-of-the-art commercial code [30]. This code sets up the equations of motion and solves them numerically as a system of index-3 DAEs, by employing a classical integration scheme, based on backward differentiation formulas (BDF). According to general multibody modeling requirements, this led initially to a model with 2 rigid bodies, corresponding to 12 degrees of freedom (dof). At the same time, the system is subject to 11 constraints (6 for the ground and 5 from the revolute joint). In both cases, an accuracy level of 0.01 was required in all runs, using either numerical scheme.

First, in Fig. 1a is shown the history of the system mechanical energy, evaluated by assuming that the potential energy is zero at the initial position, shown in the inset. The results obtained by the commercial code exhibit a gradual and noticeable mechanical energy loss. This is most probably related to the high level of artificial damping induced in the BDF scheme employed for the numerical integration. The consequences of this effect are demonstrated in Fig. 1b, showing the history of the vertical component of the displacement of the particle at a later phase of the oscillation. Although the results are virtually indistinguishable at the beginning of the motion, a drift and a reduction in the amplitude of oscillation becomes more noticeable as time goes on, when the BDF method is applied. Finally, a similar behavior with the code used was also captured by employing another state-of-the-art code, when selecting a similar BDF scheme [31].

The good performance of the applied scheme is attributed to the fact that the new set of equations of motion employed includes suitable terms, which prevent a growth in the constraint violation error in an automatic manner. Originally, this is illustrated by the numerical results presented next. First, in Fig. 1c, d are shown the histories obtained for the horizontal and vertical component of the reaction force at the support point O, respectively, within the time interval between 990 and 1000 s. In general, the constraint forces are represented by the last term in Eq. (21). That is, by the term

$$\begin{aligned} \underline{f}_c =A^{T}[({\bar{M}}\dot{\underline{\lambda }})^{{\varvec{\cdot }} }+{\bar{C}}\dot{\underline{\lambda }}+{\bar{K}}\underline{\lambda }-{\bar{\underline{f}}}], \end{aligned}$$

which is readily available after a solution is located at the end of each time step. Here, the results of the new method were found to virtually coincide with those obtained by the corresponding analytical solution. On the other hand, the results captured by the BDF scheme were also almost identical at the beginning of the simulation, while drift effects started becoming more pronounced as time evolves. For completeness, in Fig. 1e, f are shown the histories of the constraint functions \(\phi ^{R}\) corresponding to the horizontal and vertical reaction force at O and their time derivatives \(\dot{\phi }^{R}\), respectively. Similar results were also obtained for the earlier part of the simulation. The results presented demonstrate that the new method can control the values of both of these functions in an effective manner. This, in turn, guarantees the safe and accurate continuation of the numerical process developed.

Fig. 1
figure 1

Planar pendulum: a mechanical model and history of mechanical energy error, b history of the particle vertical displacement at a later period of time, c history of the horizontal and d vertical component of the reaction at support O, e history of the constraint error functions for the horizontal and vertical reaction at O and f their time derivatives

Fig. 2
figure 2

Planar pendulum: a time step as a function of time for different values of \({\bar{m}}_{{\textit{RR}}} \), b penalty factors leading to convergence for \({{\bar{m}}_{{\textit{RR}}} }/{10}\), c step size for constant penalty factors and \({{\bar{m}}_{{\textit{RR}}} }/{10}\), d mechanical energy for constant penalty factors and \({{\bar{m}}_{{\textit{RR}}} }/{10}\), e time step size for constant penalty factors and different values of \({\bar{m}}_{{\textit{RR}}} \), f mechanical energy for constant penalty factors and different values of \({\bar{m}}_{{\textit{RR}}} \)

The effect of the new terms in the set of equations of motion employed on the good performance of the approach employed is reinforced further by the numerical results presented next. For instance, in Fig. 2a are shown results obtained by the new method, by taking into account the correct value of the critical terms \({\bar{m}}_{{\textit{RR}}} \), evaluated by Eq. (18), or setting it to a different value in the calculations, i.e., \({{\bar{m}}_{{\textit{RR}}} }/{10}\), \({{\bar{m}}_{{\textit{RR}}} }/{100}\) or 0, for all the constraints simultaneously. As it can be seen from Eqs. (12), (15) and (16), this term assures the presence of the constraint inertia term \(\ddot{\lambda }^{R}\) in the equations of motion. It also scales correctly the terms in Eq. (22) for the constraints. The results demonstrate that an incorrect choice of this term can lead to a drastic reduction of the time step chosen in the numerical integration, causing a sudden termination of the numerical calculations eventually. In all cases examined, all the initial penalty values were selected to be equal to 100. In Fig. 2b are shown the changes made in the values of the penalty factors in order to achieve convergence in the case with \({{\bar{m}}_{{\textit{RR}}} }/{10}\), during the first 10 s. Here, the penalty factors change (increase) with time. In addition, they are different for each constraint. In contrast, for the correct value of \({\bar{m}}_{{\textit{RR}}} \), the step size was found to remain constant in all cases examined for the specific example. Likewise, the penalty values were also found to remain constant and equal to their initial value (i.e., 1, 10 and 100). Finally, it is noted that the values of all the constraint parameters \({\bar{m}}_{{\textit{RR}}} \) remain constant in this example through the whole motion. The results become worse in more complicated systems, examined in the following examples, where the values of the \({\bar{m}}_{{\textit{RR}}} \) vary during the motion.

Fig. 3
figure 3

Numerical results for a slider-crank mechanism: a values of \({\bar{m}}_{{\textit{RR}}} \) as a function of angle \(\theta \), b time step variation for \({\bar{m}}_{{\textit{RR}}} \) and \({{\bar{m}}_{{\textit{RR}}} }/{10}\), c mechanical energy for \({\bar{m}}_{{\textit{RR}}} \) and \({{\bar{m}}_{{\textit{RR}}} }/{10}\), d changes in the values of the penalty factors leading to convergence up to about 16 s for \({{\bar{m}}_{{\textit{RR}}} }/{10}\)

Next, the case corresponding to \({{\bar{m}}_{{\textit{RR}}} }/{10}\) was investigated further. First, in Fig. 2c are shown results for several cases, where all the penalty factors are kept equal and constant throughout the simulations. For comparison purposes, the results obtained by using the correct \({\bar{m}}_{{\textit{RR}}} \) and constant penalty values \(\xi _R =100\) are also included. The results demonstrate that the correct solution is captured for \({{\bar{m}}_{{\textit{RR}}} }/{10}\) over the time interval of 10 sec, without a reduction in the time step, provided that the penalty values are selected to lie within a range from about 100 to \(10^{6}\). For \(\xi _R =10\), a solution is reached after reducing the time step by an order of magnitude. Finally, the smallest penalty value (\(\xi _R =1\)) leads to a drastic reduction of the time step and a quick termination of the solution process. Moreover, a similar terminal behavior was also observed when the penalty value was increased beyond the value \(10^{6}\). Likewise, in Fig. 2d is shown the corresponding mechanical energy, obtained for the same values of \(\xi _R \), during the first 10 s. The results indicate that even in cases where a good numerical performance is achieved, for the specific range of penalty values between 100 to \(10^{6}\), the mechanical energy does not remain constant but drops continuously. For \(\xi _R =10\), the mechanical energy is found to increase with time, while for \(\xi _R =1\) or larger than \(10^{6}\), the energy drops in a rapid fashion. Similar trends in the mechanical energy have also been observed and analyzed in previous work [32,33,34].

Finally, quite similar behavior was also encountered when changing the value of the parameters \({\bar{m}}_{{\textit{RR}}} \), but keeping the value of all the penalty factors to \(\xi _R =100\). Specifically, in Fig. 2e, f are shown the time step and the mechanical energy error obtained during the first 10 sec for the correct and four incorrect values of \({\bar{m}}_{{\textit{RR}}} \). In all cases, an incorrect choice of \({\bar{m}}_{{\textit{RR}}} \) was found to lead eventually to failure of the solution, after a sufficiently long period of time.

7.2 Planar slider-crank mechanism

Next, in Fig. 3 are compared results obtained by applying the new method with similar results reported for a typical benchmark problem [16]. In particular, the planar slider-crank mechanism shown in the inset of Fig. 3b is examined. This is a representative of a multibody system passing through a singular configuration during its motion. Specifically, the two rods have an equal length of 1 m and a uniformly distributed mass of 1 kg, while the slider has a negligible mass and is constrained to move along the ground axis Ox. As a consequence, the number of degrees of freedom increases instantaneously from one to two when \(\theta ={n\pi }/2\), with \(n=1,3,\ldots \), for the type of forcing considered. In the set of calculations presented next, the mechanism starts from the position with \(\theta =\pi /4\), so that the initial velocity of point \(P_3 \) is 4 m/s along the \(-x\) direction and executes oscillations due to the action of gravity, acting along the \(-y\) direction, with gravity acceleration equal to \(9,81\,\hbox {m/s}^{2}\), while the friction effects are negligible.

Fig. 4
figure 4

Numerical results for a slider-crank mechanism: a time step variation and b mechanical energy for different constant values of the penalty factors, c time step variation and d mechanical energy obtained by the modified augmented Lagrangian formulation (M-ALF)

Based on standard modeling requirements, the model employed consists of 4 rigid bodies (i.e., the two rods, the slider and the ground), corresponding to 24 dof initially. In addition, it is subject to a total of \(k=26\) bilateral constraints. This means that 3 of these constraints are redundant. First, in Fig. 3a are presented the values of all the \({\bar{m}}_{{\textit{RR}}} \) parameters, obtained over the first full rotation of the crank. A significant variation is observed to occur in the value of \({\bar{m}}_{{\textit{RR}}} \) for some of the constraints over the complete rotation. In addition, a much bigger difference is observed in the values from one constraint to another. In fact, these values are found to be distributed over four distinct numerical levels. Next, results obtained by direct integration of the equations of motion are presented. In Fig. 3b is shown the time step as a function of time. When the correct values were selected for \({\bar{m}}_{{\textit{RR}}} \), the step was found to remain constant and equal to the initial selection. Also, some of the penalty factors kept their initial value (here \(\xi _R =1000)\), while some other were increased up to 2000. However, when a wrong value of \({{\bar{m}}_{{\textit{RR}}} }/{10}\) was selected, instead, the time step was found to decrease occasionally and eventually fell below the minimum allowable value, leading to a termination of the integration process a little after 15 s. In Fig. 3c is shown the corresponding mechanical energy of the system, showing an observable drop in its value at times where a decrease in the time step is performed. Also, the penalty values had to be increased by two orders of magnitude (which was the maximum allowable value) when \({{\bar{m}}_{{\textit{RR}}} }/{10}\) was selected, as depicted in Fig. 3d. Moreover, even that increase was not sufficient to guarantee continuation of the simulation beyond the first 16 s of the motion.

Next, in Fig. 4a, b are shown the time step and the mechanical energy of the mechanism, obtained as a function of time, by using the correct values of \({\bar{m}}_{{\textit{RR}}} \) but keeping the same constant penalty values, for all the constraints. Once again, the results indicate that a convergence is possible to occur in the numerical solution, within the time interval examined, provided that the penalty values lie within a specific interval (here \(10^{3}\)-\(10^{4}\)). The explanation for this behavior is that for an excessive value of the penalty value, the part associated with the corresponding constraint term dominates the Jacobian matrix of the resulting set of linear algebraic equations at each iteration step, given by Eq. (79), leading to ill-conditioning. On the other hand, relatively small values of the penalty factors make a small contribution to the Jacobian matrix and this implies that a larger number of iteration is required for convergence at each step. Among other things, these results demonstrate that keeping constant penalty values throughout the simulation is not a good practice.

Likewise, in Fig. 4c, d are shown the same quantities, obtained as a function of time for the correct values of \({\bar{m}}_{{\textit{RR}}} \), by keeping constant all the penalty factors to their initial values, again. Moreover, the results of the new method, represented by the solid blue line, are compared to those obtained by applying the same method after setting \({\bar{m}}_{{\textit{RR}}} =0\), \({\bar{c}}_{{\textit{RR}}} =0\), \({\bar{k}}_{{\textit{RR}}} =1\) and \({\bar{f}}_R =0\) in Eq. (16). In addition, it was also set \({\bar{m}}_{{\textit{RR}}} =1\) in Eq. (22). In this way, the set of equations employed is reduced to the set of equations of motion employed by current multibody dynamics formulations [4,5,6, 23,24,25,26,27]. In the sequel, this case is referred to as a modified augmented Lagrangian formulation (M-ALF). Direct comparison of the results shows that the numerical performance gets worse, demonstrating the advantages associated with the new set of equations of motion employed.

The final set of results refers to constraint forces and the corresponding constraint functions for the mechanism examined, which involves both redundant constraints and passages from singular positions. First, in Fig. 5a are presented the histories of the horizontal component of the constraint force developed at joint \(P_2 \) by the present method and by ADAMS, during the first 10 s of the simulation. Likewise, in Fig. 5b are presented the corresponding histories of the vertical component of the constraint force at \(P_2 \). Once again, the solutions obtained by ADAMS present significant drifting and amplitude reduction. In addition, they exhibit quite large jumps when the mechanism passes from a singular position. This phenomenon has already been observed and analyzed extensively in earlier studies (e.g., see [27] and references therein). Performing similar calculations after decreasing the maximum allowable time step (from \(10^{-3}\) to \(5 *10^{-4}\) s) improves the drifting and amplitude reduction observed for the BDF solver, as verified by comparing the results in Fig. 5c, d to those in Fig. 5a, b, respectively. However, the time step reduction causes much larger forces when the mechanism passes from a singular position. Specifically, the jumps observed during integration with the BDF solver reached a maximum value of about 300 N and 1250 N with maximum time step \(10^{-3}\) s and \(5 *10^{-4}\) s, respectively. This increase in the magnitude of the constraint forces can be explained by taking into account that the component of the velocity in the direction which appears temporarily due to a kinematic singularity error must be eliminated by an impulse acting on a smaller time interval [27]. In addition, as a consequence of this, the mechanism was found to settle to a static position eventually when the bigger time step was used, due to the gradual loss of mechanical energy induced by the numerical scheme. On the other hand, the simulation stopped (because the members of the mechanism were disassembled) after about 18 s, when using the smaller time step. This was not the case when the new method was applied. As can be verified by the results presented in Fig. 5a, b, much smaller peaks appear at the singular positions. This is attributed to the better control achieved in the constraint error at both the position and velocity level, which is also reduced simultaneously when the time step is reduced. This is reinforced by the results in Fig. 5e, f, showing the history of the constraint error functions for the horizontal and vertical reaction at \(P_2 \) and their time derivatives, respectively, for the bigger time step (the left inset in Fig. 5e and the inset in Fig. 5f illustrate the range of values for \(\phi ^{13}\) and \(\dot{\phi }^{12}\), respectively). Moreover, this control is applied to each constraint separately. Also, here the penalty values are different for each constraint and can increase independently when a need comes during the solution process. Finally, the results of the new method were found to be identical to those obtained by the corresponding analytical solution, except that the latter do not exhibit any peaks at the singular positions.

Fig. 5
figure 5

a Comparison of the horizontal and b vertical component of the constraint force at point \(P_2 \) by the present method and ADAMS, c and d similar results for a smaller time step, e history of the constraint error functions for the horizontal and vertical reaction at \(P_2 \) and f their time derivatives

Fig. 6
figure 6

Double four bar mechanism: a comparison of history of the position and b the velocity of point \(P_1 \) of the mechanism, c mechanical energy error and comparison with benchmark results, d mechanical energy error and comparison with results from a BDF method

7.3 Double four bar mechanism

The next mechanical example is the double four bar mechanism, shown in the inset of Fig. 6d. This is another representative example of a multibody system passing through a singular configuration during its motion. All the rods have an equal length of 1 m and a uniformly distributed mass of 1 kg. As a consequence, when the bars reach the horizontal position, the number of degrees of freedom increases instantaneously from one to three. In the set of results presented next, the mechanism starts from the position shown in Fig. 6d with a velocity of the three mobile pins (points 1, 2, 3) equal to 1 m/s to the right and executes oscillations along the \(-y\) direction due to the action of gravity. Here, the system consists of 6 rigid bodies, corresponding to 36 dof initially. Also, the motion constraints introduce 36 equations, revealing the presence of a single redundant constraint. Again, the results of the new method are labeled by LMD.

Fig. 7
figure 7

a Mechanical model of a six-member Bricard mechanism, b history of the x, y and z coordinates of point \(P_2 \), c comparison of mechanical energy with benchmark solution, d comparison with mechanical energy obtained with a BDF solution

First, in Fig. 6a–c are compared results obtained by applying the new method with similar results reported earlier for this benchmark problem [16]. Specifically, those results were obtained by applying an index-3 augmented Lagrangian formulation with projections of velocities and accelerations, keeping the value of the penalty factors constant and equal to \(10^{9}\) [26, 27]. In particular, the results of Fig. 6a and 6b verify the closeness of the results obtained by the two methods, within the initial time interval considered. However, the results presented in Fig. 6c demonstrate a difference in the error in the mechanical energy (taking as a reference configuration the one shown in Fig. 6d). The new method predicts a constant value close to zero, which is the exact value. Actually, this continues to be the case even for much longer time periods, as illustrated by the results presented in Fig. 6d. For comparison, results obtained by a BDF solver are also included [30]. Once again, these results reflect a gradual decrease in the mechanical energy. In addition, the same BDF solver fails quite frequently to continue the simulation when a singular position is reached. In such cases, the simulation may lead to erroneous predictions. For instance, it may stop suddenly, or may predict a disassembling of the mechanism members, as they pass from a singular position [35, 36].

7.4 Rectangular Bricard mechanism

The next mechanical example is the six-member rectangular Bricard mechanism, sketched in Fig. 7a. All the rods are connected with revolute joints, have an equal length of 1 m and a uniformly distributed mass of 1 kg. The mechanism consists of 6 rigid bodies (five rods and the ground), corresponding to 36 dof initially, while the motion constraints introduce 36 equations. Therefore, the mechanism examined represents a mechanical system which is redundantly constrained throughout its motion. Due to this property, it also belongs to a special set of benchmark problems selected by the multibody dynamics community [16]. In the cases examined, the system starts from rest from the position shown in Fig. 7a and moves under the action of gravity, directed along the \(-y\) axis.

First, in Fig. 7b are shown and compared the time histories of the x, y and z coordinates of point \(P_2 \), showing virtual coincidence over the initial 10 s of the motion. Once again, the benchmark results were obtained by applying an index-3 augmented Lagrangian formulation with projections of velocities and accelerations [26, 27]. Also, the value of all the penalty factors were kept constant and equal to \(10^{14}\). The results demonstrate that the present method is accurate and passes successfully the benchmark test. It also exhibits a robust numerical performance. For instance, the errors in both the displacement and velocity constraint violations are kept bounded and stay at the same level, throughout the time interval examined [35, 36]. Finally, the corresponding mechanical energy of the system is depicted in Fig. 7c and compared with results of the benchmark problem. Again, the mechanical energy computed by the present method remains virtually constant, while a gradual drop is observed in the energy of the benchmark solution. Similar behavior is also observed for much longer periods of time. For instance, this is manifested by the results of Fig. 7d, where the results obtained are compared with results obtained for the same system by employing a BDF solver [30]. In the last case, it is found that the system arrives at a static position eventually.

7.5 Model of a real ground vehicle

The last example examined is a model of a real ground vehicle, depicted in Fig. 8a. It includes a complete steering system, a basic powertrain system, together with involved front and rear suspension systems with jounce and rebound bumpers. Many of these components exhibit strongly nonlinear behavior. For instance, in Fig. 8b are shown the forces developed in the front and rear shock dampers as a function of the relative velocity. A similar type of nonlinearity is also present in the force developed at the bushings connecting the suspensions to the car body as a function of the relative displacement. Likewise, strongly nonlinear characteristics appear at the jounce rebound bumbers, placed between the wheel suspensions and the car body. Finally, the tires were modeled using the classical Pacejka tire model [37]. In total, the model consists of 53 rigid bodies, interconnected with 29 bushings, 9 spring-damper systems, 49 kinematical constraints and 9 action–reaction force elements. Consequently, the total number of degrees of freedom of the model is 134.

Fig. 8
figure 8

a Complete vehicle model and b forces in the front and rear shock dampers as a function of relative velocity

Fig. 9
figure 9

Numerical results for a single swept steering maneuver: a driving torque and steering angle input curves, b orbit of the vehicle center of mass on the horizontal plane, c lateral force on the rear left tire and d vehicle yaw rate

The example vehicle model examined was first subjected to a classical road handling test. More specifically, a swept steering maneuvre was performed. Before it starts this maneuvre, the vehicle runs over a straight path with a speed of about 64 km/h along the negative direction of the longitudinal X axis, shown in Fig. 8a. For this, an appropriate driving torque and steering angle was applied during the motion at the car’s differential and steering wheel, respectively, as shown in Fig. 9a. Next, typical results are shown in Fig. 9b–d by applying the new numerical method (labeled by LMD). Moreover, these results are compared again with results obtained for the same model by applying two state-of-the-art numerical codes [30, 31], employing a BDF method. In particular, in Fig. 9b is shown the orbit of the center of mass of the vehicle on the horizontal plane. Likewise, in Fig. 9c is depicted the lateral force developed between the rear left tire and the ground, as a function of the position of the car along the longitudinal X axis. Finally, in Fig. 9d is shown the corresponding yaw rate of the vehicle, as a function of the car position along the X axis. In terms of dynamic response, the results demonstrate that the lateral force exerted on the tire as well as the yaw rate of the car increase with time. Finally, direct comparison of the numerical results indicates that the outcome of the present method coincides virtually with that obtained by one of these codes. Also, the differences appearing between the results obtained by the other code are most probably due to differences in the tire models employed. In addition, the small deviation detected between the results of the new method and those obtained by the BDF codes is due to the small duration (i.e., 6 s) of the handling test considered.

Next, a repeated swept steering maneuvre of a longer duration was performed. First, the driving torque applied at the car’s differential and the steering angle imposed on the steering wheel during the motion are shown in Fig. 10a, b, respectively. Also, in Fig. 10c is shown the history of the longitudinal velocity of the car. The results of the new method are represented by the continuous curve. These results are first compared with those obtained by applying the modified augmented Lagrangian formulation (M-ALF), as was defined in Sect. 7.2. In the latter case, a sudden interruption of the time integration occurred after about 17 s of motion, as indicated by the broken curve. The reason for this interruption is explained by the results of Fig. 10d, where the size of the time step employed by the two methods is shown. Besides this, the results illustrate that the new method, using variable penalty factors and correct values for the parameters \({\bar{m}}_{{\textit{RR}}} \), \({\bar{c}}_{{\textit{RR}}} \), \({\bar{k}}_{{\textit{RR}}} \) and \({\bar{f}}_R \), leads to substantially larger time steps, especially as the duration of the event increases. Next, in Fig. 10e is shown a comparison of the resulting car trajectories on the horizontal plane, obtained by the current method and the same two BDF solvers used in the previous test. Likewise, Fig. 10f presents a comparison of the corresponding lateral force developed in the front left tire. Here, the deviations observed between the results of the new method and the codes grow gradually and become quite large at the final stages of the maneuvre. Finally, in Fig. 10g, h are depicted the histories of the \({\bar{m}}_{{\textit{RR}}} \) parameters with the smallest and largest value, during the first and the last seconds of the motion, respectively. The results demonstrate that there appear some observable differences in the history of each \({\bar{m}}_{{\textit{RR}}} \) value, at the beginning and the end of the maneuvre. Furthermore, there exists a quite large difference in both the amplitude and the frequency content between the largest and smallest value of \({\bar{m}}_{{\textit{RR}}} \). More specifically, the smallest and largest \({\bar{m}}_{{\textit{RR}}} \) values are around \(6 *10^{-4}\) and \(2 *10^{2}\), respectively, which yields a considerable (six orders of magnitude) ratio. In addition, both of these values are also very different than unity.

Fig. 10
figure 10

Numerical results for a repeated swept steering maneuvre: a driving torque and b steering angle input curves, c history of the longitudinal velocity of the car, d size of the time step, e comparison of trajectories and f comparison of lateral forces on the front left tire obtained by two BDF solvers, g smallest and largest \({\bar{m}}_{{\textit{RR}}} \) values during the first and h the last seconds of the maneuvre

8 Synopsis and extensions

In the first part of this study, the attention was focused on deriving a suitable augmented Lagrangian formulation for capturing dynamics of multibody systems subject to a set of bilateral (both holonomic and nonholonomic) scleronomic motion constraints. This task was achieved by employing a new system of equations of motion, consisting of a set of strongly nonlinear second-order ODEs. First, these equations were put in a suitable three-field weak form, by treating the position, velocity and momentum variables as independent. Then, it was shown that the formulation developed can be put within a convenient augmented Lagrangian framework. The augmented Lagrangian function originated by just adding suitable penalty terms due to the motion constraints to an appropriate objective function, related to the system dynamics in a way generalizing the classical Gauss principle. This provided a strong basis for developing an efficient and robust numerical scheme for determining the dynamic response of the class of systems examined in an accurate manner. Then, a selected set of mechanical examples was investigated in the second part of this study. The first four examples refer to small order models, exhibiting some challenging characteristics and considered as standard benchmark problems by the multibody dynamics community. In contrast, the last example was taken from a real industrial application, related to ground vehicle dynamics.

In the numerical examples, special emphasis was placed on comparing the results of the new method with those obtained by application of classical BDF approaches. This revealed the negative consequences of the large levels of artificial damping arising in those methods in order to get a solution of the equations of motion, especially for relatively long periods of time. In addition, the attention was also focused on investigating the effect of the penalty values as well as of some crucial terms included in the new set of equations of motion, related to time derivatives of the Lagrange multipliers. By performing systematic numerical studies, it was demonstrated that the method developed is accurate, efficient and can accommodate difficult situations, such as those arising by the presence of redundant constraints or the appearance of singular positions during the motion. This was assisted significantly by the direct control on each of the constraint functions and their time derivatives through both the action of the new terms in the equations of motion and the features of the numerical approach applied, including the selection of the penalty values. In addition, the new method was developed so that it can easily be extended and applied to more complex and challenging mechanical systems, involving a quite large number of degrees of freedom. This can be accommodated greatly by combining the analysis presented with advanced coordinate reduction techniques [38, 39]. In addition, with appropriate modifications and enhancements, it can also be extended to cover cases where contact, impact and friction effects become important and lead to a simultaneous appearance of unilateral constraints, represented by a set of inequalities [40,41,42].