1 Introduction

In the process of modeling and simulating the dynamics of constrained multibody systems, it is common to use formulations based on non-minimal coordinates, due to their flexibility in developing general computer codes. In this approach, Newton–Euler’s laws of motion are usually utilized for each rigid body within the mechanical system under analysis, leading to Ordinary Differential Equations (ODEs), while algebraic equations are added in order to reflect the kinematic constraints, which are typically associated with mechanical joints. This process results allows to obtain the equations of motion in the form of a set of Differential Algebraic Equations (DAEs) [1, 2]. It has been recognized that there are alternative formulations to derive the equations of motion for constrained multibody systems, such as the ones purposed by Lagrange [3], Hamilton [4], Gibbs [5], Dirac [6], Kane [7, 8] and Udwadia-Kalaba [9]. These methodologies differ in the type of coordinates considered and methods utilized to handle the violation of constraints, which results in different aspects such as computational errors [10, 11]. The problem of formulating and solving the violation of constraints in multibody systems has been the subject of intense investigation over the last decades. The interested reader in further details is referred to the following references [12,13,14,15,16,17,18,19,20].

A common approach to numerically solve the equations of motion of constrained multibody systems developed in the form of DAEs relies on time-differentiation of the constraint equations, resulting in a system of ODEs. In most of practical cases, analytical solutions are not available and therefore, numerical integration methods have been employed [21]. A wide variety of numerical approaches have been proposed over the last decades, namely those based on one-step schemes, such as the Euler algorithm, multi-stage single-step schemes, such as the Runge–Kutta method, and multi-step techniques, such as the Adams–Bashforth method. All of these methods are applied to first order ODEs and therefore, it is necessary to convert a generally nth order ODE to a system of n first order ODEs, using appropriate techniques of changing variables. With the standard Lagrange multiplier technique, the kinematic constraint is incorporated only at the acceleration level [22]. Hence, violation of constraints occurs at position and velocity levels due to numerical errors associated with the integration process. Amongst the several different approaches introduced to eliminate or, at least, minimize those numerical errors [23,24,25], one may refer to the Baumgarte stabilization method [23], in which appropriate terms related to the problem of constraints violation at the position and velocity levels are added to the ODE system. The main difficulty associated with the Baumgarte stabilization method deals with the identification of the parameters for the feedback values of constraints and their first-time derivatives. The selection of appropriate Baumgarte parameters to obtain the accurate solution in terms of violation of constraints is still a challenging issue within the field of multibody dynamics [22].

Chang and Nikravesh [26] developed an adaptive method to determine the proper Baumgarte parameters and demonstrated the effectiveness of the proposed method using two benchmark examples. Yoon et al. [27] used pseudo-integration of the constraint dynamics to investigate the stability of the Baumgarte method, and to identify and select the appropriate values for the Baumgarte coefficients. Ostermeyer [28], dealt with control aspects to explain the effects of the Baumgarte method together with presenting some rules to choose the values of the corresponding parameters. The works by Lin and co-workers [29, 30] showed that there exists a criterion for the proper selection of the Baumgarte parameters that results in a stable and accurate solution. The criterion proposed is dependent on the numerical integration method considered to solve the equations of motion. Flores et al. [31] presented a parametric study on the Baumgarte method to study the influence of the values of Baumgarte parameters, integration method, time step size, and accuracy of the initial conditions. In turn, Kim et al. [32], Ascher et al. [33, 34] and Guizhi and Rong [35] developed different techniques to select Baumgarte parameters. Park and co-workers [36, 37] proposed a constraint stabilization approach similar to the Baumgarte method considering a penalty formulation of the constraint equations. Bayo and Avello [38] presented an augmented Lagrangian formulation based on the Hamilton canonical form of the equations of motion, which ensures better accuracy and robustness in the presence of singular configurations compared with the alternative approach derived by Bayo et al. [25]. Weijia et al. [39] proposed an automatic constraint violation stabilization method for the numerical integration of equations of motion in the dynamics of multibody systems. Blajer [40] developed a powerful methodology for the exact elimination of the constraint violations, which is based on appropriate corrections of the state variables after each integration step. Hong and co-workers [41] presented an implicit constraint enforcement technique that is stable for large time steps and does not require problem-dependent stabilization parameters. In a later work, these authors described their method for rigid body simulations with both holonomic and non-holonomic constraints [42]. Braun and Goldfarb [43], by means of the Udwadia–Kalaba approach, proposed an explicit equation of constrained motion by embedding a small virtual force and a small virtual impulse in the equation of motion. Nada and Bayoumi [44] developed a constraint stabilization method for multibody systems based on fuzzy logic control for both holonomic and non-holonomic constraints. The interested reader in a detailed and comprehensive analysis of different methodologies for the constraint enforcement under the framework of multibody systems is referred to the works by Laulusa and Bauchau [45, 46].

