Plotting a Vehicle's Dynamic Performance Curves with MATLAB

When Automotive Theory gets to a vehicle’s dynamic performance, the textbook throws a pile of curves at you that look intimidating, but they all come out of a handful of basic formulas. As it happens, there was a big problem in class that gave all the parameters of a medium-duty truck and asked you to plot several characteristic curves. I decided to compute everything in MATLAB, walk through the whole pipeline from parameters to plots, and write it down.

The Problem

A medium-duty truck, with the following known data:

ParameterValue
Gross mass m9300 kg
Wheel rolling radius r0.49 m
Transmission efficiency (direct gear)0.9
Transmission efficiency (other gears)0.85
Rolling resistance coefficient f0.015
Aerodynamic factor Cd·A4 m²
Final drive ratio i₀6.33

Gear ratios and rotating-mass conversion coefficients for each gear:

Gear12345
Ratio7.314.312.451.541
Rotating-mass conversion coefficient3.171.771.271.121.07

Engine wide-open-throttle characteristic (torque Ttq at speed n):

n (r/min)120014001600180020002200240026002800
Ttq (N·m)326334.5343340.5338332326.5313300

Tasks:

  1. Compute and plot the driving-force / road-resistance balance diagram, and find the top speed and the maximum gradeability
  2. Compute and plot the acceleration-time curve in direct gear
  3. Compute and plot the dynamic-factor diagram
  4. Compute and plot the power-balance diagram

Step One: Load the Parameters into the Workspace

m=9300; r=0.49; efficiency_direct=0.9; efficiency_other=0.85;
f=0.015; cd_a=4; i_0=6.33; Ff=m*9.8*f;

gear_ratio(1)=7.31; gear_ratio(2)=4.31; gear_ratio(3)=2.45; gear_ratio(4)=1.54; gear_ratio(5)=1;
gear_i(1)=3.17; gear_i(2)=1.77; gear_i(3)=1.27; gear_i(4)=1.12; gear_i(5)=1.07;

engine_n(1)=1200; engine_n(2)=1400; engine_n(3)=1600; engine_n(4)=1800; engine_n(5)=2000;
engine_n(6)=2200; engine_n(7)=2400; engine_n(8)=2600; engine_n(9)=2800;

engine_T(1)=326; engine_T(2)=334.5; engine_T(3)=343; engine_T(4)=340.5; engine_T(5)=338;
engine_T(6)=332; engine_T(7)=326.5; engine_T(8)=313; engine_T(9)=300;

density_air=1.293;

Step Two: Densify the Engine Characteristic by Interpolation

The engine characteristic gives only 9 points—too sparse to integrate directly (which we’ll need later for the acceleration time). So first we use spline interpolation to densify it into a continuous curve. The interpolated speed is stored as nn and the torque as T_n:

nn=(1200:1:2800);
T_n=spline(engine_n,engine_T,nn);

Step Three: Compute Each Quantity One by One

Next we compute everything term by term following the formulas: driving force, vehicle speed, aerodynamic drag, acceleration, engine power, grade angle, acceleration time, and dynamic factor.

Driving force Ft, formula:

Ft=Ttqigi0ηTrF_t = \frac{T_{tq}\, i_g\, i_0\, \eta_T}{r}
Ft_1_int=T_n*i_0*0.85*gear_ratio(1)/r;
Ft_2_int=T_n*i_0*0.85*gear_ratio(2)/r;
Ft_3_int=T_n*i_0*0.85*gear_ratio(3)/r;
Ft_4_int=T_n*i_0*0.85*gear_ratio(4)/r;
Ft_5_int=T_n*i_0*0.9 *gear_ratio(5)/r;   % 5th gear is direct drive, so efficiency is 0.9

Vehicle speed ua, formula:

