tem and requires minimum data storage. The use of ... multirate integrations methods, and a large amount of data (the co
Multibody Syst Dyn DOI 10.1007/s11044-009-9176-0
An efficient direct differentiation approach for sensitivity analysis of flexible multibody systems Kishor D. Bhalerao · Mohammad Poursina · Kurt S. Anderson
Received: 18 February 2009 / Accepted: 24 September 2009 © Springer Science+Business Media B.V. 2009
Abstract This paper presents a recursive direct differentiation method for sensitivity analysis of flexible multibody systems. Large rotations and translations in the system are modeled as rigid body degrees of freedom while the deformation field within each body is approximated by superposition of modal shape functions. The equations of motion for the flexible members are differentiated at body level and the sensitivity information is generated via a recursive divide and conquer scheme. The number of differentiations required in this method is minimal. The method works concurrently with the forward dynamics simulation of the system and requires minimum data storage. The use of divide and conquer framework makes the method linear and logarithmic in complexity for serial and parallel implementation, respectively, and ideally suited for general topologies. The method is applied to a flexible two arm robotic manipulator to calculate sensitivity information and the results are compared with the finite difference approach. Keywords Sensitivity analysis · Direct differentiation · Divide and conquer scheme · Flexible multibody systems
1 Introduction Development of efficient, computationally low cost and highly parallelizable methods in the multibody systems has greatly expanded the realms into which these tools may and have been effectively applied. As evidence is the degree to which articulated multibody methods now enjoy use in the areas ranging from the dynamics and control of large, complex, highly K.D. Bhalerao () · M. Poursina · K.S. Anderson Mechanical, Nuclear and Aerospace Engineering, Rensselaer Polytechnic Institute, 110 8th Street, Troy 12180, NY, USA e-mail:
[email protected] M. Poursina e-mail:
[email protected] K.S. Anderson e-mail:
[email protected]
K.D. Bhalerao et al.
flexible spacecraft, to the modeling, simulation and analysis of molecular systems at the nano-scale. In the area of modern multibody systems dynamics, design of highly complex systems, which is iterative and computationally taxing in nature, can still be challenging. Sensitivity analysis, can play an important role associated with multibody computational problems such as implicit integration schemes, linearized dynamics, optimal control, and design optimization. Although easy implementation and simplicity makes finite difference approximation perhaps the most broadly adopted approach to generate sensitivity information, it suffers from critical shortcomings. This procedure is time-consuming due to the fact that it requires one additional simulation for each of the perturbed design parameters. Furthermore, selecting the optimal perturbation size of a set of design variables [1] and sensitivity of the numerical solution to the perturbation size [2–4] are important (at times critical) issues, and may significantly influence the success of this technique. Analytical sensitivity analysis methods such as adjoint variable, direct differentiation and automatic differentiation are capable of overcoming most of the problems which exist in finite difference techniques. In the adjoint variable methods, based on variation principles, explicit calculation of the state sensitivities is avoided through the introduction of a set of adjoint variables [2, 5–9]. Manipulating these adjoint variables, variations of the system equations, and the variations of design criteria, produces the required adjoint relationships. Solving sequence of adjoint relationships provides the design sensitivity vector. This vector directly corresponds to the variation (sensitivity) of design criteria in terms of design variable variations. Implementation of these methods can be complex, particularly when dealing with variable step size or multirate integrations methods, and a large amount of data (the complete state of the system at each function valuation, for the duration of the simulation over which the sensitivity is being evaluated) has to be stored for the forward problem. The need to access this complete set of state data as the adjoint equations are integrated backwards in time can require a large number of I/O operations which greatly slows the rate at which the sensitivities may be determined [10, 11]. Another source of error is the backward temporal integration necessary for the calculation of adjoint variables. Additionally, numerical stability for the adjoint variable methods remains an open question as indicated in [2] and [12]. Automatic differentiation [13, 14] is a computer science based approach in which the variables are identified within existing code, and derivative expressions are determined by direct application of the chain rule of differentiation. This method can provide results which are numerically unstable and a blind application of the chain rule of differentiation can lead to erroneous results, particularly with regard to DAE systems. The other popular methods for sensitivity analysis are those based on direct differentiation [10, 15–21]. In these techniques, direct application of the chain rule of differentiation is used to explicitly form the states sensitivities. Mathematically easy to understand, high numerical stability and relative insensitivity of the solution accuracy to parameter perturbations have distinguished direct differentiation algorithms among many competitive approaches. Besides that, if the number of design variables is small and the number of design constraints is large, the direct differentiation method becomes more attractive than adjoint variable techniques. Direct differentiation however, can be computationally expensive if not performed intelligently when dealing with large systems. The majority of the existing literature on sensitivity analysis is targeted at rigid multibody systems. However, in many real applications, it is necessary to consider the flexibility of the bodies in order to capture the dynamic behavior of the multibody system to an acceptable level of accuracy. In such systems, introducing the coordinates to describe the elastic behavior of the bodies leads to an increase in the number of the state variables, and can contribute
An efficient direct differentiation approach for sensitivity analysis
to significant nonlinear coupling between the equations of motion, and consequently in the sensitivity terms. Sensitivity analysis of flexible multibody systems has been described in [17] and [22] based on direct differentiation and automatic differentiation techniques, respectively. In this paper, an efficient logarithmic complexity (for parallel implementation) direct differentiation method is presented for the determination of first-order design sensitivities of flexible multibody systems. The governing equations which define the states and state derivatives of the system are derived based on Flexible Divide and Conquer Algorithm (FDCA) as described in [23]. The use of a divide-and-conquer framework makes the method suitable for systems with tree- or ladderlike topologies. In such complex topologies FDCA based sensitivity analysis is expected to be more efficient than the other methods [17, 22] in which the constraint equations and their sensitivities to the design variables in forward dynamics and sensitivity equations should be solved for. Since this methodology works concurrently with the forward dynamics problem as opposed to the adjoint variable methods, there is no need for the backward temporal integration of the equations and consequently requires minimal data storage. The sensitivity equations for the entire system are generated via a hierarchic assembly process and as a result the actual differentiation required in this method is minimum as compared to traditional methods. The rest of the paper is organized in the following manner. First, the modeling of flexible bodies is discussed. This is followed by a brief overview of the divide-and-conquer scheme. The recursive formulation of sensitivity equations is then presented followed by a numerical example and conclusions.
2 Flexible body dynamics There are several ways to describe the dynamics of a flexible body [24–29]. In the current work we limit ourselves to divide-and-conquer based modal superposition method (FDCA) as described in [23]. The sensitivity information is generated concurrently with the forward dynamics simulation. In order to fully describe the sensitivity formulation, it is crucial to look at the underlying forward dynamics formulation. To make the paper more self standing, FDCA is briefly discussed in the following sections. An effort has been made to use identical symbols and terminology wherever possible and interested readers should refer the original manuscript for a more detailed discussion on FDCA. Figure 1 shows a representative flexible body k in a multibody system in its deformed and undeformed configurations. The body k interacts with its environment via points referred to as handles. Body k has two handles, H1k and H2k connecting it to bodies k − 1 and k + 1 via joints J k−1 and J k , respectively. A rigid body-fixed reference frame is attached to handle H1k and the body k deforms elastically with respect to this frame. The reference frame at handle H1k moves relative to the reference frame at handle H2k−1 via the free modes of motion permitted by joint J k−1 . It is possible for the body k to have multiple handles. For example, handles corresponding to external forces and additional kinematic joints. However, only the handles corresponding to the kinematic joints are directly involved in the divideand-conquer framework and are shown in Fig. 1. A more detailed discussion on presence of multiple kinematic joints is presented in [23, 30–32]. P0 is an arbitrary differential volume δD in the undeformed configuration and is mapped to P after the body k undergoes the elastic deformation. It is assumed in the formulation presented here that the elastic deformations can occur only as a linear combination or superposition of preselected mode shapes [33]. The mode shapes must be selected in order to
K.D. Bhalerao et al.
Fig. 1 Deformed and undeformed configuration of body k
best describe the dominant modes of deformation under the external loading of the system. The method may also be expanded to use other flexible body descriptions such as absolute nodal coordinates [34]. The displacement vector (δ) between these two points in the bodyfixed reference frame at H1k is expressed in terms of space dependentshape functions {ϕik } νk ϕ ki qik |P . Here νk evaluated at P and time dependent modal coordinates {qik } as δ = i=1 is the number of modal coordinates selected for body k. The orientation of body k is then described in terms of generalized coordinates needed for the orientation of the body-fixed reference frame at handle H1k and the modal coordinates required for the elastic deformation of the body. It should be noted that, the deformation field can be defined with respect to the body-fixed reference frame at any of the kinematic joints or other points of interest (e.g center of mass of the deformable body) as long as appropriate local mode shapes are selected to describe the deformation field. 2.1 Sensitivity of an objective function In sensitivity analysis, it is desired to determine the sensitivity of an objective function J to the variation of a particular design or control variable (p). In flexible multibody systems, large rotations or translations are modeled as n rigid body (relative and/or absolute) degrees of freedom associated with the interconnecting kinematic joint free modes of motion. These modes of motion are described by introducing sets of generalized coordinates {qi }ni=1 and generalized speeds {ui }ni=1 . The generalized speeds may be any invertible linear combination of the time derivatives of the system generalized coordinates q˙i . The elastic modes of motion for the body k contribute an additional νk modal coordinates and their time derivatives. The objective function J is often an explicit function of the design and state variables, while states of the system, themselves, are implicitly dependent on the values of the design parameters. Therefore, the sensitivity equation of the objective function with respect to the
An efficient direct differentiation approach for sensitivity analysis
design variable can be written as n ∂J dur ∂J d u˙ r ∂J ∂J dqr + + + ∇J = ∂p ∂qr dp ∂ur dp ∂ u˙ r dp r=1 νk nb ∂J dukr ∂J d u˙ kr ∂J dqrk + k + k + . ∂qrk dp ∂ur dp ∂ u˙ r dp k=1 r=1
(1)
Here nb and n define the number of bodies and kinematical joint free modes of motion in the system, respectively. In evaluating ∇J , we are aided by the following additional relationships: τ +dt dq = dp t=τ +dt τ τ +dt du = dp t=τ +dt τ
dq d q˙ dt + , dp t=τ dp t =τ du d u˙ dt + . dp t=τ dp t =τ
(2a) (2b)
In the above equations, q and u contain the rigid as well as elastic modes of motion. Based on (2), the main task in sensitivity analysis then reduces to that of efficiently computing ddpu˙ . This task in straightforward direct differentiation may still result in prohibitive (O(n3 )) costs [21]. In the discussion which follows it will be demonstrated that the computational complexity can be reduced to linear and logarithmic for serial and parallel implementation, respectively. 2.2 Brief overview of FDCA With the above discussion in background, we now proceed to the kinematics and dynamics of the flexible body. 2.2.1 Kinematics of flexible body k Let rP denote the position vector of point P relative to the handle H1k (Fig. 1). Let N v P and N ωP denote the linear and angular velocity of a differential element at point P on body k in the Newtonian frame N , with P = 1, 2 referring to handles H1k and H2k , respectively. Henceforth, unless mentioned otherwise, all the kinematic quantities are assumed to be in the Newtonian frame. The expression for the spatial velocity of point P (VPk = [N ωP , N v P ]T ) can be written as νk T VPk = S rP V1k + φik q˙i k P ,
(3a)
i=1
T φik = ψ ki , ϕ ki ,
U rP × rP . S = 0 U (6×6)
(3b) (3c)
In (3), ψik and ϕik refer to the rotational and translational shape functions, respectively. rP × is the skew symmetric matrix for realizing the cross product of the matrix representation of
K.D. Bhalerao et al.
vector rP , and U is a 3 × 3 identity matrix. Similarly, if N α P and N a P represent the angular and liner acceleration of the differential element at point P , respectively, then the expression for the spatial acceleration of point P (AkP = [N α P , N a P ]T ) can be written as
AkP = S rP
Aˆ kP =
T
Ak1 + Aˆ kP +
νk
φi k q¨i k P ,
(4a)
i=1
q˙i k |P νk k k . N 1 ω × (N ω1 × rP ) + 2 N ω1 × i=1 ϕi q˙i N
ω1 ×
νk
i=1 ψi
k
(4b)
Next, to describe the dynamics of the body, the expression for spatial partial velocity [35] of any differential element on the body must be calculated. From (3), it can be seen that the expression for velocity of any point on the body k can be written in terms of the spatial velocity of handle H1k and the time derivatives of the modal coordinates. Let N ωrP and N vrP denote the partial angular and linear velocity of the differential element at point P , respectively. Then, the spatial velocity for handle H1k may be correctly described as k k k V1k = 6r=1 Pr 1 ur 1 . In this expression, Pr 1 = [N ωr1 , N vr1 ]T represents the rth spatial partial k velocity of handle H1k , with ur 1 being the absolute generalized speed associated with the absolute angular and linear velocity of handle H1k . Since a full set of 6 absolute generalized k speeds are used to describe the spatial velocity of handle H1k , all the entries in the vector Pr 1 are zero other than the rth entry which is one. Now, using (3), the spatial partial velocity for a point P can be written as
kˆi for r = i, i = 1, 2, 3, kˆi × rP (6×1) 0 for r = i + 3, i = 1, 2, 3, = ˆ ki (6×1) k ψi for r = i + 6, i = 1, . . . , νk . = ϕ ki P
PrkP =
(5a)
(5b) (5c)
(6×1)
Here, kˆi is a unit vector in reference direction i of body k. Having presented the kinematics of the flexible body, we now proceed to the equations of motion for the flexible body. 2.2.2 Equations of motion The equations of motion of body k can be written using Kane’s method [35] as
N
vrP
·
N
a dm + P
0
N
ωrP
· N α P dI −N vrP · fP − N ωrP · τ P
Bk
− N vrk1 · f k1 + N ωrk1 · τ k1 + N vrk2 · f k2 + N ω2k · τ k2 = 0.
(6)
In (6), τ ki and f ki represent the constraint torque and force, respectively, acting on body k at handle Hik . boldsymbolτ P and fP include all the known torques and forces acting on the body k including the stiffness terms. Using (4) and (5), (6) can be reduced to the following
An efficient direct differentiation approach for sensitivity analysis
form.
ΓRR ΓF R
ΓRF ΓF F
k
Ak1
−
q¨ k
γR γF
k1
F1k −
γR γF
k2
F2k +
βR βF
k =
0 . 0
(7)
In (7), Fik = [τ ki , f ki ]T is the spatial constraint force acting on handle Hik . q¨ k contains all the time derivatives of the modal speeds for the body k. The subscripts are added to distinguish the terms contributing to rigid (RR and R) and flexible (F F and F ) modes of motion. The subscripts F R and RF are used to indicate the terms causing coupling between these modes of motion. From (7), q¨ k can be written as −1 k k k k q¨ k = −ΓFkF ΓF R A1 − γF 1 F1k − γF 2 F2k + βFk .
(8)
Using (8), q¨ k can be eliminated from (7) to obtain an expression for Ak1 in terms of the unknown spatial constraint forces F1k and F2k . Then, using (4), we can get an expression for the spatial acceleration of handle H2k in terms of the unknown spatial constraint forces. Thus, the spatial acceleration of the two handles of the body k can now be written in terms of the unknown spatial constraint forces as k k k Ak1 = ζ11 F1k + ζ12 F2k + ζ13 ,
Ak2
=
k ζ21 F1k
k + ζ22 F2k
k + ζ23 .
(9a) (9b)
Equation (9) is referred to as two-handle equation of motion for body k. Following the procedure described in this section, the two-handle equation of motion can be written for any body in the multibody system. Next, we take a brief look at the divide-and-conquer algorithm. 2.2.3 Divide and conquer scheme The divide-and-conquer algorithm (DCA) is an efficient method for solving the equations of motion for a multibody system [23, 30–32], particularly in the context of parallel computing implementations. DCA consists of two distinct processes, assembly and disassembly. The goal in assembly is to recursively combine the adjacent bodies (leaf nodes) in a multibody system resulting in an encompassing fictitious body. The two-handle equation of this fictitious assembled body contains the spatial terms (acceleration and constraint force) of the terminal handles while the intermediate unknowns are eliminated. For example, to combine body k and k + 1 (see Fig. 2), we use the following kinematic relationship k
k
k
Ak+1 − Ak2 = P J u˙ J + AJt . 1
(10)
k
In (10), P J is a 6 × f k matrix, whose columns correspond to the spatial partial velocity of k the f k degree-of-freedom joint J k and u˙ J is a list of time derivative of generalized speeds Jk of the joint. At contains all remainder acceleration terms which are completely known. k k D J is defined to be the orthogonal complement of P J , with consistent units such that it k k forms a constraint force subspace of joint J k . Then from the definition of the P J and D J , we get D J
kT
k
k
· P J = 0. Premultiplying (10) by (D J )T , we get
DJ
k T
k T k · Ak+1 − Ak2 = D J · AJt . 1
(11)
K.D. Bhalerao et al.
Fig. 2 Fictitious body formed from two distinct bodies
The expressions for Ak+1 and Ak2 are obtained from the two-handle equation of motion of 1 bodies k + 1 and k, respectively. Substituting these expressions in (11), the expression for the spatial constraint force at handle H2k can be written in terms of the spatial constraint forces acting on the terminal handles (H1k and H2k+1 ) as F2k = G1 F1k + G2 F2k+1 + G3 .
(12)
Henceforth, Gi will refer to useful intermediate known terms. Substituting (12) in the expressions for Ak1 and Ak+1 2 , the two-handle equations of motion of the fictitious body can be obtained in the following form. k:k+1 k k:k+1 k+1 k:k+1 Ak1 = ξ11 F1 + ξ12 F2 + ξ13 ,
Ak+1 2
=
k:k+1 k ξ21 F1
k:k+1 k+1 + ξ22 F2
k:k+1 + ξ23 .
(13a) (13b)
This process is now continued as shown in figure 3 till one reaches the root node. The twohandle equation of motion for the assembled system can then be written as 1:nb 1 1:nb nb 1:nb A11 = ξ11 F1 + ξ12 F2 + ξ13 ,
Anb 2
=
1:nb 1 ξ21 F1
1:nb nb + ξ22 F2
1:nb + ξ23 .
(14a) (14b)
The two-handle equation of motion of the root node contains unknown spatial quantities corresponding to the terminal handles H11 and H2nb and can be solved for different constraints on the terminal handles as described in [32].
An efficient direct differentiation approach for sensitivity analysis Fig. 3 DCA: An overview
During the disassembly process (see Fig. 3), the known spatial quantities of the terminal handles are used to solve for the unknown spatial quantities at the intermediate nodes. This process is continued until all the spatial unknowns in the system (acceleration and constraint force) are completely solved for. Knowing these spatial quantities, q¨ k can now be solved for using (8). Thus at the end of the hierarchic disassembly process, the spatial constraint forces and accelerations of all the handles and the vector q¨ k are known. We now proceed to the sensitivity formulation. 3 Sensitivity analysis Recalling the discussion in Sect. 2.1, to compute the sensitivity of a given objective function q¨ k J with respect to a design variable p, the terms ddpu˙ and ddp must be computed. In the discussion that follows, we demonstrate how the divide-and-conquer scheme can be used to compute these terms efficiently. 3.1 Formulation for a single body Differentiating (9) with respect to the design variable p, we obtain the following: k k k k k dζ13 dζ11 dζ12 d Ak1 k d F1 k d F2 k k = ζ11 + ζ12 + + F + F , dp dp dp dp dp 1 dp 2 k k k k dζ23 dζ21 dζ k d Ak2 k d F1 k d F2 = ζ21 + ζ22 + + F1k + 22 F2k . dp dp dp dp dp dp
(15a) (15b)
In (15), F1k and F2k are already known from the solution to the equations of motion for the flexible body k. ζijk in the most general case is a function of the state vector of the system in addition to the local properties (e.g. mass) of body k.
dζijk dp
then takes a form similar to that dζ k
of ∇J given in (1). The partial derivatives in expression comprising dpij can be evaluated analytically while remaining derivative terms are numerically computed using relationship given in (2). Equation (15) can then be rewritten as k k d Ak1 k d F1 k d F2 k = Φ11 + Φ12 + Φ13 , dp dp dp
(16a)
K.D. Bhalerao et al. k k d Ak2 k d F1 k d F2 k = Φ21 + Φ22 + Φ23 . dp dp dp
(16b)
Equation (16) is henceforth referred to as the two-handle sensitivity equation for the body k. q¨ k , which is obtained by differentiOne more equation is needed to calculate the value of ddp ating (8) with respect to the design variable p and can be written in the following form. k k −1 k d Ak1 d q¨ k k d F1 k d F2 = −ΓFkF − γF 1 − γF 2 ΓF R + G4k , dp dp dp dp G4k = G5 Ak1 + G6 F1k + G7 F2k + G8 ,
d((−ΓFkF )−1 ΓFkR ) , dp k d((ΓFkF )−1 γF 2 ) , G7 = dp G5 =
d((ΓFkF )−1 γF 1 ) , dp d((−ΓFkF )−1 βFk ) . G8 = dp k
(17)
G6 =
In (17), the spatial accelerations and constraint forces are known from forward dynamics. The terms G5 · · · G8 are computed with an identical procedure previously used to compute dζij . Equation (17) can now be rewritten as dp k k d Ak1 d q¨ k k d F1 k d F2 = G9k + G10 + G11 + G4k . dp dp dp dp
(18)
Equations (16) and (18) represent the sensitivity equations for body k. Before proceeding, we briefly compare the equations of forward dynamics ((8) and (9)) and the corresponding sensitivity equations ((18) and (16)) for body k. The sensitivity equations are in a form identical to that of the dynamics equations. The unknowns in the sensitivity equations are the derivatives of the unknowns in the dynamics equations with respect to the design variable p. 3.2 Recursive sensitivity formulation To solve the sensitivity equations, we now follow an identical divide-and-conquer scheme which was used in forward dynamics. The two-handle sensitivity equations for body k are in a form similar to that of the sensitivity equations for the rigid body formulation as described in [21]. Thus, the procedure to solve these two-handle sensitivity equations is similar to the rigid body case. We first solve for the derivative of the spatial quantities with respect to the design variable q¨ k for each body in the system. This is done in the following and then use (18) to calculate ddp manner. Following the procedure described in the previous section, we can write the twohandle sensitivity equation of body k + 1 as k+1 k+1 d Ak+1 k+1 d F1 k+1 d F2 k+1 1 = Φ11 + Φ12 + Φ13 , dp dp dp
(19a)
k+1 k+1 d Ak+1 k+1 d F1 k+1 d F2 k+1 2 = Φ21 + Φ22 + Φ23 . dp dp dp
(19b)
As in case of forward dynamics, our goal is to combine (16) and (19) to form the two-handle sensitivity equation of the fictitious body k : k + 1 by eliminating the derivative of the spatial
An efficient direct differentiation approach for sensitivity analysis
quantities with respect to the design variable at the joint J k . To this end, we differentiate (10) with respect to the design variable p which gives k
k
d Ak2 d AJt ˙J d Ak+1 k du 1 − = PJ + . dp dp dp dp k
k
(20)
k
Premultiplying (20) by (D J )T and using (D J )T · P J = 0, we get
DJ
k T
·
d Ak2 d Ak+1 1 − dp dp
k T d AJt . · = DJ dp k
(21)
k
As before, knowing the expression for AJt , the derivative terms on the right hand side of (21) can be numerically computed. Thus, (21) can be rewritten as k+1 J k T k T d Ak2 d A1 − · · G12 . (22) D = DJ dp dp The expressions for
d Ak+1 1 dp
these equations and the fact
D
Jk T
d Ak2 are obtained from (19a) dp d F2k d F k+1 that dp = − dp1 we get
and
and (16b), respectively. Using
k+1 k
k+1 k+1 J k T k+1 d F2 k d F1 k d F1 = D − Φ12 + G13 , (23a) · Φ11 + Φ22 · Φ21 dp dp dp k+1 k G13 = Φ23 − Φ13 + G12 .
From (23), we get the following expression for
(23b)
d F1k+1 : dp
k+1 k d F1k+1 k:k+1 d F1 k:k+1 d F2 k:k+1 = G14 + G15 + G16 , dp dp dp k:k+1 k G14 = X Φ21 ,
k:k+1 k+1 G15 = −X Φ12 ,
k:k+1 G16 = X G13 ,
J k −1 J k T k
k T k k+1 X = DJ DJ . Φ22 + Φ11 D D k
(24a) (24b) (24c)
k
k+1 k In (24c), the matrix [D J ]T [Φ22 + Φ11 ]D J is a symmetric positive definite matrix and therefore always invertible, and is at worst 6 × 6 [23]. We have thus expressed the derivative of spatial constraint force at joint J k with respect to the design variable in terms of derivatives of the spatial constraint forces acting on the terminal handles of the fictitious body k : k + 1. Substituting (24) in (16a) and (19b), we obtain the following two-handle sensitivity equation for the fictitious body k : k + 1 k+1 k d Ak1 k:k+1 d F1 k:k+1 d F2 k:k+1 , = Φ11 + Φ12 + Φ13 dp dp dp
(25a)
k+1 k d Ak+1 k:k+1 d F1 k:k+1 d F2 k:k+1 2 = Φ21 + Φ22 + Φ23 , dp dp dp
(25b)
where the terms Φijk:k+1 are given by k:k+1 k k k:k+1 = Φ11 − Φ12 G14 , Φ11
(26a)
K.D. Bhalerao et al. k:k+1 k k:k+1 Φ12 = −Φ12 G15 ,
(26b)
k:k+1 k k k:k+1 = Φ13 − Φ12 G16 , Φ13
(26c)
k:k+1 Φ21
=
k+1 k:k+1 Φ21 G14 ,
k:k+1 Φ22
=
k+1 Φ22
(26d)
k+1 k:k+1 + Φ21 G15 ,
(26e)
k:k+1 k+1 k+1 k:k+1 = Φ23 + Φ21 G16 . Φ23
(26f)
As can be clearly seen, the two-handle sensitivity equations for the assembled fictitious body k : k + 1 and the bodies k and k + 1 are in an identical form. This assembled body can now be treated like any other body in the system. 3.3 Assembly–disassembly process The hierarchic assembly–disassembly process for the sensitivity equations is identical to that used to solve the forward dynamics equations. The assembly process involves starting with two-handle sensitivity equations for individual bodies or the leaf nodes. These equations are hierarchically combined using the recursive relationship given by (26) until we have a two-handle sensitivity equation for an all encompassing body or the root node for the entire system. This is schematically shown in Fig. 3. Thus, the two-handle sensitivity equation for the root node can be written as nb 1 d A11 1:nb d F1 1:nb d F2 1:nb = Φ11 + Φ12 + Φ13 , dp dp dp
(27a)
nb 1 d Anb 2 1:nb d F1 1:nb d F2 1:nb = Φ21 + Φ22 + Φ23 . dp dp dp
(27b)
The unknowns in (27) are the derivatives of the spatial accelerations of the terminal handles and the constraint forces acting on them. The terminal handles (H11 and H2nb ) may have different constraints acting on them resulting in a system anchored at both the terminal handles, a free floating system, or a combination of these two. We briefly discuss the solution scheme for a system constrained at both the ends. The other cases can be worked out using a similar procedure. 3.3.1 System constrained at both the terminal handles 1
nb
Let D J and D J denote the constraint force subspace for joints connecting bodies 1 and nb to the inertial frame, respectively. The constraint force measure numbers for the spatial representation F are henceforth referred to as F. From the definition of the constraint force subspace D, we can write the spatial constraint force in terms of the constraint force measure . Premultiplying numbers as F = DF and the corresponding sensitivity relation ddpF = D dF dp 1
1
nb
(27a) and (27b) by (D J )T and (D J )T , respectively and using the fact that (D J )T J J 1 T d At
(D )
1
and (D
dp
D
J1 T
nb J nb T d A2
)
dp
= (D
J J nb T d At
)
d A11 dp
=
nb
dp
, we get
1 T 1:nb J 1 dF11 J 1 T 1:nb J nb dFnb d AJt 2 = D J Φ11 + D D Φ12 D dp dp dp 1 T 1:nb + D J Φ13 , 1
(28a)
An efficient direct differentiation approach for sensitivity analysis
DJ
d AJt dp
nb T
nb
=
J nb T 1:nb J 1 dF11 J nb T 1:nb J nb dFnb 2 + D D Φ21 D Φ22 D dp dp nb T 1:nb + DJ Φ23 .
(28b)
Equation (28) can be rewritten as ⎡ ⎣
1
1
nb
1
1:nb J ([D J ]T Φ11 D )
1
nb
1:nb J ([D J ]T Φ12 D )
⎤⎡
⎤
dF11 ⎦ ⎣ dpnb ⎦ dF2 J nb T 1:nb J nb dp ([D ] Φ22 D )
1:nb J D ) ([D J ]T Φ21 ⎡ ⎤ 1 1 1 d AJ 1:nb (D J )T dpt − (D J )T Φ13 ⎦. =⎣ nb nb nb d AJ 1:nb (D J )T dpt − (D J )T Φ23
Equation (29) can always be solved [21] to obtain the values of values, we can now calculate
dF dp
dF = D dF . dp dp d Anb 2 and dp .
using d A11
(29)
dF11 dp
and
Thus, the values
dFnb 2 . Knowing these dp d F11 d F nb of dp and dp2 are
substituted back in (27) to obtain dp A similar procedure can be followed for different constraints on the terminal handles to obtain the solution of the two-handle sensitivity equations for the root node. At the end of the assembly process the derivatives of the spatial accelerations of the terminal handles and the constraint forces acting on them with respect to the design variable are known. The next step is to start the disassembly process by calculating the unknowns at the intermediate handles. This is done in the following manner. The solution of any assembled subsystem yields the spatial quantities at the boundary handles of this subsystem. These values are now used in the two-handle sensitivity equations of the individual bodies or subassembly. For example, as seen in Sect. 3.2, on combining the two-handle sensitivity equations of the bodies k and k + 1, we obtained (25). Now the two-handle sensitivity equations of the fictitious body k : k + 1 can be solved for different constraints on the boundary handles following the procedure already described to yield the values of
d Ak1 dp
and
d F1k dp
d Ak1 d Ak+1 dFk , dp2 , dp1 dp
in (16a), we can obtain the value of
and d F2k dp
.
d F2k+1 . Substituting dp dFk dFk Next dp1 and dp2
d Ak2 . dp
are used in (16b) to obtain the value of An identical procedure is used to obtain the sensitivity terms corresponding to the spatial quantities at handle H1k+1 . Thus, the sensitivity terms corresponding to the spatial quantities at the terminal handles of each individual body are completely known. If we were to think of bodies k and k + 1 themselves as subsystems, then knowing the sensitivity terms of the terminal handles, the disassembly process can now continue for each of these subsystems. At the end of disassembly process, the sensitivity terms corresponding to the spatial quantities of all the handles in the system are known. u˙ k can be calculated from (20). Knowing these sensitivity terms, ddp Our next goal is to calculate the modal sensitivity terms. Since all the terms of the right q¨ k can hand side of (18) are completely known at the end of the disassembly process, ddp q¨ u˙ be easily computed for each body. Knowing ddp and ddp , the sensitivity of an objective function J with respect to design variable p can be calculated as described in Sect. 2.1. k
k
K.D. Bhalerao et al.
3.4 Implementation issues 3.4.1 Basis transformations In the sensitivity formulation, we have not shown basis transformations anywhere explicitly. It is assumed that appropriate transformations have been used wherever applicable. The forward dynamics formulation does not require any additional treatment. However, while working with the sensitivity equations, the derivatives of these transformation matrices need also be considered. For example, suppose that the forward dynamics algorithm requires converting a vector V from body basis denoted by subscript b to the Newtonian basis denoted by subscript n. Let the basis transformation matrix to go from body basis to the Newtonian basis be denoted by N C B . Then we have {V }n = N C B {V }b . While calculating the corresponding sensitivity terms, we get the following equation: d{V }n N B d{V }b d N C B = C + {V }b . dp dp dp
(30)
N
C B is a function of the generalized coordinates, modal coordinates and potentially also a N B function of the design variable p. Then d dpC can be written as k ∂ N C B ∂ N C B dqr ∂ N C B dqrk dN CB = + + . dp ∂p ∂qr dp ∂qrk dp r=1 k=1 r=1
n
∂ N CB ∂ N CB , ∂qr ∂p dqrk dqr and dp . The dp
The terms
nb
∂ N CB can be calculated ∂qrk dN CB value of dp {V }b can thus
and
ν
(31)
analytically while (2) can be used to
be calculated. While such additional obtain known terms do not change the basic algorithm, these terms must be accounted for wherever applicable. 3.4.2 Joint motion subspace In describing the forward dynamics and the sensitivity formulation, we have used the matrix k P J whose columns span the joint free modes of motion and it’s orthogonal complement Jk D whose columns span the constraint load space of the joint J k . These matrices when written in joint basis are constant as long as the joint motion map for the joint J k does not change during the course of the simulation. An important advantage of writing these matrices in joint basis is that
dP J dp
k
and
dD J dp
k
are identically equal to zero. In presenting k
k
the equations for sensitivity analysis, we had assumed that P J and D J are written in the joint basis. However, in certain forward dynamics implementation it may be desirable to express these matrices in a different basis and may have transformation matrices embedded in them. For example, consider a joint J k which allows for rotation about its local x and y axis, respectively. Let the joint basis be denoted by subscript j . Then in the joint basis, these matrices can be written as ⎡ ⎡ ⎤ ⎤ 1 0 0 0 0 0 ⎢0 1⎥ ⎢0 0 0 0⎥ ⎢ ⎢ ⎥ ⎥ ⎢0 0⎥ ⎢1 0 0 0⎥ Jk Jk ⎢ ⎥, ⎥ = P j =⎢ D (32) j ⎢0 0⎥ ⎢0 1 0 0⎥ . ⎢ ⎢ ⎥ ⎥ ⎣0 0⎦ ⎣0 0 1 0⎦ 0 0 0 0 0 1
An efficient direct differentiation approach for sensitivity analysis
These matrices can be converted to a new basis denoted by subscript b using spatial transformation matrix B C J as follows
PJ
k
b
k = B CJ P J j ,
Jk k D b = B C J DJ j .
(33)
These matrices can no longer be considered as constant during the course of the simulation and their derivatives with respect to the design variable must be taken in account. For example, in Sect. 3.3, the spatial constraint force (F ) was written in terms of the constraint force measure numbers (F) as F = DF. While calculating the corresponding sensitivity terms, we + dD F. In this case, the additional term dD F, which is known from now have ddpF = D dF dp dp dp forward dynamics, must be accounted for in all the subsequent equations. 3.4.3 Minimal differentiation In the presented DCA sensitivity approach, the differentiation of the two-handle equation of motion (9) and q¨ k (8) with respect to the design variable p is performed at the body level. This results in sensitivity equations for each body which are then assembled to obtain the two-handle sensitivity equation for the entire system (27) which can be solved for different constraints applied on the system. An alternative approach to arrive at (27) is to differentiate the two-handle equation of motion of the entire assembly. For example, following the process described in Sect. 2.2, the two-handle equation of motion for the root node can be written as 1:nb 1 1:nb nb 1:nb A11 = ξ11 F1 + ξ12 F2 + ξ13 ,
(34a)
1:nb 1 1:nb nb 1:nb Anb 2 = ξ21 F1 + ξ22 F2 + ξ23 .
(34b)
1 Differentiating (34) with respect to the design variable p and knowing A11 , Anb 2 , F1 and nb F1 from forward dynamics, we can directly obtain two-handle sensitivity equation for the assembly in a form identical to that of (27). Similarly it is possible to differentiate the twohandle equation of motion of the constituent sub-assemblies/subsystems and knowing the spatial dynamic terms from forward dynamics, two-handle sensitivity equations can be obtained for each subsystem. This alternative approach is mathematically equivalent to the DCA approach presented in this paper and would result in identical two-handle sensitivity equations. However, the DCA approach presented in the paper has certain advantages. The partial derivatives of the
inertia coupling terms (see (15))
δζijk δp
are locally generated. If the design parameter p is local δζ k
to a single body, then for the rest of the system δpij = 0. The recursive relationships used to generate the sensitivity equations for the assembled systems given in (26) ensure that the number of differentiations are minimal. In the alternative approach, dξij1:nb
δξij1:nb δp
is in general
non-zero. Besides this, calculating dp involves differentiating the recursive relationship used in the assembly process of the forward dynamics for the entire system. This involves generating a large number time dependent derivative terms which must be recomputed at each time step. Another advantage of DCA based sensitivity analysis presented in this paper is the ease of implementation. Once the sensitivity equations are generated at the body level, the DCA code written for forward dynamics can be effectively recycled with minor modifications to generate corresponding sensitivity equations for the entire system.
K.D. Bhalerao et al.
3.4.4 Application to general topologies In this paper, the sensitivity formulation is presented for a single chain with different constraints on the terminal handles. This approach works concurrently with forward dynamics and can be applied to all the topologies where the underlying forward dynamics algorithm is applicable. These topologies include serial or branched chains and closed coupled loops. A discussion on the forward dynamics of such systems for rigid bodies has been presented in [31] and is directly applicable to flexible multibody systems since they both use a DCA framework. 3.4.5 Computational complexity The forward dynamics for flexible bodies in a DCA framework requires two sweeps of the entire system. The sensitivity analysis also uses an identical DCA framework and requires two additional sweeps per design variable, one each during the assembly and disassembly processes. The computational complexity of these additional sweeps is same as that of the underlying dynamics formulation [23]. The dimension of the matrices involved in manipulating the sensitivity equations in general is small. Equation (17) involves inversion of a νk × νk matrix. This matrix is time independent and it’s inversion adds only to the preprocessing cost. The other matrix multiplications in (17) involve multiplying matrices of the dimension νk × νk and νk × 6 which is a O(νk2 ) process. The dimension of the other matrices involved in manipulating the two-handle sensitivity equations in a divide-and-conquer framework can at most be 6. The divide-and-conquer framework used to solve for the spatial quantities is a O(log(n)) process for a parallel implementation. Thus, for a parallel implementation, where a single processor is responsible for generating the two-handle sensitivity equations for each body, the given method for sensitivity analysis is a O(log(n)) + O(νk2 ) process per design variable, if the deformation field in each body is modeled using νk modal shape functions.
4 Numerical example The algorithm is demonstrated by applying it to a planar flexible two-body robotic manipulator shown in Fig. 4. The forward dynamics for this example has already been presented in literature [23, 36]. The manipulator consists of two flexible bodies with a point mass at the
Fig. 4 Two-arm robotic manipulator
An efficient direct differentiation approach for sensitivity analysis Table 1 System parameters
Parameter
Body 1
Body 2
Mass (m)
1.0 Kg
3.0 Kg
Length (L)
0.545 m
0.675 m
Elastic modulus (E)
7.3 × 1010 N/m2
7.3 × 1010 N/m2
Mass density (ρ)
2700 kg/m3
2700 kg/m3
Second moment of inertia (I )
1.69 × 10−8 m−4
3.33 × 10−9 m−4
Fig. 5 Plot of x and y coordinates of point P
end of each. All the joints in the system are revolute. The fixed parameters of the system are given in Table 1. The system starts from an undeformed state and undergoes a prescribed motion given by (35) for a period of 0.5 seconds, after which the system is allowed to oscillate on its own under the influence of gravity: φ1 = −π/4, t < 0 = π/4 −1 + 72t 3 , 0 ≤ t < 1/6 = π/4 −18t + 108t 2 − 144t 3 , 1/6 ≤ t < 1/3 = π/4 −8 + 54t − 108t 2 + 72t 3 , 1/3 ≤ t < 1/2 = π/4,
(35)
t > 1/2,
φ2 = −φ1 . The deformation field for each body is modeled using a single shape function for deformation in longitudinal and transverse direction, respectively. These shape functions are given in (36) Longitudinal: Transverse:
(x/L)2 ,
(36a)
1.5(x/L)2 − 0.5(x/L)3 .
(36b)
The plots of x and y coordinate of point P (see Fig. 4) are given in Fig. 5. Geometric stiffness has been accounted for in the simulation.
K.D. Bhalerao et al.
Fig. 6 Comparison between DCA based sensitivity and finite difference approximation
As discussed in Sect. 2.1, to calculate the sensitivity of any objective function J with q¨ k . Here we choose the derespect to a design variable p, it is sufficient to calculate ddpq¨ and ddp sign variable as L1 . The system under consideration is constrained to move in a predefined manner and consequently has only modal degrees of freedom. We denote the longitudinal and transverse modal coordinates of each body by q1 and q2 , respectively and compute d q¨i using the divide-and-conquer framework presented in this the instantaneous value of dL 1 paper. The analytical sensitivity values are compared with a finite difference approximation using 0.01% perturbation in L1 and a comparison is given in Fig. 6. The difference between the finite difference approximation and the analytical solution is proportional to the perturbation of design variable and the two curves match within this error. To demonstrate the convergence of the finite difference (FD) approximation to the analytical solution, d q¨2 d q¨2 ( dL DCA − dL FD ) is computed for body 1 for three different values of perturbations in L1 1 1 and the results are shown in Fig. 7. As can be clearly seen, the difference between the analytical solution and finite difference approximation reduces by an order of magnitude on a similar change in L1 . This indicates that the finite difference approximation is converging to the analytical solution generated by the method presented in this paper.
5 Conclusion Sensitivity analysis is an important but computationally expensive tool in design and efficiently generating sensitivity information can significantly reduce the engineering cost in building new products. Existing direct differentiation methods for sensitivity analysis of flexible multibody systems involve manipulating larger matrices and a large number of differentiations. Design sensitivity analysis is an iterative process and consequently for certain applications, the existing methods could be prohibitive due to the high computational cost involved. In this paper, a recursive direct differentiation method is presented for efficient sensitivity analysis of flexible multibody systems. The method is non-iterative and generates analytical sensitivity information accurate up to integration tolerances. The use of recursive equations to generate the two-handle sensitivity equations for the root node significantly reduces the number of differentiations required to generate the sensitivity information. The method is
An efficient direct differentiation approach for sensitivity analysis
Fig. 7 Finite difference approximation converges to the analytical solution
computationally efficient and involves manipulating smaller matrices to generate the sensitivity information. The presented method is expected to be of logarithmic complexity for parallel implementation and expected to perform better than conventional direct differentiation methods. The underlying divide-and-conquer framework makes the method adequate for sensitivity analysis of flexible multibody systems with general topologies. The ease of implementation, computational efficiency and analytical results make the presented method a useful alternative to existing methods. Acknowledgement This work was supported by NSF grant numbers 0555174 and 0757936. The authors gratefully acknowledge this support.
References 1. Anderson, K.S., Hsu, Y.H.: Analytic full-recursive sensitivity analysis for multibody systems design. In: Proceedings of the International Congress of Theoretical and Applied Mechanics (ICTAM 2000), Paper-1874. Chicago, IL (2000) 2. Bestle, D., Eberhard, P.: Analysing and optimizing multibody systems. Struct. Mach. 20, 67–92 (1992) 3. Haftka, R.T., Guerdal, Z.: Elements of Structural Optimization. Kluwer Academic, Dordrecht (1992) 4. Anderson, K.S., Hsu, Y.H.: Low operational order analytic sensitivity analysis for tree-type multibody dynamic systems. J. Guid. Control Dyn. 24(6), 1133–1143 (2001) 5. Haug, E., Ehle, P.H.: Second-order design sensitivity analysis of mechanical system dynamics. Int. J. Numer. Methods Eng. 18, 1699–1717 (1982) 6. Bestle, D., Seybold, J.: Sensitivity analysis of constrained optimization in dynamic systems. Arch. Appl. Mech. 62, 181–190 (1992) 7. Eberhard, P.: Analysis and optimization of complex multibody systems using advanced sensitivity methods. Math. Mech. 76, 40–43 (1996) 8. Haug, E., Wehage, R.A., Mani, N.K.: Design sensitivity analysis of large-scaled constrained dynamic mechanical systems. Trans. ASME 106, 156–162 (1984)
K.D. Bhalerao et al. 9. Ding, J.Y., Pan, Z.K., Chen, L.Q.: Second order adjoint sensitivity analysis of multibody systems described by differential-algebraic equations. Multibody Syst. Dyn. 18, 599–617 (2007) 10. Chang, C.O., Nikravesh, P.E.: Optimal design of mechanical systems with constaint violation stabilization method. J. Mech. Transm. Autom. Des. 107, 493–498 (1985) 11. Pagalday, J., Aranburu, I., Avello, A., Jalon, J.D.: Multibody dynamics optimization by direct differentiation methods using object oriented programming. In: Proceedings of the IUTAM Symposium on Optimization of Mechanical Systems, pp. 213–220. Stuttgart, Germany (1995) 12. Etman, L.: Optimization of multibody systems using approximation concepts. Ph.D. thesis, Technische Universiteit Eindhoven (1997) 13. Bischof, C.H.: On the automatic differentiation of computer programs and an application to multibody systems. In: Proceedings of the IUTAM Symposium on Optimization of Mechanical Systems, pp. 41–48 (1996) 14. Barthelemy, J.F., Hall, L.: Automatic differentiation as a tool in engineering design. Struct. Optim. 9, 76–82 (1995) 15. Greene, W., Haftka, R.: Computational aspects of sensitivity calculations in transient structural analysis. Comput. Struct. 32(2), 433–443 (1989) 16. Tak, T.: A recursive approach to design sensitivity analysis of multibody systems using direct differentiation. Ph.D. thesis, University of Iowa, Iowa City (1990) 17. Dias, J.M.P., Pereira, M.: Sensitivity analysis of rigid-flexible multibody systems. Multibody Syst. Dyn. 1, 303–322 (1997) 18. Serban, R., Haug, E.J.: Kinematic and kinetics derivatives for multibody system analyses. Mech. Struct. Mach. 26(2), 145–173 (1998) 19. Jain, A., Rodrigues, G.: Sensitivity analysis of multibody systems using spatial operators. In: Proceedings of the International Conference on Method and Models in Automation and Robotics (MMAR 2000). Miedzyzdroje, Poland (2000) 20. Hsu, Y.H., Anderson, K.S.: Efficient direct differentiation sensitivity analysis for general multi-rigidbody systems. In: Proceedings of the Third Symposium on Multibody Dynamics and Vibrations, ASME Design Engineering Technical Conference 2001 (DETC01), DETC2001/VIB-21335. Pittsburgh, PA (2001). 21. Mukherjee, R.M., Bhalerao, K.D., Anderson, K.S.: A divide-and-conquer direct differentiation approach for multibody system sensitivity analysis. Struct. Multidiscipl. Optim. 35, 413–429 (2007) 22. Neto, M.A., Ambrósio, J.A.C., Leal, R.P.: Sensitivity analysis of flexible multibody systems using composite materials components. Int. J. Numer. Methods Eng. 77(3), 386–413 (2009) 23. Mukherjee, R., Anderson, K.S.: A logarithmic complexity divide-and-conquer algorithm for multiflexible articulated body systems. Comput. Nonlinear Dyn. 2(1), 10–21 (2007) 24. Shabana, A., Wehage, R.: A coordinate reduction technique for transient analysis of spatial structures with large angular rotations. J. Struct. Mech. 11, 401–431 (1989) 25. Craig, R.R., Bampton, M.C.: Coupling of substructures for dynamic analyses. AIAA J. 6, 1313–1319 (1968) 26. Yoo, W., Haug, E.: Dynamics of flexible mechanical systems using vibration and static correction modes. J. Mech. Transm. Autom. Des. 108, 315–322 (1986) 27. Pereira, M., Proença, P.: Dynamic analysis of spatial flexible multibody systems using joint coordinates. Int. J. Numer. Methods Eng. 32, 1799–1812 (1991) 28. Nikravesh, P., Lin, Y.S.: Use of principal axes as the floating reference frame for a moving deformable body. Multibody Syst. Dyn. 13(2), 211–231 (2005) 29. Lehner, M., Eberhard, P.: On the use of moment-matching to build reduced order models in flexible multibody dynamics. Multibody Syst. Dyn. 16(2), 191–211 (2006) 30. Featherstone, R.: A divide-and-conquer articulated body algorithm for parallel O(log(n)) calculation of rigid body dynamics. Part 1: Basic algorithm. Int. J. Robot. Res. 18(9), 867–875 (1999) 31. Featherstone, R.: A divide-and-conquer articulated body algorithm for parallel O(log(n)) calculation of rigid body dynamics. Part 2: Trees, loops, and accuracy. Int. J. Robot. Res. 18(9), 876–892 (1999) 32. Mukherjee, R., Anderson, K.S.: An orthogonal complement based divide-and-conquer algorithm for constrained multibody systems. Nonlinear Dyn. 48(1-2), 199–215 (2007) 33. Schwertassek, R., Wallrapp, O., Shabana, A.: Flexible multibody simulation and choice of shape functions. Nonlinear Dyn. 20(4), 361–380 (1999) 34. Berzeri, M., Shabana, A.: Development of simple models for the elastic forces in the absolute nodal co-ordinate formulation. J. Sound Vib. 235(4), 539–565 (2000) 35. Kane, T.R., Levinson, D.A.: Dynamics: Theory and Application. McGraw-Hill, New York (1985) 36. Botz, M., Hagedorn, P.: Dynamic simulation of multibody systems including planar elastic beams using autolev. Eng. Comput. 14(4), 456–479 (1997)