Using Bézier curves, Aghdam et al. [47] presented a multi-step method to solve the initial value problems. These authors showed that the stability of the Bézier based solution is enhanced when comparing with other well-known methods, namely the well-established Adams–Moulton approach. Furthermore, consistency and convergence of the method are investigated using error analysis theorems for multi-step approaches [47]. Subsequently, a combination of the Bézier method and the differential quadrature technique was utilized to solve the governing Partial Differential Equations (PDEs) arising in the transient response of composite plates [48] and conical shells [49]. More recently, the Bézier multi-step method was considered to obtain numerical solutions for nonlinear vibration and post-buckling of nanocomposite beams [50] and stress analysis of notched nanocomposite plates [51]. It is noteworthy that Bézier curves are based on the Bernstein basis polynomials and some given points, called control points. These curves are widely utilized in computer graphics and computer-aided design, due to their smooth nature. More details on Bézier curves and their properties can be found in references [52, 53].

Thus, in the present study, the Bézier integration technique is utilized to obtain numerical solutions for the DAEs of constrained multibody mechanical systems, by introducing a numerical integration scheme for the resulted system of ODEs. The stability domains of dimensionless Baumgarte parameters are established for different orders of the Bézier method. The stability regions are examined and compared with those of some classical integration methods, such as the Adams–Bashforth and Runge–Kutta algorithms, which permit to show the benefits and gains associated with the Bézier integration technique. Finally, a planar slider-crank mechanism is considered as a benchmark example for applications, which serves to highlight the benefits of the proposed methodology. It is noted that a planar slider-crank mechanism was used in [54] as a benchmark mechanism. A variation of the slider-crank mechanism is also introduced in [55] for evaluating various formulations and integration techniques used in simulation and analysis of multibody systems with kinematic constraints.

2 Equations of motion for constrained multibody systems

This section addresses the main aspects related to the formulation of the equations of motion of constrained multibody mechanical systems. Thus, for a general multibody mechanical system, the kinematic constraints can be established as a set of linear and/or nonlinear holonomic algebraic equations as [1]

$$\mathbf{c}\left(\mathbf{q}, t\right)=0$$
(1)

where \(\mathbf{c}\left(\mathbf{q}, t\right)={[ {\mathrm{c}}_{1}\left(\mathbf{q}, t\right) , \dots , {\mathrm{c}}_{m}\left(\mathbf{q}, t\right) ]}^{\mathrm{T}}\) represents the m-vector of constraint equations, \(\mathbf{q}={[{q}_{1} , \dots , {q}_{n}]}^{\mathrm{T}}\) denotes the n-vector of generalized coordinates, and \(t\) is the time variable.

The dynamic equations for constrained multibody systems can be expressed by [1]

$$\mathbf{M}\ddot{\mathbf{q}}+{\mathbf{C}}_{\mathbf{q}}^{\mathrm{T}} {\varvec{\uplambda}}=\mathbf{g}$$
(2)

where \(\mathbf{M}\) represents the generalized mass matrix,\(\ddot{\mathbf{q}}\) denotes the vector of generalized accelerations,\({\mathbf{C}}_{\mathbf{q}}\) is the Jacobian matrix of the constraint equations,\({\varvec{\uplambda}}\) represents the vector of Lagrange multipliers, and \(\mathbf{g}=\mathbf{g}(t,\mathbf{q},\dot{\mathbf{q}})\) contains the applied generalized forces that may include the Coriolis and centrifugal forces. The unknowns in Eq. (2) are the vector of accelerations \(\ddot{\mathbf{q}}\) and the vector of Lagrange multipliers \({\varvec{\uplambda}}\), resulting in a total of n + m unknowns. Since Eq. (2) contains only n equations, in order to be able to solve them, it is required to consider the additional m kinematic constraint equations. Thus, differentiating Eq. (1) with respect to time yields the velocity constraint equations as

$${\mathbf{C}}_{\mathbf{q}}\dot{\mathbf{q}}=-{\mathbf{c}}_{t}$$
(3)

