Next Article in Journal
Numerical Fractional Optimal Control of Respiratory Syncytial Virus Infection in Octave/MATLAB
Previous Article in Journal
Fusion and Enhancement of Consensus Matrix for Multi-View Subspace Clustering
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Exploring Energy in the Direct Correction Method for Correcting Geometric Constraint Violations

Institute of Launch Dynamics, Nanjing University of Science & Technology, Nanjing 210094, China
*
Author to whom correspondence should be addressed.
Mathematics 2023, 11(6), 1510; https://doi.org/10.3390/math11061510
Submission received: 23 February 2023 / Revised: 16 March 2023 / Accepted: 18 March 2023 / Published: 20 March 2023

Abstract

:
The direct correction method is widely used for eliminating geometric constraint violations. This method involves iteratively adjusting the generalized coordinates, which are assumed to be consistent and remain so during the velocity-level corrections. However, the corrected generalized coordinates cause a significant effect on the velocity constraint violations. In this paper, simultaneously correcting both the generalized coordinates and velocities is proposed. A semi-analytic approach to solve the Jacobian matrix, which is used to correct the generalized coordinates and velocities, was employed. Further, the position level, velocity level, and energy constraint equations were corrected simultaneously to ensure that the corrected generalized coordinates and velocities complied with the dynamic equations. The corresponding semi-analytic Jacobian matrix was derived to solve the constraint equations. The methods were demonstrated to be effective using examples, with the simultaneous correction of position-level and velocity-level constraints showing the best results when combined with the energy correction.

1. Introduction

Multibody system dynamics is an important area of study that focuses on modeling the behavior of large and complex mechanical systems precisely and efficiently [1,2,3,4,5,6,7,8]. Much commercial software in dynamics, such as Simpack [9,10], utilizes specific approaches in the underlying layer, using hinge coordinates as generalized coordinates and avoiding global dynamics equations to improve computational efficiency. The approaches include the reduced multibody system transfer matrix method (RMSTMM) [11] and recursive methods [12,13]. They establish a set of ordinary differential equations for an open-loop tree system [14,15]. In contrast, a set of differential algebraic equations (DAEs) is generated to describe the behavior of the closed-loop system [3,7]. The solution to the DAEs is continually improved to ensure computational efficiency, accuracy, and robustness.
There are three main categories for solving DAEs in multibody system dynamics: constraint stabilization approaches, coordinate partitioning methods, and direct correction formulations [16,17]. Constraint stabilization approaches commonly employ the Baumgarte method, which incorporates control feedback theory [18]. However, this approach has certain limitations in terms of stabilization coefficients [19,20,21]. Coordinate partitioning methods [22,23,24] preserve the accuracy of the original dynamic equations but have high computational costs and poor numerical efficiency [25]. In contrast, direct correction formulations offer improved accuracy over the Baumgarte method, while also showing better computational efficiency compared to coordinate partitioning methods [26,27,28].
Direct correction formulations are widely used in multibody system dynamics during the numerical solution of the DAEs [29]. Various techniques of the direct correction have been developed [16,30,31,32,33]. Yoon et al. [34] established a direct correction method to directly correct the values of state variables, resulting in a better fit with the constraint equations. It is worth mentioning, however, that this method is limited to focusing on only position-level constraints. On the other hand, Yu and Chen [28] resolved violation errors by implementing constraints at both the position and velocity levels. The effectiveness of this approach was demonstrated through a simple case, which was compared to the standard formulation and the Baumgarte method. The coordinate projection method [35] combines the direct correction with the constraint manifolds to ensure that the constraints manifold at the position and velocity levels are met in the numerical solution of the DAE by directly adding constraint equations and performing corrections in the orthogonal-to-constraint directions, as illustrated in Figure 1. Gradually, other factors are beginning to be considered. The effect of element inertia is considered by incorporating the mass of an element as a weighting term in mathematical calculations. This results in a more accurate solution as the mass of an element increases, as there is less movement within the constraints [36,37,38,39].
Furthermore, the corrected dynamics are desired to be as close as possible to the original dynamic equations. Violation problems can result in errors in estimating a system’s energy due to constraints changes [16,29]. To address this challenge, extensive research has recently been conducted on system-energy-preserving schemes. Yoon [34] introduced a geometric approach for eliminating constraint violations through a gradient-based procedure. The correction of generalized coordinates was based on the geometric constraint equations, while the correction of generalized velocities was based on the energy constraint. Blajer [38] employed energy constraints to regulate velocity exclusively based on the Lagrangian multiplier methods. Yoon et al. [40] explored different combinations of energy constraint control with other constraint stabilization methods, including the Baumgarte method and the new constraint violation stabilization using gradient feedback. A new approach for implementing constraint controls based on the geometric interpretation of the phase space has been developed using the Euler method. However, these methods have only undergone testing in basic scenarios. Zhang et al. [32] introduced the energy norm method to suppress the constraint violation in three-dimensional multibody systems with a singular mass matrix. Orden et al. proposed using a velocity projection based on the Lagrangian method to eliminate energy constraint violations [41,42]. Changes in both generalized coordinates and velocities can impact the energy of the system. Further research is necessary to fully understand the impact of these changes on the constraints and energy of the system.
The dynamics equation of a multibody system, using RMSTMM as a case, is briefly described in Section 2. In order to address the constraint violation problem encountered when handling closed-loop systems, Section 3 introduces the direct correction method using a two-step approach. First, correcting the generalized coordinates using the constraint equations on the position level through an iterative solution, and then, correcting the generalized velocities using the constraint equations at the velocity level. However, the corrected generalized coordinates directly affect the velocity constraint equations. An attempt is made to directly correct the generalized coordinates and velocities by combining the constraint equations at both the position and velocity levels in Section 4. However, this approach does not take into account the effect of corrected generalized coordinates and velocities on the dynamic equations. Energy constraint equations are added and combined to solve this with the constraint equations on the position and velocity levels to correct the generalized coordinates and velocities in Section 5. The article also notes that the semi-analytical forms of the Jacobian matrices used to correct the generalized coordinates, velocities, and energy are derived in the corresponding section. The effectiveness of this approach is verified through several examples presented in the final section.

2. Constrained Dynamic Systems

