Sunday, December 5, 2010

Well shit, might need some new ODE's already

Did a little test to see if I could get an ODE to solve at all. Simple one worked just fine. One I wrote out for my on-throttle bit? Not so much. I'm not entirely sure why it errors out, but I do have a thought.
  1. It does shoot to infinity at v = 0. Even though the initial condition will always be greater than zero, I have a feeling this may be an issue. May be able to work around it by making a piecewise differential equation and clipping the engine thrust at a value where the tires would break free anyway. Hey, it's a numeric solution, why the fuck not?
  2. The constant power thing isn't as straightforward as one might think. What value do you use? Obviously it isn't going to be peak power - so I have to think up some average over the power band. Interestingly, thinking about a 3200ish lb sportscar with a 0-60 time of 4.7 seconds (like the Nissan 370z), that's only an average power input of about 150hp, of the 330 rated output power. Of course, with 0-60 so dependent on starting line hook, and higher speeds introducing aero drag effects, it's not a good way to come up with an scaling value.
  3. If I'm making a piecewise function out of the accelerating ODE anyway, I suppose I could use an actual torque curve and gearing - picking an appropriate gear based on speed (x dot), then looking up RPM and torque. 
I'll have to think about this crap more tomorrow.  

No comments: