Collision Response with Rotation

 Linear velociites at point p before the collision

\[ \begin{aligned} v_{ap}=v_a+(\omega_a \times r_{ap})\\ v_{bp}=v_b+(\omega_b \times r_{bp}) \end{aligned}\]

After collision:

\[ \begin{aligned} v_{ap}'=v_a'+(\omega_a' \times r_{ap})\\ v_{bp}'=v_b'+(\omega_b' \times r_{bp}) \end{aligned}\]


Recall that relative velocity when there is no rotation:

\[ \begin{aligned}  v_{ab}'=v_a-v_b \\  v_{ab}'=v_{a}'-v_{b}'  \end{aligned}\]

and with rotation:

\[ \begin{aligned}   v_{abp}= v_{ap}- v_{bp}\\  v_{abp}'=v_{ap}'- v_{bp}'     \end{aligned}\]

We can also say that:

\[ \begin{aligned}  v_{ab}'\cdot n=-e(v_{ab}\cdot n)\\ v_{ab}'\cdot t=-f(v_{ab}\cdot t)    \end{aligned}\]


In a world of no ration, impulse method describes the change in their linear velociteis by the impulse J, scaled by the inverse of their corresponding masses, m(a) and m(b). Note that below asumes J is pointing from A to B.

\[ \begin{aligned}    v_{a}'= v_{a}- \frac{J}{m_a}\\ v_{b}'= v_{b}+ \frac{J}{m_b}     \end{aligned}\]

The rotational equivalent is:

\[ \begin{aligned}    \omega_a'=\omega_a-\left( r_{ap}\times \frac{J}{I_a} \right) \\ \omega_b'=\omega_b+\left( r_{bp}\times \frac{J}{I_b} \right)      \end{aligned}\]

Impulse can be decomposed into components along the collision normal and tangent.

\[J=j_n\cdot n + j_t\cdot t\]

We can say that:

\[\omega_a' = \omega_a -\left( r_{ap}\times \frac{j_n\cdot n + j_t \cdot t}{I_a} \right)=\omega_a-\frac{j_n}{I_a}(r_{ap}\times n)-\frac{j_t}{I_a}(r_{ap}\times t)\]

Simiarly,

\[\omega_b' = \omega_b +\left( r_{bp}\times \frac{j_n\cdot n + j_t \cdot t}{I_b} \right)=\omega_b+\frac{j_n}{I_b}(r_{bp}\times n)+\frac{j_t}{I_b}(r_{bp}\times t)\]

Note that the equation has been expanded to describe the change in angular velocities, casued by the normal and tangent compoenents of the impulse.

The corresponding equations describing the linear velocity changes are:

\[\begin{aligned} v_a'=v_a-\frac{J}{m_a}=v_a-\frac{j_n}{m_a}\cdot n-\frac{j_t}{m_a}\cdot t \\ v_b'=v_b+\frac{J}{m_b}=v_b+\frac{j_n}{m_b}\cdot n+\frac{j_t}{m_b}\cdot t  \end{aligned}\]

From the above, by substitution we get:

\[\begin{aligned}v_{ap}'=\left( v_{a}-\frac{j_n}{m_a}n-\frac{j_t}{m_a}t \right)+\left( \omega_a-\frac{j_n}{I_a}(r_{ap}\times n)-\frac{j_t}{I_a}(r_{ap \times t}) \right)\times r_{ap}\\ v_{bp}'=\left( v_{b}+\frac{j_n}{m_b}n+\frac{j_t}{m_b}t \right)+\left( \omega_b+\frac{j_n}{I_b}(r_{bp}\times n)+\frac{j_t}{I_b}(r_{bp \times t}) \right)\times r_{bp}\end{aligned}    \]

Ignore the contribution from the angular velocity tangent component as immaterial.

Then perform the dot product on both sides by n.

\[\begin{aligned} v_{ap}'\cdot n=\left[ \left( v_{a}-\frac{j_n}{m_a}n-\frac{j_t}{m_a}t \right)+\left( \omega_a-\frac{j_n}{I_a}(r_{ap}\times n) \right)\times r_{ap}\ \right]\cdot n     \\ v_{bp}'\cdot n= \left[\left( v_{b}+\frac{j_n}{m_b}n+\frac{j_t}{m_b}t \right)+\left( \omega_b+\frac{j_n}{I_b}(r_{bp}\times n) \right)\times r_{bp}   \right]\cdot n      \end{aligned}\]

Which can be expanded to:

\[\begin{aligned} v_{ap}'\cdot n=(v_a\cdot n)-\frac{j_n}{m_a}+(\omega_a\times r_{ap})\cdot n-\frac{j_n}{I_a} \left[ \left( r_{ap}\times n\right) \times r_{ap} \right]\cdot n \\ v_{bp}'\cdot n=(v_b\cdot n)+\frac{j_n}{m_b}+(\omega_b\times r_{bp})\cdot n+\frac{j_n}{I_b} \left[ \left( r_{bp}\times n\right) \times r_{bp} \right]\cdot n   \end{aligned}\]

Let's look at the last part of this expression, and to make the analysis simpler, call \(D= r_{ap}\times n\). Utilizing the scalar triple product identity \((D\times E)\cdot F = D\cdot (E\times F)\), we can say that:

\[\left[ (r_{ap}\times n)\times r_{ap} \right]\cdot n =(D \times r_{ap})\cdot n=D\cdot(r_{ap}\times n)\]

which means that;

\[\left[ (r_{ap}\times n)\times r_{ap} \right]\cdot n =(r_{ap}\times n)\cdot (r_{ap}\times n)=\left\| r_{ap}\times n\right\|^2\]

so,

\[\begin{equation} \begin{split} v_{ap}'\cdot n=(v_a\cdot n)-\frac{j_n}{m_a}+(\omega_a\times r_{ap})\cdot n-\frac{j_n}{I_a}\left\| r_{ap}\times n \right\|^2\\ =(v_a+\omega_a\times r_{ap})\cdot n-\frac{j_n}{m_a}-\frac{j_n}{I_a}\left\| r_{ap}\times n \right\|^2 \end{split} \end{equation}\]

but recall that:

\[v_{ap}=v_a+(\omega_a\times r_{ap})\]

so

\[v_{ap}'\cdot n=v_{ap}\cdot n -\frac{j_n}{m_a}-\frac{j_n}{I_a}\left\| r_{ap}\times n \right\|^2\]

similarly,

\[v_{bp}'\cdot n=v_{bp}\cdot n +\frac{j_n}{m_b}+\frac{j_n}{I_b}\left\| r_{bp}\times n \right\|^2\]

Subtracting the above two equations:

\[(v_{ap}'-v_{bp}')\cdot n=(v_{ap}-v_{bp})\cdot n-j_n\left( \frac{1}{m_a}+\frac{1}{m_b} \right)-\frac{\left\| r_{ap}\times n \right\|^2}{I_a}+\frac{\left\| r_{bp}\times n \right\|^2}{I_b}\]


Since \(v_{abp}'=-e(v_{abp}\cdot n)\):

\[-e(v_{abp}\cdot n)=v_{abp}\cdot n-j_n\left[\frac{1}{m_a}+\frac{1}{m_b}+\frac{\left\| r_{ap}\times n \right\|^2}{I_a}+\frac{\left\| r_{bp}\times n \right\|^2}{I_b}  \right]\]

Collecting terms we get:

\[j_n=\frac{(1+e)(v_{abp}\cdot n)}{\left( \frac{1}{m_a}+ \frac{1}{m_b}+\frac{\left\| r_{ap}\times n \right\|^2}{I_a}  ++\frac{\left\| r_{bp}\times n \right\|^2}{I_b}  \right)}\]

Collision Response without Rotation

\[\begin{aligned}v'_a=v_a+\Delta v_a\\ v'_b=v_b+\Delta v_b \end{aligned}\]


\[\begin{aligned}v'_a=v_a-\frac{J}{m_a}\\  v'_b=v_b+\frac{J}{m_b} \end{aligned}\]

\[\begin{aligned}v'_a=v_a-\frac{J}{m_a}=v_a-(j_n\cdot n+j_t\cdot t)\frac{1}{m_a} \\ v'_b=v_b+\frac{J}{m_b} =v_b+(j_n\cdot n+j_t\cdot t)\frac{1}{m_b} \end{aligned}\]



\[(v_a'-v_b') = (v_a-v_b)+J(\frac{1}{m_a}+\frac{1}{m_b})\]

which can be expressed as:

\[v_{ab}' = v_{ab}+J(\frac{1}{m_a}+\frac{1}{m_b})\]

Dcompose velocity

\[v=v\cdot n+v\cdot t\]


Decomposition J

\[J=j_n\cdot n+j_t\cdot t\]



 \[v'_a\cdot n=\left( v_a-\left[ \frac{j_n}{m_a}n+\frac{j_t}{m_a}t \right]  \right)\cdot n=v_a\cdot n-\frac{j_n}{m_a}\]

\[v'_b\cdot n=\left( v_b+\left[ \frac{j_n}{m_b}n+\frac{j_t}{m_b}t \right]  \right)\cdot n=v_b\cdot n+\frac{j_n}{m_b}\]

Subtracting the preceding two equations results in the following:

\[((v'_a -v'_b)\cdot n = (v_a-v_b)\cdot n - j_n(\frac{1}{m_a}+\frac{1}{m_b})\]

Given how we have defined relative velocity the above equation simplifies to:

\[v'_{ab}\cdot n = v_{ab}\cdot n - j_n\left(  \frac{1}{m_a}+\frac{1}{m_b}  \right)\]

Given the definnition of the coefficient of restitution,

\[v'_{ab}\cdot n=-e(v_{ab}\cdot n) \]

we can say that:

\[-e(v_{ab}\cdot n)=  v_{ab}\cdot n-j_n\left( \frac{1}{m_a} +\frac{1}{m_b} \right)\]

Collecting the terms and solving for j(n), the impulse in the normal direction result in the following:

\[j_n=\frac{(1+e)(v_{ab}\cdot n)}{\frac{1}{m_a}+\frac{1}{m_b}}\]


We can adopt a similar approach to calculating the tangential component of J.

First perform the dot product with the t vector on both sides of the impulse equation.
\[v'_a\cdot t=\left( v_a-\left[ \frac{j_n}{m_a}n+\frac{j_t}{m_a}t \right] \right)\cdot t=v_a\cdot t-\frac{j_t}{m_a}\]
\[v'_b\cdot t=\left( v_b+\left[ \frac{j_n}{m_b}n+\frac{j_t}{m_b}t \right] \right)\cdot t=v_b\cdot t+\frac{j_t}{m_b}\]
Following similar steps adopted for the normal component, we get:
\[v'_{ab}\cdot t = v_{ab}\cdot t - j_t\left( \frac{1}{m_a}+\frac{1}{m_a} \right)\]
Given that:
\[v'_{ab}\cdot t=f(v_{ab}\cdot t) \]
Now substitute the equation for the friction coefficient:
\[f(v_{ab}\cdot t) = v_{ab}\cdot t - j_t\left( \frac{1}{m_a}+\frac{1}{m_b} \right)\]
Collecting the terms and solving for j(n), the impulse in the normal direction result in the following:
\[j_t=\frac{(1-f)(v_{ab}\cdot t)}{\frac{1}{m_a}+\frac{1}{m_b}}\]




Moment and Centre of Mass of Simple Systems

 



Remember, moment (or Torque) is force times distance. Consider a balanced seesaw, like below.


The moment of the red box is the product of \(m_1\) and \(x_1\), and the moment of the blue box is product of \(m_2\) and \(x_2\). The seesaw is balanced with the fulcrum shifted to the left of the centre of the seesaw, at x = 0, the "origin".

The centre of mass of the "system" along the x-axis is where the fulcrum is. Mathematically it can be represented as:
\[\bar{x}=\frac{m_1\times x_1 +m_2\times x_2 }{m_1+m_2}\]
where the capital M is the mass of the total system. 

It is the sum of the moment of each "element" divided by the total mass of the system. This makes intuitive sense. Note this analysis is in one dimension. If we extend the analysis to two dimensions. As more than one dimension is involved one needs to be aware of the "axis" around which the moment will act. However, the mathematics are basically the same - except we need to do the calculation along the x and y-axes.

\[\bar{x}=\frac{\sum_{i=1}^{n}{m_i\times x_i}}{\sum_{i=1}^{n}{m_i}}\]



\[M_x=\sum_{i=1}^nm_iy_i\]
and
\[M_y=\sum_{i=1}^nm_ix_i\]

Also, the coordinates of the center of mass \((\bar{x},\bar{y})\) of the system are
\[\bar{x}=\dfrac{M_y}{m}\]
\[\bar{y}=\dfrac{M_x}{m}\]



\[M_x=\lim_{Δm→0}\sum_{i=1}^nΔm_iy_i =\int_{0}^{n}ydm\]
\[\M_y=\lim_{Δm→0}\sum_{i=1}^nΔm_ix_i =\int_{0}^{n}xdm]

Moment



The moment of an element around the x-axis which is free to rotate is given by the product of the mass of the element and the distance (displacement) from the axis of rotation, ie y coordinate of the element.

Similarly, the moment of an element around the y-axis is the product of its mass and its distance from the axis, ie x.

Centre of Mass


The x-coordinate of the centre of mass is the sum of the moments about the y-axis, divided by the total mass of the system \[\bar{x}=\frac{m_1\times x_1 +m_2\times x_2 }{m_1+m_2}=\frac{1}{M_T}\sum_{i=0}^{n}{m_i\times x_i}\] Simiarly, the y-coordinate of the centre of mass is the moment of the whole system around the x-axis divided by the total mass of the system. \[\bar{y}=\frac{m_1\times y_1 +m_2\times y_2 }{m_1+m_2}=\frac{1}{M_T}\sum_{i=0}^{n}{m_i\times y_i}\]

Mass Moment of Inertia of Arbitrary Polygon



By integration

Calculate \(I_x\) and \(I_y\) and use the perpendicular axis theorem to get the \(I_o\). Finally you can use the parallel axis theorem to shift the origin to the centre of mass.

For a polygon \(A_0,A_1,A_2⋯A_{n−1}\) with \(A_i=(xi,yi)Ai=(x_i,y_i)\) and \(A_n=A_0\), those are equal to:

\[I_x =\rho \frac{1}{12}\sum_{i=0}^{n-1}\left(x_iy_{i+1}-x_{i+1}y_i\right)\left(y_i^2+y_iy_{i+1}+y_{i+1}^2\right)\]
\[I_y =\rho \frac{1}{12}\sum_{i=0}^{n-1}\left(x_iy_{i+1}-x_{i+1}y_i\right)\left(x_i^2+x_ix_{i+1}+x_{i+1}^2\right)\]

Now, denote by zz the line perpendicular to the \(xy\)-plane that passes through the origin. Then:

\[\begin{align}J_z &= I_x+I_y\\&= \rho \frac1{12}\sum_{i=0}^{n-1}(x_{i}y_{i+1}-x_{i+1}y_i)\left(x_{i+1}^2+x_{i+1}x_i+x_i^2 +y_{i+1}^2+y_{i+1}y_i+y_i^2\right)\end{align}\]

Then the Parallel Axis Theorem can be used to shift the reference axis to the centre of mass.

Useful References



Numerical Integration: 2nd and 4th order Runge-Kutta schemes

Second-order Runge-Kutta scheme (RK2) There are several variations of the second order Runge-Kutta schemes of numerical integration. They ar...