Over the years, the solutions for dynamics problems have been diversified. The RMSTMM is widely used by avoiding global dynamics equations with a system inertia matrix. It derives acceleration equations in a recursive manner and can be calculated efficiently [3,11].
The essence of the RMSTMM involves discretizing the system into different elements, such as body and joint elements, and using linear relationships among kinematic and kinetic quantities acting on each element. The method utilizes a general equation, known as the reduced transfer equation, to transfer the dynamical properties of each element and establish the dynamics of the entire system in a recursive manner. The form of reduce transfer equation is as follows:
z a , p = S p z b , p + e p + j χ p , L j z a , C , L j ,
where
z a , p = m T f T p T ,   z b , p = r ¨ T Ω ˙ T p T   .
where z a , p include internal torque m and internal force f and z b , p include translational acceleration r ¨ and angular acceleration Ω ˙ . L j is the jth closed loop. The constraint acting on the jth cut-joint is treated as force z a , C , L j . S p , e p , and χ p , L j are coefficient matrices of point P .
The RMSTMM is an algorithm, which, given generalized coordinates q and velocities q ˙ of a mechanical multibody system, computes the generalized accelerations ( q ¨ ). The generalized acceleration of a multibody system is obtained using the transfer equation as follows:
(a)
The spanning tree system can be derived by cutting the connecting joint, and the initial values for the reduced transfer matrices are set based on the equations for the cut-joint;
(b)
The reduced transfer matrices for each element can be determined by sweeping through the spanning tree system;
(c)
Force z a , C , L j is determined by using the supplementary equations for the cut-joint and iteratively sweeping through the spanning tree;
(d)
The intermediate vectors z a , p and z b , p can be calculated recursively using the reduced transfer equations in the reverse direction of the transfer path. The generalized acceleration can be obtained as described in reference [43].
Finally, a numerical algorithm for solving ordinary differential equations uses the generalized acceleration obtained to evaluate the generalized coordinates and velocities of the next step. During the solution process, the global dynamics equations are avoided. A fast, accurate solution to the violation problem is paramount, especially in the unknown overall dynamics equations. The direct correction method was favored due to its simplicity, high accuracy, and low computational cost. This method directly supplements the constraint equations and performs corrections, making it an effective solution for addressing violation problems.

3. Direct Elimination of Position-Level and Velocity-Level Geometric Constraint Violations

3.1. Direct Correct Formulations

A general and comprehensive direct correction method [40] accurately solves the constraint divergence problem by eliminating the constraint violation at both the position and velocity levels without increasing the computational effort. During the numerical solution of the dynamic method, the constraint on the acceleration level is a strong constraint that must be met. However, constraints on the position and velocity levels may not be upheld due to integration errors. To control this error, the constraint equations for the position and velocity levels were introduced. The system’s generalized coordinates were corrected firstly using the Newton–Raphson iteration method, denoted as
c q + c q Δ q   = 0 ,
where the constraint equations at the position level of a cut-joint are denoted as c , and the rectangular matrix representing the constraint Jacobian is denoted as c q .
The velocity constraint is modified by considering only the effect of the generalized velocities as the generalized coordinates have been corrected. In turn, it is known that the Jacobian matrix c q can represent the derivative of the velocity constraint equations with respect to generalized velocities c ˙ q ˙ . The Newton–Raphson formula for the constraint equation on the velocity level can be expressed as
0 = c ˙ q , q ˙ + Δ q ˙ c ˙ q , q ˙ + c ˙ q ˙ Δ q ˙ = c ˙ q , q ˙ + c q Δ q ˙ .
The constraint equations were established based on the type of cut-off joint. A pin joint element moving in the plane was used for completeness. The base and moving ends of the cut-off joint were marked as B and M, respectively. The relative displacement of the cut-off pin joint moving in the plane was restricted, and the constraint equation on the position level can be expressed as
c = r OM r OB = 0 ,
where r OB denotes the position of the base marker with respect to the inertial frame, r OM denotes the position of the moving marker, and subscript O denotes the inertial coordinate system.
The constraint equation on the velocity level, using the example of the pin cut-off joint, can be established as
c ˙ = r ˙ OM r ˙ OB = 0 ,
where r ˙ OB denotes the velocity of the base marker with respect to the inertial frame and r ˙ OM denotes the velocity of the moving marker.
The Jacobian matrices c q = c / q are typically derived using the direct differential method. However, as a system’s complexity increases, the Jacobian matrix’s complexity also increases, resulting in a significant computational burden. In order to solve this issue, the derivations of the semi-analytic Jacobian matrices are discussed in greater detail below.

3.2. The Jacobian Matrix of the Constraint Equation

The Jacobian matrix is an essential tool used to analyze the dynamics of systems and can be represented as a matrix of partial derivatives of constraints with respect to the system’s generalized coordinates. The system Jacobian matrix, as presented in Equation (3), can be represented as
c q = c q 1 c q n .
Assuming that all other generalized coordinates remain constant, the constraint equation with respect to generalized coordinate q j can be expressed as follows:
c q j + c q j q j Δ q j = 0 .
The sub-matrix c / q j of the Jacobian matrix can be derived based on the characteristics of a joint element. It can be derived in the semi-analytical form in the following manner.
Let us consider the case of pin joint element j rotated about the z-axis of the body-fixed frame and encountered in the closed loop. The angle of the joint serves as the generalized coordinate, represented by
q j = θ z , j .
The root and tip ends of pin joint j are marked as R j and T j , as shown in Figure 2. If this joint is associated with the B end of cut-joint L, then changes in generalized coordinate q j of the joint will not affect the displacement of the M end in Equation (5), no matter how it changes. The displacement of the B end, on the other hand, is described by
r OB = r OR j + r R j T j + r T j B = r OR j + A OR j l R j T j + A OR j A R j T j A OT j T r T j B ,
where subscripts R j and T j denote the body-fixed coordinate system with points R j and T j , respectively; r OP denotes the position of P point with respect to the inertial frame; l R j T j describes the position vector from R j point to T j point in the body-fixed coordinate system with the R j point; and cosine matrix A OP denotes the coordinate transformation from the body-fixed coordinate system as the origin with the P point to the inertial frame, as noted in
A OP = cos θ OP sin θ OP sin θ OP cos θ OP .
The kinematic quantities were transferred along with the elements recursively using the RMSTMM. As a result, the quantities at the root end of the joint element passed from the inboard element would not change, irrespective of this generalized coordinate. Since the pin joint can only rotate around the z-axis, l R j T j will be zero. Furthermore, displacement A OT j T r T j B described in the coordinate system fixed on the tip end of the joint will also be independent of the generalized coordinate. The partial derivative of Equation (10) with respect to the generalized coordinate of the joint element can be represented as
q j r OB = q j ( r OR j + A OR j l R j T j + A OR j A R j T j A OT j T r T j B ) = A OR j A R j T j q j A OT j T r T j B = A OR j D A R j T j A OT j T r T j B = D r T j B ,
where a relationship exists for joint j that can be represented as
A R j T j / q j = D A R j T j ,
D = 0 1 1 0 .
By substituting Equation (12) into the partial derivative of Equation (5), the Jacobian submatrix can be obtained as
c q j = r OB q j = [ D r T j B ] .
If joint j is associated with the M end of cut-joint L, the same applies to r OM / q j , denoted as
q j r OM = q j ( r OR j + A OR j l R j T j + A OR j A R j T j A OT j T r T j M ) = A OR j A R j T j q j A OT j T r T j M = D r T j M .
By substituting Equation (16) into the partial derivative of Equation (5), the Jacobian submatrix can be derived as
c q j = r OM q j = [ D r T j M ] .

