Skip to content

Commit 1c9fd34

Browse files
committed
Initial commit R2019b. Converted to MATLAB Project.
1 parent f7cc0c7 commit 1c9fd34

File tree

391 files changed

+1276
-400
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

391 files changed

+1276
-400
lines changed

Diff for: HEV_SeriesParallel.prj

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<MATLABProject xmlns="http://www.mathworks.com/MATLABProjectFile" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0"/>

Diff for: HEV_SeriesParallel.slx

2.98 KB
Binary file not shown.

Diff for: Libraries/Battery/Battery_Cell_Det.slx

2.09 KB
Binary file not shown.

Diff for: Libraries/Battery/HEV_Battery_Det_Lib.slx

3.01 KB
Binary file not shown.

Diff for: Libraries/Battery/HEV_Battery_Lib.slx

5.51 KB
Binary file not shown.

Diff for: Libraries/Battery/HEV_Battery_Testrig_v1.slx

746 Bytes
Binary file not shown.

Diff for: Libraries/Battery/HEV_Battery_Testrig_v2.slx

-722 Bytes
Binary file not shown.

Diff for: Libraries/Electrical/HEV_Electrical_Lib.slx

7 KB
Binary file not shown.

Diff for: Libraries/Vehicle/Engine_Testrig.slx

1.66 KB
Binary file not shown.

Diff for: Libraries/Vehicle/HEV_Vehicle_Dynamics_Lib.slx

2.18 KB
Binary file not shown.

Diff for: Libraries/Vehicle/Vehicle_Dynamics_Testrig.slx

1.35 KB
Binary file not shown.

Diff for: PCT/Generate_Sim_Settings.m

-33
This file was deleted.

Diff for: PCT/HEV_Model_PCT_Sim.m

-78
This file was deleted.

Diff for: PCT/Initialize_MLPool.m

-12
This file was deleted.

Diff for: PCT/PCT_Simulation_Slide_Prep.m

-6
This file was deleted.

Diff for: README.txt

+1-6
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,10 @@ README file for HEV_SeriesParallel demonstration
22
Steve Miller, updated 2017
33
Copyright 2011-2019 The MathWorks, Inc.
44

5-
To start this demonstration, run startup_HEV_Model.m
5+
To start this demonstration, open project HEV_SeriesParallel.prj
66
This will bring you to the simplest configuration of the full vehicle.
77
Look at the slides to see all of the available configurations.
88

9-
For R2011a,
10-
1. This model has been updated to use the Simscape-based driveline components.
11-
2. You can adjust the efficiency of the planetary gear
12-
3. There is a fuel economy calculation, and you can show how we imported data to make this calculation
13-
149
There are a number of things to be aware of with this demonstration.
1510
1. Configurations
1611
2. Animation
-11.5 KB
Binary file not shown.
-35.7 KB
Binary file not shown.
-25.8 KB
Binary file not shown.
-27.2 KB
Binary file not shown.
-10.4 KB
Binary file not shown.
-29.6 KB
Binary file not shown.
-28.5 KB
Binary file not shown.
-29.2 KB
Binary file not shown.
-9.63 KB
Binary file not shown.
-29.2 KB
Binary file not shown.
-26.2 KB
Binary file not shown.
-28.3 KB
Binary file not shown.

Diff for: Scripts_Data/Compare_HEV_Results.m

+27-8
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
% Copyright 2011-2019 The MathWorks, Inc.
22

33
% SELECT SIMULATION RESULTS TO BE COMPARED
4-
VarSetStr = 'SM';
4+
VarSetStr = 'DSM';
55
BattStr = 'P';
66
VehStr = 'S';
7-
DCycle = '2';
7+
DCycle = '1';
88
EffInd = '1';
99

1010
% REST OF FILE SHOULD NOT CHANGE
@@ -21,7 +21,7 @@
2121
MV_str = char(ModelVariants(MV_ind));
2222
MV_name = strrep(MV_str,' ','_');
2323

