# How multiple objects in contact are resolved in an inelastic collision, when edge normals don't "line up"

In a case I understand, let's say I have an object A moving at velocity V toward 3 objects in contact B, C, and D:

The momentum of A is the mass of A times its velocity. To figure out how the inelastic collision ends up when A hits B, I sum the masses of A, B, C, and D, and I divide the old momentum of A by the sum of those masses. That is the velocity all 4 objects end up with. Easy and extendable!

But when objects are in contact along edges with normals not parallel to the original momentum:

Such as here, with C mucking up the nice neat solution I had for the system above. I know that when objects collide, they are pushed away along the normal of the edge of contact. So D is going to move up and right at an angle, and presumably C and E need to get pushed downward to conserve momentum. Further, I still have to deal with my momentum from A pushing things to the right. I'm pretty sure D will be moving to the right slower than A, B, and C. And E won't be moving to the right at all, assuming there's no friction. Right?

What is the summed mass to use in the equation I used to solve my first problem? Can I simplify this into equations dealing with the "branching off" of the "main path" (D branching off, and C + E branching off?)? I need to understand this as a general case, not simply the solution to this one problem... Any possible set of convex polygons in contact being hit. How does this work?

I'm also wondering how to deal with this with partially elastic collisions... Seems like it'd get pretty crazy, especially with systems more complicated than my 2nd example.

• I believe the general solution is to invoke a full finite element analysis (which is to say you embrace the craziness and let a computer do the algebra). Trying to handle a situation like this without allowing distortions will generally lead to a system of equations that is over-constrained. May 14, 2013 at 19:29
• This will include rotations too.
– ABC
May 18, 2013 at 2:47

I am going to ignore rotations in order to simplify the problem for your understanding. You have to enforce a series of inelastic relationship of the form

$$\vec{n}_{k}^\top (\vec{v}_i^+-\vec{v}_j^+) = 0$$

where $\vec{n}_k$ is the normal direction of the $k$-th contact, and $i$, $j$ are the bodies this contact affects. The superscript $\phantom{c}^+$ denotes condition after the impact. You enforce this relationship with a series of $k$ impulses $J_k$ such that

$$\vec{v}_i^+ = \vec{v}_i + \frac{\vec{n} J_k}{m_i}$$ $$\vec{v}_j^+ = \vec{v}_j - \frac{\vec{n} J_k}{m_j}$$

Since it all has to happen at the same time it is best to form the problem with matrices.

Consider a Contact matrix $A$ where each column $k$ has +1 in the $i$-th row and -1 in the $j$-th row. For example $A = \begin{pmatrix}0&-1 \\ -1 & 0 \\ 0 & 0 \\ 1 & 1 \end{pmatrix}$ means there are two contacts, one between body 2 and body 4 and another between body 1 and 4. (actually each 0 and 1 are 2×2 for 2D or 3×3 for 3D zero and identity matrices).

The inelastic relationships are

$$N^\top A^\top v^+ =0$$ with the contact normal block diagonal matrix $$N = \begin{pmatrix} \vec{n}_1 & 0 & \cdots & 0 \\ 0 & \vec{n}_2 & & 0 \\ \vdots & & & \vdots \\ 0 & 0 & \cdots & \vec{n}_K \end{pmatrix}$$ and $$v = \begin{pmatrix} v_1 \\ v_2 \\ \vdots \\ v_N \end{pmatrix}$$

The momentum exchange is described by the relationship

$$M v^+ = M v - A N J$$ where $M$ is the block diagonal mass matrix $M=\begin{pmatrix}m_1& & & \\ &m_2 & & \\& & \ddots & \\ & & & m_N\end{pmatrix}$ and $J$ the vector of impulses $J^\top=(J_1\,J_2\,\cdots J_K)$

To solve the problem we combine the momentum with the inelastic collisions to get

$$v^+ = v - M^{-1} A N J$$ $$N^\top A^\top \left(v - M^{-1} A N J \right) = 0$$ $$\left(N^\top A^\top M^{-1} A N\right) J = N^\top A v$$

$$\boxed{ J = \left(N^\top A^\top M^{-1} A N\right)^{-1} N^\top A^\top v }$$

## Example

With $A$ as above (4 2D bodies, 2 contacts) and $\vec{v}_i = (\dot{x}_i,\dot{y}_i)^\top$, $\vec{n}_1=(1,0)^\top$, $\vec{n}_2 = (0,1)^\top$ then

