Back to Home

Coursework

Vehicle Performance Analysis in Python

A modular program that models wide open throttle performance across every gear, driven by real dynamometer data.

ME 1600 Iowa State University Python, NumPy, Matplotlib 3 min read
PythonNumPyMatplotlibExcel I/OVehicle DynamicsCurve Fitting

Goal

Build a modular Python program that analyzes vehicle performance at wide open throttle by modeling engine output, drivetrain behavior, road load, acceleration, and axle loads across every gear ratio, using real dynamometer data as the input.

Free body diagram of a vehicle on a grade showing forces and axle loads
The free body model of the vehicle on a grade, which is the basis for the static and dynamic axle load calculations.

The challenge

The hard part was connecting systems that are usually studied separately. Engine torque curves, transmission and final drive ratios, aerodynamic drag, rolling resistance, and axle load transfer all had to end up inside one working model where changing any input propagates correctly through the rest.

The second challenge was making it reliable rather than just correct once. The program has to import and validate spreadsheet data, fit real dyno measurements, catch engine speeds that fall outside the tested range, and organize repeated runs into outputs someone can actually read.

How it works

Input and validation

The program opens with a menu. You pick a vehicle, it loads the matching sheet out of the Excel workbook, and it validates the selection before continuing.

Python code showing the menu driven car selection and Excel workbook loading
Menu driven car selection and Excel loading, with input validation.

From there it pulls three separate blocks out of the sheet: the six gear ratios, the vehicle parameters, and the raw dynamometer points. Horsepower is computed for each dyno point as it is read.

Python code reading gear ratios, parameters, and dynamometer data from the spreadsheet
Pulling gear ratios, parameters, and dyno data, then computing power at each point.

The physics

The dyno points get fit with a polynomial, which turns a handful of measured torque readings into a continuous torque curve the model can evaluate at any engine speed. Road load comes from rolling resistance, grade, and aerodynamic drag combined. Traction comes from engine torque through the gear and final drive ratios divided by wheel radius. Acceleration falls out of the difference between the two.

Axle loads are handled separately, static first and then with the load transfer that happens under acceleration on a grade.

Python code implementing horsepower, axle load transfer, and acceleration equations
Core equations: horsepower, axle load transfer, and acceleration.

Output

Results are written out to multi sheet Excel files so runs can be compared side by side, and any engine speed that falls outside the range covered by the dyno data is flagged automatically rather than silently extrapolated.

Results

I ran the model on four vehicles with very different engines: a Corvette, a Honda Civic, a Mustang, and an Impala. For each one the program produces the fitted dyno curve and a set of performance sweeps across all gears.

Chevrolet Corvette

Fitted torque and horsepower curves for the Corvette
Performance sweeps for the Corvette

Honda Civic

Fitted torque and horsepower curves for the Civic
Performance sweeps for the Civic

Ford Mustang

Fitted torque and horsepower curves for the Mustang
Performance sweeps for the Mustang

Chevrolet Impala

Fitted torque and horsepower curves for the Impala
Performance sweeps for the Impala

Left in each pair is the fitted dynamometer data, with measured torque and horsepower plotted against engine speed and the polynomial fit drawn through it. Right is the sweep set: front axle load against wheel radius, acceleration against vehicle weight, and engine speed against road speed, with one curve per gear.

Putting the four side by side makes the differences obvious. The Corvette and the Mustang carry torque high into the rev range. The Civic makes far less absolute torque but needs much less of it to move the car, which shows up immediately in the acceleration against weight sweep.

Takeaways

This project pushed my experience in vehicle dynamics, numerical modeling, and data validation, but the part that stuck was the translation itself. Turning equations from a textbook into a program that takes messy real measurements, checks them, and produces trustworthy output is a different skill than solving the equations, and it is the one that actually gets used.