# Physics - Collisions in 1 dimension without using impulse

## Solution using conservation of momentum and energy

before the collision the two bodies are approaching in the same plane:

after the collision they have new velocities but are still in the same plane:

(note: all velocities are positive toward the right, the arrows on the diagrams above just indicate their motion relative to each other)

by conservation of energy: * + * = * + * (both sides of equation multiplied by two)

by conservation of momentum: * + * = * + *

where:

 is initial velocity of body a is initial velocity of body b is final velocity of body a is final velocity of body b is mass of body a is mass of body b

We want to find the final velocities ( and ) so there are 2 unknowns and 2 equations, so we can solve:

This is a simultaneous quadratic equation which is difficult to solve, here is my attempt. But there is a trick, that is to measure in the frame of reference of one of the bodies, that way we can show that after the collision the bodies will move apart at the same rate that they approached each other before the collision:

rearranging 1 gives: * ( - ) = * (- )

giving : * ( + )*( - ) = * (+ ) * (- )

and from 2 we get: * ( - ) = * (- )

dividing 3 by this gives: + = +

so : - = - ( - )

i.e. the bodies move away form each other at minus the speed that they were approaching.

But this only tells you what the relative speed of the objects is to calculate the absolute speed, try the following:

from 2 : * + * = * + *

* = * + * - *

substituting for in 4 gives: ( + - )* = * + * - *

* (+) = * (- )+ *2*

= * + *

and

= + - = + * + *( -1)

= * - *

### perfectly inelastic collision

First take the case of perfectly inelastic collisions (where the objects stick together after collision) and their final velocity is equal.

So,

=

( - )* = -( - )*

* ( + ) = * + *

so the solution is:

= =* + *

The value of the impulse is:

impulse = ( - )*

impulse = (* + * - )*

impulse = (* + * - )*

impulse = (*- + * )*

impulse = (- )*

### perfectly elastic collision

In this case the equation for impulse is the same as inelastic case (but its value is twice because the objects separate at the same rate that they approach)

impulse = ( - )* = - ( - )*

in this case, relative separating velocity = - relative approach velocity

( - ) = -( - )

-( - ) = -( - 2+)

( - )* +( - 2+)* = 0

* - * +( - 2+)* = 0

* ( + )= * ( -) + 2**

which gives the solution -

= * + *

The value of the impulse is:

impulse = ( - )*

impulse = ( * + * - )*

impulse = ( *- + * )*

impulse = (- ) *

impulse = 2(- )*

Where I can, I have put links to Amazon for books that are relevant to the subject, click on the appropriate country flag to get more details of the book or to buy it from them.

Physics for Game Developers - Assumes a knowledge of vectors, Matrix and trigonometry (the book has a one page introduction to quatnions). The book introduces Newtons laws but it does assume a basic knowledge physics. It covers Kinematics, Force, Kinetics, Collision (detection), Projectiles, Aircraft, Ships, Hovercraft, Cars, Real-time, 2D rigid body, Collision Response, Rigid body rotation, 3D rigid body, multiple bodies in 3D and particles. (I cant find a general formula for collision response which combines linear and rotation, but there may be something in the code included?). If you don't have the prerequisite knowledge of Matrices etc. you may want to get the Mathematics for 3D Game programming book first.

Commercial Software Shop

Where I can, I have put links to Amazon for commercial software, not directly related to the software project, but related to the subject being discussed, click on the appropriate country flag to get more details of the software or to buy it from them.

 Dark Basic Professional Edition - It is better to get this professional edition This is a version of basic designed for building games, for example to rotate a cube you might do the following: make object cube 1,100 for x=1 to 360 rotate object 1,x,x,0 next x Game Programming with Darkbasic - book for above software

This site may have errors. Don't use for critical systems.