Granular Materials, Contact Problems, DVI, MPRGP
Abstract
Active-set algorithm for solving inner optimization problem in multi-body dynamics is presented. The efficiency of our algorithm is demonstrated on the solution of simple simulation with thousands of moving spherical particles and static box obstacles. We discuss the solvability and the uniqueness of solution of the problem and the influence of solution to resulting velocity during time-stepping schema.
Full text
732 Modelling of Granular MaterialsActive-set based quadratic programming algorithm for solving optimization problems arising in granular dynamics simulations IV International Conference on Particle-based Methods – Fundamentals and Applications PARTICLES 2015 E. O˜nate, M. Bischoff, D.R.J. Owen, P. Wriggers & T. Zohdi (Eds) ACTIVE-SET BASED QUADRATIC PROGRAMMING ALGORITHM FOR SOLVING INNER OPTIMIZATION PROBLEMS WITH INEQUALITIES IN GRANULAR DYNAMICS SIMULATIONS Luk´aˇs Posp´ıˇsil1, Zdenˇek Dost´al1and David Hor´ak1 1VSB-Technical University of Ostrava, Tr 17. listopadu 15, CZ-70833 Ostrava, Czech Republic e-mail: lukas.p[email protected], [email protected], da[email protected] web page: http://industry.it4i.cz/ Key words: Granular Materials, Contact Problems, DVI, MPRGP Abstract. Active-set algorithm for solving inner optimization problem in multi-body dynamics is presented. The efficiency of our algorithm is demonstrated on the solution of simple simulation with thousands of moving spherical particles and static box obstacles. We discuss the solvability and the uniqueness of solution of the problem and the influence of solution to resulting velocity during time-stepping schema. 1 Introduction In this paper, we are interested in granular dynamics problems; in particular, namely simple multibody dynamics problems. These problems that may deal with from hundreds to billions of discrete rigid bodies interacting through contact, impact, or mutual constraints, such as simulation of the movement of granular matter, are one of the most challenging issue in computer-aided kinematics and dynamics of mechanical systems. Many real-world systems contain or interact with granular material, as granular material belongs among the most manipulated materials. For instance, such a material is utilized in a variety of fields, from sand, gravel, or nanoscale powders to large boulders in the civil industry. Devices consisted of rigid bodies interacting through frictional contacts and mechanical joints pose numerical solution challenges because of the discontinuous nature of their motion, see Pfeiffer and Glocker [1]. Usually, these simulations are performed using discrete element method (DEM, see for instance Cundall [2], Avci and Wriggers [3]; a penalty method where the computation of interaction force is based on the kinematics of the interaction, some representative parameters, and an empirical force law. 1
733 Luk´aˇs Posp´ıˇsil, Zdenˇek Dost´al and David Hor´ak From our point of view, an other method is more interesting. It is more similar to the solution of linear elasticity contact problems, because the problem is consisting of a differential variational inequality (DVI, see Pang and Stewart [4], Renouf and Alart [5], Heyn [6]). The method is sometimes referred to the Lagrange multiplier approach. It enforces non-penetration of rigid bodies via a constraint-based approach. In the DVI method, a linear inequality constrained quadratic optimization problem with symmetric positive semidefinite Hessian matrix must be solved at each time step of the simulation. The unknowns in the problem are the normal contact forces between interacting bodies. The efficient solution of inner optimization problem in DVI brings us to the development of Quadratic programming (QP) algorithms. Our research in the solution of particle dynamics simulations is motivated by the results achieved by Heyn et al. [7]. Authors used our Modified Proportioning with Reduced Gradient projection algorithm (MPRGP) to solve DVI efficiently in spite of the fact that all theoretical results supporting the convergence of MPRGP were valid only for the strictly convex cost functions. Only recently, we successfully extended the theory and explained the convergence of the MPRGP for the problems with more general convex quadratic cost function, see Dost´al and Posp´ıˇsil [8]. In the paper, we are interested in simple simulations with sphere and box particles, but our algorithms can be easily generalized to particle problems with general geometry. The first subsection consists of short review of the numerical solution concept and timestepping scheme. The aim of the paper is not to develop new simulations techniques or to modify the mathematical modelling process. However, we are interested in numerical aspect of the inner QP optimization problem and our proofs of the solvability are based on the object structures. Therefore, we decided to present short review. We present the formulation of the problem and derivation of optimization problem. The presented theory and ideas in these subsections can be considered as a short review of Heyn [6]. In the second section we present own new results in the mathematical aspect of the optimization problem solvability. In the next section, we present our active-set based algorithm Modified Proportioning with Reduced Gradient Projection (MPRGP). This algorithm was successfully used to solve a linear elasticity contact problems with up to more than 40 million of nodal variables, see Dost´al et. al [9]. This method combines the conjugate gradient steps with the reduced gradient projection steps and adaptive precision control of the solution of the auxiliary problems. Special attention is paid in the discussion of the solvability of optimization problem. The performance of the algorithm is demonstrated by the solution of a 3D particle dynamics problem. The last subsection includes the numerical experiments and results. We have implemented algorithms in C programming language with CUDA library, and we performed simulations on GPU card. The problem of granular dynamics is suitable for solving on such a massively parallel architectures. However, the aim of the paper is not to develop 2
734 Luk´aˇs Posp´ıˇsil, Zdenˇek Dost´al and David Hor´ak optimal implementation, but the development of algorithms. Much more efficient implementation was presented by the team from Simulation-Based Engineering Lab (SBEL) University of Wisconsin-Madison in Chrono::Engine software [10]. 2 Time-stepping schema and formulation of optimization problem In this short section, we review the basic of multi-body simulations. For more informations see, for instance, Haug [11] and Heyn [6]. Let us consider the system of nb∈Nrigid bodies (particles) in vector space {(x, y, z)∈ R3}. Each particle has 6 degrees of freedom - location of centre of gravity [rx,r y,r z]Tand unit quaternion of rotation [e0,e 1,e 2,e 3]T. For every body T(i),i=1,...,n bin the system in given time t, let us denote qt (i)∈R7asavector of generalized position and vt (i)∈R6as a vector of generalized velocities. In our simulations, the rotation of the body is represented by the unit quaternion of rotation and the angular velocity is represented by Euler angles. The position of bodies in the next time-step can be evaluated using time-stepping schema q(t+h)=q(t)+h.Qv(t), where his sufficiently small time step. Here, Qdenotes the matrix of linear mapping between derivative of position vector and vector of velocities, see Haug [11]. This equation can be considered as a discretized numerical solution of the first Newton law using Euler method. The same method is also used for the computation of velocities. The increment in the next time-step depends on the mass of each body, affecting external forces Fext(t, q, v), and contacts and other limiting conditions. This situation is described by second Newton law, i.e. v(t+h)=v(t)+hM−1(Fext +FC),(1) where Mis generalized mass matrix, FCis a vector of forces induced by contact constraints, and Fext is a vector of external forces. In our simple simulation, the vector of external forces represents the gravity force affecting each body. The contact between two bodies TAand TBconstitutes forces and torques FA=−˜γnA(C),F B=˜γnA(C), MA=CA×FA,M B=CB×FB, where nA(C) is outward unit normal to the body TAat the contact point C=[Cx,C y,C z]T∈ R3in global coordinate system, and ˜γ≥0 is unknown size of the force. Force FBcauses the change of the position of the body TB(the components of the generalized velocity vector corresponding to the position of gravity center). The change of rotation of the body TB(the components of the generalized velocity vector corresponding to the rotation) is effected by associated torque MB. Analogically, forces FAand MAchange the position 3
735 Luk´aˇs Posp´ıˇsil, Zdenˇek Dost´al and David Hor´ak and rotation of body TA. All forces can be expressed by one vector FC= FA MA FB MB = −˜γnA(C) CA×FA ˜γnA(C) CB×FB = −˜γnA(C) −˜γ˜ CAnA(C) ˜γnA(C) ˜γ˜ CBnA(C) = −nA(C) −˜ CAnA(C) nA(C) ˜ CBnA(C) =:D∈R12,1 ˜γ, (2) where we used the matrix representation of the vector product ˜ CB= 0−CA zCA y CA z0−CA x −CA yCA x0 ,˜ CB= 0−CB zCB y CB z0−CB x −CB yCB x0 . The unknown size of the force ˜γis constrained by the non-penetration conditions of the bodies, which can be described by gap function Φ:R7+7 →R. It holds •Φ([qA,q B])=0,˜γ≥0 if the bodies are in contact, •Φ([qA,q B]) >0,˜γ= 0 if the bodies are not in contact, •Φ([qA,q B]) <0 if the bodies penetrate each other. Merging these observations, we obtain the complementarity condition Φ(q)≥0, ˜γ≥0, Φ(q)⊥˜γ. Instead of these conditions, we can consider more numerically stable conditions (see Anitescu [12]) ˜γ≥0, 1 hΦ(q)+DTv(t+h)≥0, 1 hΦ(q)+DTv(t+h)⊥˜γ. (3) This problem can be reformulated to the quadratic programming problem with bound constraints, see next theorem. For simplicity we denote γ=t.˜γ. Lemma 1. The solution of the optimization problem min γ≥0 1 2γTNγ +rTγ, (4) where N=DTM−1D, (5a) r=1 hΦ+DTM−1k, (5b) k=Mv(t)+h.Fext,(5c) 4
736 Luk´aˇs Posp´ıˇsil, Zdenˇek Dost´al and David Hor´ak is equivalent to the solution of original problem M(v(t+h)−v(t))=hFext +DTγ, (6a) 1 hΦ(q)+DTv(t+h)≥0,(6b) 1 hΦ(q)+DTv(t+h)⊥γ, (6c) γ≥0.(6d) Proof. The proof is based on the Karush-Kuhn-Tucker optimality conditions. See Heyn [6]. The algorithm in every time-step has the form of Algorithm 1. Algorithm 1:Time-stepping schema. Given t, h, q(t),v(t). find contacts if there is a contact set up N,r from contacts solve the problem γ= arg min γ≥0 1 2γTNγ +rTγ v(t+h)=v(t)+M−1(hFext +Dγ) else v(t+h)=v(t)+hM−1Fext endif q(t+h)=q(t)+h.Qv(t) Return q(t+h),v(t+h). 3 The solvability and uniquess of the solution In this section, we prove that the inner optimization problem has always solution. However, since kernel of Hessian matrix is non-trivial, it can have infinite number of solutions. We show that the resulting velocity is independent of the choice of the solution of inner optimization problem. Lemma 2. Let A∈Rn,n be a symmetric positive definite matrix and let B∈Rn,m be a rectangular matrix. 5
737 Luk´aˇs Posp´ıˇsil, Zdenˇek Dost´al and David Hor´ak Then Ker BTAB = Ker B, (7a) Im BTAB = Im BT.(7b) Proof. See Laub [13] or Dost´al [14]. Lemma 3. The optimization problem (4) is a quadratic programming problem with symmetric positive semidefinite Hessian matrix and right-hand side vector from the image of Hessian matrix, i.e. ∀x∈Rnc:Nx, x≥0 (8a) r∈Im N(8b) Proof. At first, we prove (8a). It is necessary to show that ∀x∈Rnc:Nx, x≥0. We use that M∈R6nb,6nbis symmetric positive definite. Therefore, the inverse is also symmetric positive definite and it induces the norm in R6nb. Furthermore, we can write Nx, x=DTM−1Dx, x=M−1Dx, Dx=Dx2 M−1≥0. If we take a look into the formula for the right-hand side vector r=1 hΦ+DTM−1k, we can use Lemma 2 and simplify the proof of (8b) into the proof of Φ∈Im DT.(9) At first, let us define the vector spaces V,W⊂Rnc V= span 1 −1 0 0 . . . 0 0 , 0 0 1 −1 . . . 0 0 ,... 0 0 0 0 . . . 1 −1 ,W= span 1 1 0 0 . . . 0 0 , 0 0 1 1 . . . 0 0 ,... 0 0 0 0 . . . 1 1 . We take a better look into the structure of matrix D∈R6nb,ncwhose blocks are given by (2). This matrix always consists of the pairs of contacts - the contact between the body TAand the body TB(denoted by contact AB) as well as the contact between body B and A(denoted by contact BA). For the sake of simplicity we consider the construction 6
738 Luk´aˇs Posp´ıˇsil, Zdenˇek Dost´al and David Hor´ak of matrix D∈R6nb,ncwith consecutive collocation of the contact pairs. Then each pair of columns corresponds to the pair of contacts and the nonzero rows corresponding to the indexes of the bodies in this contact is given by (2). The submatrix for one pair of contacts AB and BA has the structure DR,C= −nA(CAB)nB(CBA) − CA ABnA(CAB) CA ABnB(CBA) nA(CAB)−nB(CBA) CB ABnA(CAB) CB BAnB(CBA) , R={indexes of vA,indexes of vB}, C={index of contact AB, index of contact BA}. (10) The key ingredient of the proof is a small observation −the contact forces in the contact points CAB =CBA have opposite directions and the outward unit normals of the bodies in the contact are also opposite. Thus nA=−nBand the submatrix (10) can be written in simplier form DR,C= −nA−nA − CAnA− CAnA nAnA CBnA CBnA , where we used notations nA=nA(CAB)=−nB(CBA), CA=CA AB =CA BA, and CB= CB AB =CB BA. Using this structure, it is easy to check that ∀v∈V:Dv =0, ∀w∈W\{0}:Dw =0. Furthermore, we proved that V⊂Ker Dand W∩Ker D={0}. Using this and Im DT⊥ Ker D, we can write Ker D⊃V⊥W W∩Ker D={0}⇒ W⊥Ker D⇒ W⊂Im DT. To prove (9), notice that Φ ∈Wbecause the gap function has the same value for both contacts AB and BA (the distance between bodies TAand TBis the same as distance between bodies TBand TA). The previous lemma proves that the cost function is bounded from below. Using the clasical results given by Frank and Wolfe [15], we can conclude that the optimization problem (4) has always solution. Lemma 4. The velocity in the next time-step v(t+h)given by Algorithm 1 is independent of the choice of the solution of the optimization problem (4). 7
739 Luk´aˇs Posp´ıˇsil, Zdenˇek Dost´al and David Hor´ak Proof. Let ¯γ1,¯γ2denote different solutions of optimization problem (4). Then the velocity in the next time-step given by Algorithm 1 is given by v(t+h)(¯γ1)=v(t)+M−1(hFext +D¯γ1), v(t+h)(¯γ2)=v(t)+M−1(hFext +D¯γ2). Thus the difference of these velocities reads v(t+h)(¯γ1)−v(t+h)(¯γ2)=M−1D(¯γ1−¯γ2). Since the solutions of quadratic programming problem differ by the vector from the kernel of Hessian matrix, see Dost´al [14] and Ker N= Ker D(see Lemma 2), we can write v(t+h)(¯γ1)−v(t+h)(¯γ2)=M−10=0. 4 Modified Proportioning with Reduced Gradient Projection For solving problem (5), we are using an active-set based algorithm. This algorithm is based on the decomposition of the set of indices of all constraints M=1,...,n cinto two disjoint subsets subject to the value of the constraint function F(γ) := {j∈M:γj>0},A(γ) := {j∈M:γj=0}. Using this decomposition, we decompose the gradient of the cost function g(γ)=∇f(γ)= Nγ +rin every iteration γkinto free and chopped gradient ϕj(γk)=gjfor j∈F(γk),ϕ j(γk) = 0 for j∈A(γk), βj(γk)=0 forj∈F(γk),β j(γk) = min{gj,0}for j∈A(γk). Modified Proportioning with Reduced Gradient Projection (MPRGP, see Algorithm 2) is an efficient algorithm for the solution of convex quadratic programming problems with simple bounds. The basic version was proposed independently by Dost´al [16] and Friedlander and Mart´ınez [17]. It can be considered as a modification of the Polyak algorithm. Dost´al and Sch¨oberl in [18] combine the proportioning algorithm with the gradient projections [19]. They use the constant Γ >0, the test to decide about leaving the face, and three types of steps to generate the sequence of iterates γkthat approximate the solution. The precision of the solution of auxiliary problems is controlled by norm of violation of Karush-Kuhn-Tucker condition in each inner iterate γkby Γϕ(γk)≥ β(γk) , while Γ >0 and γksatisfying this inequality is called as proportional. If γ∈Ω, i.e. γ≥0, we call γfeasible. 8
740 Luk´aˇs Posp´ıˇsil, Zdenˇek Dost´al and David Hor´ak Algorithm 2:Modified Proportioning with Reduced Gradient projection (MPRGP). Step 0 {Initialization of parameters} γ0∈Ω,α∈0,N−1,Γ>0 Step 1 {Proportioning step - removes indices from A(γk)} If γkis not proportional then define γk+1 =γk−αCGβ(γk)by proportioning, αCG =βT(γk)g(γk) βT(γk)Aβ(γk)minimizes φ(γk−αβ(γk)) with respect to α Step 2 {CG step} If γkis proportional then generate γk+1 =γk−αCGpkby trial cg step, pk+1 =ϕ(γk)−βCGpk,βCG =(ϕT(γk)Apk)/((pk)TApk) Step 3 {Expansion step - expands A(γk)} If γk∈Ωthen accept it else generate γk+1 =P+(γk−αϕ(γk)) = γk−αϕ(γk)by projection to feasible set Every solution γof auxiliary problem satisfies the Karush-Kuhn-Tucker conditions expressed by the relation ϕ(γ)=0 ∧β(γ)=0, hence as a stopping criteria, we are using the Euclidean norm of the projected gradient gP(γ)=ϕ(γ)+β(γ)= 1 α(γ−P+(x−αg(γ))), where P+is the projection to set of feasible vectors defined as P+(γ)i= max{γi,0}. More details about implementation of the algorithm may be found in [18]. A short review of optimal QP algorithms can be found in Dost´al and Posp´ıˇsil [20]. 5 Numerical experiment In this section, we present the numerical results showing the efficiency of our algorithm on the simulation of 32810 spherical particles. During the first stage of the simulation, small particles are poured into box represented by five walls. The initial position of the particles and final position can be found in Fig. 3. Afterwards, in t=0.3 s, we add large 9