$$A = \left(\begin{array}{cc|cc} 0 & 0 & -1 & 0\\ 0 & 0 & 0 & -1\\ \hline -1 & 0 & 0 & 0\\ 0 & -1 & 0 & 0\\ \hline 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 0\\ \hline 1 & 0 & 1 & 0\\ 0 & 1 & 0 & 1 \end{array}\right)$$

$$N = \left(\begin{array}{c|c} 1 & 0\\ 0 & 0\\ \hline 0 & 0\\ 0 & 1 \end{array}\right)$$

$$M = \left(\begin{array}{cc|cc|cc|cc} m_{1} & 0 & 0 & 0 & 0 & 0 & 0 & 0\\ 0 & m_{1} & 0 & 0 & 0 & 0 & 0 & 0\\ \hline 0 & 0 & m_{2} & 0 & 0 & 0 & 0 & 0\\ 0 & 0 & 0 & m_{2} & 0 & 0 & 0 & 0\\ \hline 0 & 0 & 0 & 0 & m_{3} & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 0 & m_{3} & 0 & 0\\ \hline 0 & 0 & 0 & 0 & 0 & 0 & m_{4} & 0\\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & m_{4} \end{array}\right)$$

$$v = \begin{pmatrix} \dot{x}_1 \\ \dot{y}_1 \\ \hline \dot{x}_2 \\ \dot{y}_2 \\ \hline \dot{x}_3 \\ \dot{y}_3 \\ \hline \dot{x}_4 \\ \dot{y}_4 \end{pmatrix}$$

$$N^\top A^\top M^{-1} A N = \left(\begin{array}{cc} \frac{1}{m_{1}} + \frac{1}{m_{4}} & 0\\ 0 & \frac{1}{m_{2}} + \frac{1}{m_{4}} \end{array}\right)$$ $$N^\top A^\top v = \begin{pmatrix} \dot{x}_4-\dot{x}_2 \\ \dot{y}_4 - \dot{y}_2 \end{pmatrix}$$

$$J = \begin{pmatrix} \frac{\dot{x}_4-\dot{x}_2}{\frac{1}{m_2}+\frac{1}{m_4}} \\ \frac{\dot{y}_4-\dot{y}_1}{\frac{1}{m_1}+\frac{1}{m_4}} \end{pmatrix}$$

Then

$$v^+ = v - M^{-1} A N J = \begin{pmatrix} \dot{x}_1 \\ \frac{m_1 \dot{y}_1 + m_4 \dot{y}_4}{m_1+m_4} \\ \frac{m_2 \dot{x}_2 + m_4 \dot{x}_4}{m_2+m_4} \\ \dot{y}_2 \\ \dot{x}_3 \\ \dot{y}_3 \\ \frac{m_2 \dot{x}_2 + m_4 \dot{x}_4}{m_2+m_4} \\ \frac{m_1 \dot{y}_1 + m_4 \dot{y}_4}{m_1+m_4} \end{pmatrix}$$

## Appendix

To include rotations follow the guidelines here:

• Note that this works when more that one body are stuck together, for example with $\vec{n}_2 = (1,0)^\top$ above. Dec 22, 2013 at 16:43
• @Irhala You are right, it is a typo. I'll fix it. Apr 22, 2018 at 14:14

It is not clear in general how to model the inelastic character of the collisions of such bodies. For starter, let's assume the collisions are elastic.

To figure out how the inelastic collision ends up when A hits B, I sum the masses of A, B, C, and D, and I divide the old momentum of A by the sum of those masses. That is the velocity all 4 objects end up with.

That would work only if the objects A, B, C, D sticked together after the collision and moved as one body. If there is no sticking mechanism (billiard balls), you cannot treat the objects as one body. The same holds also for collisions that are not elastic.

Instead, you can imagine that the objects are initially slightly apart, so they touch only when they collide. Collision of rigid bodies will most often happen just at one time instant. You can determine how each body will move by calculating what happens at each collision.

To account for the inelasticity, you can model the bodies not as rigid, but as bodies with movable plane faces attained at equilibrium positions with respect to some smaller rigid core by spring-like forces, while the movement of these planes experiences friction force when they move. This already leads to some differential equations, but at least one should be able to avoid complicated finite-element computations.