4. Simultaneous Eliminations of Position-Level and Velocity-Level Geometric Constraint Violations

The general approach used is to adjust the generalized coordinates and velocities in succession. The velocity constraint equations, however, are influenced not only by the generalized velocities but also by the corrected generalized coordinates. The correction of generalized coordinates will cause the velocity constraint equations to be further violated. Here, the generalized coordinates and velocities were corrected together, which is studied in this section.

4.1. Simultaneous Formulation for Correcting Position-Level and Velocity-Level Constraints

The general direct correction method maintains a clear linear relationship between the constraints on the velocity level and the generalized velocities. Nevertheless, the generalized coordinates and velocities can affect the velocity constraints, resulting in a more complex relationship that is no longer purely linear. In such a case, the constraint equation on the velocity level will be expressed as
c ˙ q , q ˙ = 0 .
The equation representing the elimination of violation on the velocity level through adjusting the generalized coordinates and velocities is expressed as
c ˙ q , q ˙ + c ˙ q Δ q + c ˙ q ˙ Δ q ˙ = 0 .
The constraint equation c s during simultaneous correction changes to
c s = c q c ˙ q , q ˙ = 0 .
The Newton–Raphson iteration method is used to correct the generalized coordinates and velocities simultaneously, and it is represented as follows:
c c ˙ + c q O c ˙ q c ˙ q ˙ Δ q Δ q ˙ = 0 .
The Jacobian matrix is essential in understanding how changes in the system’s variables affect its constraints. At this stage, updating the Jacobian matrix by calculating the partial derivatives of the constraint equations on the velocity level with respect to the generalized coordinates and velocities is necessary.

4.2. The Jacobian Matrix of the Constraint Equation

It is known that Jacobian matrix c q to correct the constraints at the position level is equal to Jacobian matrix c ˙ q ˙ , then the one to be solved is c ˙ q . The Jacobian matrix c ˙ q is solved similarly to the Jacobian matrix on the position level c q . When pin joint j is associated with the B end of a cut-joint, the following steps should be taken. The generalized coordinate of the joint is denoted as Equation (9), and it will not affect the velocity r ˙ OM in Equation (6). The velocity r ˙ OB , on the other hand, is described by taking the derivative of Equation (10) with respect to time, read as
r ˙ OB = r ˙ OR j + r ˙ R j T j + r ˙ T j B = r ˙ OR j + ( D A OR j θ ˙ OR j l R j T j + A OR j l ˙ R j T j ) + ( D A OR j θ ˙ OR j A R j T j l T j B + A OR j D A R j T j θ ˙ R j T j l T j B + A OR j A R j T j l ˙ T j B ) ,
where the first-time derivatives of the directional cosine matrix A OR j can be expressed as
A ˙ OR j = sin θ OR j θ ˙ OR j cos θ OR j θ ˙ OR j cos θ OR j θ ˙ OR j sin θ OR j θ ˙ OR j = 0 1 1 0 cos θ OR j sin θ OR j sin θ OR j cos θ OR j θ ˙ OR j = : D A OR j θ ˙ OR j .
The kinematic quantities A OR j , r ˙ OR j , and θ ˙ OR j passed from the inboard element through the kinematics analysis remain constant, irrespective of the generalized coordinate. Furthermore, l T j B is the projection of displacement r T j B onto the T j -fixed reference frame, which is unaffected by the generalized coordinate. As the pin joint can only rotate around the z-axis, l ˙ R j T j will be zero. Only A R j T j is affected by the generalized coordinate in Equation (22). The partial derivative with respect to the generalized coordinate of the equation above, based on Equation (13), yields
r ˙ OB q j = D A OR j θ ˙ OR j A R j T j q j l T j B + A OR j D A R j T j q j θ ˙ R j T j l T j B + A OR j A R j T j q j l ˙ T j B = D A OR j θ ˙ OR j A R j T j D l T j B + A OR j D A R j T j D θ ˙ R j T j l T j B + A OR j A R j T j D l ˙ T j B = A OT j l T j B θ ˙ OR j A OT j l T j B θ ˙ R j T j + A OT j D l ˙ T j B .
By combining Equation (24) with the partial derivative of Equation (6) for generalized coordinate q j , one obtains
c ˙ q j = r ˙ OB q j = A OT j l T j B θ ˙ OR j + A OT j l T j B θ ˙ R j T j A OT j D l ˙ T j B .
Similarly, the M end of the cut-off joint is associated with pin joint j. As a result, velocity r ˙ OB will remain unchanged despite any movement of the joint. The same as r ˙ OB / q j holds true for r ˙ OM / q j , which is represented as
q j r ˙ OM = q j ( r ˙ OR j + r ˙ R j T j + r ˙ T j M ) = D A OR j θ ˙ OR j A R j T j q j l T j M + A OR j D A R j T j q j θ ˙ R j T j l T j M + A OR j A R j T j q j l ˙ T j M = A OT j l T j M θ ˙ OR j A OT j l T j M θ ˙ R j T j + A OT j D l ˙ T j M .
By substituting Equation (26) into the partial derivative of Equation (6), the Jacobian submatrix reads as
c q j = A OT j l T j M θ ˙ OR j A OT j l T j M θ ˙ R j T j + A OT j D l ˙ T j M .
The obtained Jacobian submatrices c ˙ q are combined with c q to form the overall Jacobian matrix. The overall Jacobian matrix is then used in Equation (21) to correct generalized coordinates and velocities of the system with closed loops simultaneously.

