%% ME 2016 Section %% Fall 2007 %% %% AUTHOR: Chris Paredis %% %% PURPOSE: plot the 5 power curves as a function of car speed, %% one for each of the five gear ratios in a transmission %% %% This script loads the engine model from an Excel file, computes the %% engine speed from the car speed for each of the five gears in an %% automatic transmission, and plots the engine power relative to the car %% speed %% %% ASSUMPTIONS: %% - the torque converter can be ignored %% - no friction losses anywhere %% - no tire slip %% %% define the problem %% % to be on the safe side, clear all the variables and close all figures clear all; close all; % define the drivetrain parameters wheel_radius = 0.332; % in [m] gear_ratios = [2.77 1.54 1 0.69]; differential_ratio = 4.266; % conversion constant -- for convenience ms_to_kmh = 3.6; % create the engine speed vector across the entire range of speeds engine_speed = (500:6500)*pi/30; % in [rad/s] %% %% solve the problem %% % for each engine speed, compute the corresponding power in [W] % power = speed * torque engine_power = engine_speed .* engine_model_CJP(engine_speed); % compute the total conversion from engine speed in rad/s to car velocity % in km/h total_ratios = ms_to_kmh * wheel_radius ./ gear_ratios / differential_ratio; % compute the car velocities -- one row for each gear % note: rather than using a for loop, this can be done using an "outer" % matrix product. A for-loop over the different gear ratios is an % acceptable solution here also car_velocity = total_ratios' * engine_speed; %% %% interpret the results %% figure(1) plot(engine_speed*30/pi, engine_power/1000); grid on; xlabel('Engine Speed [RPM]'); ylabel('Engine Power [kW]'); title('Engine power as a function of engine speed (ME 2016 - Chris Paredis)'); figure(2) plot(car_velocity, engine_power/1000); grid on; xlabel('Car Speed [km/h]'); ylabel('Engine Power [kW]'); title('Car power as a function of car speed (ME 2016 - Chris Paredis)'); legend('1st gear','2nd gear','3rd gear','4th gear','Location','SouthEast');