24-
FileName = [MV_name '_DATA_UC' DCycle '_Veh' num2str(VehInd) '_Batt' num2str(BattInd)}];
24+
FileName = [MV_name '_DATA_UC' DCycle '_Veh' num2str(VehInd) '_Batt' num2str(BattInd)];
2525
%FileName = [MV_name '_DATA_UC' DCycle '_Veh' num2str(VehInd) '_Batt' num2str(BattInd) '_' EffVariants{str2num(EffInd)}];
2626

2727
disp(FileName)
@@ -31,18 +31,37 @@
3131
plot_HEV_Data(1,[3 1 1],'Car',4,1,'Vehicle Speed (kph)',VarSetStr);
3232
plot_HEV_Data(1,[3 1 2],'Motor',2,1,'Motor Speed (RPM)',VarSetStr);
3333
plot_HEV_Data(1,[3 1 3],'Generator',2,1,'Generator Speed (RPM)',VarSetStr);
34+
sub_h(1) = subplot(3,1,1); ylabel('Speed (kph)');
35+
sub_h(2) = subplot(3,1,2); ylabel('Speed (RPM)');
36+
sub_h(3) = subplot(3,1,3); xlabel('Time (s)'); ylabel('Speed (RPM)');
37+
linkaxes(sub_h,'x'); clear sub_h
38+
3439

3540
plot_HEV_Data(2,[2 1 1],'Electrical',2,2,'Battery Voltage',VarSetStr);
3641
plot_HEV_Data(2,[2 1 2],'Electrical',2,1,'DC Bus Voltage',VarSetStr);
42+
sub_h(1) = subplot(2,1,1); ylabel('Voltage (V)');
43+
sub_h(2) = subplot(2,1,2); ylabel('Voltage (V)'); xlabel('Time (s)');
44+
linkaxes(sub_h,'x'); clear sub_h
3745

3846
plot_HEV_Data(3,[2 1 1],'Electrical',3,2,'Battery Current',VarSetStr);
3947
plot_HEV_Data(3,[2 1 2],'Electrical',3,3,'Generator Current',VarSetStr);
40-
plot_HEV_Data(3,[3 1 1],'Electrical',3,2,'Battery Current',VarSetStr);
41-
plot_HEV_Data(3,[3 1 2],'Electrical',3,3,'Generator Current',VarSetStr);
42-
plot_HEV_Data(3,[3 1 3],'Electrical',3,1,'Motor Current',VarSetStr);
48+
sub_h(1) = subplot(2,1,1); ylabel('Current (A)');
49+
sub_h(2) = subplot(2,1,2); ylabel('Current (A)'); xlabel('Time (s)');
50+
linkaxes(sub_h,'x'); clear sub_h
51+
52+
plot_HEV_Data(4,[3 1 1],'Electrical',3,2,'Battery Current',VarSetStr);
53+
plot_HEV_Data(4,[3 1 2],'Electrical',3,3,'Generator Current',VarSetStr);
54+
plot_HEV_Data(4,[3 1 3],'Electrical',3,1,'Motor Current',VarSetStr);
55+
sub_h(1) = subplot(3,1,1); ylabel('Current (A)');
56+
sub_h(2) = subplot(3,1,2); ylabel('Current (A)');
57+
sub_h(3) = subplot(3,1,3); ylabel('Current (A)'); xlabel('Time (s)');
58+
linkaxes(sub_h,'x'); clear sub_h
4359

44-
plot_HEV_Data(4,[2 1 1],'Generator',3,1,'Generator Torque',VarSetStr);
45-
plot_HEV_Data(4,[2 1 2],'Motor',3,1,'Motor Torque',VarSetStr);
60+
plot_HEV_Data(5,[2 1 1],'Generator',3,1,'Generator Torque',VarSetStr);
61+
plot_HEV_Data(5,[2 1 2],'Motor',3,1,'Motor Torque',VarSetStr);
62+
sub_h(1) = subplot(2,1,1); ylabel('Torque (Nm)');
63+
sub_h(2) = subplot(2,1,2); ylabel('Torque (Nm)'); xlabel('Time (s)');
64+
linkaxes(sub_h,'x'); clear sub_h
4665