5. Simultaneous Elimination of Position-Level, Velocity-Level, and Energy Constraint Violations

The violation correction process in physics and engineering refers to adjusting the system state q , q ˙ to ensure that constraints, such as the position and velocity, are met. The violation correction expects to minimize the impact of these adjustments on the dynamics of the system. The dynamics equation is essentially the first-order derivative of the energy conservation equation. Consequently, it is crucial to take the energy constraint equation into account. The system constraint equations c E are now represented as
c E = c c ˙ Δ E .
The Newton–Raphson formula for constraint c E to correct the generalized coordinates and velocities is described as
c E + c E q T q ˙ T T Δ q q ˙ = 0 .

5.1. Simultaneous Formulation for Correcting Position-Level, Velocity-Level, and Energy Constraints

The constraint equation of energy in a conservative system, disregarding any energy consumption or supplementation [29], can be expressed as follows:
Δ E   =   E E 0 = 0 ,
where E is the system energy calculated at each correction point. E 0 is the initial energy of the system, which remains constant. The Jacobian matrices of the energy constraint equation for generalized coordinates and velocities q , q ˙ can be simplified to
Δ E q = E E 0 q = E q Δ E q ˙ = E E 0 q ˙ = E q ˙ .
The system energy is composed of the system kinetic energy and the system potential energy, denoted as
E   =   V + T ,
where V is the potential energy of the system and T is the kinetic energy of the system. The system potential or kinetic energy is the sum of the potential or kinetic energy of each element, denoted as
V = i = 1 n V H i + i = 1 n V B i ,
T = i = 1 n T B i ,
where V B i V H i is the potential energy of the ith body(joint) element in the system, and n is the total number of the body or joint elements in the system. T B i is the kinetic energy of the ith body element in the system. It is important to note that the joint element serves solely as a constraint on the system and does not impact the potential energy of system.
The calculation of energy at each moment in the system is influenced by the generalized coordinates and velocities. To correct energy violations, it is necessary to adjust both simultaneously. The correction equation for the energy constraint, utilizing the Newton–Raphson iteration method, is referred to as
Δ E + E q Δ q + E q ˙ Δ q ˙ = 0 .
By combining this with the Jacobian matrix c s in Equation (21), the Jacobian matrix in Equation (29) can be written as
c E q T q ˙ T T = c q O c ˙ q c q E q E q ˙ .
The correction process will utilize the derived constraints at the position and velocity levels and their corresponding Jacobian matrices c q , c ˙ q . The following section will derive the semi-analytical form of the Jacobian matrix E q , with E q ˙ required for the energy correction.

5.2. The Jacobian Matrix of the Constraint Equation

In the context of the simultaneous energy correction in Equation (36), the Jacobian matrix can be represented in a specific form:
c E q 1 q n q ˙ 1 q ˙ n T = c q 1 c q n O O c ˙ q 1 c ˙ q n c q 1 c q n E q 1 E q n E q ˙ 1 E q ˙ n .
The Jacobian matrices of the energy correction, as the energy equations illustrated in Equations (32)–(34), can be represented as the combination of the Jacobian matrix of potential energy and the Jacobian matrix of kinetic energy, read as
E q j = V q j + T q j E q ˙ j = V q ˙ j + T q ˙ j ,
where
T q j = i = 1 n T B i q j ,
V q j = i = 1 n V H i q j + i = 1 n V B i q j .
Determining the partial derivatives of the kinetic energy and potential energy for the i th i = 1 , 2 n body and joint with respect to the generalized coordinate and velocity q j , q ˙ j is necessary. These partial derivatives will be computed using a semi-analytic approach as outlined in the following subsection.

5.2.1. The Partial Derivative of the Potential Energy for Rigid Body i

The potential energy of the ith rigid element, assuming that the plane on which the ground allocate has a potential energy of zero, can be represented mathematically as
V B i = m i r OC i T g ,
where m i is the mass of ith rigid body and g is the acceleration due to gravity. This calculation is based on the consideration that gravity is the only applied force acting on the element.
The partial derivative of potential energy V B i with respect to the generalized coordinate and velocity of joint j yield
V B i q j = m i r OC i q j T g ,
V B i q ˙ j = m i r OC i q ˙ j T g .
The mass and gravitational acceleration of the rigid element are known in the above equation. It is necessary to determine a semi-analytic expression for the partial derivatives of r OC i with respect to generalized coordinate q j and velocity q ˙ j . Similar to Equation (10), r OC i can be represented in terms of the kinematic quantities of joint j, written as
r OC i = r OR j + r R j T j + r T j C i = r OR j + A OR j l R j T j + A OR j A R j T j A OT j T r T j C i .
Kinematic quantities r OR j and A OR j at the root end of joint j are derived from the inboard body element and are unaffected by joint j. Displacement A OT j T r T j C i , described in the T j -fixed frame, varies with time but is independent of joint j. Therefore, the partial derivative of Equation (44) with respect to generalized coordinate q j can be represented as
r OC i q j = A OR j l R j T j + A OR j A R j T j A OT j T r T j C i q j = A OR j l R j T j q j + A OR j A R j T j q j A OT j T r T j C i .
The kinematic quantities of joint j, as described earlier, are
l R j T j q j = 0 , A R j T j q j = A R j T j D .
Substituting Equation (46) into Equation (45) gives
r OC i q j = D r T j C i .
Since the quantities in Equation (44) are independent of the generalized velocity, the partial derivatives of the equation with respect to generalized velocity q ˙ j will be
r OC i q ˙ j = 0 .
The partial derivative of potential energy V B i with respect to the generalized coordinate of joint j is given by the expression in
V B i q j = m i D r T j C i T g = m i r T j C i T D g .
The partial derivative of potential energy V B i with respect to generalized velocity q ˙ j is
V B i q ˙ j = 0 .

