Collision of spheres in 2D

Problem

Two spheres with radii R_1 and R_2, masses m_1 and m_2, velocities \vec{u}_1 and \vec{u}_2 located at \vec{r}_1 and \vec{r}_2 collide. Considering a coefficient of restitution \epsilon find the velocities after the collision! Assume planar 2D collision.

Data

\vec{r}_1, R_1, m_1, \vec{u}_1
\vec{r}_2, R_2, m_2, \vec{u}_2
\epsilon
\vec{v}_1=?, \vec{v}_2=?

Solution

First let us calculate a vector from the center of the first sphere to the center of the second and normalize it:

    \[\vec{n}=\frac{\vec{r}_2-\vec{r}_1}{|\vec{r}_2-\vec{r}_1|}.\]

Collision occurs if the spheres are in contact

    \[|\vec{r}_2-\vec{r}_1|=R_1+R_2\]

and if the projections of the two velocities onto the normal direction such that their difference is positive. We calculate the projection via dot product and establish the collision criterion as:

    \[\vec{u}_1\cdot\vec{n}-\vec{u}_2\cdot\vec{n}>0\]

The contact point is at

    \[\vec{r}_c=\vec{r}_1+R_1\vec{n}.\]

A tangent vector to the surfaces of the spheres from the contact point is \vec{t}=(-n_y,n_x).

We now decompose the velocity vectors into normal and tangential directions

    \[u_{1,n}=\vec{u}_1\cdot\vec{n},\qquad u_{2,n}=\vec{u}_2\cdot\vec{n}\]

    \[u_{1,t}=\vec{u}_1\cdot\vec{t},\qquad u_{2,t}=\vec{u}_2\cdot\vec{t}\]

During the collision the tangential components are preserved

    \[v_{1,t}=u_{1,t}, \qquad v_{2,t}=u_{2,t}.\]

In the normal direction, the momentum is conserved

    \[m_1u_{1,n}+m_2u_{2,n}=m_1v_{1,n}+m_2v_{2,n}\]

The coefficient of restitution \epsilon, is the ratio of the final to initial relative speed between two objects after they collide. It normally ranges from 0 to 1 where 1 would be a perfectly elastic collision.

    \[v_{2,n}-v_{1,n}=-\epsilon(u_{2,n}-u_{1,n})\]

Thus, we end up with a system of equations

    \[\left( \begin{array}{cc} m_1 & m_2 \\ -1 & 1 \\ \end{array} \right) \left( \begin{array}{c} v_{1,n} \\ v_{2,n} \\ \end{array} \right)= \left( \begin{array}{c} m_1u_{1,n}+m_2u_{2,n} \\ -\epsilon(u_{2,n}-u_{1,n}) \\ \end{array} \right)\]

The solution is

    \[v_{1,n}=\frac{m_2}{m_1+m_2}\left( \left(\frac{m_1}{m_2}-\epsilon\right)u_{1,n}+(1+\epsilon)u_{2,n} \right)\]

    \[v_{2,n}=\frac{m_1}{m_1+m_2}\left( (1+\epsilon)u_{1,n}+\left(\frac{m_2}{m_1}-\epsilon\right)u_{2,n} \right)\]

Finally, the velocities after collision are

    \[\vec{v}_1=v_{1,n}\vec{n}+v_{1,t}\vec{t}, \qquad \vec{v}_2=v_{2,n}\vec{n}+v_{2,t}\vec{t}.\]

In the billiards case, where the spheres have equal mass, only one sphere is moving and the collision is perfectly elastic (m_1=m_2, \vec{u}_2=0, \epsilon=1) the equations simplify to:

    \[v_{1,n}=0, \qquad v_{2,n}=u_{1,n}\]

Example in MATLAB

%
% Coefficient of restitution
%
eps=1;
%
% Define Sphere 1
%
u1=[1;1];r1=[0.7;1];R1=1;m1=1.3;
%
% Define Sphere 2
%
m2=1;u2=[-1.4;1];R2=2;th=35/180*pi;
r2=[r1(1)+(R1+R2)*cos(th);r1(2)+(R1+R2)*sin(th)];
%
% unit normal
%
n=(r2-r1)/norm(r2-r1);
%
% unit tangent
%
t=[-n(2);n(1)];
%
% Contact point
%
rc=r1+R1*n;
%
% velocity components in the normal direction
%
u1n=dot(u1,n);
u2n=dot(u2,n);
%
% velocity after collision in the normal direction
%
v1n=m2/(m1+m2)*((m1/m2-eps)*u1n+(1+eps)*u2n);
v2n=m1/(m1+m2)*((1+eps)*u1n+(m2/m1-eps)*u2n);
%
% velocity after collision in the tangential direction
%
v1t=dot(u1,t);
v2t=dot(u2,t);
%
% velocity after collision
%
v1=v1n*n+v1t*t;
v2=v2n*n+v2t*t;
%
% plot the result
%
hold on
circle(r1(1),r1(2),R1);
circle(r2(1),r2(2),R2);
quiver(r1(1),r1(2),u1(1),u1(2),0,'-r')
quiver(r2(1),r2(2),u2(1),u2(2),0,'-r')
quiver(rc(1),rc(2),n(1),n(2),0,'--b')
quiver(rc(1),rc(2),t(1),t(2),0,'--b')
quiver(r1(1),r1(2),v1(1),v1(2),0,'-g')
quiver(r2(1),r2(2),v2(1),v2(2),0,'-g')
axis equal
grid on
hold off
function h = circle(x,y,r)
th = 0:pi/50:2*pi;
xunit = r * cos(th) + x;
yunit = r * sin(th) + y;
h = plot(xunit, yunit,"black");
end
MATLAB output

Leave a comment

Your email address will not be published. Required fields are marked *