Skip to content

Commit

Permalink
Initial commit R2017a
Browse files Browse the repository at this point in the history
  • Loading branch information
smiller01985 committed Nov 2, 2019
1 parent 688d6f3 commit cd4bc3d
Show file tree
Hide file tree
Showing 37 changed files with 63 additions and 51 deletions.
2 changes: 1 addition & 1 deletion Fuel_Consumption/Create_Fuel_Consumption_LUT.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
%% ESTIMATE FUEL CONSUMPTION WITH MEASURED DATA
% Copyright 2011-2016 The MathWorks, Inc.
% Copyright 2011-2017 The MathWorks, Inc.
% CONSTANTS
gasoline_density_gpm3 = 750*1000; % Grams per cubic meter
gallons_per_m3 = 264.172; % gallons per cubic meter
Expand Down
2 changes: 1 addition & 1 deletion Fuel_Consumption/Fuel_Consumption_PlotData.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
% Copyright 2011-2016 The MathWorks, Inc.
% Copyright 2011-2017 The MathWorks, Inc.

hndl = plot3(FCData.Speed_RPM, FCData.Trq_Nm, FCData.FuelUse_gps,'o','MarkerFaceColor','blue','MarkerEdgeColor','white');
grid on
Expand Down
Binary file modified HEV_SeriesParallel.slx
Binary file not shown.
File renamed without changes
File renamed without changes
Binary file modified Libraries/Battery/Battery_Cell_Det.slx
Binary file not shown.
Binary file modified Libraries/Battery/HEV_Battery_Det_Lib.slx
Binary file not shown.
Binary file modified Libraries/Battery/HEV_Battery_Lib.slx
Binary file not shown.
Binary file modified Libraries/Battery/HEV_Battery_Testrig_v1.slx
Binary file not shown.
Binary file modified Libraries/Battery/HEV_Battery_Testrig_v2.slx
Binary file not shown.
Binary file modified Libraries/Electrical/HEV_Electrical_Lib.slx
Binary file not shown.
Binary file modified Libraries/Vehicle/Engine_Testrig.slx
Binary file not shown.
Binary file modified Libraries/Vehicle/HEV_Vehicle_Dynamics_Lib.slx
Binary file not shown.
Binary file modified Libraries/Vehicle/Vehicle_Dynamics_Testrig.slx
Binary file not shown.
2 changes: 1 addition & 1 deletion Local_Solver/Test_RT_Model.m
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,6 @@
hold off
legend({'Reference','Fixed-Step','Real-Time','Modified'},'Location','NorthWest');

% Copyright 2011-2016 The MathWorks(TM), Inc.
% Copyright 2011-2017 The MathWorks(TM), Inc.
%% Close model and clean up directory
cleanup_rt_dir
2 changes: 1 addition & 1 deletion Local_Solver/cleanup_rt_dir.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
% CLEANUP RT TEST DIR
% Copyright 2011-2016 The MathWorks, Inc.
% Copyright 2011-2017 The MathWorks, Inc.

mdl = 'HEV_SeriesParallel';
delete([mdl '*bio.m'])
Expand Down
2 changes: 1 addition & 1 deletion PCT/Generate_Sim_Settings.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function [simCmdParamValStructs] = Generate_Sim_Settings(param_vals,param_name,rtp)
% Copyright 2009-2016 The MathWorks(TM), Inc.
% Copyright 2009-2017 The MathWorks(TM), Inc.

numParamSets = length(param_vals);

Expand Down
2 changes: 1 addition & 1 deletion PCT/HEV_Model_PCT_Sim.m
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,5 @@
delete('*.mex*')
!rmdir slprj /S/Q

% Copyright 2013-2016 The MathWorks(TM), Inc.
% Copyright 2013-2017 The MathWorks(TM), Inc.

2 changes: 1 addition & 1 deletion PCT/Initialize_MLPool.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
% Copyright 2013-2016 The MathWorks, Inc.
% Copyright 2013-2017 The MathWorks, Inc.
TempSimSettings = SimSettings;
Temppool = gcp;
Temppoolsize = Temppool.NumWorkers;
Expand Down
2 changes: 1 addition & 1 deletion PCT/PCT_Simulation_Slide_Prep.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
% Copyright 2009-2016 The MathWorks(TM), Inc.
% Copyright 2009-2017 The MathWorks(TM), Inc.
set(gcf,'Position',[765 405 449 336]);
box on
text(200,25,'Testing Time (normal): 93.2 sec','FontSize',12,'FontWeight','Bold');
Expand Down
2 changes: 1 addition & 1 deletion Power_Quality/DC_Power_Quality_Analysis.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
%% CONSTANTS
% Copyright 2011-2016 The MathWorks, Inc.
% Copyright 2011-2017 The MathWorks, Inc.

