View Single Post
Old 08-02-2009, 03:39 AM   #4 (permalink)
roflwaffle
Master EcoModder
 
roflwaffle's Avatar
 
Join Date: Dec 2007
Location: Southern California
Posts: 1,490

Camryaro - '92 Toyota Camry LE V6
90 day: 31.12 mpg (US)

Red - '00 Honda Insight

Prius - '05 Toyota Prius

3 - '18 Tesla Model 3
90 day: 152.47 mpg (US)
Thanks: 349
Thanked 122 Times in 80 Posts
Alrightly, I have some primitive code for some really convenient plugging and chugging. This is only for acceleration in one gear, so to find acceleration to some speed, you will need to add all the different times for acceleration in each gear you need to get to whatever speed, plus the shift times. It also assumes a relatively flat torque curve, so if someone's engine/motor's torque curve isn't flat, they'll have to modify the code.

Anyhoo... Install octave, and use a file editor to open the accelcalc.m text file, and paste this in there.

Code:
function z = accelcalc( mass, drag, roll, spd1, spd2, spdt, power, eff)
% accelcalc (mass, drag, roll, spd1, spd2, power, eff)
% A calculator to estimate acceleration in one gear given a motor/engine with a flat torque curve
% Inputs:
% mass = the mass of the vehicle in kilograms
% drag = the drag area (CdA) of the vehicle in square meters
% roll = the force associated with rolling friction (CrrW) in Newtons
% spd1 = the starting speed in gear in meters per second
% spd2 = the ending speed in gear in meters per second
% spdt = the top speed in gear in meters per second
% power = peak power in Watts
% eff = the vehicle's drivetrain efficiency (~85-90% at WOT for most vehicles w/ a manual transmission)

p1=(power*eff)/spdt;

x1=atan((sqrt(drag)*spd2)/sqrt(roll-p1));
y1=sqrt(drag)*sqrt(roll-p1);
a1=x1/y1;
z1=-mass*a1;

x2=atan((sqrt(drag)*spd1)/sqrt(roll-p1));
y2=sqrt(drag)*sqrt(roll-p1);
a2=x2/y2;
z2=mass*a2;

z=z1+z2;

endfunction
Close (at least save) the accelcalc.m file with your text editor, navigate to the directory the text file is in if you aren't already there, start octave (type octave in aterm for me) from the command line or however, and run accelcalc( these, are, my, inputs, for, this, calc) using the different vehicle characteristics needed. All the info on each variable is in the accelcalc.m file, or type help accelcalc on the octave command line to print the help info.

For instance, the (not my yet) Mercedes 190dc weighs in at 3000lbs, which is 1360kg (I use onlineconversion.com for the conversions, but y'all can use whatever works), has a drag area of about .75 square meters, has 133N associated with rolling friction (has tires w/ a Crr=.01, and has a weight (weight is a force) of ~13300 newtons), is starting from 0mph or 0m/s, is going to 20mph or 9 m/s in first gear, has a top speed of 9m/s, has an engine that makes about 52hp or 41,000W at peak power, and has an assumed driveline efficiency of 85%, so that's represented as .85.

All together, this means my input in octave will look like
Code:
accelcalc(1360, .75, 133, 0, 9, 9, 41000, .85)
and the output in seconds is
Code:
3.2913
For the Camryaro, the input is more or less the same w/ greater time (taller gear) spent in first gear, more power, and greater losses (auto trans).
Code:
accelcalc(1360, .7, 133, 0, 15.5, 15.5, 138000, .75)
and the result is...
Code:
3.241
To approximate the 0-60mph, or whatever acceleration time, I need to do the same for the other gears. For instance to get a 0-60mph time for the merc, I would also need to get a time for 2nd gear (9m/s to 15.5m/s), 3rd gear (15.5m/s to 23.5m/s), and part of fourth (23.5m/s to 26.5m/s), add all of those up, and then add the time needed for each shift.

What's really cool is that there seems to be a lot of resolution for top speed runs, at least for manual transmissions that won't kick down. For instance in the Merc, a ~6+% reduction in drag results in a 12s change in the time needed to accelerate from 53-72mph, so there's quite a bit of resolution in terms of calculating CdA. Newer cars w/ more power would need to find a nice steep (unpopular?) grade so they could accelerate at WOT w/ the same amount of resolution w/o breaking the speed limit.

Edit - Does anyone want to incorporate a gearing calculator, so people don't have to figure out the maximum speed in each gear on their own, or would that take too many inputs? Maybe I'll just make another .m file for that...

Last edited by roflwaffle; 08-02-2009 at 06:51 PM..
  Reply With Quote