TR-2016-02 - SBEL · TR-2016-02 Using an Anti-Relaxation Step to Improve the Accuracy of the...

21
TR-2016-02 Using an Anti-Relaxation Step to Improve the Accuracy of the Frictional Contact Solution in a Differential Variational Inequality Framework for the Rigid Body Dynamics Problem Daniel Melanz, Hammad Mazhar and Dan Negrut February 22, 2016

Transcript of TR-2016-02 - SBEL · TR-2016-02 Using an Anti-Relaxation Step to Improve the Accuracy of the...

Page 1: TR-2016-02 - SBEL · TR-2016-02 Using an Anti-Relaxation Step to Improve the Accuracy of the Frictional Contact Solution in a Di erential Variational Inequality Framework for the

TR-2016-02

Using an Anti-Relaxation Step to Improve the Accuracy of the

Frictional Contact Solution in a Differential Variational Inequality

Framework for the Rigid Body Dynamics Problem

Daniel Melanz, Hammad Mazhar and Dan Negrut

February 22, 2016

Page 2: TR-2016-02 - SBEL · TR-2016-02 Using an Anti-Relaxation Step to Improve the Accuracy of the Frictional Contact Solution in a Di erential Variational Inequality Framework for the

Abstract

Systems composed of rigid bodies interacting through frictional contact are mani-fest in several science and engineering problems. The number of contacts can be small,such as in robotics and geared machinery, or large, such as in terramechanics appli-cations, additive manufacturing, farming, food industry, and pharmaceutical industry.Currently, there are two popular approaches for handling the frictional contact problemin dynamic systems. The penalty method calculates the frictional contact force basedon the kinematics of the interaction, some representative parameters, and an empiricalforce law. Alternatively, the complementarity method, based on a differential varia-tional inequality (DVI), enforces non-penetration of rigid bodies via a complementaritycondition. This contribution concentrates on the latter approach and investigates theimpact of an anti-relaxation step that improves the accuracy of the frictional contactsolution. We show that the proposed anti-relaxation step incurs a relatively modestcost to improve the quality of a numerical solution strategy which poses the calculationof the frictional contact forces as a cone-complementarity problem.

1

Page 3: TR-2016-02 - SBEL · TR-2016-02 Using an Anti-Relaxation Step to Improve the Accuracy of the Frictional Contact Solution in a Di erential Variational Inequality Framework for the

Contents

1 Introduction 3

2 Modeling frictional contact via DVI 32.1 The numerical solution scheme . . . . . . . . . . . . . . . . . . . . . . . . . . 52.2 Anti-relaxation via iterative refinement . . . . . . . . . . . . . . . . . . . . . 72.3 The anti-relaxed APGD algorithm . . . . . . . . . . . . . . . . . . . . . . . . 9

3 Numerical experiments 103.1 A 2D example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103.2 Filling test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133.3 Scaling analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

4 Summary and conclusions 16

Appendices 19

A Additional plots 19A.1 Surface plots of the objective functions . . . . . . . . . . . . . . . . . . . . . 19A.2 Constraint plots with objective contours . . . . . . . . . . . . . . . . . . . . 19

2

Page 4: TR-2016-02 - SBEL · TR-2016-02 Using an Anti-Relaxation Step to Improve the Accuracy of the Frictional Contact Solution in a Di erential Variational Inequality Framework for the

1 Introduction

Nonsmooth rigid multibody dynamics (NRMD) consists of predicting the position and veloc-ity evolution of a group of rigid particles that are subject to non-interpenetration, collision,adhesion, and dry friction constraints and to possibly global forces (such as electrostatic andgravitational forces). The dynamics of such a group of particles is nonsmooth because ofthe intermittent nature of non-interpenetration, collision, and adhesion constraints and be-cause of the nonsmooth nature of the dry friction constraints at stick-slip transitions. UsingCoulomb’s Law of Friction, the dynamics of such a nonsmooth rigid multibody system canbe resolved by simultaneously solving a linear complementarity problem (LCP) that linksthe normal contact impulses to the distances between bodies and a quadratic minimiza-tion problem that links the normal and tangential contact impulses via conic constraints.Solving this coupled system, or differential variational inequality (DVI), has proven to bequite difficult although polyhedral linearizations of the minimization problem have provideda reasonable approximation. To circumvent the difficulties posed by increasing complexityof classical LCP solvers and the increased size and inaccuracy introduced by polyhedralapproximation, however, a novel solution method was developed based on a fixed-point it-eration with projection on a convex set, that can directly solve large cone complementarityproblems with low computational overhead. This solution method works by adding a relax-ation term to transform the original problem into a cone complementarity problem (CCP).By considering the Karush-Kuhn-Tucker (KKT) conditions, the CPP is further transformedinto a cone-constrained quadratic optimization problem (CCQO) for which several iterativesolution methods exist. In the DVI method, a CCQO must be solved at each time step ofthe simulation, where the unknowns are the normal and frictional contact forces betweeninteracting bodies. The time-stepping scheme was proven to converge in a measure differen-tial inclusion sense, to the solution of the original continuous-time DVI. This paper uses aniterative refinement scheme, called anti-relaxation, to update the objective function of theCCQO to yield a optimum that is equivalent to the solution of the original NRMD problem.

2 Modeling frictional contact via DVI

Consider a three dimensional (3D) system of rigid bodies which may interact through fric-tional contact. An absolute Cartesian coordinate system will be used to define the equationsof motion for the time evolution of such a system [1]. Therefore, the generalized positions

