I just posted this:
Drivetrain Acceleration Model with C source code. Drivetrain and rolling resistance losses modeled with 3 adjustable parameters. Numerical integration with Heun's Method for speed and accuracy. Creates CSV output file which can be directly imported into Excel for graphing.
The 3 adjustable parameters for losses account for torque-dependent drivetrain friction (drivetrain efficiency fraction) and speed-dependent rolling resistance (carpet compression loss etc).
http://www.chiefdelphi.com/media/papers/2868
Please report any errors.