Skip to content

Commit 2804dab

Browse files
committed
Update to 1.1.
1 parent 0768f08 commit 2804dab

26 files changed

+209
-8
lines changed

.gitlab-ci.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# GitLab CI configuration file
2+
3+
# Copyright 2021 The MathWorks, Inc.
4+
5+
test:
6+
stage: test
7+
tags:
8+
- matlab_win64
9+
script:
10+
- mw -using R2021a matlab -batch "openProject('HybridElectricVehicle.prj'); HEV_RunTests;"
11+
cache:
12+
paths:
13+
- /*.slxc
14+
artifacts:
15+
paths:
16+
- testReport.pdf
17+
- testResults.xml
18+
when: always
19+
reports:
20+
junit: testResults.xml

Components/DrivingPatternBasic/DrivingPatternBasic_inputs.m

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
'accelerate_decelerate_kph' ...
1414
'accelerate_decelerate_mph' ...
1515
'simple_drive_pattern' ...
16+
'simple_slow_drive_pattern' ...
1617
'ftp75_mph' ...
1718
})} = 'all_zero'
1819
nvpairs.TimeStep (1,1) double {mustBePositive} = 0.1
@@ -250,6 +251,33 @@
250251
inputBus.Elements(2).Name = 'VehAccRef';
251252
inputBus.Elements(2).Unit = 'm/s^2';
252253

254+
case 'simple_slow_drive_pattern'
255+
t_end = 200;
256+
% Define signal trace:
257+
VehSpdRef = timetable([0 0 0 20 20 20 20 30 30 30 30 10 10 10 10 0 0 0 0 25 25 25 35 35 35 45 45 45 45 30 30 30 30 15 15 15 15 0 0 0]', ...
258+
'RowTimes',seconds([0 9.5 10 15 15.5 19.5 20 25 25.5 29.5 30 35 35.5 39.5 40 45 45.5 49.5 50 58 58.5 59 65 65.5 66 85 85.5 89.5 90 110 110.5 119.5 120 150 150.5 159.5 160 190 190.5 t_end])');
259+
% Make the signal trace smooth using Akima interpolation:
260+
VehSpdRef = retime(VehSpdRef, 'regular','makima', 'TimeStep',seconds(dt));
261+
% Remove the negative wiggle:
262+
VehSpdRef.Var1(VehSpdRef.Var1 < 0) = 0;
263+
% Calculate the acceleration:
264+
tmp = diff(VehSpdRef.Var1)/dt * 1000/3600; % (km/hr)/s to m/s^2 conversion
265+
VehAccRef = timetable([tmp; tmp(end)], 'RowTimes',VehSpdRef.Time);
266+
inputSignals.VehSpdRef = VehSpdRef;
267+
inputSignals.VehSpdRef.Properties.VariableNames = {'VehSpdRef'};
268+
inputSignals.VehSpdRef.Properties.VariableUnits = {'km/hr'};
269+
inputSignals.VehSpdRef.Properties.VariableContinuity = {'continuous'};
270+
inputSignals.VehAccRef = VehAccRef;
271+
inputSignals.VehAccRef.Properties.VariableNames = {'VehAccRef'};
272+
inputSignals.VehAccRef.Properties.VariableUnits = {'m/s^2'};
273+
inputSignals.VehAccRef.Properties.VariableContinuity = {'continuous'};
274+
inputBus.Elements(1) = Simulink.BusElement;
275+
inputBus.Elements(1).Name = 'VehSpdRef';
276+
inputBus.Elements(1).Unit = 'km/hr';
277+
inputBus.Elements(2) = Simulink.BusElement;
278+
inputBus.Elements(2).Name = 'VehAccRef';
279+
inputBus.Elements(2).Unit = 'm/s^2';
280+
253281
case 'ftp75_mph'
254282
opt.useFromWorkspace = false; % Use another source
255283
opt.useKph = false;
1.01 KB
Binary file not shown.
Binary file not shown.

HEV_main_script.mlx

91 Bytes
Binary file not shown.

README.md

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![View Hybrid Electric Vehicle Model in Simscape on File Exchange](https://www.mathworks.com/matlabcentral/images/matlab-file-exchange.svg)](https://www.mathworks.com/matlabcentral/fileexchange/92820-hybrid-electric-vehicle-model-in-simscape)
44

5-
Version 1
5+
Version 1.1
66

77
Copyright 2021 The MathWorks, Inc.
88

@@ -56,7 +56,7 @@ some components come with their own test setups.
5656

5757
## Tool Requirements
5858

59-
Supported MATLAB version: R2020b or newer releases
59+
Supported MATLAB version: R2021a or newer releases
6060

6161
Required:
6262
[MATLAB](https://www.mathworks.com/products/matlab.html),
@@ -67,6 +67,29 @@ Required:
6767
[Simscape Driveline&trade;](https://www.mathworks.com/products/simscape-driveline.html),
6868
[Simscape Electrical&trade;](https://www.mathworks.com/products/simscape-electrical.html)
6969

70+
Optional:
71+
[Parallel Computing Toolbox&trade;](https://www.mathworks.com/products/parallel-computing.html)
72+
73+
## What's New in Version 1.1
74+
75+
### Highlights
76+
77+
Parameter Sweep Workflow in Live Script
78+
79+
- Demonstrates how to investigate the effect of reduction gear ratio,
80+
high-voltage battery capacity and high-voltage battery weight
81+
on the electrical efficiency.
82+
You can optionally use Parallel Computing Toolbox to shorten
83+
total simulation time.
84+
- Watch [YouTube video](https://www.youtube.com/watch?v=cbo83A8K_4w)
85+
showing the workflow as well as real-time application.
86+
- Real-Time application presented in the video will be added
87+
to this project in future updates.
88+
89+
### Other Updates
90+
91+
- MATLAB R2021a or newer release is required.
92+
7093
## How to Use
7194

7295
Open `HybridElectricVehicle.prj` in MATLAB, and
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version='1.0' encoding='UTF-8'?>
2+
<Info>
3+
<Category UUID="FileClassCategory">
4+
<Label UUID="design" />
5+
</Category>
6+
</Info>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<?xml version='1.0' encoding='UTF-8'?>
2+
<Info location="PowerSplitHEV_SpeedTracking_sweep.mlx" type="File" />
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<?xml version='1.0' encoding='UTF-8'?>
2+
<Info Ref="test" Type="Relative" />
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<?xml version='1.0' encoding='UTF-8'?>
2+
<Info location="080bba62-92f7-4760-9f82-ad1d6d284941" type="Reference" />

0 commit comments

Comments
 (0)