% This script file is called from the StopFcn callback of
% COMBINED_DRIVE_CYCLE.mdl to display some results. It can also be run
% manually.
%
% Example: 1)Simulate COMBINED_DRIVE_CYCLE
% 2)Run Plot_Combined_Cycle
%
% Copyright 2004 - 2009 The MathWorks, Inc.
% Create a figure window
hFigure = figure('Name','FTP72 DRIVE CYCLE RESULTS');
Position = get(hFigure,'Position');
Position(3:4) = [1000 1000];
set(hFigure,'Position',Position);
movegui(hFigure,'center');
% % US
% subplot(6,1,1)
% plot(VehicleSpeedOut(:,1),VehicleSpeedOut(:,2));
% title('Vehicle Speed');
% xlabel('time (s)'); ylabel('speed (MPH)'); grid on;
% set(gca,'YLim',[0 55])
% METRIC
mph2kph = 1.609344;
subplot(6,1,1)
plot(VehicleSpeedOut(:,1),VehicleSpeedOut(:,2)*mph2kph);
title('Vehicle Speed');
xlabel('time (s)'); ylabel('speed (KPH)'); grid on;
set(gca,'YLim',[0 55*mph2kph])
subplot(6,1,2)
plot(EMB_RPMOut(:,1),EMB_RPMOut(:,2)/1000);
title('EMB Rotational Speed');
xlabel('time (s)'); ylabel('RPM x 1000'); grid on;
set(gca,'YLim',[0 35])
subplot(6,1,3)
plot(EMBPowerOut(:,1),EMBPowerOut(:,2)/1000);
title('Hydro-pneumatic Power Transfer');
xlabel('time (s)'); ylabel('Power (kW)'); grid on;
set(gca,'YLim',[-25 25])
subplot(6,1,4)
plot(UsbSOCOut(:,1),UsbSOCOut(:,2));
title('Usable SOC');
xlabel('time (s)'); ylabel('SOC'); grid on;
set(gca,'YLim',[0 1]); %set(gca,'XLim',[0 1400])
subplot(6,1,5)
plot(EMBEnergyOut(:,1),EMBEnergyOut(:,2));
title('Energy flow into EMB');
xlabel('time (s)'); ylabel('Energy (kWh)'); grid on;
set(gca,'YLim',[-0.2 0]); %set(gca,'XLim',[0 1400])
subplot(6,1,6)
plot(EMBTorqueOut(:,1),EMBTorqueOut(:,3));
title('EMB Torque');
xlabel('time (s)'); ylabel('Torque (N.m)'); grid on;
set(gca,'YLim',[-15 15])