q =[rT1 , ε

T1 , . . . , r

Tnb, εTnb

]Tand their time derivatives q =

[rT1 , ε

T1 , . . . , r

Tnb, εTnb

]Tare used to

describe the state of the system. Here, rj is the absolute position of the center of mass ofbody j and εj is the quaternion used to represent rotation. Note that the angular velocity ofbody j in local coordinates, ωj, may be used in place of the time derivative of the rotation

quaternion. Then, the vector of generalized velocities v =[rT1 , ω

T1 , . . . , r

Tnb, ωTnb

]Tcan be

related to q via a linear mapping given as q = T (q) v [1].Due to the rigid body assumption and the choice of centroidal reference frames, the

3

Page 5: TR-2016-02 - SBEL · TR-2016-02 Using an Anti-Relaxation Step to Improve the Accuracy of the Frictional Contact Solution in a Di erential Variational Inequality Framework for the

generalized mass matrix M is constant and diagonal. Further, let f (t,q,v) be a set ofgeneralized external forces which act on the bodies in the system. Finally, the second orderdifferential equations which govern the time evolution of the system can be written in thematrix form M v = f (t,q,v) [2].

The rigid body assumption implies that elements that come into contact should notpenetrate each other. Such a condition is enforced here through unilateral constraints. Toenforce the non-penetration constraint, a gap function, Φ (q, t), must be defined for eachpair of near-enough bodies. When two bodies are in contact, or Φ (q, t) = 0, a normal forceacts on each of the two bodies at the contact point. When a pair of bodies is not in contact,or Φ (q, t) > 0, no normal force exists. This captures a complementarity condition, whereone of two scenarios must hold. Either the gap is positive and the normal force is exactlyzero, or vice-versa: the gap is zero, and the normal force is positive.

When a pair of bodies is in contact, friction forces may be introduced into the systemthrough the Coulomb friction model [3]. The force associated with contact i can then bedecomposed into the normal component, Fi,N = γi,nni, and the tangential component, Fi,T =γi,uui+γi,wwi, where multipliers γi,n > 0, γi,u, and γi,w represent the magnitude of the force ineach direction, ni is the normal direction at the contact point, and ui and wi are two vectorsin the contact plane such that ni, ui, and wi are mutually orthonormal. The governingdifferential equations are obtained by combining the rigid body dynamics equations with theunilateral constraint equations. Then, the governing differential equations, which assumethe form of a differential variational inequality (DVI) problem, become [4],

q = T (q) v (1)

M (q) v = f (t,q,v) +Nc∑i=1

(γi,nD

Ti,n + γi,uD

Ti,u + γi,wD

Ti,w

)(2)

0 ≤ Φi (q, t) ⊥ γi,n ≥ 0 i = 1, 2, . . . , Nc (3)

(γi,u, γi,w) = arg min√γ2i,u+γ

2i,w≤µiγi,n

(γi,uv

TDi,u + γi,wvTDi,w

). (4)

The tangent space generators Di = [Di,n,Di,u,Di,w] ∈ R6nb×3 are defined as

DTi =

[0, · · · ,−AT

i,p,ATi,pAA˜si,A,0, · · · ,0,AT

i,p,−ATi,pAB˜si,B, · · · ,0

], (5)

and are used to transform the contact forces from local to global frame, µi is the coefficientof friction for contact i, and Nc is the total number of possible contacts. Note that forcontact between bodies A and B, the matrix Ai,p = [ni,ui,wi] ∈ R3×3 is used to representthe orientation of the contact in global coordinates, and the matrices AA and AB as therotation matrices of bodies A and B, respectively.

4

Page 6: TR-2016-02 - SBEL · TR-2016-02 Using an Anti-Relaxation Step to Improve the Accuracy of the Frictional Contact Solution in a Di erential Variational Inequality Framework for the

2.1 The numerical solution scheme

Equations 1 through 4 are discretized to obtain an approximation of the solution at discreteinstants in time. In the following, superscript (l) denotes a variable at time instant t(l). Forexample, q(l) and v(l) represent the position and velocity at time t(l), respectively. Further,γi = hγi is the contact impulse for contact i. Then, the discretized form of the equations ofmotion is posed as [5]:

q(l+1) = q(l) + hT(q(l))

v(l+1) (6)

M(v(l+1) − v(l)

)= hf

(t(l),q(l),v(l)

)+

Nc∑i=1

(γi,nD

Ti,n + γi,uD

Ti,u + γi,wD

Ti,w

)(7)

0 ≤ 1

hΦi

(q(l), t

)+ DT

i,nv(l+1) ⊥ γi,n ≥ 0, i = 1, 2, . . . , Nc (8)

(γi,u, γi,w) = arg min√γ2i,u+γ

2i,w≤µiγi,n

(γi,uv

(l+1)TDi,u + γi,wv(l+1)TDi,w

), (9)

where t(l+1) = t(l)+h for some integration time step h. Methods for solving the above problemin the most general case are lacking and various strategies are employed to simplify it [6].For example, the friction cones can be approximated by linear faceted pyramids, leadingto a linear complementarity problem (LCP) which can be solved by pivoting or simplexmethods [7]. However, these approaches in the class of direct methods can have exponentialcomplexity in the worst-case [8]. Another artifact is the lack of isotropy, given that thefriction cone is approximated by a pyramid. An alternative is to introduce a relaxation tothe complementarity constraints, replacing 0 ≤