where \(\dot{\mathbf{q}}\) represents the vector of generalized velocities, and the subscript t indicates partial differentiation with respect to time. A second differentiation of Eq. (1) with respect to time leads to the acceleration constraint equations in the form of

$${\mathbf{C}}_{\mathbf{q}}\ddot{\mathbf{q}}={-\left({\mathbf{C}}_{\mathbf{q}}\dot{\mathbf{q}}\right)}_{\mathbf{q}}\dot{\mathbf{q}}-2{\mathbf{C}}_{\mathbf{q}t}\dot{\mathbf{q}}-{\mathbf{c}}_{tt}\equiv {\varvec{\upgamma}}$$
(4)

in which \({\varvec{\upgamma}}\) represents the right-hand side of acceleration equations. Equations (1), (3), and (4) must be satisfied during the numerical solution of the equations of motion for constrained multibody mechanical systems. Therefore, Eqs. (2) and (4) can be condensed in the matrix form as

$$\left[\begin{array}{cc}\mathbf{M}& {\mathbf{C}}_{\mathbf{q}}^{\mathrm{T}}\\ {\mathbf{C}}_{\mathbf{q}}& 0\end{array}\right] \left[\begin{array}{c}\ddot{\mathbf{q}}\\ \lambda \end{array} \right]= \left[\begin{array}{c}g\\ \gamma \end{array}\right]$$
(5)

It is clear that Eq. (5) contains n + m equations and n + m unknowns. Assuming that the mass matrix is positive definite and the Jacobian matrix has a full row rank, a unique solution for accelerations \(\ddot{\mathbf{q}}\) and Lagrange multipliers \({\varvec{\uplambda}}\) will be obtained. It is noted that necessary and sufficient conditions for the existence and uniqueness of solutions for accelerations and Lagrange multipliers are obtained and discussed in [56]. Then, in each integration time step, velocities and positions, for the next time step, can be computed by integrating the accelerations and velocities of the previous step. This procedure is repeated until the final analysis time is reached in forward dynamic problems [1, 31].

3 Baumgarte stabilization method

The main purpose of this section is to summarize the key issues associated with the Baumgarte stabilization method and its incorporation into the equations of motion for constrained multibody systems. Thus, when using Eq. (5) in its original form, it is guaranteed that the constraint equations at the acceleration level, \(\ddot{\mathbf{c}}=0\), are satisfied at every integration step. Furthermore, as it was mentioned previously, \(\dot{\mathbf{c}}=0\), and \(\mathbf{c}=0\) must also be satisfied in any numerical integration method that is used to solve the equations of motion of the system. However, from the control theory it is known that the equation \(\ddot{\mathbf{c}}=0\) represents an unstable system, therefore \(\mathbf{c}\) and \(\dot{\mathbf{c}}\) will not converge to zero if any perturbation occurs during numerical integration [29, 57].

Thus, based on the Baumgarte constraints stabilization technique, the acceleration constraint equation is modified and rewritten as [23]

$$\ddot{\mathbf{c}}+2\alpha \dot{\mathbf{c}}+{\beta }^{2}\mathbf{c}=0$$
(6)

where \(\alpha\) and \(\beta\) are two scalar positive coefficients. By taking the Laplace transform of Eq. (6), the characteristic equation would be [58]

$${\mathrm{s}}^{2}+2\alpha s+{\beta }^{2}=0$$
(7)

From the control theory, it is established that with \(\alpha\) and \(\beta\) greater than zero, Eq. (7) is stable and, consequently, \(\mathbf{c}\) and \(\dot{\mathbf{c}}\) will converge to zero. Hence, Eq. (4) can be rewritten as

$${\mathbf{C}}_{\mathbf{q}}\ddot{\mathbf{q}}={\varvec{\upgamma}}-2\alpha \dot{\mathbf{c}}-{\beta }^{2}\mathbf{c}$$
(8)

Finally, the equations of motion can be expressed as

$$\left[\begin{array}{cc}\mathbf{M}& {\mathbf{C}}_{\mathbf{q}}^{\mathrm{T}}\\ {\mathbf{C}}_{\mathbf{q}}& 0\end{array}\right] \left[\begin{array}{c}\ddot{\mathbf{q}}\\ \lambda \end{array} \right]= \left[\begin{array}{c}g\\ \gamma -2\alpha \left({\mathbf{C}}_{\mathbf{q}}\dot{\mathbf{q}}+{\mathbf{c}}_{t}\right)-{\beta }^{2}c\end{array}\right]$$
(9)

