> I thought ODE was actually using a modified Euler-type integration,
> although I'm not sure what the 'modified' entails. :)
I'm actually refering to "Ordinary Differential Equations" (ODE).
Not "ODE", the Open-Source package.
Modified Euler:
http://www.cems.uwe.ac.uk/~klhender/NUMAN1/lec10/node4.html
Two other nice solvers for mechanics:
Runge-Kutta: http://mathworld.wolfram.com/Runge-KuttaMethod.html
Adams: http://mathworld.wolfram.com/AdamsMethod.html
You will probably end up with a function that only is activated when the
tire is 'in' the track and deactivated when it's not. Highly non-linear.
:) I guess you won't bother to analyze the stability of that system... *lol*
I guess it depends... I simulated a single tire modeled as a spring
toward the ground and a suspension with a bump stop using MatLab. I set
the following numbers:
spring damper
Tire: 175 kN/m 525 Ns/m
Susp: 60 kN/m 460 Ns/m
Bump: 5779 kN/m -
Wheel mass: 42 kg
Chassis: 225 kg
Using the standard ODE-solvers in MatLab gave a nice result. Runge-Kutta
4th order solved it nicely too for a fixed time step. But for the same
time step the Euler integration failed (unstable) unless the time step was
ridiculously low. The bump stop was hard to simulate due to numerical
problems I guess. It did work with very small time steps... Perhaps it
could be simulated using Newtons first law (the one which handles
transfer of momentum when two bodies collide?) with some loss factor?
I guess you need to use "ad hoc" methods to obtain a stable enough solution
in a realtime simulation. As long as it "feels good enough" it should be
ok? I've been reading a book about computational dynamics (Achmed A.
Shabana 2001, excellent book!) in which I tried to find some methods to
construct general suspensions by reducing the degrees of freedom with
constraints such as H-arms, but it does not seem to be functional for a
simulation. The joints can "float away" if the time steps are too coarse.
And especially when it comes to games, make sure that your methods are robust and
numerically stable!
I guess you need to stiffen your springs then ;)
Hehe, I remembered when I tried a Peugeot rallycar in Racer and the rear
axle started to oscillate at a certain speed... But that's probably a
flaw in the design of the car. *lol*
/Stefan