(1hΦi

(q(l), t

)+ DT

i,nv(l+1)

)⊥ γi,n ≥ 0 with

the following [9]:

0 ≤(

1

hΦi

(q(l), t

)+ DT

i,nv(l+1) − µi

√(DT

i,uv(l+1)

)2+(DT

i,wv(l+1))2) ⊥ γi,n ≥ 0 . (10)

As seen from Eq. 10, the modification is small when µ or the relative tangential velocity

at the point of contact,√(

DTi,uv

(l+1))2

+(DT

i,wv(l+1))2

, are small. Additionally, it has been

shown in [5] that the solution of the modified scheme will still approach the solution of theoriginal problem as the step-size tends to zero. An iterative method has been developed tosolve this problem [10,11]. It can be shown that solving the relaxed discretized equations ofmotion is equivalent to solving a Cone Complementarity Problem (CCP) of the form

Find γ(l+1)i , for i = 1, . . . , Nc

such that Υi 3 γ(l+1)i ⊥ −

(Nγ(l+1) + r

)i∈ Υ◦i (11)

where Υi = {[x, y, z]T ∈ R3|√y2 + z2 ≤ µix}

and Υ◦i = {[x, y, z]T ∈ R3|x ≤ −µi√y2 + z2},

5

Page 7: TR-2016-02 - SBEL · TR-2016-02 Using an Anti-Relaxation Step to Improve the Accuracy of the Frictional Contact Solution in a Di erential Variational Inequality Framework for the

with matrix N and vector r defined as

N = DTM−1D, (12)

r = b + DTM−1k, (13)

where bT =[bT1 , . . . ,b

TNc

]with bi =

[1hΦi, 0, 0

]T ∈ R3, and k = Mv(l) + hf(t(l),q(l),v(l)

).

It can be verified by considering the KKT first-order necessary conditions that solving theCCP of Eq. 11 is equivalent to solving a cone-constrained quadratic optimization (CCQO)problem. For the case with only unilateral constraints (contacts), this optimization problemtakes the form [12,13],

min q (γ) =1

2γTNγ + rTγ (14)

subject to γi ∈ Υi for i = 1, 2, . . . , Nc,

where γi is the triplet of multipliers associated with contact i and Υi is the friction cone of

contact i. Note also that γ =[γT1 , γ

T2 , . . . , γ

TNc

]T.

It should be noted that the relaxation introduced by Eq. 10 is non-physical. The objectivefunction of the CCQO can be modified by an anti-relaxation term, aT =

[aT1 , . . . , a

TNc

]with

ai = [αi, 0, 0]T ∈ R3, to result in a solution that is equivalent to the optimum of Eqs. 1-4.This modification results in the anti-relaxed CCQO,

min q (γ) =1

2γTNγ + (r + a)Tγ (15)

subject to γi ∈ Υi for i = 1, 2, . . . , Nc,

The value of α can be determined by considering the Lagrangian, L (γ, λ), for the con-strained optimization problem in Eq. 15,

L (γ, λ) =1

2γTNγ + (r + a)Tγ −

Nc∑i=1

λi

(µiγi,n −

√γ2i,u + γ2i,w

). (16)

Then, the KKT conditions for Eq. 15 can be stated as follows. If γ∗ is a local solutionof Eq. 15, then there exists a vector λ∗ of Lagrange multipliers, λ∗i , i = 1, . . . , Nc, such thatthe following conditions are satisfied,

∇L (γ∗, λ∗) = 0, (17)

ci (γ∗) ≥ 0, ∀i = 1, . . . , Nc (18)

λ∗i ≥ 0, ∀i = 1, . . . , Nc (19)

λ∗i ci (γ∗) = 0, ∀i = 1, . . . , Nc (20)

6

Page 8: TR-2016-02 - SBEL · TR-2016-02 Using an Anti-Relaxation Step to Improve the Accuracy of the Frictional Contact Solution in a Di erential Variational Inequality Framework for the

where ci (γ) = µiγi,n −√γ2i,u + γ2i,w. These equations can be stated in a more manageable

form by defining the vector s as follows:

s =

. . . , λiµi, −λiγi,u√γ2i,u + γ2i,w

,−λiγi,w√γ2i,u + γ2i,w

, . . .

T ∈ R3Nc (21)

Then, the condition in Eq. 17 can be expressed as follows:

Nγ + r + a = s (22)

DTM−1Dγ + DTM−1k + b + a = s (23)

DTM−1 (Dγ) + b + a = s (24)

DTv + b + a = s (25)

Specifically, the rows of Eq. 22 associated with contact i are

(Nγ + r + a)i = DTi v + bi + ai = si (26)DT

i,nv + 1hΦi + αi

DTi,uv

DTi,wv

=

λiµi−λiγi,u√γ2i,u+γ

2i,w

−λiγi,w√γ2i,u+γ

2i,w

. (27)

For the case where γi,n > 0, the quantity in the first line of Eq. 27 must be equal to zeroaccording to Eq. 8 and αi = λiµi. By manipulating the second and third lines of Eq. 27, λican be expressed as follows:

λi =

√(DT

i,uv)2

+(DT

i,wv)2

(28)

2.2 Anti-relaxation via iterative refinement

As the anti-relaxation term αi relies on the value of v(l+1), the approximation vk = M−1 (k + Dγk)is used as γk approaches γ∗ via an iterative scheme. In [14], Nesterov developed a gradient-descent method with an improved convergence rate of O (1/k2). In fact, the method in [14]was shown to be an ‘optimal’ first-order method for smooth problems [15] in terms of itsperformance among all first-order methods, up to a constant.