While the Baumgarte constraints stabilization method gives accurate results in some cases, there is no valid method for selecting the parameters \(\alpha\) and \(\beta\) [22, 26, 31, 33]. As it was pointed out by Baumgarte, the suitable parameters are obtained by numerical experiments [23]. It should be noted that improper selection of the Baumgarte coefficients can lead to unacceptable results in terms of the physics associated with the dynamic response of the constrained multibody mechanical systems.

4 Selection of \(\boldsymbol{\alpha }\) and \({\varvec{\beta}}\) parameters for the Bézier method

In this section, a general study on the identification and selection of the Baumgarte parameters in the context of the Bézier integration technique is presented. It has been recognized that positive values for \(\alpha\) and \(\beta\) parameters does not guarantee the convergence of \(\mathbf{c}\) and \(\dot{\mathbf{c}}\) [29, 30]. This aspect suggests that the selection of the values for \(\alpha\) and \(\beta\) only based on the stability of Eq. (6) does not guarantee appropriate results when simulating constrained multibody systems.

At this stage, it must be highlighted that the numerical integration algorithms convert differential equations to discretized equations and then solve them. Different numerical integration algorithms are available for the discretization process. Therefore, it is important to check the stability conditions of the discretized resulting equations rather than the original differential equations [29]. This aspect is of crucial relevance, since the selection of adequate values for the \(\alpha\) and \(\beta\) parameters also depends on the integration method being utilized in the process of solving the equations of motion.

Using Bézier curves, a new multi-step method for the solution of ordinary differential equations was derived by Aghdam et al. [47]. Different degrees of Bézier curves lead to distinctive formulations, as it is listed in Table 1. In what follows, the 2nd order Bézier method is utilized to illustrate how to select Baumgarte parameters based on the stability analysis. The procedure described here, which has been implemented on other numerical integration algorithms [29,30,31, 35], is based on the stability analysis approach in digital control theory.

Table 1 The mapping between s and Z planes for the Bézier method

The differential equation to be solved by numerical integration can be defined as

$$\dot{y}=f(y,t)$$
(10)

where \(y\) represents the dependent variable in the differential equation, and \(\dot{y}\) is its time derivative.

Applying the Laplace transform technique to Eq. (10) yields

$$sY\left(s\right)=F\left(s\right)\; \mathrm{or}\; \frac{F\left(s\right)}{Y\left(s\right)}=s$$
(11)

in which s denotes the variable of the Laplace domain.

Thus, when 2nd order Bézier method is considered, the numerical solution of the differential equation can be written as [47]

$${y}_{k+1}={y}_{k}+\frac{h}{2} (3 {f}_{k}-{f}_{k-1})$$
(12)

where subscript k represents the numerical solution at the corresponding time step, and \(h\) denotes the integration time step.

Since Eq. (12) is a discretized equation, the Z transform technique can be utilized for the purpose of studying the stability of the solution [57]. Thus, the Z transform of Eq. (12) can be expressed as

$$z\mathrm{Y}(z)=\mathrm{Y}(z)+\frac{\mathrm{h}}{2} (3\mathrm{ F}(z)-\frac{1}{z}\mathrm{ F}(z) )$$
(13a)

or, alternatively,

$$\frac{F\left(z\right)}{Y\left(z\right)}=\frac{2}{h} \frac{z(z-1)}{3z-1}$$
(13b)

where \(z\) denotes the Z transform variable.

A direct comparison between Eqs. (11) and (13b) allows to obtain the mapping between s and Z planes as

$$s=\frac{2}{h} \frac{z(z-1)}{3z-1}$$
(14)

A similar procedure can be considered to obtain the mapping between s and Z planes for different orders of the Bézier method, results of which are condensed in Table 1.

Introducing Eq. (14) into Eq. (7) the characteristic equation in the Z plane can be obtained and expressed as

$$4 {z}^{4}+ \left(-8+12\alpha h\right){z}^{3}+\left(4-16\alpha h+9 {\beta }^{2}{h}^{2}\right) {z}^{2}+$$
(15)
$$\left(4\alpha h-6 {\beta }^{2}{h}^{2}\right)z+{\beta }^{2}{h}^{2}=0$$

