Skip to content

Commit 441ca41

Browse files
authored
Further isolation of features including signal design, model set up, and test files (#42)
1 parent 2f71997 commit 441ca41

File tree

2,453 files changed

+114596
-84931
lines changed

Some content is hidden

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

2,453 files changed

+114596
-84931
lines changed

.gitignore

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,45 @@
22
#
33
# Copyright 2020-2025 The MathWorks, Inc.
44

5-
*.js
6-
75
*.pdf
86
*.pptx
97

10-
*.asv
118
*.mldatx
12-
*.slxc
139

14-
sfprj/
10+
# Autosave files
11+
*.asv
12+
*.m~
13+
*.autosave
14+
*.slx.r*
15+
*.mdl.r*
16+
17+
# Derived content-obscured files
18+
*.p
19+
20+
# Compiled MEX files
21+
*.mex*
22+
23+
# Packaged app and toolbox files
24+
*.mlappinstall
25+
*.mltbx
26+
27+
# Deployable archives
28+
*.ctf
29+
30+
# Generated helpsearch folders
31+
helpsearch*/
32+
33+
# Code generation folders
1534
slprj/
35+
sccprj/
36+
codegen/
37+
sfprj/
38+
39+
# Cache files
40+
*.slxc
41+
42+
# Cloud based storage dotfile
43+
.MATLABDriveTag
1644

1745
# The Build Tool creates the .buildtool folder, which git must ignore.
1846
# See the documentation about Cache Folder in MATLAB Incremental Builds.
@@ -22,6 +50,14 @@ slprj/
2250
# The Buildfile.m files in this project are configured to save results in the test-result folder, which git must ignore.
2351
test-result/
2452

53+
# Profiling simulation with Solver Profiler leaves the session data in a mat file.
54+
# It can be easily produced by running a profiling simulation.
55+
# https://www.mathworks.com/help/simulink/slref/solverprofiler.profilemodel.html
56+
#
57+
# The name of the session data file is arbitrary.
58+
# In this project, it is assumed to be "profiling_data.mat".
59+
profiling_data.mat
60+
2561
screenshot-test-*.png
2662
screenshot-untitled.png
2763
untitled.m

BEV/BEV_main_script.html

Lines changed: 7 additions & 9 deletions
Large diffs are not rendered by default.

BEV/BEV_main_script.m

Lines changed: 109 additions & 102 deletions
Large diffs are not rendered by default.

BEV/BEV_setup.m

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
%% Model Parameters for Battery Electric Vehicle System Model
2-
% This is automatically run in the PostLoadFcn callback of BEV_system_model
3-
% and sets referenced subsystems.
4-
% Note that the callback is not PreLoadFcn but PostLoadFcn
5-
% because the model needs to be loaded before setting referenced subsystems.
1+
%% Model Parameters for the Battery Electric Vehicle (BEV) system model.
62
%
7-
% Informational messages from disp are turned off to prevent
8-
% the warnings/diagnostics from appearing when the model is opened.
3+
% This script defines parameters for the BEV model.
4+
% Use this script to load default values.
5+
% Override any of them elsewhere later as needed.
6+
%
7+
% The BEV_system_model automatically runs this script in the PostLoadFcn callback.
98

10-
% Copyright 2020-2023 The MathWorks, Inc.
9+
% Copyright 2020-2025 The MathWorks, Inc.
1110

1211
%% Bus definitions
1312

BEV/BEV_system_model.mdl

Lines changed: 366 additions & 373 deletions
Large diffs are not rendered by default.

BEV/Model-Basic/BEV_setBasic.m

Lines changed: 0 additions & 36 deletions
This file was deleted.

BEV/Model-Basic/BEV_setup_Basic.m

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
function BEV_setup_Basic(NameValuePair)
2+
% Use Basic models for all components.
3+
%
4+
% Set up the BEV system model with all Basic components.
5+
6+
% Copyright 2021-2025 The MathWorks, Inc.
7+
8+
arguments (Input)
9+
NameValuePair.ModelName {mustBeTextScalar} = "BEV_system_model"
10+
NameValuePair.DisplayMessage logical = true
11+
end % arguments
12+
13+
model_name = NameValuePair.ModelName;
14+
15+
load_system(model_name)
16+
17+
if NameValuePair.DisplayMessage
18+
disp("Use Basic models for all components.")
19+
end % if
20+
21+
set_param(model_name + "/Longitudinal Vehicle", ReferencedSubsystem = "Vehicle1D_Basic_refsub");
22+
FileTool2.evalMFile("Vehicle1D_Basic_params")
23+
24+
set_param(model_name + "/High Voltage Battery", ReferencedSubsystem = "BatteryHV_Basic_refsub");
25+
FileTool2.evalMFile("BatteryHV_Basic_params")
26+
27+
set_param(model_name + "/Motor Drive Unit", ReferencedSubsystem = "MotorDriveUnit_Basic_refsub");
28+
FileTool2.evalMFile("MotorDriveUnit_Basic_params")
29+
30+
set_param(model_name + "/Reduction Gear", ReferencedSubsystem = "Reducer_Basic_refsub");
31+
FileTool2.evalMFile("Reducer_Basic_params")
32+
33+
set_param(model_name + "/Controller and Environment/BEV Controller", ReferencedSubsystem = "BEVController_Basic_refsub");
34+
FileTool2.evalMFile("BEVController_Basic_params")
35+
36+
end % function

BEV/Model-Basic/SimulationCases/BEV_Basic_Constant.m

Lines changed: 23 additions & 15 deletions
Large diffs are not rendered by default.

BEV/Model-Basic/SimulationCases/BEV_Basic_FTP75.m

Lines changed: 22 additions & 14 deletions
Large diffs are not rendered by default.

BEV/Model-Basic/SimulationCases/BEV_Basic_HighSpeed.m

Lines changed: 23 additions & 15 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)