FigurePos1 = [450 499 574 186];
FigurePos2 = [449 69 574 372];
Expand Down
2 changes: 1 addition & 1 deletion RSIM/HEV_Model_RSIM.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
%% OPEN AND CONFIGURE MODEL
% Copyright 2011-2016 The MathWorks, Inc.
% Copyright 2011-2017 The MathWorks, Inc.

mdl = 'HEV_SeriesParallel';
open_system(mdl);
Expand Down
2 changes: 1 addition & 1 deletion Reports/HEV_Model_Report_SHORT.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>HEV Simulation Test Report</title><meta name="generator" content="DocBook MathWorks XSL Stylesheets V1.75.2-mathworks"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div lang="en" class="book" title="HEV Simulation Test Report"><div class="titlepage"><div><div><h1 class="title"><a name="d38e1"></a>HEV Simulation Test Report</h1></div><div><h2 class="subtitle">Generated by the Simulink Report Generator</h2></div><div><div class="mediaobject" align="left"><img src="./HEV_Model_Report_SHORT_html_files/image-000-copied.jpg"></div></div><div><div class="legalnotice" title="Legal Notice"><a name="d38e13"></a><p>Copyright 2016 The MathWorks, Inc.</p></div></div><div><p class="pubdate">30-Aug-2016 12:40:59</p></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="chapter"><a href="#d38e16">1. Configuration "Sys BD VS" Tests</a></span></dt><dd><dl><dt><span class="sect1"><a href="#d38e53">1. Drive Cycle 1</a></span></dt><dt><span class="sect1"><a href="#d38e81">2. Drive Cycle 2</a></span></dt><dt><span class="sect1"><a href="#d38e109">3. Drive Cycle 3</a></span></dt></dl></dd><dt><span class="chapter"><a href="#d38e137">2. Simulation Time Table</a></span></dt></dl></div><div class="list-of-figures"><p><b>List of Figures</b></p><dl><dt>1.1. <a href="#d38e57">Vehicle
<title>HEV Simulation Test Report</title><meta name="generator" content="DocBook MathWorks XSL Stylesheets V1.75.2-mathworks"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div lang="en" class="book" title="HEV Simulation Test Report"><div class="titlepage"><div><div><h1 class="title"><a name="d38e1"></a>HEV Simulation Test Report</h1></div><div><h2 class="subtitle">Generated by the Simulink Report Generator</h2></div><div><div class="mediaobject" align="left"><img src="./HEV_Model_Report_SHORT_html_files/image-000-copied.jpg"></div></div><div><div class="legalnotice" title="Legal Notice"><a name="d38e13"></a><p>Copyright 2017 The MathWorks, Inc.</p></div></div><div><p class="pubdate">30-Aug-2016 12:40:59</p></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="chapter"><a href="#d38e16">1. Configuration "Sys BD VS" Tests</a></span></dt><dd><dl><dt><span class="sect1"><a href="#d38e53">1. Drive Cycle 1</a></span></dt><dt><span class="sect1"><a href="#d38e81">2. Drive Cycle 2</a></span></dt><dt><span class="sect1"><a href="#d38e109">3. Drive Cycle 3</a></span></dt></dl></dd><dt><span class="chapter"><a href="#d38e137">2. Simulation Time Table</a></span></dt></dl></div><div class="list-of-figures"><p><b>List of Figures</b></p><dl><dt>1.1. <a href="#d38e57">Vehicle
Speed</a></dt><dt>1.2. <a href="#d38e63">Speeds From Urban Cycle 1</a></dt><dt>1.3. <a href="#d38e69">Voltages From Urban Cycle 1</a></dt><dt>1.4. <a href="#d38e75">Currents From Urban Cycle 1</a></dt><dt>1.5. <a href="#d38e85">Vehicle
Speed</a></dt><dt>1.6. <a href="#d38e91">Speeds From Urban Cycle 2</a></dt><dt>1.7. <a href="#d38e97">Voltages From Urban Cycle 2</a></dt><dt>1.8. <a href="#d38e103">Currents From Urban Cycle 2</a></dt><dt>1.9. <a href="#d38e113">Vehicle
Speed</a></dt><dt>1.10. <a href="#d38e119">Speeds From Urban Cycle 3</a></dt><dt>1.11. <a href="#d38e125">Voltages From Urban Cycle 3</a></dt><dt>1.12. <a href="#d38e131">Currents From Urban Cycle 3</a></dt></dl></div><div class="list-of-tables"><p><b>List of Tables</b></p><dl><dt>2.1. <a href="#d38e141">Simulation Time</a></dt></dl></div><div class="chapter" title="Chapter&nbsp;1.&nbsp;Configuration &#34;Sys BD VS&#34; Tests"><div class="titlepage"><div><div><h2 class="title"><a name="d38e16"></a>Chapter&nbsp;1.&nbsp;Configuration "Sys BD VS" Tests</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="#d38e53">1. Drive Cycle 1</a></span></dt><dt><span class="sect1"><a href="#d38e81">2. Drive Cycle 2</a></span></dt><dt><span class="sect1"><a href="#d38e109">3. Drive Cycle 3</a></span></dt></dl></div><pre xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd"><span style="color:green">% CONFIGURE HEV Model</span>
Expand Down
2 changes: 1 addition & 1 deletion Reports/actxlicense.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function lic = actxlicense(progid)
% Copyright 2011-2016 The MathWorks, Inc.
% Copyright 2011-2017 The MathWorks, Inc.
if strcmpi(progid, 'air.airctrl.1')
lic = 'Copyright (c) 1996 ';
return;
Expand Down
2 changes: 1 addition & 1 deletion Scripts_Data/Compare_HEV_Results.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
% Copyright 2011-2016 The MathWorks, Inc.
% Copyright 2011-2017 The MathWorks, Inc.

% SELECT SIMULATION RESULTS TO BE COMPARED
VarSetStr = 'SM';
Expand Down
2 changes: 1 addition & 1 deletion Scripts_Data/Configure_HEV_Simulation.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
% Copyright 2011-2016 The MathWorks, Inc.
% Copyright 2011-2017 The MathWorks, Inc.

%disp('CONFIGURING MODEL...');
HEV_Solver_Selection = 'ode15s';
Expand Down
2 changes: 1 addition & 1 deletion Scripts_Data/HEVSP_setdesktop.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
% Copyright 2011-2016 The MathWorks, Inc.
% Copyright 2011-2017 The MathWorks, Inc.

set_param(bdroot,'Solver','ODE15s');
HEV_Param.Control.Mode_Logic_TS = 0.1;
Expand Down
2 changes: 1 addition & 1 deletion Scripts_Data/HEVSP_setrealtime.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
% Copyright 2011-2016 The MathWorks, Inc.
% Copyright 2011-2017 The MathWorks, Inc.

tvar_Nonlinear_Iterations = '3';
tvar_StepSize = '0.005';
Expand Down
2 changes: 1 addition & 1 deletion Scripts_Data/HEVSP_tictoc.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function HEVSP_tictoc(enable)
% Copyright 2011-2016 The MathWorks, Inc.
% Copyright 2011-2017 The MathWorks, Inc.

if(strcmpi(enable,'on'))
set_param(bdroot,'StartFcn','tic;');
Expand Down
6 changes: 3 additions & 3 deletions Scripts_Data/HEV_Model_Demo_Script.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<!--
This HTML was auto-generated from MATLAB code.
To make changes, update the MATLAB code and republish this document.
--><title>HEV Model Demo Script</title><meta name="generator" content="MATLAB 9.1"><link rel="schema.DC" href="http://purl.org/dc/elements/1.1/"><meta name="DC.date" content="2016-08-09"><meta name="DC.source" content="HEV_Model_Demo_Script.m"><style type="text/css">
--><title>HEV Model Demo Script</title><meta name="generator" content="MATLAB 9.2"><link rel="schema.DC" href="http://purl.org/dc/elements/1.1/"><meta name="DC.date" content="2017-02-06"><meta name="DC.source" content="HEV_Model_Demo_Script.m"><style type="text/css">
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td{margin:0;padding:0;border:0;outline:0;font-size:100%;vertical-align:baseline;background:transparent}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:'';content:none}:focus{outine:0}ins{text-decoration:none}del{text-decoration:line-through}table{border-collapse:collapse;border-spacing:0}