Based on this approach, it can be observed that variable \(z\) depends on the values of \(\alpha\), \(\beta\) and h. In order to avoid the dependence on step size, two dimensionless parameters must be established as [29]

$$\widehat{\alpha }=2\alpha h\; \mathrm{and}\; \widehat{\beta }={\beta }^{2}{h}^{2}$$
(16)

Thus, using these dimensionless parameters, Eq. (15) can be rewritten as.

$$4 {z}^{4}+ \left(-8+6 \widehat{\alpha }\right) {z}^{3}+\left(4-8 \widehat{\alpha }+9 \widehat{\beta }\right) {z}^{2}+(2 \widehat{\alpha }-6 \widehat{\beta }) z+\widehat{\beta }=0$$
(17)

Table 2 shows the characteristic equations for different orders of the Bézier method in terms of dimensionless Baumgarte parameters \(\widehat{\alpha }\) and \(\widehat{\beta }\).

Table 2 Characteristic equations when using different orders of the Bézier method

In order to select appropriate values for \(\widehat{\alpha }\) and \(\widehat{\beta }\) parameters, the behavior of the characteristic equation for different locations of the eigenvalues in the Z plane must be examined first. From control theory, it is known that the stability boundary is the unit circle \(|z|=1\), meaning that \(\mathbf{c}\) and \(\dot{\mathbf{c}}\) diverge if \(|{z}_{p}|>1\) (\({z}_{p}\) is z of the pole of the characteristic equation), and converge to zero if \(|{z}_{p}|<1\) for all of the poles [59]. Moreover, the smaller the magnitude of \(|{z}_{p}|\), the faster \(\mathbf{c}\) and \(\dot{\mathbf{c}}\) converge to zero, and the smaller the magnitude of \(\angle {z}_{p}\) (angle of \({z}_{p}\)), the smaller the frequency of oscillations of \(\mathbf{c}\) and \(\dot{\mathbf{c}}\). Therefore, in the stability region of the system on the Z plane (\(|z|<1\)), according to Eq. (17), a domain for the values of \(\widehat{\alpha }\) and \(\widehat{\beta }\) can be determined. By specifying the step size, with the use of Eq. (16), the stability region in terms of α and β parameters can then be obtained.

5 Results and discussion

In this section, stability regions for different orders of the Bézier method are presented and discussed, which are based on the approaches described in the previous sections. In order to examine the stability of the Bézier approach, the same stability regions for Adams–Bashforth and Runge–Kutta methods are also studied. Furthermore, a planar slider-crank mechanism is considered as an example of application as a constrained multibody system to study the influence of the values of the Baumgarte parameters on the violation of constraints at the position and velocity levels using different approaches.

5.1 Analysis of the stability regions

The stability regions in terms of \(\widehat{\alpha }\) and \(\widehat{\beta }\) for the second to the fourth order of the Bézier method are illustrated in the plots of Fig. 1a–c, respectively. In these diagrams, region S is the stable region, \(|{z}_{p}|<1\), while region H shows a relatively higher stable domain for the same systems. The magnitudes of \(|{z}_{p}|\) for regions H are smaller than 0.65, 0.70, and 0.75 for the second, third, and fourth order of the Bézier method, respectively. As discussed earlier, by choosing \(\widehat{\alpha }\) and \(\widehat{\beta }\) in these regions, the error of constraint and its derivative converge to zero more rapidly.

Fig. 1
figure 1

Stability regions in the \(\widehat{\alpha }-\widehat{\beta }\) plane for different orders of the Bézier method

It must be noted that the smallest \(|{z}_{p}|\) that can be found are 0.58, 0.62, and 0.65, respectively for the second, third, and fourth order of the Bézier method. It is noteworthy that for a characteristic equation with orders higher than two, only the dominant eigenvalue, which has the largest \(|{z}_{p}|\), is considered since it has the greatest effect on the constraint error. Figure 1a–c allow to conclude that the stability regions of the Bézier method slightly decrease as the order of the method increases.

In what follows, a comparison between the stability regions of the Bézier and Adams–Bashforth methods is presented. It should be noted that formulations for the second order of both methods are the same and, therefore, they exhibit similar stability regions. Thus, a comparison is considered between the 3rd and 4th order of Bézier and Adams–Bashforth algorithms, as it is illustrated in the plots of Fig. 2. As it can be observed in the diagram, the Bézier stability regions for both the 3rd and 4th orders are larger than those of the Adams–Bashforth. This fact means that the selection range of Baumgarte parameters for the Bézier method is significantly larger, which can be considered as a clear benefit of the presented method when compared with the Adams–Bashforth method. Moreover, it can be seen that the percentage of reducing the size of stability regions from 3rd order to 4th order of Adams–Bashforth is considerably higher than that of the presented Bézier technique.

