# Math Help - Car collision physics, don't know where I'm going wrong

1. ## Car collision physics, don't know where I'm going wrong

Hey guys,
I have been given an equation by my tutor for car collision physics.

Only, I only understand half of his equation. It does not add up. I'm getting a problem of increasing acceleration.

//Math
Constants - Mass - m1, m2
Inputs - Horizontal, Vertical. Initial, final - v1I, v1F, v2I, v2F
Parameters - e between 0 and 1

v1F = m1 * v1I + m2 * v2I - m2 * e * (v2I - v1I)
------------------------------------------
m1 + m2

v2F = v1F + e * (v2I - v1I)
//

I ended up with something quite different (2nd bit), I just can't figure what that second bit is, he said it's for the 2nd car (v2 velocity of 2nd car). But instead the acceleration freezes my computer it gets so high.

Code:
vnew = (mass * vspeed + other.mass + other.vspeed - other.mass * E * (other.vspeed - vspeed)) / mass + other.mass;
hnew = (mass * hspeed + other.mass + other.hspeed - other.mass * E * (other.hspeed - hspeed)) / mass + other.mass;

other.vnew = (other.mass * other.vspeed + mass + vspeed - mass * E * (vspeed - other.vspeed)) / other.mass + mass;
other.hnew = (other.mass * other.hspeed + mass + hspeed - mass * E * (hspeed - other.hspeed)) / other.mass + mass;

vspeed = vnew;
hspeed = hnew;

other.vspeed = other.vnew;
other.hspeed = other.hnew;
I split it up into "vnew, hnew" to make it more clear what v1I and v1F (vspeed, hspeed) is.

Just ask if you need more info, it seems to be pretty standard physics math.

2. Can you use LaTeX? It'll make your equations easier to decypher and people will help you faster!

From what I see you are having a 2D collision between two cars. Correct?

Shouldn't this:
Code:
vnew = (mass * vspeed + other.mass + other.vspeed - other.mass * E * (other.vspeed - vspeed)) / mass + other.mass;
hnew = (mass * hspeed + other.mass + other.hspeed - other.mass * E * (other.hspeed - hspeed)) / mass + other.mass;

other.vnew = (other.mass * other.vspeed + mass + vspeed - mass * E * (vspeed - other.vspeed)) / other.mass + mass;
other.hnew = (other.mass * other.hspeed + mass + hspeed - mass * E * (hspeed - other.hspeed)) / other.mass + mass;
Actually be this:

Code:
vnew = (mass * vspeed + other.mass * other.vspeed - other.mass * E * (other.vspeed - vspeed)) / (mass + other.mass);
hnew = (mass * hspeed + other.mass * other.hspeed - other.mass * E * (other.hspeed - hspeed)) / (mass + other.mass);

other.vnew = (other.mass * other.vspeed + mass * vspeed - mass * E * (vspeed - other.vspeed)) / (other.mass + mass);
other.hnew = (other.mass * other.hspeed + mass * hspeed - mass * E * (hspeed - other.hspeed)) / (other.mass + mass);

3. Originally Posted by Vlasev
Can you use LaTeX, it'll make your equation easier and people will help you faster!

From what I see, you are dealing with a 2D car collision problem. I am guessing that parameter e is the coefficient of restitution of the collision, since car crashes are usually only slightly elastic.
Yeah those are the sort of equations, due to lack of documentation I haven't been able to find what expression is for horizontal/vertical velocity.

4. Sorry, I must have edited my post while you were reading it and replying. Please check my post again!

5. Hmm, the E constan for elasticity is broken, only works at 0. So cars tend to stick together, this may be causing the car which collided to not have a change in speed.

Should vertical and horzontal be using the same formula?