5.2.2. The Partial Derivative of the Kinetic Energy for Rigid Body i

The kinetic energy for rigid body i can be expressed as
T B i = 1 2 m i r ˙ OC i 2 + 1 2 θ ˙ OC i 2 J C i ,
where J C i is the moment of inertia of the body about the center of mass and θ ˙ OC i is the angular velocity of the body. The partial derivatives of the kinetic energy for the ith rigid body with respect to the generalized coordinate and velocity for joint j can be represented as
T B i q j = q j 1 2 m i r ˙ OC i 2 + 1 2 θ ˙ OC i 2 J C i = m i r ˙ OC i T r ˙ OC i q j + θ ˙ OC i q j T θ ˙ OC i J C i ,
T B i q ˙ j = q ˙ j 1 2 m i r ˙ OC i 2 + 1 2 θ ˙ OC i 2 J C i = m i r ˙ OC i T r ˙ OC i q ˙ j + θ ˙ OC i q ˙ j θ ˙ OC i J C i .
Quantities r ˙ OC i and θ ˙ OC i in Equations (52) and (53) can be obtained using kinematic analysis. These quantities, along with the known quantities of mass and rotational inertia, are used to compute the overall influence of joint j on the kinetic energy of rigid body i. Similar to Equation (22), velocity r ˙ OC i can be obtained by taking the derivative of Equation (44) with respect to time, read as
r ˙ OC i = r ˙ OR j + r ˙ R j T j + r ˙ T j C i = r ˙ OR j + A OR j l R j T j + A OR j A R j T j A OT j T r T j C i = r ˙ OR j + D A OR j θ ˙ OR j l R j T j + A OR j l ˙ R j T j + D A OR j θ ˙ OR j A R j T j A OT j T r T j C i + A OR j D A R j T j θ ˙ R j T j A OT j T r T j C i + A OR j A R j T j d d t A OT j T r T j C i .
Kinematic quantities r ˙ OR j , A OR j , θ ˙ OR j , and A OT j T r T j C i in Equation (54) remain unchanged despite any movement of joint j. The partial derivative of velocity r ˙ OC i with respect to generalized coordinate q j can be represented as
r ˙ OC i q j = D A OR j θ ˙ OR j l R j T j q j + A OR j l ˙ R j T j q j + D A OR j θ ˙ OR j A R j T j q j A OT j T r T j C i + A OR j D A R j T j q j θ ˙ R j T j A OT j T r T j C i + A OR j D A R j T j θ ˙ R j T j q j A OT j T r T j C i + A OR j A R j T j q j d d t A OT j T r T j C i ,
where d A OT j T r T j C i / d t described in the tip-fixed frame varies with time but does not change with q j , described as
d d t A OT j T r T j C i = A ˙ OT j T r T j C i + A OT j T r ˙ T j C i = D A OT j θ ˙ OT j T r T j C i + A OT j T r ˙ T j C i .
The quantities of joint j, as previously described, are
l R j T j q j = 0 , A R j T j q j = A R j T j D , θ ˙ R j T j q j = 0 , l R j T j q ˙ j = 0 , A R j T j q ˙ j = 0 , θ ˙ R j T j q ˙ j = 1 .
The semi-analytic form of the partial derivative of r ˙ OC i / q j can be obtained by substituting Equation (57) into Equation (55). These partial derivatives can be represented as:
r ˙ OC i q j = r T j C i θ ˙ OR j r T j C i θ ˙ R j T j + A OT j D d d t A OT j T r T j C i .
A well-known fact is that the partial derivatives r OC i / q j and r ˙ OC i / q ˙ j are equal. Referring to Equation (47), r ˙ OC i / q ˙ j can be expressed as
r ˙ OC i q ˙ j = D r T j C i .
Quantity θ ˙ OC i in Equations (52) and (53) can be expressed as
θ ˙ OC i = θ ˙ OR j + θ ˙ R j T j + θ ˙ T j C i .
The analysis conducted earlier indicates that the generalized coordinate and velocity exclusively impact θ ˙ R j T j in the above equation. Substituting Equation (57) into Equation (60), θ ˙ OC i / q j , θ ˙ OC i / q ˙ j yields
θ ˙ OC i q j = θ ˙ R j T j q j = 0 , θ ˙ OC i q ˙ j = θ ˙ R j T j q ˙ j = 1 .
Substituting Equations (58) and (61) into Equation (52) allows for the semi-analytic calculation of the partial derivative of the kinetic energy with respect to the generalized coordinate, represented as
T B i q j = m i r ˙ OC i T r ˙ OC i q j + θ ˙ OC i q j T θ ˙ OC i J C i = m i r ˙ OC i T r T j C i θ ˙ OR j r T j C i θ ˙ R j T j + A OT j D d d t A OT j T r T j C i .
The semi-analytic form of the partial derivative of kinetic energy with respect to the generalized velocity can be obtained by substituting Equations (59) and (61) into Equation (53). The expression is written as
T B i q ˙ j = m i r ˙ OC i T r ˙ OC i q ˙ j + θ ˙ OC i q ˙ j θ ˙ OC i J C i = m i r ˙ OC i T D r T j C i + θ ˙ OC i J C i .

5.2.3. The Partial Derivative of the Potential Energy for Joint i

The potential energy of joint i can be described as
V H i = 1 2 k q i 2 ,
where k is the stiffness coefficient of joint i. The potential energy V H i is affected by changes in joint j if i = j holds. The partial derivative of the potential energy of joint j with respect to the generalized coordinate and velocity can be represented as
V H j q j = k q j , V H j q ˙ j = 0 .

6. Test Simulations