The following set of equations represents one iteration of the accelerated gradient descent(AGD) scheme with iterative refinement [16]. Note that y0 = x0 ∈ Rn, θ0 = 1, q ∈ [0, 1] is atuning parameter, and tk is the step size for the current iteration.

7

Page 9: TR-2016-02 - SBEL · TR-2016-02 Using an Anti-Relaxation Step to Improve the Accuracy of the Frictional Contact Solution in a Di erential Variational Inequality Framework for the

xk+1 = yk − tk∇fk (29)

θk+1 solves θ2k+1 = (1− θk+1) θ2k + qθk+1 (30)

βk+1 =θk (1− θk)θ2k + θk+1

(31)

yk+1 = xk+1 + βk+1 (xk+1 − xk) (32)

∇fk+1 = ∇f (yk+1) (33)

Assume f (x) is convex and Lipschitz continuous with constant L; i.e., ||∇f (x)−∇f (y) ||2 ≤L||x−y||2,∀x, y ∈ Rn. Then, the method described by Eqs. 29 through 32 converges for anytk ≤ 1/L. In the above, note that q = 1 leads to θk = 1, βk = 0, and yk = xk for all k ≥ 0,which reduces to the gradient descent method. In general, the parameter q can tune theperformance of the method depending on the specifics of the objective function f (x). For ex-ample, if f (x) is also strongly convex, i.e., ∃µ > 0 : f (x) ≥ f (x?)+(µ/2) ||x−x?||22,∀x ∈ Rn,then the optimal value is q = µ/L, which achieves a linear convergence rate. If the objectivefunction is not strongly convex, or the strong convexity parameter µ is unknown, then it isoften assumed that q = 0. Note that the original statement of the accelerated method in [14]had q = 0, so the convergence rate of O (1/k2) is still valid.

The AGD scheme can be extended to constrained optimization by ensuring that Eq. 29does not leave the feasible set. The resulting algorithm, called Accelerated Projected Gradi-ent Descent (APGD) can be expressed by the following set of computations to be performedat each iteration k ≥ 0. Once again, let y0 = x0 ∈ Rn, and θ0 = 1.

xk+1 = ΠC (yk − tk∇fk) (34)

θk+1 solves θ2k+1 = (1− θk+1) θ2k (35)

βk+1 =θk (1− θk)θ2k + θk+1

(36)

yk+1 = xk+1 + βk+1 (xk+1 − xk) (37)

∇fk+1 = ∇f (yk+1) (38)

When f (x) is convex and Lipschitz continuous with constant L, then the method de-scribed by Eqs. 34 through 37 converges for any tk ≤ 1/L. An equivalent algorithm wasproved in [17] to converge with the same O (1/k2) rate as the AGD method. These compu-tations are performed until the residual, r, which is defined as

r = ||f ||2, f =1

gd(γ − ΠK (γ − gd (Nγ + r))) ∈ R3Nc , (39)

drops below a specified tolerance. This termination criteria is a scaled version of the projectedgradient, and is designed to ensure that the computed projected gradient direction is tangent

8

Page 10: TR-2016-02 - SBEL · TR-2016-02 Using an Anti-Relaxation Step to Improve the Accuracy of the Frictional Contact Solution in a Di erential Variational Inequality Framework for the

to the constraint manifold at the current iterate. This is desirable because it is known thatat the optimal solution, the gradient is orthogonal to the constraint manifold. Therefore, itis logical to use the component of the gradient which is tangent to the constraint manifoldas a measure of error. To understand this residual, first note that if γ = γ∗ is optimal, thenΠK (γ∗ − gd (Nγ∗ + r)) = γ∗, so f = 0 and r = 0 as expected. Second, consider the casewhen γ is not optimal. Then, it can be verified that

ΠK (γ − gd (Nγ + r)) = γ − gdf . (40)

In the preceding, the left hand side is equivalent to taking a step of length gd in thenegative gradient direction and projecting back to the feasible region. The right hand sidesays that the same point can be reached by taking a step of length gd in the direction oppositeof f . In the limit, as gd → 0, the direction f approaches the plane tangent to the constraintmanifold. Note that r could be used to measure convergence for any value of gd, but a smallvalue was used in practice for the reasons just stated.

2.3 The anti-relaxed APGD algorithm

This section states the overall algorithm obtained when applying the APGD method withanti-relaxation to the problem in Eq. 15. As stated, the algorithm includes an adaptive stepsize which may both shrink and grow, an adaptive restart scheme based on the gradient, anda fall-back strategy to allow early termination [12].

Algorithm APGD with anti-relaxation(N , r, τ , Nmax)(1) γ0 = 0nc

(2) γ0 = 1nc

(3) y0 = γ0(4) r0 = r(5) θ0 = 1

(6) Lk = ||N(γ0−γ0)||2||γ0−γ0||2

(7) tk = 1Lk

(8) for k := 0 to Nmax

(9) g = Nyk + r(10) γk+1 = ΠK (yk − tkg)(11) while 1

2γTk+1Nγk+1 + γTk+1r ≥ 1

2yTkNyk + yTk r + gT (γk+1 − yk) +

12Lk||γk+1 − yk||22

(12) Lk = 2Lk(13) tk = 1

Lk

(14) γk+1 = ΠK (yk − tkg)(15) endwhile

(16) θk+1 =−θ2k+θk

√θ2k+4

