Skip to content

Commit

Permalink
Generate new Markdown files from Live scripts in R2024b.
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacito12 committed Nov 19, 2024
1 parent 84dc873 commit d0243b2
Show file tree
Hide file tree
Showing 137 changed files with 4,792 additions and 4,201 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
command: openProject(pwd); buildtool CodeIssues CheckProject Test

- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v2
uses: github/codeql-action/upload-sarif@v3
if: always()
with:
sarif_file: cache/buildtool-results/code-issues.sarif
Expand Down
Binary file modified BEV/BEV_main_script.mlx
Binary file not shown.
915 changes: 460 additions & 455 deletions BEV/BEV_system_model.mdl

Large diffs are not rendered by default.

Binary file modified BEV/SimulationCases/BEV_Case_Constant_Basic.mlx
Binary file not shown.
Binary file modified BEV/SimulationCases/BEV_Case_Constant_Thermal.mlx
Binary file not shown.
Binary file modified BEV/SimulationCases/BEV_Case_FTP75_Basic.mlx
Binary file not shown.
Binary file modified BEV/SimulationCases/BEV_Case_HighSpeed_Basic.mlx
Binary file not shown.
Binary file modified BEV/SimulationCases/BEV_Case_SimpleDrivePattern_Basic.mlx
Binary file not shown.
Binary file modified BEV/SimulationCases/BEV_Case_SimpleDrivePattern_Thermal.mlx
Binary file not shown.
75 changes: 0 additions & 75 deletions BEV/markdown/BEVProject_main_script.md

This file was deleted.

2 changes: 1 addition & 1 deletion BEV/markdown/BEV_Case_Constant_Basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ VehSpdRef_loadCase_Constant( ...
Setting up simulation...
Simulation case: Constant
Setting simulation stop time to 1000 sec.
Selecting simulation case 5.
Selecting simulation case 4.
```

```matlab
Expand Down
3 changes: 1 addition & 2 deletions BEV/markdown/BEV_Case_Constant_Thermal.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ BEV_useComponents_Thermal

```matlabTextOutput
Use thermal models for Motor Drive Unit and High Voltage Battery components.
Warning: BatteryHV_refsub_SystemSimple (systems/system_root.xml, line 342): Simulink.DataType object 'Bus_HighVoltage' is not in scope from 'BatteryHV_refsub_SystemSimple/Simscape Bus'
```

```matlab
Expand All @@ -24,7 +23,7 @@ VehSpdRef_loadCase_Constant( ...
Setting up simulation...
Simulation case: Constant
Setting simulation stop time to 1000 sec.
Selecting simulation case 5.
Selecting simulation case 4.
```

```matlab
Expand Down
38 changes: 0 additions & 38 deletions BEV/markdown/BEV_Case_WLTP_Basic.md

This file was deleted.

22 changes: 7 additions & 15 deletions BEV/markdown/BEV_main_script.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@

<a name="T_0F8BC05C"></a>

# <span style="color:rgb(213,80,0)">Battery Electric Vehicle (BEV) System Level Model</span>
<a name="beginToc"></a>

## Table of Contents
[Introduction](#H_A0C28D4F)
&emsp;[Introduction](#introduction)

[Run Simulation](#H_EC484CEF)
&emsp;[Run Simulation](#run-simulation)

[Save Result](#H_EF7BCF44)
&emsp;[Save Result](#save-result)

[Analyse Result](#H_81E3C32A)
&emsp;[Analyse Result](#analyse-result)

<a name="endToc"></a>
<a name="H_A0C28D4F"></a>

# Introduction

Expand All @@ -29,8 +26,6 @@ This script shows an example workflow to programmatically open model, run simula

You can find more scripts demonstrating other simulation cases in the **SimulationCases** folder.

<a name="H_EC484CEF"></a>

# Run Simulation

This section sets up the model and runs simulation. To run this script at once, navigate Toolstrip > Live Editor tab, and click "Run" button. You can also run this section only by clicking "Run Section" button.
Expand Down Expand Up @@ -85,7 +80,6 @@ exportgraphics(fig, fullfile(prjRoot, "BEV", "results", imgFilename))

<center><img src="media/BEV_main_script_media/figure_0.png" width="702" alt="figure_0.png"></center>

<a name="H_EF7BCF44"></a>

# Save Result

Expand Down Expand Up @@ -136,8 +130,6 @@ writetimetable(simData, simResultFile_FullPath)

Open the saved CSV file in text editor and check that the variable names are saved at the first line as expected.

<a name="H_81E3C32A"></a>

# Analyse Result

This section reads a simulation result CSV file which was saved in the previous section, and do some analysis on the data. This section should work independently without running the previous section as long as the result file exists. At the end of this section, you get the electric efficiency of the vehicle according to the drive cycle for which the data was collected.
Expand Down Expand Up @@ -216,7 +208,7 @@ averageSpeed = sum(vehicleSpeed)/numel(vehicleSpeed)

```matlabTextOutput
averageSpeed =
37.4561 (km/hr)
37.4472 (km/hr)
```

Expand Down Expand Up @@ -264,7 +256,7 @@ batteryEnergyUsed = sum(batteryPower(2:end).*dt)

```matlabTextOutput
batteryEnergyUsed =
518.2202 (kW*s)
518.2258 (kW*s)
```

Expand All @@ -283,7 +275,7 @@ energyEfficiency_kWh_per_100km = 100 * value(batteryEnergyUsed / travelledDistan
```

```matlabTextOutput
energyEfficiency_kWh_per_100km = 14.9538
energyEfficiency_kWh_per_100km = 14.9539
```

*Copyright 2022\-2024 The MathWorks, Inc.*
Expand Down
Binary file not shown.
Binary file not shown.
Binary file modified BEV/markdown/media/BEV_Case_Constant_Basic_media/figure_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified BEV/markdown/media/BEV_Case_Constant_Thermal_media/figure_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified BEV/markdown/media/BEV_Case_FTP75_Basic_media/figure_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified BEV/markdown/media/BEV_Case_HighSpeed_Basic_media/figure_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file modified BEV/markdown/media/BEV_main_script_media/figure_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified BEV/results/BEV_SimulationResultPlot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 12 additions & 10 deletions BEVProject_main_script.html

Large diffs are not rendered by default.

Binary file modified BEVProject_main_script.mlx
Binary file not shown.
Loading

0 comments on commit d0243b2

Please sign in to comment.