# 3D Theory - Car Racing Game - Information from Ian

 RE: car physics - question and answers By: Martin Baker (martinbaker ) - 2007-07-07 03:26 Hi Ian,    This is impressive, you are way ahead of me, I think it would be useful to link this message to the web pages, if thats alright with you, as I think it would help others.    It seems to me that one of the reasons this is difficult to model is that it can be very non-linear, for example, as we gradually increase the speed of the wheels then the road speed will increase in a linear way. Then suddenly, at a point determined by the road surface (oil on road etc.), the wheels will start to spin, we are then in a completely different mode (wheel spin) given by a different set of equations. Even if we reduce the wheel speed below the point where they started spinning they will still spin (hysteresis effect). I have just put some equations and diagrams to try to illustrate on this page:  https://www.euclideanspace.com/threed/games/examples/cars/transmission/    It therefore seems to me that we need to identify different modes for the system, such as,   1.engine stall   2.linear acceleration   3.wheel spin   4.breaking   and then derive a set of equations for each together with a set of criteria which switches between these modes.  Do you think that would be a practical approach?    Martin
 RE: car physics - question and answers By: Martin Baker (martinbaker ) - 2007-07-16 02:05 Hi Ian,     > Firstly, not sure about your idea of 'switching modes' - I don't think this  > is necessary as the maths should work it all out.    I'm afraid I haven't fully studied the Pacejka 'magic formulas but it just seemed to me that equations alone could not represent the hysteresis effects of friction? From what you say I guess this does not matter?    > One of Brian's articles covers power consumed in overcoming drag. He  > states that to get the drag force into power you simply multiply the drag  > force by the speed, which is of course distance/time, so it makes perfect  > sense as far as the units of power go. I've tried this and it seems to  > work great.    Seems right to me, although of course it is only the power consumed in overcoming drag, can we expand it to include the power required to overcome: drag, tyre friction and that which accelerates the car?  since:  work(energy) = sum ((drag force + tyre friction force + acceleration force) • d x)  where:  • = dot product   d = differential operator   x = change in position vector   force = total force vector = drag force + tyre friction force + acceleration force  so:  d work = force • d x  but power = rate of change of energy = d work /dt  therefore power = force • dx/dt = force • v  so the power is the dot product of velocity and force    > Is it safe to assume then that the same holds true for the acceleration  > force at the drive wheels? - just multiply by the speed and presto we have  > the power? I've added this to power feedback and it seems to work ok but  > I'm just guessing that this is right...?    Can we use Newtons second law: F = m a  Where F is the force left over after drag force and tyre friction force are subtracted.    Martin