2

(17) βk+1 = θk1−θk

θ2k+θk+1

9

Page 11: TR-2016-02 - SBEL · TR-2016-02 Using an Anti-Relaxation Step to Improve the Accuracy of the Frictional Contact Solution in a Di erential Variational Inequality Framework for the

(18) yk+1 = γk+1 + βk+1 (γk+1 − γk)(19) r = r (γk+1)(20) if r < εmin(21) rmin = r(22) γ = γk+1

(23) endif(24) if r < τ(25) break(26) endif(27) if gT (γk+1 − γk) > 0(28) yk+1 = γk+1

(29) θk+1 = 1(30) endif(31) Lk = 0.9Lk(32) tk = 1

Lk

(33) vk = M−1 (k + Dγk+1)(34) for i = 1 to nc

(35) λi =√(

DTi,uvk

)2+(DT

i,wvk)2

(36) r = r0(37) ri,n = ri,n + λiµi(38) endfor(39) return Value at time step tl+1, γ

l+1 := γ .

3 Numerical experiments

This section analyzes the effect of anti-relaxation using three different numerical experiments.The first numerical experiment in §3.1 thoroughly analyzes the simple case of a spheretransitioning from pure sliding to rolling. The second experiment in §3.2 investigates theeffect of anti-relaxation over time for a filling test with 1000 spheres. The last experiment in§3.3 looks at several filling tests, each with a different number of bodies, to investigate theeffect of the anti-relaxation as a function of the number of collisions.

3.1 A 2D example

The first numerical experiment thoroughly analyzes the dynamics of a 3D ball (two trans-lational and one rotational degrees of freedom, q = [qx, qy, ω]T ∈ R3) as it transitions from

pure sliding to rolling [18]. In this case, γ = [γn, γt]T ∈ R2 because there is only a normal

and tangential impulse. Fig. 1 shows an elevation view of a rough uniform sphere of unitradius and mass in contact with a fixed horizontal plane in a uniform gravitational field. Thisexample was chosen because of the existence of an easily obtainable closed-form solution ofthe dynamic motion of the sphere for certain conditions. Let the plane coincide with the

10

Page 12: TR-2016-02 - SBEL · TR-2016-02 Using an Anti-Relaxation Step to Improve the Accuracy of the Frictional Contact Solution in a Di erential Variational Inequality Framework for the

Figure 1: Sphere on a fixed horizontal plane.

xz-plane of a (right-handed) inertial frame, with the inertial y-direction upward. Thus, therewill be a single contact with the n always pointed in the y-direction, the u always pointedin the x-direction (there is no w in this example), and the gap function Φ = qy − 1 so that

b =[1h(qy − 1), 0

]T ∈ R2. The coefficient of friction was assumed to have a constant valueof 0.2. The matrices D and M can be seen to be constant throughout the motion. For thisproblem, the various matrices are:

M =

1 0 00 1 00 0 0.4

(41)

D =

0 11 00 1

(42)

fext =

0−9.81

0

(43)

Given the following initial conditions:

q0 =[0 1 0

]T(44)

v0 =[2 0 0

]T, (45)

using h =0.01 s the matrices N and r can be calculated from Eqs. 12 and 13 and will resultin:

N =

[1 00 3.5

](46)

r =

[−0.0981

2

](47)

The sphere initially slides in the x-direction, gathering angular velocity until the tran-sition time, ttrn =

2vx07gµ≈ 0.291 s where vx0 is the initial velocity in the x-direction and

g = 9.81 m s−2. After the transition time, the sphere rolls with constant velocity in thex-direction and angular velocity ω =

5vx07≈ 1.429 m s−1. The analytical solution for the

11

Page 13: TR-2016-02 - SBEL · TR-2016-02 Using an Anti-Relaxation Step to Improve the Accuracy of the Frictional Contact Solution in a Di erential Variational Inequality Framework for the

0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.40

0.2

0.4

0.6

0.8

1

1.2

1.4

1.6

1.8

2

Time [s]

Vel

ocity

vx [m/s] (Analytical)

ω [rad/s] (Analytical)v

x [m/s] (Relaxed CCQO)

ω [rad/s] (Relaxed CCQO)

(a)

0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.40

0.2

0.4

0.6

0.8

1

1.2

1.4

1.6

1.8

2

Time [s]

Vel

ocity

vx [m/s] (Analytical)

ω [rad/s] (Analytical)v

x [m/s] (Anti−Relaxed CCQO)

ω [rad/s] (Anti−Relaxed CCQO)

(b)

Figure 2: Rolling ball test for the analytical and numerical velocities with the relaxed CCQO(left) and the anti-relaxed CCQO (right).

contact impulses at t = 0 s can be shown to be γanalytical = [0.0981,−0.01962]T . Althoughthe anti-relaxed method matched the analytical solution, shown in Fig. 2, using the relaxedCCQO of Eq. 14 results in incorrect behavior, even at the initial time step.

