# Prove that kinetic energy is conserved for simultaneous collisions if Newton's impact law holds

5 months ago I asked a question about simultaneous collisions Derivation of collision rules. I've been reading about the subject, but, unfortunately, some things are still not clear to me. I implemented a simulator of simultaneous elastic collisions using the method from Baraff's paper Analytical methods for dynamic simulation of non-penetrating rigid bodies https://www.cs.cmu.edu/~baraff/papers/sig89.pdf (section 8. Simultaneous Collisions). He writes:

At every contact point $$i$$, there is some impulse $$J_i = j_i \hat{n}_i$$ with $$j_i ≥ 0$$ the unknown magnitude. The goal is to find a $$\vec{j}$$ that satisfies the laws of classical mechanics

For contact point $$i$$, let $$v^−_i$$ be the relative approach velocity in the $$\hat{n}_i$$ direction and $$v^+_i$$ be the (unknown) relative recession velocity in the $$\hat{n}_i$$ direction. $$v^+_i$$ is a linear function of $$\vec{j}$$. If $$v^−_i > 0$$, the bodies are separating. Otherwise, the bodies are in resting contact $$(v^−_i = 0)$$ or are colliding $$(v^−_i < 0)$$

For each contact point in the collision, it is required that $$v^+_i ≥ −ε_iv^−_i$$

The "≥" is needed since body A might be pushed away from body B by some third body C

the constraints can be written as $$v^+_i (\vec{j})+ε_iv^−_i ≥0,\quad j_i ≥0,\quad j_i(v^+_i(\vec{j})+ε_iv^−_i )=0$$

To solve this quadratic programming problem, I implemented my own solver, using interior-point method. But what is surprising to me: even though kinetic energy is not explicitly mentioned in the formulation, the simulation manages to conserve it. Of course, the conservation of energy law is "hidden" in the constraint $$j_i(v^+_i(\vec{j})+ε_iv^−_i )=0$$. But Baraff writes:

The definition of $$ε$$ does not readily extend to handle simultaneous collisions. The most that can be said is that if each $$ε_i = 1$$ then no kinetic energy is lost during the collision.

A routine calculation shows that kinetic energy is conserved for multiple collisions when each $$ε_i = 1$$, and that for single contact point collisions, $$v_i^+ = −ε_iv_i^-$$

Note that he talks about single contact point collisions. He provides no proof that kinetic energy is conserved for simultaneous collisions of multiple objects and/or with multiple contact points. Just after the quoted text Baraff makes a reference to Classical Mechanics by Goldstein. So I hoped to find something about multiple collisions there, but no luck.

It's easy to show that energy is conserved for this method when the bodies are aligned.

Since tangential components of the velocities stay the same, they can be ignored in the conservation of energy law. So all velocities in the following formulas are velocities along horizontal axis. Also, to simplify, suppose all bodies have the same mass, than: $$v_{1f}^2 + v_{2f}^2 + v_{3f}^2 = v_{1i}^2 + v_{2i}^2 + v_{3i}^2$$ where $$v_{kf}$$ - final velocity of the body $$k$$, $$v_{ki}$$ - initial velocity of the body $$k$$

I wrote a MATLAB script that proves that

% impulses
syms j12 j23 positive
% initial velocities
syms v1i v3i v2i positive
% final velocities

v2f = v2i + j12 - j23
v1f = v1i - j12
v3f = v3i + j23

% Newton's impact laws
laws = [v2f - v1f == -(v2i - v1i)
v3f - v2f == -(v3i - v2i)]

% Express j12, j23 as functions of initial velocities
js = solve(laws,[j12,j23])

% Conservation of energy law
K = v1f^2 + v2f^2 + v3f^2 - v1i^2 - v2i^2 - v3i^2 == 0;

% Substitute symbols j12, j23 in the energy law for the functions
proof = subs(K, j12, js.j12);
proof = subs(proof, j23, js.j23)

%returns symtrue => kinetic energy is conserved
simplify(proof)


Now, stuff gets more complicated if the bodies are not aligned