4766
%{
4867
plot_HEV_Data(6,[2 1 1],'Electrical',2,2,'Battery Voltage',VarSetStr);

Diff for: Scripts_Data/HEVPS_setupRTtest.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
% Copyright 2014-2019 The MathWorks(TM), Inc.
2-
Select_HEV_Model_Systems('Sys BC VS',HEV_Configs);
2+
Select_HEV_Model_Systems(mdl,'Sys BC VS',HEV_Configs);
33
set_param([mdl '/Vehicle Dynamics/Simple'],'LinkStatus','inactive')
44
HEV_Vehicle_Mass = 1600;
55
set_param([mdl '/Vehicle Dynamics/Simple'],'mass','HEV_Vehicle_Mass');

Diff for: Scripts_Data/HEVSP_setrealtime.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
tvar_Nonlinear_Iterations = '3';
44
tvar_StepSize = '0.005';
5-
Select_HEV_Model_Systems('Sys BC VS',HEV_Configs);
5+
Select_HEV_Model_Systems(mdl,'Sys BC VS',HEV_Configs);
66
tvar_LocalSolver = 'NE_BACKWARD_EULER_ADVANCER';
77

88
% Do not run script that autoconfigures solver settings based on variants

Diff for: Scripts_Data/HEV_MODEL_TestManager.mldatx

19.4 KB
Binary file not shown.

Diff for: Scripts_Data/HEV_Model_Demo_Script.html

+16-14
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<!--
77
This HTML was auto-generated from MATLAB code.
88
To make changes, update the MATLAB code and republish this document.
9-
--><title>HEV Model Demo Script</title><meta name="generator" content="MATLAB 9.6"><link rel="schema.DC" href="http://purl.org/dc/elements/1.1/"><meta name="DC.date" content="2019-03-05"><meta name="DC.source" content="HEV_Model_Demo_Script.m"><style type="text/css">
9+
--><title>HEV Model Demo Script</title><meta name="generator" content="MATLAB 9.7"><link rel="schema.DC" href="http://purl.org/dc/elements/1.1/"><meta name="DC.date" content="2019-09-15"><meta name="DC.source" content="HEV_Model_Demo_Script.m"><style type="text/css">
1010
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}
1111