To graphically understand the non-physical behavior that is occurring at t = 0, foursituations have been plotted in Figs. 3-6. Fig. 3 represents the original DVI that must besolved at t = 0 plotted in the γn-γt domain by substituting the velocity terms for contactimpulses using Eq. 7. The contours, shown by the colored lines, represent the objectivefunction in Eq. 4, the cone constraints of which are shown by the solid black lines (thesolution must lie in the interior of these lines). Lastly, the complementarity condition in Eq. 8is captured by the dotted and dashed lines. If γn = 0, then γt must lie on the dashed line; ifγn is nonzero, the solution must lie on the dotted line. The optimum and analytical solutionsare indicated by the red X and circle, respectively. As this is the true DVI, the optimumand analytical solutions match. Fig. 4 shows what happens when Eq. 8 is replaced withthe relaxed complementarity condition in Eq. 10. The complementarity condition associatedwith normal velocities bifurcates, resulting in the optimum being increased in magnitude.Physically, this would result in the ball being launched off of the ground. The relaxed CCQOof Eq. 14 is shown in Fig. 5. Here the contours represent the quadratic objective functionand the solid black lines represent the conic constraints (the solution must lie in the interiorof these lines). The dashed line represents the non-negativity constraint on γn - the solutionmust lie on or to the right of this line. Since the relaxed CCQO is equivalent to the relaxedDVI/CCP, the optimum (represented by the red circle) will be identical to the one in Fig. 4.Notice that, like the relaxed DVI/CCP, the optimum does not match the analytical solutionto the problem. Lastly, using anti-relaxation from Eq. 15 results in a shift of the contoursof the objective function in the negative γn-direction. This shift results in an optimum that

12

Page 14: TR-2016-02 - SBEL · TR-2016-02 Using an Anti-Relaxation Step to Improve the Accuracy of the Frictional Contact Solution in a Di erential Variational Inequality Framework for the

coincides with the analytical solution. Additional surface plots of the objective functionsand constraints can be viewed in Appendix A.

γnormal

[g*cm/s]-0.2 -0.15 -0.1 -0.05 0 0.05 0.1 0.15 0.2

γta

ngen

t [g*c

m/s

]

-0.2

-0.15

-0.1

-0.05

0

0.05

0.1

0.15

0.2

-0.2

-0.1

0

0.1

0.2

0.3

0.4

Figure 3: The original DVI problem based onEqs. 6-9.

γnormal

[g*cm/s]-0.6 -0.4 -0.2 0 0.2 0.4

γta

ngen

t [g*c

m/s

]-0.6

-0.4

-0.2

0

0.2

0.4

0

0.2

0.4

0.6

0.8

1

1.2

1.4

1.6

1.8

2

Figure 4: The relaxed DVI/CCP problembased on Eq. 10.

γnormal

[g*cm/s]-0.6 -0.4 -0.2 0 0.2 0.4

γta

ngen

t [g*c

m/s

]

-0.6

-0.4

-0.2

0

0.2

0.4

-0.4

-0.2

0

0.2

0.4

0.6

0.8

1

1.2

1.4

1.6

Figure 5: The relaxed CCQO based on Eq. 14.

γnormal

[g*cm/s]-0.2 -0.15 -0.1 -0.05 0 0.05 0.1 0.15 0.2

γta

ngen

t [g*c

m/s

]

-0.2

-0.15

-0.1

-0.05

0

0.05

0.1

0.15

0.2

-0.3

-0.2

-0.1

0

0.1

0.2

0.3

0.4

Figure 6: The anti-relaxed CCQO based onEq. 15.

3.2 Filling test

The second numerical experiment studies a model of spherical bodies falling into a containerunder gravity, the time evolution of which can be seen in Fig. 7. The goal of this study was tosee how anti-relaxation effects the physical results of the simulation. Several statistics weremonitored, such as the computation time, number of iterations performed at each step, max-imum velocity of the bodies, and contact force on the container. In this case, there are 1000

13

Page 15: TR-2016-02 - SBEL · TR-2016-02 Using an Anti-Relaxation Step to Improve the Accuracy of the Frictional Contact Solution in a Di erential Variational Inequality Framework for the

spheres, each with a radius r =1 m, mass m =1 kg, and friction coefficient µ =0.25. The sys-tem had a gravitational acceleration in the vertical direction g =9.81 m s−1. The simulationwas run for 5 s with a time step h =0.01 s and a solver tolerance of τ =0.000 01 g cm s−1.

Figure 7: A simulation of 1000 spherical bodies falling into a container due to gravity. Thecolors of the bodies represent the magnitude of the linear velocity (red = fast, blue = slow).

The results of the simulation are plotted in Fig. 8. Fig. 8a shows the total contact forcethat the container experiences as a function of time. The dynamics behavior as determinedby the relaxed CCQO (using Eq. 14) is represented by the blue line and dynamics behavioras determined by the anti-relaxed CCQO (using Eq. 15) is represented by the red line.Although both models converge to the total weight of the spheres, the dynamics are clearlydifferent and the anti-relaxed solution settles much sooner than the relaxed solution. Thecomplementarity error in the anti-relaxed solution, calculated using Eq. 8 and shown inFig. 8b, is several orders of magnitude less than the relaxed solution.

3.3 Scaling analysis

The last numerical experiment studies several models of spherical bodies falling into a con-tainer under gravity to understand how the solver statistics change as a function of thenumber of collisions. Several statistics were monitored, such as the computation time, num-ber of iterations performed at each step, maximum velocity of the bodies, and contact forceon the container. The number of spheres is varied from 10 to 16 000, each with a radiusr =1 m, mass m =1 kg, and friction coefficient µ =0.25. The system had a gravitationalacceleration in the vertical direction g =9.81 m s−1. Each simulation was run for 5 s with atime step h =0.01 s and a solver tolerance of τ =0.000 01 g cm s−1.