I tried splitting velocity of body 2 into normal and tangential components: $$v_{2n1f}$$ -normal velocity relative to body 1, $$v_{2n3f}$$ - normal velocity relative to body 3, $$v_{2t1f}$$ - tangential velocity relative to body 1. Since bodies are not aligned, $$v_{2t1f}$$ depends on $$j_{23}$$. Tangential components of velocities for bodies 1 and 3 stay the same and can be ignored, so $$v_{1f}$$ and $$v_{3f}$$ - normal components. Formulas I used: $$v_{1f} = v_{1i} - j_{12}$$

$$v_{2n1f} = v_{2n1i} + j_{12} - j_{23}(\vec{n_{23}} \cdot \vec{n_{12}})$$ $$v_{2t1f} = v_{2t1i} - j_{23}(\vec{n_{23}} \cdot \vec{q_{12}})$$ $$v_{2n3f} = v_{2n3i} - j_{23} + j_{12}(\vec{n_{12}} \cdot \vec{n_{23}})$$

$$v_{3f} = v_{3i} + j_{23}$$

$$\vec{q_{12}} = \frac{\vec{v_{2t1i}}}{v_{2t1i}}$$, so it's a unit vector, perpendicular to $$\vec{n_{12}}$$

Maybe the formulas are wrong or/and I' missing something. I wasn't able to get the proof that energy is conserved in the same fashion I did for the aligned case using MATLAB.

And there are even more complicated cases, where each body has more than one colliding contact point:

I'm aware that the method described in the paper makes many assumptions, which are not realistic. I understand that it's an approximation meant to look plausible for some configurations of bodies. Yet, somehow it does conserve energy.

So, my question is: given that the momentum of the system is conserved and Newton's impact law is satisfied for each colliding contact point, is it possible to prove that kinetic energy of the system is conserved for the arbitrary system of colliding objects? For example:

My question is only about smooth spherical bodies, so no friction and rotation

$$\def \b {\mathbf}$$ I use this theory

for this example you obtain these equations

$$g_1=m_1\,(v_1-u_1)=-\lambda_1\,n_1\\ g_2=m_2\,(v_2-u_2)=+\lambda_1\,n_1-\lambda_2\,n_2\\ g_3=m_3\,(v_3-u_3)=+\lambda_2\,n_2$$

the kinetic energy is: $$2\,T=\sum_{i=1}^3\,m_i\,(v_i-u_i)\,(v_i+u_i)=0$$

substitute $$~v_i-u_i~$$ from $$~g_i~$$ and because $$~\lambda_i\ne 0~$$ you obtain two additional equations.

$$(v_2-v_1)\cdot\,n_1+\epsilon\,(u_2-u_1)\cdot n_1=0\\ (v_3-v_2)\cdot\,n_2+\epsilon\,(u_3-u_2)\cdot n_1=0$$

altogether 11 linear scalar equations for the unknows

$$~v_1~,v_2,v_3~,\lambda_1~,\lambda_2~$$

you can check with the solution that the kinetic energy (with $$\epsilon=1$$) is conserved.

$$2\,T=\sum _{i=1}^3\,m_i\,(v_i^2-u_i^2)=0$$

and the linear momentum $$~P~$$ (bevor you solve the equations)

$$P=\sum _{i=1}^3 g_i=0$$

solve this linear equations \begin{align*} &\mathbf A\,\mathbf x=\mathbf b\\ &\mathbf A=\begin{bmatrix} m_1\,\mathbf I_3 & 0\,\mathbf I_3 & 0\,\mathbf I_3 & \mathbf n_1 & 0\,\mathbf I_3 \\ 0\,\mathbf I_3 & m_2\mathbf I_3 & 0\,\mathbf I_3 & -\mathbf n_1 & \mathbf n_2 \\ 0\,\mathbf I_3 & 0\,\mathbf I_3 & m_3\mathbf I_3 & 0\,\mathbf I_3 & -m_2\mathbf I_3 \\ -\mathbf n_1^T & \mathbf n_1^T & 0 & 0 & 0 \\ 0 & -\mathbf n_2^T & \mathbf n_2^T & 0 & 0 \\ \end{bmatrix}_{11\times 11}\\ &\mathbf b=\begin{pmatrix} m_1\,\mathbf u_1 \\ m_2\,\mathbf u_2\\ m_3\,\mathbf u_3 \\ \epsilon\,\mathbf n_1^T(\mathbf u_1-\mathbf u_2 )\\ \epsilon\,\mathbf n_2^T(\mathbf u_2-\mathbf u_2 ) \\ \end{pmatrix}_{11\times 1}\\ &\mathbf x=\begin{bmatrix} \mathbf v_1 \\ \mathbf v_2 \\ \mathbf v_3 \\ \lambda_1 \\ \lambda_2 \\ \end{bmatrix}_{11\times 1}\\ \end{align*} and substitute the solution in the kinetic energy $$~(\epsilon=1)~$$ you obtain $$~2\,T=0~$$