Fig. 2
figure 2

Comparison between stability regions of Bézier and Adams–Bashforth methods

The subsequent important study is to examine stability regions for the three different techniques, namely the Bézier, Adams–Bashforth and Runge–Kutta methods. It should be noted that the computational costs of the 4th order Bézier and Adams–Bashforth are quite similar when solving the equations of motion. However, the computational cost of the Runge–Kutta method for the same order is about 5 times higher than Bézier and Adams–Bashforth. It is well-known that computational effort plays a key and decisive role in the identification and selection of the most appropriate numerical procedure to solve the equations of motion. In order to provide a simple and fair comparison, the step size of the Runge–Kutta method should be 5 times greater than the step size for the other two methods, to have a similar computational cost for all three approaches. For comparison, the step size is assumed to be 1 ms for Bézier and Adams–Bashforth methods, and 5 ms for Runge–Kutta. Figure 3 shows the stability regions of the mentioned methods in terms of \(2\alpha\) and \({\beta }^{2}\). It can be observed that considering similar computational costs, the Bézier method provides the largest stability region, when compared to the other two methods, while Adams–Bashforth exhibits the smallest region.

Fig. 3
figure 3

Comparison between stability regions of Bezier, Adams–Bashforth and Runge–Kutta methods of order 4 with the same computational cost

5.2 Demonstrative example of application

Figure 4 shows a generic configuration of the planar slider-crank mechanism considered in the scope of this study. The geometrical and inertial properties of the mechanism bodies are presented in Table 3. It should be noted that all joints are considered to be ideal, the gravitational effects are present, and the crank is given an initial angular velocity of 10 rpm counter clockwise. The initial conditions at the position and velocity levels are consistent with the physics of the problem, in order to prevent violation of constraints at the initial instant of analysis, which, eventually, can lead to erroneous results [60].

Fig. 4
figure 4

Planar slider-crank mechanism

Table 3 Properties of the bodies of the slider-crank mechanism [19]

The equations of motion for the slider-crank mechanism can be formulated using an optional set of coordinates. In the formulation considered in the present work, the generalized coordinates are expressed as [29]

$$\mathbf{q}={\left[\begin{array}{ccccc}\theta {}_{1}& {x}_{2}& { y}_{2}& {\theta }_{2}& {x}_{3}\end{array} \right]}^{\mathrm{T}}$$
(18)

where \(\theta {}_{1}\) and \(\theta {}_{2}\) represent the angles of bodies 1 and 2 with respect to the horizon, \({x}_{2}\) and \({x}_{3}\) are the horizontal positions of the centers of mass of bodies 2 and 3 (which are considered to be located at the corresponding mid-points), and \({y}_{2}\) denotes the vertical position of the center of mass of body 2.

The equations of the kinematic constraints of the slider-crank multibody model can be established as

$$\mathbf{c}=\left[\begin{array}{c}\begin{array}{c}{l}_{1}\mathrm{cos}\left({\theta }_{1}\right)+\frac{{l}_{2}}{2}\mathrm{cos}\left({\theta }_{2}\right)-{x}_{2}\\ {l}_{1}\mathrm{sin}\left({\theta }_{1}\right)+\frac{{l}_{2}}{2}\mathrm{sin}\left({\theta }_{2}\right)-{y}_{2}\end{array}\\ {x}_{2}+\frac{{l}_{2}}{2}\mathrm{cos}\left({\theta }_{2}\right)-{x}_{3}\\ {y}_{2}+\frac{{l}_{2}}{2}\mathrm{sin}\left({\theta }_{2}\right)\end{array}\right]$$
(19)

in which \({l}_{1}\) and \({l}_{2}\) denote the lengths of bodies 1 and 2, respectively. With the set of coordinates represented in Eq. (18) and constraint relations expressed in Eq. (19), the resulted mass matrix, constraint Jacobian matrix, vector \({\varvec{\upgamma}}\) and vector \(\mathbf{g}\) are reported in the Appendix presented at the end of the article. Therefore, the equations of motion can be developed as in Eq. (5).

5.2.1 Analysis without constraints stabilization