html { min-height:100%; margin-bottom:1px; }
Expand Down Expand Up @@ -84,7 +84,7 @@
<tr>8. <a href="matlab:cd([HEV_Model_HomeDir '/RSIM']);edit HEV_Model_RSIM">Deploy Simulation As a Standalone Executable</a><br>
</style>
</style>
</p><p>Copyright 2011-2016 The MathWorks&#8482;, Inc.</p><p class="footer"><br><a href="http://www.mathworks.com/products/matlab/">Published with MATLAB&reg; R2016b</a><br></p></div><!--
</p><p>Copyright 2011-2017 The MathWorks&#8482;, Inc.</p><p class="footer"><br><a href="http://www.mathworks.com/products/matlab/">Published with MATLAB&reg; R2017a</a><br></p></div><!--
##### SOURCE BEGIN #####
%% HEV Model Demo Script
%
Expand All @@ -108,7 +108,7 @@
% </style>
% </html>
%
% Copyright 2011-2016 The MathWorks(TM), Inc.
% Copyright 2011-2017 The MathWorks(TM), Inc.
Expand Down
2 changes: 1 addition & 1 deletion Scripts_Data/HEV_Model_Demo_Script.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
% </style>
% </html>
%
% Copyright 2011-2016 The MathWorks(TM), Inc.
% Copyright 2011-2017 The MathWorks(TM), Inc.


2 changes: 1 addition & 1 deletion Scripts_Data/HEV_Model_PARAM.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
% Copyright 2011-2016 The MathWorks, Inc.
% Copyright 2011-2017 The MathWorks, Inc.

%disp('DEFINING PARAMETERS...');
% HEV SERIES PARALLEL PARAMETERS
Expand Down
2 changes: 1 addition & 1 deletion Scripts_Data/Select_HEV_Model_Systems.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function Select_HEV_Model_Systems(HEV_Config_Name,HEV_Configs)
% Copyright 2011-2016 The MathWorks, Inc.
% Copyright 2011-2017 The MathWorks, Inc.

CurrentPath = gcs;
SlashInd = findstr(CurrentPath,'/');
Expand Down
2 changes: 1 addition & 1 deletion Scripts_Data/Setup_HEV_Model_Configurations.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
% Copyright 2011-2016 The MathWorks, Inc.
% Copyright 2011-2017 The MathWorks, Inc.

expModel = bdroot;

Expand Down
42 changes: 26 additions & 16 deletions Scripts_Data/Test_HEV_Model_SHORT.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
% Copyright 2011-2016 The MathWorks, Inc.
% Copyright 2011-2017 The MathWorks, Inc.

expModel = 'HEV_SeriesParallel';
open_system(expModel);
Expand All @@ -8,9 +8,9 @@
VehVariants = {'Simple' 'Full'};

SimDuration = [max(UrbanCycle1.time) max(UrbanCycle2.time) max(UrbanCycle3.time)];

set_param(bdroot,'FastRestart','on')
for MV_ind = 1:1

MV_str = char(ModelVariants(MV_ind));
MV_name = strrep(MV_str,' ','_');

Expand All @@ -19,28 +19,36 @@
for Veh_ind = 1:1 %length(VehVariants)
Veh_str = char(VehVariants(Veh_ind));
Veh_name = strrep(Veh_str,' ','_');
set_param([expModel '/Vehicle Dynamics'],'BlockChoice',Veh_str);

if (strcmp(get_param(bdroot,'FastRestart'),'off'))
set_param([expModel '/Vehicle Dynamics'],'BlockChoice',Veh_str);
end
for Batt_ind=1:1 %length(BattVariants)
Batt_str = char(BattVariants(Batt_ind));
Batt_name = strrep(Batt_str,' ','_');

set_param(expModel,'StopTime',num2str(SimDuration(DC_ind)));
%if (strcmp(get_param(bdroot,'FastRestart'),'off'))
set_param(expModel,'StopTime',num2str(SimDuration(DC_ind)));
%end
Drive_Cycle_Num = DC_ind;
set_param([expModel '/Electrical'],'BlockChoice',MV_str);