The precision of the method was evaluated using a conservative four-link system subjected to gravity as the only applied force (Figure 3). The system assumed identical link dimensions (1 m in length and 1 kg in mass), and the third joint was cut to create a span system with q = q 1 q 2 q 3 T . The dynamic calculations were performed using the RMSTMM, and the initial conditions were set as q 1 = π / 3 , q 2 = π / 3 , and q 3 = π / 3 . A fixed-step fourth-order Runge–Kutta algorithm with a very small step size ( Δ t = 0.001 s) was used for the numerical solution. The following four scenarios were conducted.
(a)
No constraint controls;
(b)
Direct elimination of position-level and velocity-level geometric constraint violations;
(c)
Simultaneous elimination of position-level and velocity-level geometric constraint violations;
(d)
Simultaneous elimination of position-level, velocity-level, and energy constraint violations.
Figure 3. Multibody model of a planar four bar mechanism.
Figure 3. Multibody model of a planar four bar mechanism.
Mathematics 11 01510 g003
Figure 4 illustrates the position constraint violations in the x-direction over time for different results. The violation in scenario (a) was divergent. Scenario (c) had a smaller constraint violation than scenario (b). Furthermore, scenario (d) had the smallest violations among all cases and was closest to zero.
Figure 5 shows the position constraint violations in the y-direction. The violations with scenario (b) were the largest among the correction scenarios. Scenario (c) managed to keep the constraint violations smaller, within the range of ± 0.3 × 10 13 . The violation of scenario (d) was the smallest among all cases, consistently staying within the range of ± 2 × 10 16 .
Figure 6 illustrates the velocity constraint violations in the x-direction for different scenarios. Scenario (b) only corrected the velocity constraint violations once, using Equation (4). As shown in the figure, the violations no longer diverged after correction. In contrast, scenario (c) included the velocity constraints in the constraint equations and corrected them, staying within a minor violation. Scenario (d) was notably closer to zero and demonstrated superior control.
The variation of the velocity constraint in the y-direction shown in Figure 7 became more pronounced, with a clear trend of divergence in the violations without correction. The constraint correction for the velocity level was applied once at each corrected moment in scenario (b), remaining within a range of ± 3 × 10 13 . Meanwhile, scenario (c) kept the violations within a range of ± 1 × 10 13 . Scenario (d) provided better accuracy of the violation at ± 0.3 × 10 13 .
It is important to note that non-conservation of the system energy can lead to calculation errors and inaccuracies. Therefore, correcting energy violations is crucial for achieving accurate and reliable results. Figure 8 illustrates the variations in energy violations under different scenarios. Scenario (a) showed an apparent change in energy. However, scenarios (b) and (c) provided a degree of correction to the energy violation, but the difference in energy variations between these scenarios was insignificant. Scenario (d) consistently penalized energy violations as expected, providing superior control and more robust energy stability.
Next, a complex closed-loop example, as depicted in Figure 9, was used to examine these scenarios. The system comprised rigid bodies with an identical mass of 1 kg and moment of inertia of J C = 1 / 6   kg m 2 . The motion of the system was under the effect of gravity. The arrow direction in the figure indicates the transfer direction of the body element and its adjacent joint elements. The span tree system was obtained by cutting joints 13, 14, and 15. The simulation was conducted based on the RMSTMM using the fourth-order Runge–Kutta algorithm with a small time step of 0.001 s. Four different test scenarios were carried out:
(a)
No constraint controls;
(b)
Direct elimination of position-level and velocity-level geometric constraint violations;
(c)
Simultaneous elimination of position-level and velocity-level geometric constraint violations;
(d)
Simultaneous elimination of position-level, velocity-level, and energy constraint violations.
The simulation results were analyzed and compared to evaluate the performance of the different scenarios.
Figure 9. A multibody system with closed loops.
Figure 9. A multibody system with closed loops.
Mathematics 11 01510 g009
The behavior of the system’s violations over time was still observed using the different correction scenarios. The position and velocity constraints of joints 13, 14, and 15 were well corrected compared to the uncorrected scenario. However, the overall trends remained consistent. As an illustration, the trend of hinge element 15 in Figure 10 is presented, providing a clear view of the corrections. Figure 10 includes the following:
(1)
Position constraint violations in the x-direction;
(2)
Position constraint violations in the y-direction;
(3)
Velocity constraint violations in the x-directional;
(4)
Velocity constraint violations in the y-directional.
The deviation on the velocity level was more significant than the position level. By comparing scenarios (b), (c), and (d), scenarios (c) and (d) had the best correction performance and could effectively control the violations, while scenario (b) had a weaker correction performance. In long-term simulations, scenario (b) struggled to effectively control the violations. In contrast, scenario (c) was seen to control the violations effectively and consistently compared to scenario (b). Furthermore, scenario (d) exhibited the smallest violations and was closest to the 0-axis, making it the most effective correction scenario.
Figure 10. The violation of constraints in joint 14. (1) Position constraint violations in the x-direction; (2) Position constraint violations in the y-direction; (3) Velocity constraint violations in the x-directional; (4) Velocity constraint violations in the y-directional.
Figure 10. The violation of constraints in joint 14. (1) Position constraint violations in the x-direction; (2) Position constraint violations in the y-direction; (3) Velocity constraint violations in the x-directional; (4) Velocity constraint violations in the y-directional.
Mathematics 11 01510 g010
Energy changes can also have an immeasurable impact on simulations. Figure 11 illustrates the energy changes under four different scenarios: (a), (b), (c), and (d). Without correction, as time progressed, the energy curve of scenario (a) exhibited a clear diverging trend. Scenario (b), which corrected the velocity violation without iteration, also caused the energy to diverge. Scenario (c) did not show a significant divergence in energy, but the violation was still present. In contrast, scenario (d) effectively corrected the energy as expected. This correction reduced the energy violation and minimized its effect on numerical integration during long-term simulations.

7. Conclusions

This article discussed direct correction methods in violation problems of the dynamic methods, which avoid global dynamics equations with a system inertia matrix. The general direct correction only corrects velocity constraints without consecutive iteration, but this article suggested a method that simultaneously corrects constraints at both the position and velocity level. Energy violations can potentially lead to system failure in long-time simulations. Hence, the article discussed a new approach for correcting dynamics systems violation problems that consider constraints at both the position and velocity level, along with changes in the system’s energy. This approach improved the accuracy and robustness of simulation results by taking into account all constraints, resulting in stable and predictable system behavior in actual operation.
This article attempted to correct the energy while also correcting position and velocity constraints, but the effect of energy on violation issues remains worth investigating. The potential future research objectives are as follows: (1) One of the apparent areas for improvement of energy constraint control methods is the accuracy of determining E for non-conservative systems [38]. It is worth delving into how to correct energy for non-conservative systems and the derivation of its correction Jacobian matrix in a semi-analytical form. (2) The increasing use of lightweight and flexible materials in mechanical systems offers many benefits but presents challenges when modeling and analyzing the systems. These materials exhibit complex behavior, and modeling them using kinetic methods can lead to intricate DAEs. Therefore, it is an important area of research in the future to investigate the effect of energy corrections on flexible bodies to ensure accurate and reliable analysis.

