4.4. General assessment of the perceptions and experiences of developers and consultants in Case
4.3.2. Case Study Two
Este trabajo permite abrir diversos campos de investigación tras los resultados obtenidos, entre éstos se puede citar:
1. Formulación conservativa de una gran variedad de restricciones con Lagrange aumentado, que permitan una representación más completa de un sistema multicuerpo.
2. Desarrollo de modelos de contacto en superficies de geometría compleja, que puedan dar un carácter general al tratamiento dinámico de este fenómeno.
3. Estudio del comportamiento numérico en la implementación de restric- ciones de tipo general aplicadas a modelos de contacto, proponiendo nuevas estrategias de solución, basadas en criterios energéticos, que per- mitan solventar posibles problemas de convergencia.
4. Formulación conservativa de uniones con holguras, que permitirían obtener un modelo más realista de sistemas multicuerpo de interés práctico.
5. Introducción de la fricción en los modelos de contacto, pero de forma con- sistente en cuanto a energía. Es decir, tal que la disipación de energía no este condicionada por el algoritmo de integración.
Artículo aceptado en: Mechanics Based Design of Structures and Machines A conservative augmented Lagrangian algorithm for the
dynamics of constrained mechanical systems
Juan C. Garc´ıa Orden∗ and Roberto A. Ortega
Grupo de Mec´anica Computacional. Escuela T´ecnica Superior de Ingenieros de Caminos, Canales y Puertos.
Universidad Polit´ecnica de Madrid, Spain
ABSTRACT
The motion of many practical mechanical systems is often constrained. An important example is the dynamics of multibody systems, where the numerical solution of this type of systems faces several difficulties. A strategy for to solve this type of problems is the augmented Lagrange formulation, which allows the use of numerical integrators for ODEs, combined with an update scheme for the algebraic variables, accomplishing exact fulfillment of the constraints. This work focuses on the design of a conservative version of this augmented Lagrangian formulation for holonomic constraints, proposing a numerical procedure that exhibits excellent stability.
Key words: dynamics, constrained, multibody, augmented Lagrangian
∗Correspondence: Juan C. Garc´ıa Orden, Grupo de Mec´anica Computacional. Escuela T´ecnica Su-
perior de Ingenieros de Caminos, Canales y Puertos. Universidad Polit´ecnica de Madrid, c/ Profesor Aranguren s/n 28040 Madrid, Spain; E-mail: [email protected]
1 INTRODUCTION
Constraints are essential in many mathematical models in mechanics. A relevant example is the dynamics of multibody systems, where constraints are typically employed to represent joints connecting different bodies.
It is possible to employ different strategies in order to set up the equations of motion of such systems. The basic difference among them is the method employed to enforce constraints. Each one has its own peculiarities, and poses special requirements on the numerical method to be employed in order to solve. Section 2 of this paper provides a brief overview of these formulations, and sets up the context for the more detailed description for the augmented Lagrangian formulation.
The augmented Lagrangian technique was originally introduced in the field of con- strained optimization (Bertsekas, 2003) and is used in a wide variety of engineering ap- plications, such as contact/impact mechanics (Wiggers, 2002; Laursen, 2002), multibody dynamics (Garc´ıa de Jal´on and Bayo, 1994), etc. With its most common implementation, the Uzawa method, which will be introduced in Section 2.2, establishes a means of exactly enforcing constraints using standard methods for solving Ordinary Differential Equation (ODE) systems.
However, the numerical solution of this formulations poses some difficulties, mostly related to stability issues. Exact discrete energy conservation does not guarantee uncon- ditional stability for the non linear case, but definitely enhance it, as it has been widely reported in the literature (Stuart and Humphries, 1996; Garc´ıa Orden and Dopico Dopico, 2006). This is the main motivation behind this work, that aims to extend a previously de- veloped conserving penalty formulation (Garc´ıa Orden and Goicolea, 2000; Goicolea and Garc´ıa Orden, 2000; Garc´ıa Orden and Goicolea, 2001), which showed excellent stability properties, to the augmented Lagrangian formulation, which is the main contribution of this paper and it is developed in Section 3.2.
2 CONSTRAINED DYNAMICS FORMULATION: AUGMENTED LAGRANGIAN
Following, the formulation of the constrained dynamics based on the Augmented La- grange method is presented, along with some algorithmic details for classical implicit time integrators. Nevertheless, a brief review of the most popular methods used for the enforcement of constraints is presented first, along with some comments about their nu- merical implementation, that will set up the context for the developments of following sections.
2.1 Constraint enforcement methods
Let us consider a mechanical system with a configuration defined by the set of coordi- nates q ∈ Rn, under the action of generalized forces Q(q, ˙q, t) (due to the applied forces
and possible centrifugal, Coriolis and gyroscopic dynamic terms) and subjected to a set of r holonomic constraints Φ(q, t) ∈ Rr.
The Lagrange multiplier method leads to an index-3 Differential Algebraic Equation (DAE) system given by:
M¨q + ΦTqλ
∗ = Q , Φ = 0 , (1)
being M the mass matrix, λ∗ ∈ Rr the vector of Lagrange multipliers and denoting by
( )q def
= ∂( )/∂q and ¨( )def= d2( )/dt2.
Direct integration of high index DAEs, such as (1), is usually not recommended for stability reasons (Brenan et al., 1996). On the other hand, the analytical differentiation of the constraint equations can reduce the index down to index-1 allowing the use of standard ODE integrators. However, this last procedure negatively affect the stability of the numerical solution, and special techniques must be used in order to satisfy the low-order constraint equations (Baumgarte, 1972; Yoon et al., 1994; Blajer, 2002b).
The penalty method leads to an ODE system given by:
M¨q + ΦT
q(αΦ) = Q , (2)
being α the penalty matrix, which is diagonal and it is often defined with a single penalty parameter α, such that α = α1, being 1 the unit matrix. This formulation can be interpreted as the perturbed DAE problem given by (1), verifying Φ → 0 as α→ ∞, and can be solved by an ODE integrator. However, special attention should be paid to its selection, since ODE integrators may exhibit severe numerical instabilities for stiff systems, such as (2), where large penalty parameters are required in order to get a satisfactory constraint enforcement.
Equation (2) penalizes the constraint at position level only (Φ), but it may include also the constraint at velocity and acceleration levels ( ˙Φ and ¨Φ respectively), taking the more general form:
M¨q + ΦTα ¨Φ + 2ξω ˙Φ + ω2Φ= Q , (3)
where ω and ξ can be interpreted as the natural frequency and damping ratio of the penalized constraint (Garc´ıa de Jal´on and Bayo, 1994; Bayo et al., 1988; Bayo and Avello, 1996; Bayo and Ledesma, 1996; Blajer, 2002a) . This formulation is more stable but it still requires a large penalty parameter, and also introduces some artificial damping that may be inconvenient for long term calculations.
The augmented Lagrange method can be understood as a compromise between the Lagrange multiplier and the penalty method, and leads to and index-3 DAE system given by:
M¨q + ΦTqλ ∗+ ΦT
q(αΦ) = Q , Φ = 0 (4)
The important feature of this method is that it provides the exact Lagrange multiplier vector λ∗, thus enforcing exactly the constraint Φ. On the other hand, as remarked
previously for the Lagrange multiplier method, direct integration of (4) present stability problems. Also, the solution obtained with an index reduction and the use of standard ODE integrators often exhibits instability, and special procedures should be used to satisfy the low-order constraints.
2.2 Augmented Lagrange formulation with a standard implicit integrator
Formulation (4) is commonly set, from an algorithmic point of view, by the Uzawa’s method, which introduces an iterative scheme for the multipliers. This algorithmic ap- proach, in practice, transforms the DAE system into an ODE system setting an iterative scheme for the approximate multiplier λ, with an update from iteration k to k + 1 given by:
λ(k+1)= λ(k)+ αΦ
verifying λ → λ∗ as iteration in λ progresses, being λ∗ the exact Lagrange multiplier vector.
Now, for non-linear problems, it is possible to define two main alternatives for the multipliers update scheme in a single time step. The most common implementation of this method is with a nested iteration, setting an outer loop for the multiplier λ and an interior loop that solve the ODE for one time step with a fixed value of the multiplier (Laursen, 2002; Wiggers, 2002), and it is the implementation adopted in this paper. Nevertheless, in some applications related to multibody dynamics a simultaneous iteration strategy has been reported to be successfully applied (Bayo et al., 1988; Cuadrado et al., 2000), with only one loop where the multiplier update is done simultaneously with the iterations required by the ODE solver.
The nested iteration employed in this paper has two nested loops in order to get the solution for one time step. The outer one is in λ (the approximate Lagrange multiplier), labeled with a superscript k = 1, 2, .... The inner loop makes null the residual coming
from the non linear equations of motion for constant λ. For iteration k in the outer loop, we have λ(k), and the solution of the residual with λ(k) constant will not, in general, satisfy the constraint, meaning that Φ(k) 6= 0 for the converged solution of the inner loop. Next, the Lagrange multiplier is updated, such that λ(k+1) = λ(k)+ αΦ(k), which is kept constant in the next outer iteration (k + 1).
With an standard implicit integration method, an algorithmic set of equations are obtained that allows to advance the solution from tn to tn+1. For instance, for the
implicit rule method these equations are:
M ( ˙qn+1− ˙qn) + ∆tΦTqλ+ Φ T q(αΦ) n+1 2 = ∆tQn+1 2 (5) 1 2( ˙qn+1+ ˙qn) = 1 ∆t(qn+1− qn)
where the subscript ( )n+1
2 denotes evaluation at the midpoint.
Besides, the solution for qn+1 of the nonlinear algebraic equation system given by (5)
usually involves a linearization of the different terms; for instance, if a Newton-Raphson method is applied. Note that for a nested iteration scheme this linearization is quite straightforward, since the Lagrange multiplier vector λ is constant through the Newton loop. However, the multiplier update carried out inside the Newton loop in simultaneous iteration strategy is not differentiable, and may cause convergence problems.
This augmented Lagrangian formulation leads to an exact fulfillment of the original position constraints (Φ = 0), but usually exhibits an unstable behavior for moderate time step sizes, even with ODE integrators suited to stiff systems. This fact motivates the search for numerical algorithms that can overcome these difficulties; one of them is based on a conservative formulation, which will be developed in following section.
3 CONSERVING FORMULATION
In this section, a conservative augmented Lagrangian formulation is developed for the index-3 DAE system given by (4). Nevertheless, it is convenient to introduce first a conservative formulation for the penalty approach, given by equation (2), which will serve to introduce some important aspects that will be extended in the following section. In all cases it is assumed that i) the generalized coordinates q are cartesian coordinates of selected points of the mechanism, or alternatively natural coordinates (Garc´ıa de Jal´on and Bayo, 1994); ii) the constraint vector take the form Φ(q) and iii) the generalized forces are null (Q = 0).
Assumption i) is motivated by the fact that there are already simple available results of conserving schemes for this type of coordinates based on penalty (Garc´ıa Orden, 1999; Garc´ıa Orden and Goicolea, 2000; Goicolea and Garc´ıa Orden, 2002). Schemes resulting from the use of other type of coordinates (e.g. finite rotations) are more complex, and conserving augmented Lagrangian formulations based on them are still under develop- ment. Assumption ii) implies that the considered dynamical system is conservative (the total mechanical energy, which in this case equals the kinetic energy, remains constant), since the work performed by holonomic constraints which no depends explicitly on time is null. This fact does not pose any practical limitation for our purposes and helps the understanding of the developments presented in the rest of the section.
Assumption iii) does not imply a loss of generality, since the main focus of these devel- opments is the formulation of the constraints forces. The vector of generalized forces Q can be formulated consistlently with the conserving scheme, but the resulting expressions are more involved and they would obscure the results obtained for the constraint terms, which are the focus of this work.
3.1 Conserving penalty formulation
The point of departure is the ODE system given by (2) with no applied forces, given by:
M¨q + αΦT
qΦ = 0 , (6)
where it has been assumed that the penalty matrix takes the usual form α = α1. Based on the concept of discrete derivative introduced in (Gonz´alez and Sim´o, 1996) in the context of Hamiltonian systems, it is possible to obtain a conserving algorithm for (6), which exactly conserves the total energy and the linear and angular momentum. This formulation has been developed in (Garc´ıa Orden, 1999; Garc´ıa Orden and Goicolea, 2000; Goicolea and Garc´ıa Orden, 2002) for any type of holonomic constraint. Here we will present the main results with a simple proof of their energy conserving properties.
The conserving scheme can be understood as a modification of the implicit mid point rule, which it is known as been symplectic, and it has been applied in the previous section (see expressions (5)) for the solution of the augmented Lagrangian formulation. For the penalty formulation (6) the midpoint rule and takes the form :
M ( ˙qn+1− ˙qn) + ∆tαΦTq
n+ 12Φn+ 1
2 = 0 (7)
Now we introduce the conserving algorithm as a modification of the midpoint algorithm (7), where the constraint gradient (in other words, the direction of the constraint force) is evaluated at an intermediate configuration qn+β
def
= qn+ β(qn+1− qn) ; β ∈ [0, 1], which
is not necessarily the midpoint, and such that it verifies the following condition at every time step:
β ; Φqn+β(qn+1− qn) = Φn+1− Φn (8)
Note that β = 1/2 if the constraints are at most quadratic; note also that the gradient of the constraint (in other words, the constraint force) is orthogonal to the increment in
position when constraints are exactly fulfilled. Finally, the term Φ in (7) is no longer evaluated at the midpoint; it is simply the average between its value in tnand tn+1, which
we will denote as (·)n+1 2
def
= (·)n+ (·)n+1 /2. Summarizing, the final conserving scheme for (6) has the following expression:
M ( ˙qn+1− ˙qn) + ∆tαΦTqn+βΦn+12 = 0 (9)
1
2( ˙qn+1+ ˙qn) = 1
∆t(qn+1− qn)
with parameter β verifying (8).
Now, It is necessary to proof that this scheme conserves the total energy, which is the result of adding the constraint potential to the kinetic energy:
E = T + VΦ with VΦ=
1 2αΦ
2
which shows that VΦ vanishes, and therefore E = T , when constraints are exactly en-
forced. The proof for energy conservation can be carried out evaluating the change of kinetic energy in one time step ∆T = Tn+1− Tn employing equations (9):
∆T = 1 2( ˙qn+1+ ˙qn) T M ( ˙qn+1− ˙qn) = −1 2 2 ∆t(qn+1− qn) T MM−1∆tαΦT qn+βΦn+12 = −α (qn+1− qn)TΦTqn+βΦn+12 (10)
If constraints are exactly satisfied, Φn = Φn+1 = Φn+1
2 = 0, and therefore ∆T = ∆E =
0; it means, exact energy conservation is accomplished. If constraints are not exactly satisfied, the following relation is obtained taking into account (8) and elaborating further
expression (10):
∆T = −α (Φn+1− Φn) T1
2(Φn+1+ Φn) = −∆VΦ
and therefore ∆E = ∆T + ∆VΦ= 0. which means that exact total energy conservation
is again achieved.
Finally, it has to be remarked that if the constraint is generally expressed in terms of an scalar variable (e.g. the distance between points), there is no need to calculate parameter β since the constraint force term in (9) can be formulated in a closed form. For instance, let us consider a single particle with coordinates q constrained to move satisfying Φ(q) = 0, being q = ||q||. The conserving algorithm takes then the form (see (Garc´ıa Orden and Goicolea, 2000) for more details):
M ( ˙qn+1− ˙qn) + ∆tα Φ2 n+1− Φ2n q2 n+1− qn2 qn+1 2 = 0 (11) 1 2( ˙qn+1+ ˙qn) = 1 ∆t(qn+1− qn)
which guarantees exact total energy (E = T + VΦ) conservation.
3.2 Conserving augmented Lagrangian formulation
In this section we provide details of the conserving augmented Lagrangian formula- tion for two different type of constraints. Firstly, for general constraints (vector type) Φ(q) = 0, which are general functions of the set of coordinates q. Secondly, for a scalar constraint Φ(q) = 0 which is a function of a single scalar variable q. A simple and useful example of such a constraint is the constant relative distance between two points (A, B) of a rigid body. This constraint is a function of a scalar variable q = ||q|| = p(xB− xA)2+ (yB− yA)2+ (zB− zA)2, and can be expressed as Φ(q) = q2− q20, where
Type I: General constraints (vector type) The point of departure for the devel- opment of a conservative augmented Lagrangian formulation is to read the penalty for- mulation (9) as a second order approximation of an integral balance of linear momentum between n and n + 1: Z tn+1 tn M¨q dt + α Z tn+1 tn ΦTqΦ dt = 0 (12)
Then, the conserving formulation of the constraint force can be understood as a special second order approximation of the integral in (12). This is carried out approximating each term inside the integral by their value at a specific configuration. A simple inspection of (9) and (12) reveals that the approximations made for the conserving formulation are:
Φq → Φqn+β ; Φ → Φn+1
2 (13)
On the other hand, it is also possible to understand the augmented Lagrangian method (4) as an extended penalty method, where the penalized constraint αΦ is corrected at each time step by a set λ∗ of Lagrange multipliers.
Based on these considerations, the basic idea of the proposed conserving augmented Lagrangian formulation is to introduce this correcting term, containing the Lagrange multipliers, in the momentum balance equation (12), and then to apply the same second order approximations (13) to evaluate the integral. In doing so, it is expected that the total energy is exactly conserved, as it occurs with the penalty formulation.
Following this procedure, we first introduce the Lagrange multiplier term in the mo- mentum balance (12): Z tn+1 tn M¨q dt + α Z tn+1 tn ΦTqΦ dt + Z tn+1 tn ΦTqλ dt = 0 (14)
following scheme is obtained for the conserving augmented formulation: M ( ˙qn+1− ˙qn) + ∆t ΦTqn+β αΦn+1 2 + λ = 0 (15) 1 2( ˙qn+1+ ˙qn) = 1 ∆t(qn+1− qn)
with an update for the Lagrange multipliers given by:
λ(k+1)= λ(k)+ αΦn+1
2 (16)
Now, it is necessary to proof that the proposed scheme given by (15) and (16) exactly conserves the energy between tn and tn+1. This can be accomplished with a procedure
which is very similar to the one developed in the previous section for the penalty formu- lation.
First, the balance of kinetic energy between tn and tn+1 is obtained using (15):
∆T = 1 2( ˙qn+1+ ˙qn) T M ( ˙qn+1− ˙qn) = −1 2 2 ∆t(qn+1− qn) T MM−1∆tΦTqn+β αΦn+1 2 + λ = − (qn+1− qn)TΦTqn+β αΦn+1 2 + λ (17)
If constraints are exactly satisfied, Φn = Φn+1= 0, and taking into account (8), it follows
that ∆T = ∆E = 0; it means, exact energy conservation is accomplished. If constraints are not exactly satisfied, the following relation is obtained inserting the equation (8) that defines β on expression (17):
potential.
We are interested in obtaining an upper bound for the kinetic energy change in one time step as the iteration in k for the Lagrange multiplier loop progresses:
∆T(k)= Tn+1(k) − Tn (19)
Taking the absolute value of this change of energy in (18), and denoting by || · || a norm in Rr, the following relation holds:
|∆T(k)| ≤ |∆VΦ(k)| + ∆Φ(k) λ (k) (20)
Now we should take into account that, as the iteration in the multiplier progresses, it converges towards the true Lagrange multiplier vector λ∗, which also means that the constraints should tend to zero:
λ(k) → λ∗ and Φ (k) → 0 as k→ ∞ (21)
Assuming that constraints are exactly enforced in the last converged time step (Φn= 0,
thus ∆Φ = Φn+1), relations (21) imply also that when the iteration in the multiplier
progresses: |∆VΦ(k)| → 0 , ∆Φ(k) → 0 , λ (k) → ||λ ∗|| (22)
which means, introducing (22) in (20) that the energy tends to be exactly conserved:
variable s often represents, for practical constraints on mechanisms, a distance between different points. For instance, this is the case of a constraint that expresses that the distance between two points of two bodies is constant, representing a massless link joining them.
In order to simplify the resulting expressions, without loss of generality, in what follows we will consider a system composed only by one particle with coordinates q forced to move satisfying the scalar constraint Φ(q), being q = ||q||.
The point of departure is the conserving penalty formulation of this problem that was already presented in section 3.1. The first step is to rearrange expression (11) as:
M ( ˙qn+1− ˙qn) + ∆tα Φn+1− Φn qn+1− qn ·qn+ 1 2 qn+1 2 ! Φn+1 2 = 0
This expression may also be understood as a second order approximation of the following momentum balance from tn to tn+1.
Z tn+1 tn M¨q dt + α Z tn+1 tn ΦTqΦ dt = 0 (24)
where the following approximations have been employed:
Φq = dΦ dq dq dq → Φn+1− Φn qn+1− qn ·qn+ 1 2 qn+1 2 ; Φ → Φn+1 2 (25)
The idea of the conservative augmented Lagrangian is to use approximations (25) for the evaluation of the integrals appearing in the following momentum balance expression that incorporates the Lagrange multiplier term:
Z tn+1 tn M¨q dt + α Z tn+1 tn ΦT qΦ dt + Z tn+1 tn ΦT qλdt = 0
obtaining, finally, the following conserving augmented Lagrangian scheme: M ( ˙qn+1− ˙qn) + 2∆t Φn+1− Φn q2 n+1− qn2 qn+1 2 αΦn+1 2 + λ = 0 (26) 1 2( ˙qn+1+ ˙qn) = 1 ∆t(qn+1− qn)
with an update for the Lagrange multiplier given by:
λ(k+1)= λ(k)+ αΦ
n+12 (27)
Note the similarity between the expressions obtained for a general vector-type constraint presented previously in (15) and (16), and those for a scalar constraint given by (26) and (27).
A procedure similar to the one presented previously for general constraints (vector type) can be followed here in order to proof that the scheme defined by (26) and (27) tends to exactly conserve the energy as iteration in the multiplier λ progresses.
Again we apply the balance of kinetic energy between tn and tn+1, now using (26),
∆T = 1 2( ˙qn+1+ ˙qn) T M ( ˙qn+1− ˙qn) = − 1 ∆t(qn+1− qn) T 2∆t Φn+1− Φn q2 n+1− qn2 qn+1 2 αΦn+1 2 + λ = −Φn+1− Φn q2 n+1− q2n (qn+1− qn)T(qn+1+ qn) αΦn+1 2 + λ = − (Φn+1− Φn) αΦn+1 2 + λ (28)
If constraints are exactly satisfied, Φn = Φn+1 = 0, and therefore the total energy
is exactly conserved ∆T = ∆E = 0. Note that, for the case where constraints are not exactly fulfilled (Φn+1 − Φn = ∆Φ 6= 0), the energy balance (28) equals the expression
same arguments previously given in order to justify that the energy tends to be exactly