set_param([expModel '/Electrical/' MV_str '/Battery'],'BlockChoice',Batt_str);
if (strcmp(get_param(bdroot,'FastRestart'),'off'))
set_param([expModel '/Electrical'],'BlockChoice',MV_str);
end
if (strcmp(get_param(bdroot,'FastRestart'),'off'))
set_param([expModel '/Electrical/' MV_str '/Battery'],'BlockChoice',Batt_str);
end
disp(['Simulating UC' num2str(DC_ind) ', ' get_param([expModel '/Electrical'],'BlockChoice') ', '...
get_param([expModel '/Vehicle Dynamics'],'BlockChoice') ' Vehicle, ',...
get_param([expModel '/Vehicle Dynamics'],'BlockChoice') ' Vehicle, ',...
get_param([expModel '/Electrical/' MV_str '/Battery'],'BlockChoice') ' Battery'] );
sim(expModel);

eval([MV_name '.Electrical = Electricals;']);
eval([MV_name '.Car = Car;']);
eval([MV_name '.Generator = Generator;']);
eval([MV_name '.Motor = Motor;']);
eval([MV_name '.Control_Logic = Control_Logic;']);
eval([MV_name '.DCDC_Conv = DCDC_Temp;']);
if exist('Electricals','var')
eval([MV_name '.Electrical = Electricals;']);
eval([MV_name '.Car = Car;']);
eval([MV_name '.Generator = Generator;']);
eval([MV_name '.Motor = Motor;']);
eval([MV_name '.Control_Logic = Control_Logic;']);
eval([MV_name '.DCDC_Conv = DCDC_Temp;']);
end

%SaveFolder = [SaveFolderRoot '\UC' num2str(DC_ind) '\' MV_name];
%SaveFileName = [SaveFolder '\' MV_name '_DATA_UC' num2str(DC_ind) '_Veh' num2str(Veh_ind) '_Batt' num2str(Batt_ind)];
Expand All @@ -52,4 +60,6 @@
end
end

set_param(bdroot,'FastRestart','off');

open('HEV_Model_Report_SHORT.html');
2 changes: 1 addition & 1 deletion Scripts_Data/plot_HEV_Data.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function plot_HEV_Data(FigID,SubPlID,DataStr,SigID,ValID,titlestr,PlotChoice)
% Copyright 2011-2016 The MathWorks, Inc.
% Copyright 2011-2017 The MathWorks, Inc.

SP_style = 'b';
SY_style = 'b-';
Expand Down
22 changes: 12 additions & 10 deletions startup_HEV_Model.m
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
% Copyright 2011-2016 The MathWorks, Inc.
% Copyright 2011-2017 The MathWorks, Inc.

HEV_Model_HomeDir = pwd;
addpath(pwd);
addpath([pwd '/Libraries/Electrical']);
addpath([pwd '/Libraries/Battery']);
addpath([pwd '/Libraries/Vehicle']);
addpath([pwd '/Images']);
addpath([pwd '/Scripts_Data']);
addpath([pwd '/Reports']);
addpath([pwd '/Power_Quality']);
addpath([pwd filesep 'Libraries' filesep 'Electrical']);
addpath([pwd filesep 'Libraries' filesep 'Battery']);
addpath([pwd filesep 'Libraries' filesep 'Vehicle']);
%addpath([pwd filesep 'Libraries' filesep 'Animation']);
addpath([pwd filesep 'Images']);
addpath([pwd filesep 'Scripts_Data']);
addpath([pwd filesep 'Reports']);
addpath([pwd filesep 'Power_Quality']);
addpath(genpath([pwd filesep 'SimResults']));

HEV_Model_PARAM

% FOR VARIABLE INERTIA (PCT TESTS)
if(exist('Libraries\Vehicle')==7)
cd Libraries\Vehicle
if(exist(['Libraries' filesep 'Vehicle'])==7)
cd(['Libraries' filesep 'Vehicle'])
if((exist('+TunableMech')==7) && ~exist('TunableMech_lib'))
disp('Building Custom Simscape Library...');
ssc_build TunableMech
Expand Down

0 comments on commit cd4bc3d

Please sign in to comment.