1212
html { min-height:100%; margin-bottom:1px; }
@@ -72,19 +72,20 @@
7272
<tr><b><u>Model</u></b><br>
7373
<tr>1. <a href="matlab:open_system('HEV_SeriesParallel');">Open HEV Model</a><br>
7474
<tr>2. <a href="matlab:Test_HEV_Model_SHORT;">Run Drive Cycles</a><br>
75-
<tr>3. <a href="matlab:cd([HEV_Model_HomeDir '/Fuel_Consumption']);edit Create_Fuel_Consumption_LUT;">Estimate Fuel Economy With Measured Data</a><br>
75+
<tr>3. <a href="matlab:cd(fileparts(which('Create_Fuel_Consumption_LUT.m')));edit Create_Fuel_Consumption_LUT;">Estimate Fuel Economy With Measured Data</a><br>
7676
<br>
7777
<tr><b><u>Simulate</u></b><br>
78-
<tr>4. <a href="matlab:cd([HEV_Model_HomeDir '/PCT']);edit HEV_Model_PCT_Sim;HEV_SeriesParallel;">Distribute Simulations Using Parallel Computing</a><br>
79-
<tr>5. Analyze and Document: <a href="matlab:open('HEV_Model_Report_SHORT.html');">View Report</a>, <a href="matlab:cd([HEV_Model_HomeDir '/Reports']);open('HEV_Model_Report_SHORT.rpt');">Generate Report</a><br>
80-
<tr>6. Power Quality Plots: <a href="matlab:edit DC_Power_Quality_Analysis;">Create Plots</a><br>
78+
<tr>4. <a href="matlab:cd(fileparts(which('HEV_Model_PCT_Sim.m')));edit HEV_Model_PCT_Sim;HEV_SeriesParallel;">Distribute Simulations Using Parallel Computing</a><br>
79+
<tr>5. Test and Analyze <a href="matlab:open('HEV_MODEL_TestManager.mldatx');">Test Case Management</a><br>
80+
<tr>6. Document: <a href="matlab:open('HEV_Model_Report_SHORT.html');">View Report</a>, <a href="matlab:cd(fileparts(which('HEV_Model_Report_SHORT.rpt')));open('HEV_Model_Report_SHORT.rpt');">Generate Report</a><br>
81+
<tr>7. Power Quality Plots: <a href="matlab:edit DC_Power_Quality_Analysis;">Create Plots</a><br>
8182
<br>
8283
<tr><b><u>Deploy</u></b><br>
83-
<tr>7. <a href="matlab:cd([HEV_Model_HomeDir '/Local_Solver']);edit Test_RT_Model">Improve Simulation Performance With Local Solvers</a><br>
84-
<tr>8. <a href="matlab:cd([HEV_Model_HomeDir '/RSIM']);edit HEV_Model_RSIM">Deploy Simulation As a Standalone Executable</a><br>
84+
<tr>8. <a href="matlab:cd(fileparts(which('Test_RT_Model.m')));edit Test_RT_Model">Improve Simulation Performance With Local Solvers</a><br>
85+
<tr>9. <a href="matlab:cd(fileparts(which('HEV_Model_RSIM.m')));edit HEV_Model_RSIM">Deploy Simulation As a Standalone Executable</a><br>
8586
</style>
8687
</style>
87-
</p><p>Copyright 2011-2019 The MathWorks&#8482;, Inc.</p><p class="footer"><br><a href="https://www.mathworks.com/products/matlab/">Published with MATLAB&reg; R2019a</a><br></p></div><!--
88+
</p><p>Copyright 2011-2019 The MathWorks&#8482;, Inc.</p><p class="footer"><br><a href="https://www.mathworks.com/products/matlab/">Published with MATLAB&reg; R2019b</a><br></p></div><!--
8889
##### SOURCE BEGIN #####
8990
%% HEV Model Demo Script
9091
%
@@ -94,16 +95,17 @@
9495
% <tr><b><u>Model</u></b><br>
9596
% <tr>1. <a href="matlab:open_system('HEV_SeriesParallel');">Open HEV Model</a><br>
9697
% <tr>2. <a href="matlab:Test_HEV_Model_SHORT;">Run Drive Cycles</a><br>
97-
% <tr>3. <a href="matlab:cd([HEV_Model_HomeDir '/Fuel_Consumption']);edit Create_Fuel_Consumption_LUT;">Estimate Fuel Economy With Measured Data</a><br>
98+
% <tr>3. <a href="matlab:cd(fileparts(which('Create_Fuel_Consumption_LUT.m')));edit Create_Fuel_Consumption_LUT;">Estimate Fuel Economy With Measured Data</a><br>
9899
% <br>
99100
% <tr><b><u>Simulate</u></b><br>
100-
% <tr>4. <a href="matlab:cd([HEV_Model_HomeDir '/PCT']);edit HEV_Model_PCT_Sim;HEV_SeriesParallel;">Distribute Simulations Using Parallel Computing</a><br>
101-
% <tr>5. Analyze and Document: <a href="matlab:open('HEV_Model_Report_SHORT.html');">View Report</a>, <a href="matlab:cd([HEV_Model_HomeDir '/Reports']);open('HEV_Model_Report_SHORT.rpt');">Generate Report</a><br>
102-
% <tr>6. Power Quality Plots: <a href="matlab:edit DC_Power_Quality_Analysis;">Create Plots</a><br>
101+
% <tr>4. <a href="matlab:cd(fileparts(which('HEV_Model_PCT_Sim.m')));edit HEV_Model_PCT_Sim;HEV_SeriesParallel;">Distribute Simulations Using Parallel Computing</a><br>
102+
% <tr>5. Test and Analyze <a href="matlab:open('HEV_MODEL_TestManager.mldatx');">Test Case Management</a><br>
103+
% <tr>6. Document: <a href="matlab:open('HEV_Model_Report_SHORT.html');">View Report</a>, <a href="matlab:cd(fileparts(which('HEV_Model_Report_SHORT.rpt')));open('HEV_Model_Report_SHORT.rpt');">Generate Report</a><br>
104+
% <tr>7. Power Quality Plots: <a href="matlab:edit DC_Power_Quality_Analysis;">Create Plots</a><br>
103105
% <br>
104106
% <tr><b><u>Deploy</u></b><br>
105-
% <tr>7. <a href="matlab:cd([HEV_Model_HomeDir '/Local_Solver']);edit Test_RT_Model">Improve Simulation Performance With Local Solvers</a><br>
106-
% <tr>8. <a href="matlab:cd([HEV_Model_HomeDir '/RSIM']);edit HEV_Model_RSIM">Deploy Simulation As a Standalone Executable</a><br>
107+
% <tr>8. <a href="matlab:cd(fileparts(which('Test_RT_Model.m')));edit Test_RT_Model">Improve Simulation Performance With Local Solvers</a><br>
108+
% <tr>9. <a href="matlab:cd(fileparts(which('HEV_Model_RSIM.m')));edit HEV_Model_RSIM">Deploy Simulation As a Standalone Executable</a><br>
107109
% </style>
108110
% </style>
109111
% </html>