Author Contributions

Conceptualization, L.Z. and J.Z.; methodology, L.Z. and X.R.; software, L.Z. and J.G.; validation, L.Z.; formal analysis, X.R.; investigation, L.Z.; resources, J.G.; data curation, L.Z.; writing—original draft preparation, L.Z.; writing—review and editing, J.Z. and X.Z.; visualization, L.Z.; supervision, J.Z. and X.Z.; project administration, X.R.; funding acquisition, J.G. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by National Natural Science Foundation of China under grant number 11902158, the Natural Science Foundation of Jiangsu Province under grant number BK20190438, and the Multi-Domain System Model Simulation and Collaborative Verification Technology (JCKY2020606B004).

Data Availability Statement

Not applicable.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Amirouche, F.M. Computational Methods in Multibody Dynamics; Prentice-Hall, Inc.: Englewood Cliffs, NJ, USA, 1992. [Google Scholar]
  2. De Jalon, J.G.; Bayo, E. Kinematic and Dynamic Simulation of Multibody Systems: The Real-Time Challenge; Springer Science & Business Media: Berlin, Germany, 2012. [Google Scholar]
  3. Liu, Y.; Pan, Z.; Ge, X. Dynamics of Multibody Systems; Higher Education Press: Beijing, China, 2014. [Google Scholar]
  4. Nikravesh, P.E. Computer-Aided Analysis of Mechanical Systems; Prentice-Hall, Inc.: Englewood Cliffs, NJ, USA, 1988. [Google Scholar]
  5. Roberson, R.E.; Schwertassek, R. Dynamics of Multibody Systems; Springer Science & Business Media: Berlin, Germany, 2012. [Google Scholar]
  6. Schiehlen, W. Multibody Systems Handbook; Springer: Berlin, Germany, 1990. [Google Scholar]
  7. Shabana, A.A. Dynamics of Multibody Systems; Cambridge University Press: Cambridge, UK, 2020. [Google Scholar]
  8. Wittenburg, J. Dynamics of Systems of Rigid Bodies; Springer: Berlin, Germany, 2013. [Google Scholar]
  9. Rulka, W. SIMPACK—A computer program for simulation of large-motion multibody systems. In Multibody Systems Handbook; Springer: Berlin/Heidelberg, Germany, 1990; pp. 265–284. [Google Scholar]
  10. Schupp, G.; Netter, H.; Mauer, L.; Gretzschel, M. Multibody system simulation of railway vehicles with SIMPACK. In The Manchester Benchmarks for Rail Vehicle Simulation; Routledge: London, UK, 2017; pp. 101–118. [Google Scholar]
  11. Rui, X.; Zhang, J.; Wang, X.; Rong, B.; He, B.; Jin, Z. Multibody system transfer matrix method: The past, the present, and the future. Int. J. Mech. Syst. Dyn. 2022, 2, 3–26. [Google Scholar] [CrossRef]
  12. Brandl, H.; Johanni, R.; Otter, M. A Very Efficient Algorithm for the Simulation of Robots and Similar Multibody Systems without Inversion of the Mass Matrix. IFAC Proc. Vol. 1986, 19, 95–100. [Google Scholar] [CrossRef]
  13. Cammarata, A.; Sinatra, R.; Maddìo, P.D. Interface reduction in flexible multibody systems using the Floating Frame of Reference Formulation. J. Sound Vib. 2022, 523, 116720. [Google Scholar] [CrossRef]
  14. Anderson, K.S. Recursive Derivation of Explicit Equations of Motion for Efficient Dynamic/Control Simulation of Large Multibody Systems; Stanford University: Stanford, CA, USA, 1990. [Google Scholar]
  15. Brandl, H. An Algorithm for the Simulation of Multibady An Algorithm for the Simulation of Multibody Systems with Kinematic Loops. In Proceedings of the 7th World Congress in the Theory of Machines and Mechanisms, Sevilla, Spain, 17–22 September 1987. [Google Scholar]
  16. Marques, F.; Souto, A.P.; Flores, P. On the constraints violation in forward dynamics of multibody systems. Multibody Syst. Dyn. 2017, 39, 385–419. [Google Scholar] [CrossRef] [Green Version]
  17. Nikravesh, P.E. Some Methods for Dynamic Analysis of Constrained Mechanical Systems: A Survey, Computer Aided Analysis and Optimization of Mechanical System Dynamics; Springer: Berlin, Germany, 1984; pp. 351–368. [Google Scholar]
  18. Baumgarte, J. Stabilization of constraints and integrals of motion in dynamical systems. Comput. Methods Appl. Mech. Eng. 1972, 1, 1–16. [Google Scholar] [CrossRef]
  19. Flores, P.; Machado, M.; Seabra, E.; Miguel, T. A Parametric Study on the Baumgarte Stabilization Method for Forward Dynamics of Constrained Multibody Systems. J. Comput. Nonlinear Dyn. 2009, 6, 011019. [Google Scholar] [CrossRef]
  20. Lin, S.-T.; Huang, J.-N. Stabilization of Baumgarte’s method using the Runge-Kutta approach. J. Mech. Des. 2002, 124, 633–641. [Google Scholar] [CrossRef] [Green Version]
  21. Zhang, P. A Stabilization of Constraints in the Numerical Solution of Euler-Lagrange Equation. Chin. J. Eng. Math. 2003, 20, 13–18. [Google Scholar]
  22. Carpinelli, M.; Gubitosa, M.; Mundo, D.; Desmet, W. Automated independent coordinates’ switching for the solution of stiff DAEs with the linearly implicit Euler method. Multibody Syst. Dyn. 2016, 36, 67–85. [Google Scholar] [CrossRef]
  23. Pappalardo, C.M.; Lettieri, A.; Guida, D. Stability analysis of rigid multibody mechanical systems with holonomic and nonholonomic constraints. Arch. Appl. Mech. 2020, 90, 1961–2005. [Google Scholar] [CrossRef]
  24. Wehage, K.T.; Wehage, R.A.; Ravani, B. Generalized coordinate partitioning for complex mechanisms based on kinematic substructuring. Mech. Mach. Theory 2015, 92, 464–483. [Google Scholar] [CrossRef]
  25. Fisette, P.; Vaneghem, B. Engineering, Numerical integration of multibody system dynamic equations using the coordinate partitioning method in an implicit Newmark scheme. Comput. Methods Appl. Mech. Eng. 1996, 135, 85–105. [Google Scholar] [CrossRef]
  26. Flores, P. A Study on Constraints Violation in Dynamic Analysis of Spatial Mechanisms. In Computational Kinematics; Zeghloul, S., Romdhane, L., Laribi, M., Eds.; Springer: Cham, Switzerland, 2018; pp. 593–601. [Google Scholar]
  27. Hong, J. Computational Multibody System Dynamics; Higher Education Press: Beijing, China, 1999. [Google Scholar]
  28. Yu, Q.; Chen, I.-M. A direct violation correction method in numerical simulation of constrained multibody systems. Comput. Mech. 2000, 26, 52–57. [Google Scholar]
  29. Bauchau, O.A.; Laulusa, A. Laulusa, Review of contemporary approaches for constraint enforcement in multibody systems. J. Comput. Nonlinear Dyn. 2008, 3, 011005. [Google Scholar] [CrossRef] [Green Version]
  30. Lyu, G.; Liu, R. Errors control of constraint violation in dynamical simulation for constrained mechanical systems. J. Comput. Nonlinear Dyn. 2019, 14, 031008. [Google Scholar]
  31. Xu, X.; Luo, J.; Wu, Z. Extending the modified inertia representation to constrained rigid multibody systems. J. Appl. Mech. 2020, 87, 011010. [Google Scholar] [CrossRef]
  32. Zhang, J.; Liu, D.; Liu, Y. A constraint violation suppressing formulation for spatial multibody dynamics with singular mass matrix. Multibody Syst. Dyn. 2016, 36, 87–110. [Google Scholar]
  33. Zhang, L.; Rui, X.; Zhang, J.; Gu, J.; Zheng, H.; Li, T. Study on Transfer Matrix Method for the Planar Multibody System with Closed-Loops. J. Comput. Nonlinear Dyn. 2021, 16, 121006. [Google Scholar] [CrossRef]
  34. Yoon, S.; Howe, R.M.; Greenwood, D.T. Geometric Elimination of Constraint Violations in Numerical Simulation of Lagrangian Equations. J. Mech. Des. 1994, 116, 1058–1064. [Google Scholar] [CrossRef]
  35. Eich, E. Convergence results for a coordinate projection method applied to mechanical systems with algebraic constraints. SIAM J. Numer. Anal. 1993, 30, 1467–1482. [Google Scholar] [CrossRef]
  36. Blajer, W. An orthonormal tangent space method for constrained multibody systems. Eng. Comput. Methods Appl. Mech. Eng. 1995, 121, 45–57. [Google Scholar] [CrossRef]
  37. Blajer, W. A geometric unification of constrained system dynamics. Multibody Syst. Dyn. 1997, 1, 3–21. [Google Scholar] [CrossRef]
  38. Blajer, W. Elimination of constraint violation and accuracy aspects in numerical simulation of multibody systems. Multibody Syst. Dyn. 2002, 7, 265–284. [Google Scholar] [CrossRef]
  39. Nikravesh, P.E. Initial condition correction in multibody dynamics. Multibody Syst. Dyn. 2007, 18, 107–115. [Google Scholar]
  40. Yoon, S.; Howe, R.M.; Greenwood, D.T. Constraint violation stabilization using gradient feedback in constrained dynamics simulation. J. Guid. Control. Dyn. 1992, 15, 1467–1474. [Google Scholar]
  41. García Orden, J.C. Energy considerations for the stabilization of constrained mechanical systems with velocity projection. Nonlinear Dyn. 2010, 60, 49–62. [Google Scholar]
  42. Garcia Orden, J.C.; Conde Martín, S. Controllable velocity projection for constraint stabilization in multibody dynamics. Nonlinear Dyn. 2012, 68, 245–257. [Google Scholar]
  43. Rui, X.; Bestle, D. Reduced multibody system transfer matrix method using decoupled hinge equations. Int. J. Mech. Syst. Dyn. 2021, 1, 182–193. [Google Scholar]