The first analysis performed in this study was to solve the equations of motion of the mechanism using the 4th order of both Bézier and Adams–Bashforth methods with different step sizes and without incorporating the Baumgarte stabilization method. Thus, in order to examine the stability of the system, the error of the first constraint in Eq. (19), which represents the x-direction constraint due to the revolute joint between the crank and the connecting rod, is computed. This constraint can be considered as representative of all of the constraints in Eq. (19).

Figure 5 compares the error for the first constraint for both Bézier and Adams–Bashforth techniques. Thus, by analyzing these plots, it can be observed that the constraint violation increases linearly with time. Therefore, after some time, either the amount of error reaches a point that causes serious problems for the system simulation or collapses where the error suddenly increases too much. As it is shown in the plots, for all step sizes considered, the collapse point for the Bézier method occurs later than the Adams–Bashforth method, which is a benefit and gain associated with the Bézier integration technique. The errors in the first constraint for both techniques are compared in Fig. 6 for several step sizes. Figures 5 and 6 indicate that both methods have the same order of error by considering the same step sizes. Furthermore, it can be observed that the constraint error for 4th order Bézier is slightly less than 4th order Adams–Bashforth in different step sizes. In particular, the Bézier method provides more stable and even more accurate results for large step sizes, which would be of interest in the cases where computational cost plays a significant role, such as in real-time problems and complex multibody systems.

Fig. 5
figure 5

Error of the 1st constraint equation without stabilization (comparison of collapse points of 4th order of both Adams–Bashforth (AB4) and Bézier (B4) methods using small and large step sizes)

Fig. 6
figure 6

Error of the 1st constraint equation without stabilization (comparison of 4th order of both Adams–Bashforth (AB4) and Bézier (B4) methods using small and large step sizes)

5.2.2 Influence of Baumgarte parameters

This subsection presents a study on the influence of Baumgarte parameters in terms of the constraint violations associated with the slider-crank mechanism. Thus, by choosing the Bézier 4th order method as the numerical solution algorithm with assuming the step size of 1 ms and using the Baumgarte stabilization technique, the equations of motion of the mechanism are obtained. With the purpose of checking the stability of the multibody system, the error of the first kinematic constraint and its derivative are examined. Table 4 shows the dominant poles and the results of simulation for different values of Baumgarte parameters. Figures 7 and 8 show the errors for both the first kinematic constraint and its derivative, which confirm the data listed in Table 4.

Table 4 The dominant poles and the results of simulation for different selections of Baumgarte parameters
Fig. 7
figure 7

Error of the 1st constraint equation with different Baumgarte parameters

Fig. 8
figure 8

Error of the derivative of the 1st constraint equation with different Baumgarte parameters

In case 1 of Table 4, it is expected to observe a divergent response as the parameter \(\widehat{\alpha }\) is negative and \(|{z}_{p}|\) is greater than one. In case 6, although the parameters are positive and therefore, consistent with Baumgarte conditions, the overall result also diverges, because the selected Baumgarte parameters are not within the stability region of the Bézier 4th order method and \(|{z}_{p}|\) is greater than one. The specific cases 2 and 3 show low convergence speeds, since the size of the dominant pole is close to one in both cases. The angle of the dominant pole is high for case 3 and small for case 2. Therefore, case 3 exhibits oscillations, while case 2 does not exhibit significant oscillations. Finally, cases 4 and 5 present high convergence speeds, since the dominant pole for the Bézier 4th order method is considerably less than one, which clearly suggests the existence of a more stable region. The dominant pole angle is high for case 5 and small for case 4, therefore case 5 shows oscillations, while case 4 exhibits either fewer number of oscillations or no oscillations.

5.2.3 Comparative study for constraint stabilization

In this section, 4th order of the Bézier, Adams–Bashforth and Runge–Kutta methods, are examined. Furthermore, Euler’s semi-implicit scheme is compared with the mentioned explicit methods, since it is one of the most simple and popular integration algorithms in real-time simulations. It should be noted that the Bézier and Adams–Bashforth methods are multi-step numerical integration algorithms, while the Runge–Kutta method is a single-step multi-stage numerical integration procedure. The step size for the Bézier, Adams–Bashforth and Euler methods is equal to 1 ms. As mentioned earlier, in order to consider similar computational costs for all methods, the step size of the Runge–Kutta method is 5 times that of the other three methods, that is the time step is equal to 5 ms. With the purpose to compare these methods, the Baumgarte parameters presented in Table 5 have been selected according to the stability regions. The CPU time necessary to solve the equations of motion for each method is reported in Table 6. It can be observed that computational costs are almost the same and the difference between CPU times of each method is less than 4%, which is caused by background apps running on the computer. It must be noticed that the reported CPU times are for 10 s of simulation as it is shown in the plots of Fig. 9 and they represent the average response for 5 simulation trials. The simulations are performed on a laptop with Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz, 8.00 GB DDR4 RAM, Windows 10 64-bit and MATLAB 2017.