Diff for: Scripts_Data/HEV_Model_Demo_Script.m

+7-6
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,17 @@
66
% <tr><b><u>Model</u></b><br>
77
% <tr>1. <a href="matlab:open_system('HEV_SeriesParallel');">Open HEV Model</a><br>
88
% <tr>2. <a href="matlab:Test_HEV_Model_SHORT;">Run Drive Cycles</a><br>
9-
% <tr>3. <a href="matlab:cd([HEV_Model_HomeDir '/Fuel_Consumption']);edit Create_Fuel_Consumption_LUT;">Estimate Fuel Economy With Measured Data</a><br>
9+
% <tr>3. <a href="matlab:cd(fileparts(which('Create_Fuel_Consumption_LUT.m')));edit Create_Fuel_Consumption_LUT;">Estimate Fuel Economy With Measured Data</a><br>
1010
% <br>
1111
% <tr><b><u>Simulate</u></b><br>
12-
% <tr>4. <a href="matlab:cd([HEV_Model_HomeDir '/PCT']);edit HEV_Model_PCT_Sim;HEV_SeriesParallel;">Distribute Simulations Using Parallel Computing</a><br>
13-
% <tr>5. Analyze and Document: <a href="matlab:open('HEV_Model_Report_SHORT.html');">View Report</a>, <a href="matlab:cd([HEV_Model_HomeDir '/Reports']);open('HEV_Model_Report_SHORT.rpt');">Generate Report</a><br>
14-
% <tr>6. Power Quality Plots: <a href="matlab:edit DC_Power_Quality_Analysis;">Create Plots</a><br>
12+
% <tr>4. <a href="matlab:cd(fileparts(which('HEV_Model_PCT_Sim.m')));edit HEV_Model_PCT_Sim;HEV_SeriesParallel;">Distribute Simulations Using Parallel Computing</a><br>
13+
% <tr>5. Test and Analyze <a href="matlab:open('HEV_MODEL_TestManager.mldatx');">Test Case Management</a><br>
14+
% <tr>6. Document: <a href="matlab:open('HEV_Model_Report_SHORT.html');">View Report</a>, <a href="matlab:cd(fileparts(which('HEV_Model_Report_SHORT.rpt')));open('HEV_Model_Report_SHORT.rpt');">Generate Report</a><br>
15+
% <tr>7. Power Quality Plots: <a href="matlab:edit DC_Power_Quality_Analysis;">Create Plots</a><br>
1516
% <br>
1617
% <tr><b><u>Deploy</u></b><br>
17-
% <tr>7. <a href="matlab:cd([HEV_Model_HomeDir '/Local_Solver']);edit Test_RT_Model">Improve Simulation Performance With Local Solvers</a><br>
18-
% <tr>8. <a href="matlab:cd([HEV_Model_HomeDir '/RSIM']);edit HEV_Model_RSIM">Deploy Simulation As a Standalone Executable</a><br>
18+
% <tr>8. <a href="matlab:cd(fileparts(which('Test_RT_Model.m')));edit Test_RT_Model">Improve Simulation Performance With Local Solvers</a><br>
19+
% <tr>9. <a href="matlab:cd(fileparts(which('HEV_Model_RSIM.m')));edit HEV_Model_RSIM">Deploy Simulation As a Standalone Executable</a><br>
1920
% </style>
2021
% </style>
2122
% </html>

0 commit comments

Comments
 (0)