ua=0.377nrigi0u_a = 0.377\, \frac{n\, r}{i_g\, i_0}
ua_1_int=nn*r*0.377/i_0/gear_ratio(1);
ua_2_int=nn*r*0.377/i_0/gear_ratio(2);
ua_3_int=nn*r*0.377/i_0/gear_ratio(3);
ua_4_int=nn*r*0.377/i_0/gear_ratio(4);
ua_5_int=nn*r*0.377/i_0/gear_ratio(5);

Aerodynamic drag Fw, formula:

Fw=CDAua221.15F_w = \frac{C_D A\, u_a^{2}}{21.15}
Fw_1_int=cd_a*ua_1_int.^2/21.15;
Fw_2_int=cd_a*ua_2_int.^2/21.15;
Fw_3_int=cd_a*ua_3_int.^2/21.15;
Fw_4_int=cd_a*ua_4_int.^2/21.15;
Fw_5_int=cd_a*ua_5_int.^2/21.15;

Acceleration acc, formula:

a=dudt=1δm[Ft(Ff+Fw)]a = \frac{du}{dt} = \frac{1}{\delta m}\left[F_t - (F_f + F_w)\right]
acc_1=(Ft_1_int-Ff-Fw_1_int)/m/3.17;
acc_2=(Ft_2_int-Ff-Fw_2_int)/m/1.77;
acc_3=(Ft_3_int-Ff-Fw_3_int)/m/1.27;
acc_4=(Ft_4_int-Ff-Fw_4_int)/m/1.12;
acc_5=(Ft_5_int-Ff-Fw_5_int)/m/1.07;

Engine power Pe, formula:

Pe=1ηT(Gfua3600+Giua3600+CDAua376140+δmua3600dudt)P_e = \frac{1}{\eta_T}\left( \frac{G f u_a}{3600} + \frac{G i\, u_a}{3600} + \frac{C_D A\, u_a^{3}}{76140} + \frac{\delta m\, u_a}{3600}\frac{du}{dt} \right)
for j=1:1601
    Pe_1(j)=(m*9.8*0.015*ua_1_int(j)/3600+cd_a*ua_1_int(j)^3/76140+3.17*m*ua_1_int(j)/3600*acc_1(j))/efficiency_other;
    Pe_2(j)=(m*9.8*0.015*ua_2_int(j)/3600+cd_a*ua_2_int(j)^3/76140+1.77*m*ua_2_int(j)/3600*acc_2(j))/efficiency_other;
    Pe_3(j)=(m*9.8*0.015*ua_3_int(j)/3600+cd_a*ua_3_int(j)^3/76140+1.27*m*ua_3_int(j)/3600*acc_3(j))/efficiency_other;
    Pe_4(j)=(m*9.8*0.015*ua_4_int(j)/3600+cd_a*ua_4_int(j)^3/76140+1.12*m*ua_4_int(j)/3600*acc_4(j))/efficiency_other;
    Pe_5(j)=(m*9.8*0.015*ua_5_int(j)/3600+cd_a*ua_5_int(j)^3/76140+1.07*m*ua_5_int(j)/3600*acc_5(j))/efficiency_direct;
end

Grade angle and gradeability, formula:

α=arcsinFt(Ff+Fw)G\alpha = \arcsin \frac{F_t - (F_f + F_w)}{G}
angle(1,:)=asin((Ft_1_int-Ff-Fw_1_int)/m/9.8);
angle(2,:)=asin((Ft_2_int-Ff-Fw_2_int)/m/9.8);
angle(3,:)=asin((Ft_3_int-Ff-Fw_3_int)/m/9.8);
angle(4,:)=asin((Ft_4_int-Ff-Fw_4_int)/m/9.8);
angle(5,:)=asin((Ft_5_int-Ff-Fw_5_int)/m/9.8);

Acceleration time t, accumulated point by point using a differential method—essentially a first-order Runge-Kutta. Formula:

t(i)=t(i1)+ua(i)ua(i1)a(i1)t(i) = t(i-1) + \frac{u_a(i) - u_a(i-1)}{a(i-1)}
t(1)=0;
for i=2:1601
    t(i)=(ua_5_int(i)-ua_5_int(i-1))/acc_5(i-1)+t(i-1);
end

Then we compute the total resistance for each gear, plus a continuous speed-resistance curve (used to draw the resistance line on the balance diagram):

F_1_resist=Fw_1_int+Ff;
F_2_resist=Fw_2_int+Ff;
F_3_resist=Fw_3_int+Ff;
F_4_resist=Fw_4_int+Ff;
F_5_resist=Fw_5_int+Ff;

ua_continue=[0:1:100];
F_resist_continue=Ff+1/2*density_air*ua_continue.^2*cd_a/3.6/3.6;

Dynamic factor D, formula:

D=ψ+δdugdtD = \psi + \frac{\delta\, du}{g\, dt}
D(1,:)=f+3.17/9.8*acc_1;
D(2,:)=f+1.77/9.8*acc_2;
D(3,:)=f+1.27/9.8*acc_3;
D(4,:)=f+1.12/9.8*acc_4;
D(5,:)=f+1.07/9.8*acc_5;

Step Four: Plot

Plot the quantities computed above as the four kinds of curves:

% Driving-force / road-resistance balance diagram
plot(ua_1_int,Ft_1_int,ua_2_int,Ft_2_int,ua_3_int,Ft_3_int,ua_4_int,Ft_4_int,ua_5_int,Ft_5_int,ua_continue,F_resist_continue);
xlabel('ua(km/h)');ylabel('F/N');title('Driving-force / road-resistance balance diagram')

% Maximum gradeability
plot(ua_1_int,tan(angle(1,:))*100,ua_2_int,tan(angle(2,:))*100,ua_3_int,tan(angle(3,:))*100,ua_4_int,tan(angle(4,:))*100,ua_5_int,tan(angle(5,:))*100);
xlabel('ua(km/h)');ylabel('i(%)');title('Gradeability diagram')

% Acceleration-time curve in direct gear
plot(t,ua_5_int);xlabel('t/s');ylabel('ua km/h');title('Acceleration-time curve in direct gear')

% Dynamic-factor diagram
f_continue=0.015*ones(1,101);
plot(ua_1_int,D(1,:),ua_2_int,D(2,:),ua_3_int,D(3,:),ua_4_int,D(4,:),ua_5_int,D(5,:),ua_continue,f_continue);
xlabel('ua(km/h)');ylabel('D');title('Dynamic-factor diagram')

% Power-balance diagram
plot(ua_1_int,Pe_1,ua_2_int,Pe_2,ua_3_int,Pe_3,ua_4_int,Pe_4,ua_5_int,Pe_5);
xlabel('ua km/h');ylabel('Pe/kW');title('Power-balance diagram')

Results

Reading off the plots:

  • Top speed 81.71 km/h (the intersection of the driving-force curve and the resistance curve in top gear)
  • Maximum gradeability 30% (the peak of the 1st-gear gradeability curve)

The five plots are below:

Driving-force / road-resistance balance diagram (the driving-force curves for each gear together with the upward-sweeping resistance curve; the intersection is the top speed):

Driving-force / road-resistance balance diagram

Gradeability diagram (the 1st-gear peak is about 30%, which is the maximum gradeability):

Gradeability diagram

Acceleration-time curve in direct gear:

Acceleration-time curve

Dynamic-factor diagram (the dynamic factor D; the horizontal line at the bottom is the rolling resistance coefficient f):

Dynamic-factor diagram

Power-balance diagram:

Power-balance diagram

Working through this whole problem, my biggest takeaway is that a vehicle’s dynamic performance is really governed by just a few formulas: the engine wide-open-throttle characteristic + the gear ratios + the resistance model, and everything else is just combining them to integrate and find intersections. MATLAB here is just a handy calculator that saves you the trouble of interpolating and integrating by hand.