where

• $$\b v_i~$$ velocities after the collision
• $$\b u_i~$$ velocities bevor the collision
• $$m_i~$$ particle masses
• $$\b n_i~$$ collision direction vector $$\quad,\b n\cdot\b n=1$$
• $$\epsilon~$$ coefficient of restitution $$\quad,\epsilon=0~$$ perfectly inelastic collision $$\quad,\epsilon=1~$$ perfectly elastic collision

this example

\begin{align*} &g_1=m_1\,(v_1-u_1)=-\lambda_{12}\,n_{12}-\lambda_{13}\,n_{13}\\ &g_2=m_2\,(v_2-u_2)=+\lambda_{12}\,n_{12}-\lambda_{23}\,n_{23}\\ &g_3=m_3\,(v_3-u_3)=+\lambda_{13}\,n_{13}+\lambda_{23}\,n_{23}\quad\Rightarrow\\ &P=\sum_{i=1}^{3} g_i=0 \end{align*} and \begin{align*} & \left[(v_2-v_1)+\epsilon\,(u_2-u_1)\right]\cdot n_{12}=0\\ & \left[(v_2-v_3)+\epsilon\,(u_2-u_3)\right]\cdot n_{23}=0\\ & \left[(v_3-v_1)+\epsilon\,(u_3-u_1)\right ]\cdot n_{13}=0\\ \end{align*}

• Thanks! I think I got it now! Just to make sure, that I understood you, I'll reiterate through your solution for the first case. So, the system is: $$\vec{g_1}=m_1(\vec{v_1}-\vec{u_1})=-\lambda_1\vec{n_1}\\ \vec{g_2}=m_2(\vec{v_2}-\vec{u_2})=+\lambda_1\vec{n_1}-\lambda_2\vec{n_2}\\ \vec{g_3}=m_3(\vec{v_3}-\vec{u_3})=\lambda_2\vec{n_2}$$ I think you don't need minus before $\lambda_2$ in the 3rd equation. Now, expressing energy conservation law as: $$\sum_{i=1}^3\,m_i\,(\vec{v_i}-\vec{u_i})\cdot(\vec{v_i}+\vec{u_i})=0$$ I suspect you made a typo when wrote $u_1$ instead of $u_i$ Commented Jan 24, 2023 at 21:01
• Then, making the substitution you suggested we get: $$\lambda_1\vec{n_1}\cdot(\vec{v_2}-\vec{v_1}+\vec{u_2}-\vec{u_1})+\lambda_2\vec{n_2}\cdot(\vec{v_3}-\vec{v_2}+\vec{u_3}-\vec{u_1})=0$$ Now, if Newton's impact law holds for each colliding contact point and $\epsilon=1$ then $$\vec{v_2}-\vec{v_1}+\vec{u_2}-\vec{u_1}=0\\ \vec{v_3}-\vec{v_2}+\vec{u_3}-\vec{u_1}=0$$ Putting these into the previous formula proves that the energy is conserved!$$0=0$$ Did I get the idea right? Thank you once again for the answer! Commented Jan 24, 2023 at 21:02
• You are right two typo in the equations. The idea is that you obtain linear equations system, which you can easily solve with MATLAB.
– Eli
Commented Jan 24, 2023 at 21:59
• Your last equations are not correct, you should live $~n_i~$ in the equations, because the dot product. Please look also at theory simulation…
– Eli
Commented Jan 24, 2023 at 22:09
• ah, right, forgot to write the dot product. Thanks for putting the system into matrix form, very helpful! Commented Jan 25, 2023 at 10:41