The results of the simulation are plotted in Fig. 9. Fig. 9a shows the maximum com-plementarity error (calculated using Eq. 8) that occurs over the entire simulation. It isimportant to note that the complementarity error in both models increases as the numberof collisions increases, although the error in the anti-relaxed solution is again several ordersof magnitude lower than the relaxed solution. Fig. 9b shows the average number of APGDiterations that are used to solve the CCQO over the entire simulation. Although the number

14

Page 16: TR-2016-02 - SBEL · TR-2016-02 Using an Anti-Relaxation Step to Improve the Accuracy of the Frictional Contact Solution in a Di erential Variational Inequality Framework for the

0 1 2 3 4 5 60

0.5

1

1.5

2

2.5

3

3.5

4x 10

4

Time [s]

Con

tact

forc

e on

bin

[N]

Total weightRelaxedAnti−relaxed

(a)

0 1 2 3 4 5 610

−6

10−4

10−2

100

102

104

Time [s]

Com

plem

enta

rity

erro

r [k

g*m

2 /s2 ]

RelaxedAnti−relaxed

(b)

Figure 8: Simulation of the contact force experienced by the container (left) and the com-plementarity error (right) as a function of time.

101

102

103

104

105

10−3

10−2

10−1

100

101

102

103

104

105

Average number of collisions [#]

Max

imum

com

plem

enta

rity

erro

r [k

g*m

2 /s2 ]

RelaxedAnti−relaxed

(a)

101

102

103

104

105

0

100

200

300

400

500

600

700

Average number of collisions [#]

Ave

rage

sol

ver

itera

tions

[#]

RelaxedAnti−relaxed

(b)

Figure 9: The maximum complementarity error (left) and the average number of iterations(right) as a function of the number of collisions.

of iterations are similar for low numbers of collisions (below 100 spheres), the anti-relaxedsolution quickly becomes increasingly costly as the number of collisions increases.

15

Page 17: TR-2016-02 - SBEL · TR-2016-02 Using an Anti-Relaxation Step to Improve the Accuracy of the Frictional Contact Solution in a Di erential Variational Inequality Framework for the

4 Summary and conclusions

This paper summarizes an approach for predicting the position and velocity evolution ofa group of rigid particles that are subject to non-interpenetration, collision, adhesion, anddry friction constraints and to possibly global forces (such as electrostatic and gravitationalforces). The DVI model is based on complementarity conditions for contact and differentialinclusions for handling friction forces. By adding a term to mathematically relax the DVI,the model can be posed as a CCP and the solution can be found by solving a CCQO. In manycases, the relaxation results in non-physical behavior. In this work, the objective function ofthe CCQO is modified by an anti-relaxation term to result in a solution that is equivalent tothe optimum of the original DVI. Three numerical experiments were carried out to analyzethe effect of anti-relaxation. The first numerical experiment thoroughly analyzed the simplecase of a sphere transitioning from pure sliding to rolling and described in graphical formthe error that relaxation can introduce. The second experiment investigated the effect ofanti-relaxation over time for a filling test with 1000 spheres. It was determined that theanti-relaxation results in less noise, or “jitter”, in the settled configuration and results in acomplementarity error that is several orders of magnitude lower than the relaxed solution.The last experiment looked at several filling tests, each with a different number of bodies,to investigate the effect of the anti-relaxation as a function of the number of collisions. Itwas found that the number of iterations are similar for low numbers of collisions (below 100spheres) but the anti-relaxed solution quickly becomes increasingly costly as the number ofcollisions increases.

References

[1] E. J. Haug, Computer-Aided Kinematics and Dynamics of Mechanical Systems Volume-I, Prentice-Hall, Englewood Cliffs, New Jersey, 1989.

[2] A. A. Shabana, Dynamics of Multibody Systems, 4th Edition, Cambridge UniversityPress, Cambridge, England., 2013.

[3] M. Anitescu, F. A. Potra, Formulating dynamic multi-rigid-body contact problems withfriction as solvable linear complementarity problems, Nonlinear Dynamics 14 (1997)231–247.

[4] J.-S. Pang, D. Stewart, Differential variational inequalities, Mathematical Programming113 (2) (2008) 345–424.

[5] M. Anitescu, Optimization-based simulation of nonsmooth rigid multi-body dynamics, Mathematical Programming 105 (1) (2006) 113–143.doi:http://dx.doi.org/10.1007/s10107-005-0590-7.

16

Page 18: TR-2016-02 - SBEL · TR-2016-02 Using an Anti-Relaxation Step to Improve the Accuracy of the Frictional Contact Solution in a Di erential Variational Inequality Framework for the

[6] G. Daviet, F. Bertails-Descoubes, L. Boissieux, A hybrid iterative solver for robustlycapturing coulomb friction in hair dynamics, in: ACM Transactions on Graphics (TOG),Vol. 30 (6), ACM, 2011, p. 139.

[7] D. E. Stewart, Rigid-body dynamics with friction and impact, SIAM Review 42(1)(2000) 3–39.

[8] D. Baraff, Fast contact force computation for nonpenetrating rigid bodies, in: ComputerGraphics (Proceedings of SIGGRAPH), 1994, pp. 23–34.

[9] A. Tasora, A fast NCP solver for large rigid-body problems with contacts, in: C. Bot-tasso (Ed.), Multibody Dynamics: Computational Methods and Applications, Springer,2008, pp. 45–55.

[10] M. Anitescu, A. Tasora, An iterative approach for cone complementarity problems fornonsmooth dynamics, Computational Optimization and Applications 47 (2) (2010) 207–235. doi:10.1007/s10589-008-9223-4.

[11] A. Tasora, M. Anitescu, A matrix-free cone complementarity approach for solving large-scale, nonsmooth, rigid body dynamics, Computer Methods in Applied Mechanics andEngineering 200 (5-8) (2011) 439–453. doi:doi:10.1016/j.cma.2010.06.030.

[12] T. Heyn, On the Modeling, Simulation, and Visualization of Many-Body Dynam-ics Problems with Friction and Contact, PhD thesis, Department of MechanicalEngineering, University of Wisconsin–Madison, http://sbel.wisc.edu/documents/

TobyHeynThesis_PhDfinal.pdf (2013).

[13] F. Cadoux, An optimization-based algorithm for coulomb’s frictional contact, ESAIM:Proc. 27 (2009) 54–69. doi:10.1051/proc/2009019.URL http://dx.doi.org/10.1051/proc/2009019

[14] Y. Nesterov, A method of solving a convex programming problem with convergence rateO(1/k2), in: Soviet Mathematics Doklady, Vol. 27(2), 1983, pp. 372–376.

[15] A. Nemirovsky, D. B. Yudin, Problem complexity and method efficiency in optimiza-tion., John Wiley & Sons, 1983.

[16] Y. Nesterov, Introductory lectures on convex optimization: A basic course, Vol. 87,Springer, 2003.

[17] A. Beck, M. Teboulle, A fast iterative shrinkage-thresholding algorithm for linear inverseproblems, SIAM Journal on Imaging Sciences 2 (1) (2009) 183–202.

[18] J. C. Trinkle, Formulation of Multibody Dynamics as Complementarity Problems,Volume 5: 19th Biennial Conference on Mechanical Vibration and Noise, Parts A, B,and C 2003 (2003) 361–370. doi:10.1115/DETC2003/VIB-48342.

17

Page 19: TR-2016-02 - SBEL · TR-2016-02 Using an Anti-Relaxation Step to Improve the Accuracy of the Frictional Contact Solution in a Di erential Variational Inequality Framework for the

URL http://proceedings.asmedigitalcollection.asme.org/proceeding.aspx?

articleid=1587646

18

Page 20: TR-2016-02 - SBEL · TR-2016-02 Using an Anti-Relaxation Step to Improve the Accuracy of the Frictional Contact Solution in a Di erential Variational Inequality Framework for the

Appendices

A Additional plots

A.1 Surface plots of the objective functions

2

1

γnormal

[g*cm/s]

0

-1

-2-2

γtangent

[g*cm/s]

-1

0

1

15

20

5

0

-5

10

2

Obj

ectiv

e [g

*cm

2/s

2]

0

2

4

6

8

10

12

14

16

Figure 10: The original DVI problem based onEqs. 6-9.

2

1

γnormal

[g*cm/s]

0

-1

-2-2

γtangent

[g*cm/s]

-1

0

1

15

20

5

0

-5

10

2

Obj

ectiv

e [g

*cm

2/s

2]

0

2

4

6

8

10

12

14

16

Figure 11: The relaxed DVI/CCP problembased on Eq. 10.

2

1

γnormal

[g*cm/s]

0

-1

-2-2

γtangent

[g*cm/s]

-1

0

1

14

12

8

6

10

4

2

0

-22

Obj

ectiv

e [g

*cm

2/s

2]

0

2

4

6

8

10

12

Figure 12: The relaxed CCQO based onEq. 14.

2

1

γnormal

[g*cm/s]

0

-1

-2-2

γtangent

[g*cm/s]

-1

0

1

14

12

8

6

10

4

2

0

-22

Obj

ectiv

e [g

*cm

2/s

2]

0

2

4

6

8

10

12

Figure 13: The anti-relaxed CCQO based onEq. 15.

A.2 Constraint plots with objective contours

19

Page 21: TR-2016-02 - SBEL · TR-2016-02 Using an Anti-Relaxation Step to Improve the Accuracy of the Frictional Contact Solution in a Di erential Variational Inequality Framework for the

γnormal

[g*cm/s]-0.6 -0.4 -0.2 0 0.2 0.4

γta

ngen

t [g*c

m/s

]

-0.6

-0.4

-0.2

0

0.2

0.4

0

0.2

0.4

0.6

0.8

1

1.2

1.4

1.6

1.8

2

Figure 14: The original DVI problem based onEqs. 6-9.

γnormal

[g*cm/s]-0.6 -0.4 -0.2 0 0.2 0.4

γta

ngen

t [g*c

m/s

]

-0.6

-0.4

-0.2

0

0.2

0.4

0

0.2

0.4

0.6

0.8

1

1.2

1.4

1.6

1.8

2

Figure 15: The relaxed DVI/CCP problembased on Eq. 10.

γnormal

[g*cm/s]-0.6 -0.4 -0.2 0 0.2 0.4

γta

ngen

t [g*c

m/s

]

-0.6

-0.4

-0.2

0

0.2

0.4

-0.4

-0.2

0

0.2

0.4

0.6

0.8

1

1.2

1.4

1.6

Figure 16: The relaxed CCQO based onEq. 14.

γnormal

[g*cm/s]-0.6 -0.4 -0.2 0 0.2 0.4

γta

ngen

t [g*c

m/s

]

-0.6

-0.4

-0.2

0

0.2

0.4

0

0.2

0.4

0.6

0.8

1

1.2

1.4

1.6

1.8

2

Figure 17: The anti-relaxed CCQO based onEq. 15.

20