function [torque_tc, torque_engine, omega_engine] = engine_w_torque_converter (omega_tc) % [TORQUE_TC, TORQUE_ENGINE, OMEGA_ENGINE] = ENGINE_W_TORQUE_CONVERTER (OMEGA_TC) % computes the torque converter torque, TORQUE_TC [Nm], as a function of % the rotational velocity of the torque converter shaft and OMEGA [rad/s]. % This model also computes the corresponding engine speed and torque. % % INPUT: % omega_tc: speed at the output of the torque converter in rad/s % OUTPUT: % torque_tc: torque at the output of the torque conververter in Nm % torque_engine: torque at produced by the engine in Nm % omega_engine: speed of the engine in rad/s % % Assumptions: % - Although qualitatively correct, this function is based entirely % on fictitious data. %% %% ME 2016 %% Fall 2007 %% %% AUTHOR: Chris Paredis %% % red-line RPM -- above this engine speed the fuel is cut off to avoid % damage to the engine omega_red = 6000*pi/30; % make sure the input is within a valid range. The car should never operate % at speeds outside this range, but it may happen that the ODE solver tries % to make a big step and ends up at these velocities. This is just a % saveguard to stop the root-finder from breaking. if omega_tc < 0 %warning('car should not move backwards'); torque_tc = 0; torque_engine = 0; omega_engine = 0; fprintf('following output resulted from negative omega_tc: %g\n',omega_tc); return; elseif omega_tc > 700 omega_tc = 700; end % To compute the output torque for a given output velocity, % start with some fairly tight bounds on the initial guess -- these bounds % were determined through visual inspection of the solutions. The code % works with less specific bounds, but including these thight bounds % improves the speed significantly. upper_bound = omega_tc + 250*exp(-omega_tc/300); lower_bound = max(30,omega_tc*0.9); f = @(x)(torque_converter(x,omega_tc)-engine_model_CJP(x)); omega_engine = fzero(f, [lower_bound, upper_bound]); % check whether we are beyond the red-line of the engine. Clip the speed % to the red-line if omega_engine > omega_red omega_engine = omega_red; end % make one more call to the torque converter model to determine the output % torque [torque_engine,torque_tc] = torque_converter(omega_engine, omega_tc);