Figure 1. Sketch of the coordinate projection method.
Figure 1. Sketch of the coordinate projection method.
Mathematics 11 01510 g001
Figure 2. Sketch of the kinematic quantities.
Figure 2. Sketch of the kinematic quantities.
Mathematics 11 01510 g002
Figure 4. The violation of position constraint in the x-direction.
Figure 4. The violation of position constraint in the x-direction.
Mathematics 11 01510 g004
Figure 5. The violation of position constraint in the y-direction.
Figure 5. The violation of position constraint in the y-direction.
Mathematics 11 01510 g005
Figure 6. The violation of velocity constraint in the x-direction.
Figure 6. The violation of velocity constraint in the x-direction.
Mathematics 11 01510 g006
Figure 7. The violation of velocity constraint in the y-direction.
Figure 7. The violation of velocity constraint in the y-direction.
Mathematics 11 01510 g007
Figure 8. Variation of the mechanical energy for the planar four bar mechanism.
Figure 8. Variation of the mechanical energy for the planar four bar mechanism.
Mathematics 11 01510 g008
Figure 11. Variation of the mechanical energy for the multibody system with closed loops.
Figure 11. Variation of the mechanical energy for the multibody system with closed loops.
Mathematics 11 01510 g011
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Zhang, L.; Rui, X.; Zhang, J.; Gu, J.; Zhang, X. Exploring Energy in the Direct Correction Method for Correcting Geometric Constraint Violations. Mathematics 2023, 11, 1510. https://doi.org/10.3390/math11061510

AMA Style

Zhang L, Rui X, Zhang J, Gu J, Zhang X. Exploring Energy in the Direct Correction Method for Correcting Geometric Constraint Violations. Mathematics. 2023; 11(6):1510. https://doi.org/10.3390/math11061510

Chicago/Turabian Style

Zhang, Lina, Xiaoting Rui, Jianshu Zhang, Junjie Gu, and Xizhe Zhang. 2023. "Exploring Energy in the Direct Correction Method for Correcting Geometric Constraint Violations" Mathematics 11, no. 6: 1510. https://doi.org/10.3390/math11061510

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop