Week-3 Challenge: ADVISOR Tool
1.Simulation was carried out under the specified conditions i.e. EV_defaults_in file and cargo mass of 500 Kg.The result shown was as under:
A.Fuel Consumed :0
B.Gasoline Equivalent:2.4
C.Distance Travelled:17.8 Km
Hence the vehicle cannot travel 45 Km under the conditions specified.
2.Battery capacity was changed by selecting Energy Storage System from ESS_PB_25 to ESS_PB_91.The result was identical for parameters A and C above.However, for B the value was 2.6.
3.Gradeability test was carried out for PRIUS_jpn_default_in under the following conditions:
A.Grade:6%
B.Speed :55 mph
C. Duration:10 s
Energy Storage disabled.Test result is enclosed vide
Part of the code is enclosed for Q1.
function varargout = advisor(varargin)
% advisor Application M-file for advisor.fig
% FIG = advisor launch advisor GUI.
% advisor('callback_name', ...) invoke the named callback.
%
% ADVISOR Advanced Vehicle Simulator
%
% This function opens the first graphical user interface (GUI) into
% the program ADVISOR.
%
% The ADVISOR program is designed to assist in testing different
% vehicle configurations using standard and custom driving cycles or
% test procedures.
%
% For help in running ADVISOR please use the help buttons found on
% each user interface which links to the documentation pages. If you still
% need help or have helpful suggestions for improvement please email:
% [email protected]
Part of the code enclosed for Q2.
advisor_ver
waitbar(1)
close(hwait); %close the waitbar
adv_dir=fileparts(which('advisor'));
imagedata = imread(fullfile(adv_dir, 'gui_graphics', 'Splash_Screen_car.jpg'));
h=image(imagedata);
set(h,'ButtonDownFcn','advisor(''play_movie'')');
advisor('play_movie')
elseif ischar(varargin{1}) % INVOKE NAMED SUBFUNCTION OR CALLBACK
try
if (nargout)
[varargout{1:nargout}] = feval(varargin{:}); % FEVAL switchyard
else
feval(varargin{:}); % FEVAL switchyard
end
catch
disp(lasterr);
end
end
%| ABOUT CALLBACKS:
%| GUIDE automatically appends subfunction prototypes to this file, and
%| sets objects' callback properties to call them through the FEVAL
%| switchyard above. This comment describes that mechanism.
%|
%| Each callback subfunction declaration has the following form:
%| <SUBFUNCTION_NAME>(H, EVENTDATA, HANDLES, VARARGIN)
%|
%| The subfunction name is composed using the object's Tag and the
%| callback type separated by '_', e.g. 'slider2_Callback',
%| 'figure1_CloseRequestFcn', 'axis1_ButtondownFcn'.
Part of code for Q3:
if ~exist('varargin') % no user-specified filename provided
[name, path]=uigetfile('*.mat'); %user input for mat name of saved simulation
elseif isempty(varargin)
[name, path]=uigetfile('*.mat'); %user input for mat name of saved simulation
else % user-specified filename provided
path_name=varargin{1};
% break argument into the path and filename parts
idx=strfind(path_name,'\');
if isempty(idx)
idx=strfind(path_name,'/');
end
if isempty(idx)
name=path_name;
path='';
else
name=path_name((max(idx)+1):end);
path=path_name(1:max(idx));
end
end
%if no file is selected(ie. figure is cancelled)
%then exit(or return) out of this function
if name==0
return
end
evalin('base','clear all')