Table 5 Influence of dimensionless Baumgarte parameters on the dominant poles for different numerical integration methods
Table 6 CPU time consumed for different numerical integration methods
Fig. 9
figure 9

Influence of the values of \(\widehat{\alpha }\) and \(\widehat{\beta }\) on the error of the 1st constraint equation for different numerical methods

In the first case presented in Table 5, these parameters are selected in such a way that they are within the stability regions of all methods considered. In the second case, for all methods, they are within the stability regions, but the magnitude of the dominant pole of the Adams–Bashforth method is close to one, and in fact, the parameters for the Adams–Bashforth method are close to the boundary of the stability region. In the third case, with a slight change in the value of \(\widehat{\beta }\), the parameters for the Adams–Bashforth method are located outside the region, but close to the boundary of the stability region, and as a result, the size of the dominant pole exceeds one. Moreover, in this particular case, the parameters are within the stability regions of the Bézier, Runge–Kutta and Euler methods. Based on the analysis previously described, it is expected to observe a diverging behavior in the error of constraint and its time derivative for the Adams–Bashforth method, in the third case. Some computational results for these studies are presented in the plots of Fig. 9, from which the following points can be inferred:

  1. 1.

    According to the plots of Fig. 9b, it can be observed that when the Baumgarte parameters are within the stability region and far from the boundaries of the region; the Bézier and Adams–Bashforth methods show almost identical behavior.

  2. 2.

    According to the plots of Fig. 9a, c and f, it is visible that the Runge–Kutta and the Euler’s semi-implicit methods have a constant oscillation around the value of zero, and the amplitude of the oscillation is much larger for the Euler method. For the Bézier and Adams–Bashforth methods, the oscillation is damped out.

  3. 3.

    In the second and third cases plotted in Fig. 9, Baumgarte parameters are close to the boundary of the stability region of the Adams–Bashforth method and the magnitude of \(\angle {z}_{p}\) is large; therefore, the response of this method exhibits irregular oscillations with very high frequency. In the second case, Fig. 9c and d, the Baumgarte parameters are within the stability region, and therefore, the amplitude of these oscillations gradually decreases and the error of constraint converges to zero. Nevertheless, in the third case, see plots in Fig. 9e, these parameters are outside of the stability region, which results in a gradual increase of the amplitude of the oscillations and therefore divergence of the error of the constraint. These findings confirm the validity and potential of the presented stability analysis.

6 Concluding remarks

In this paper, the criterion for obtaining the appropriate Baumgarte parameters for the Bézier numerical integration method has been investigated. The computational performance of the introduced method is studied by comparing stability regions for different orders of the numerical method with the Adams–Bashforth and Runge–Kutta methods. The primary results revealed that the Bézier method provides a larger stability domain, and therefore, a wider range for selection of Baumgarte parameters compared with the classical alternative approaches. Furthermore, the rate at which the stability region gets smaller by increasing the order of the integration is less for the Bézier method when compared to the Adams–Bashforth method. These findings clearly indicate a better performance of the Bézier method compared to both Adams–Bashforth and Runge–Kutta integration techniques. By analyzing the constraint error resulted from various numerical integration algorithms in the computational simulation for a slider-crank mechanism, two main sets of results were drawn. Firstly, for certain values of Baumgarte parameters, the Adams–Bashforth method became unstable while the Bézier method remained stable. The same observation can be shown for the comparison of the Runge–Kutta and Bézier methods as a result of a larger stability region for the Bézier method. This observation is in line with the predicted behavior based on the presented theory. Secondly, for Runge–Kutta and Euler’s semi-implicit methods, a constant oscillation about zero is observed in the plots of constraint error against time, which implies a clear disadvantage of these methods. Considering reasonably high performance of the Bézier based integration scheme, in terms of accuracy and stability, it is expected that the described approach to be considered for different benchmark problems in the context of multibody dynamics.