Skip to content

Commit 1d5f156

Browse files
committed
Update R2024b
1 parent 4af4c4b commit 1d5f156

File tree

177 files changed

+419
-268
lines changed

Some content is hidden

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

177 files changed

+419
-268
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# **Optimizing Vehicle Design Using AI and Simscape™**
2-
Copyright 2024 The MathWorks, Inc.
2+
Copyright 2025 The MathWorks, Inc.
33

44
This example shows the workflow to create a surrogate AI model using
55
training data from a multibody model of a vehicle. The resulting AI
@@ -15,6 +15,9 @@ the optimal design parameters.
1515

1616
Open the project file SSVT_Susp_Opt.prj to get started.
1717

18+
View on File Exchange: [![View Wheel Loader Design with Simscape on File Exchange](https://www.mathworks.com/matlabcentral/images/matlab-file-exchange.svg)](https://www.mathworks.com/matlabcentral/fileexchange/180114-optimize-vehicle-design-with-ai-and-simscape)
19+
You can also open in MATLAB Online: [![Open in MATLAB Online](https://www.mathworks.com/images/responsive/global/open-in-matlab-online.svg)](https://matlab.mathworks.com/open/github/v1?repo=simscape/Optimize-Vehicle-Design-with-AI-and-Simscape&project=SSVT_Susp_Opt.prj)
20+
1821
## **Vehicle Model**
1922

2023
**Simscape Multibody is used to model the vehicle**. The multibody model has
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
web('Vehicle_Design_Opt_with_AI_Overview.html')
20 Bytes
Binary file not shown.

Workflows/01_Define_Metric/html/suspOpt_sweep_param_limits.html

Lines changed: 40 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<title>Create Virtual Test with Performance Metrics</title>
1010
<meta name="generator" content="MATLAB 24.2">
1111
<link rel="schema.DC" href="http://purl.org/dc/elements/1.1/">
12-
<meta name="DC.date" content="2025-02-07">
12+
<meta name="DC.date" content="2025-02-11">
1313
<meta name="DC.source" content="suspOpt_sweep_param_limits.m">
1414
<style type="text/css">
1515
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,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}
@@ -78,51 +78,55 @@
7878
<div class="content">
7979
<h1>Create Virtual Test with Performance Metrics</h1>
8080
<!--introduction-->
81-
<p>This example individually tests the vehicle model with one parameter value set to one of its range limits. This simple sweep ensures that</p>
82-
<div>
83-
<ul>
84-
<li>Parameter values are modified in parallel simulations without recompiling</li>
85-
<li>Tests at parameter limits do not result in invalid tests (locked wheels, etc.)</li>
86-
<li>Performance metrics are calculated properly</li>
87-
</ul>
88-
</div>
89-
<p>A simple measure of the sensitivity to each metric is calculated by measuring the percent change in the performance metric as the parameter value is set to its limits. A more robust evaluation of the performance metric would require a design of experiments to test a distribution of the parameters.</p>
90-
<p>
91-
<img vspace="5" hspace="5" src="suspOpt_Workflow_Define_Metrics.png" alt=""> </p>
92-
<p>The code used to create this documentation is here: <a href="matlab:edit('suspOpt_sweep_param_limits.m');">suspOpt_sweep_param_limits.m</a>
93-
</p>
94-
<p>(<a href="matlab:web('Vehicle_Design_Opt_with_AI_Overview.html')">return to Optimizing Vehicle Design Using AI and Simscape Overview</a>)</p>
9581
<!--/introduction-->
9682
<h2>Contents</h2>
9783
<div>
9884
<ul>
9985
<li>
100-
<a href="#1">Open Vehicle Model</a>
86+
<a href="#1">Overview</a>
87+
</li>
88+
<li>
89+
<a href="#2">Open Vehicle Model</a>
10190
</li>
10291
<li>
103-
<a href="#3">Generate Table of Design Parameters</a>
92+
<a href="#4">Generate Table of Design Parameters</a>
10493
</li>
10594
<li>
106-
<a href="#4">Create Simulation Input Objects to Test Range Limits</a>
95+
<a href="#5">Create Simulation Input Objects to Test Range Limits</a>
10796
</li>
10897
<li>
109-
<a href="#5">Run Simulations Using Parallel Computing</a>
98+
<a href="#6">Run Simulations Using Parallel Computing</a>
11099
</li>
111100
<li>
112-
<a href="#6">Check Run Validity</a>
101+
<a href="#7">Check Run Validity</a>
113102
</li>
114103
<li>
115-
<a href="#7">Extract Performance Metrics</a>
104+
<a href="#8">Extract Performance Metrics</a>
116105
</li>
117106
<li>
118-
<a href="#9">Identify Sensitive Values Based on Variance Threshold</a>
107+
<a href="#10">Identify Sensitive Values Based on Variance Threshold</a>
119108
</li>
120109
<li>
121-
<a href="#10">Identify Top 10 Parameters Based on Variance Only</a>
110+
<a href="#11">Identify Top 10 Parameters Based on Variance Only</a>
122111
</li>
123112
</ul>
124113
</div>
125-
<h2 id="1">Open Vehicle Model</h2>
114+
<h2 id="1">Overview</h2>
115+
<p>This example individually tests the vehicle model with one parameter value set to one of its range limits. This simple sweep ensures that</p>
116+
<div>
117+
<ul>
118+
<li>Parameter values are modified in parallel simulations without recompiling</li>
119+
<li>Tests at parameter limits do not result in invalid tests (locked wheels, etc.)</li>
120+
<li>Performance metrics are calculated properly</li>
121+
</ul>
122+
</div>
123+
<p>A simple measure of the sensitivity to each metric is calculated by measuring the percent change in the performance metric as the parameter value is set to its limits. A more robust evaluation of the performance metric would require a design of experiments to test a distribution of the parameters.</p>
124+
<p>
125+
<img vspace="5" hspace="5" src="suspOpt_Workflow_Define_Metrics.png" alt=""> </p>
126+
<p>The code used to create this documentation is here: <a href="matlab:edit('suspOpt_sweep_param_limits.m');">suspOpt_sweep_param_limits.m</a>
127+
</p>
128+
<p>(<a href="matlab:web('Vehicle_Design_Opt_with_AI_Overview.html')">return to Optimizing Vehicle Design Using AI and Simscape Overview</a>)</p>
129+
<h2 id="2">Open Vehicle Model</h2>
126130
<p>Open model and load default parameters. The vehicle model is set up to perform a test in three stages.</p>
127131
<div>
128132
<ol>
@@ -138,7 +142,7 @@ <h2 id="1">Open Vehicle Model</h2>
138142
<p>
139143
<a href="matlab:open_system('sm_car_dlc_only');">Open Model</a>
140144
</p>
141-
<img vspace="5" hspace="5" src="suspOpt_sweep_param_limits_01.png" alt=""> <img vspace="5" hspace="5" src="suspOpt_sweep_param_limits_02.png" alt=""> <img vspace="5" hspace="5" src="suspOpt_sweep_param_limits_03.png" alt=""> <h2 id="3">Generate Table of Design Parameters</h2>
145+
<img vspace="5" hspace="5" src="suspOpt_sweep_param_limits_01.png" alt=""> <img vspace="5" hspace="5" src="suspOpt_sweep_param_limits_02.png" alt=""> <img vspace="5" hspace="5" src="suspOpt_sweep_param_limits_03.png" alt=""> <h2 id="4">Generate Table of Design Parameters</h2>
142146
<p>Adjusting the design requires selecting a set of design parameters to tune and setting ranges for those values. That set is defined in a table. For each parameter we specify:</p>
143147
<div>
144148
<ol>
@@ -262,7 +266,7 @@ <h2 id="1">Open Vehicle Model</h2>
262266
{'Ar_A2_AR_Stif'} {'Vehicle.Chassis.SuspA2.AntiRollBar.k.Value' } 1 true 40 60 50
263267

264268
</pre>
265-
<h2 id="4">Create Simulation Input Objects to Test Range Limits</h2>
269+
<h2 id="5">Create Simulation Input Objects to Test Range Limits</h2>
266270
<p>A suite of tests is defined using the table above. For each test, all parameters set to the default value and one parameter set to either of its range limits. The tests are created using a SimulationInput object so that the tests can be performed in series or parallel without modifying the original model. Parameter value changes and any model parameter setting overrides are applied temporarily during the test using the SimulationInput object.</p>
267271
<pre class="codeoutput">
268272
simInputFR =
@@ -281,14 +285,14 @@ <h2 id="4">Create Simulation Input Objects to Test Range Limits</h2>
281285
VariantConfiguration
282286

283287
</pre>
284-
<h2 id="5">Run Simulations Using Parallel Computing</h2>
288+
<h2 id="6">Run Simulations Using Parallel Computing</h2>
285289
<p>Using the parsim() command, the suite of tests is executed in parallel on multiple workers. Using Fast Restart, the model is only compiled once per worker. Because we have defined the design parameters as run-time parameters, we can modify their values even within the compiled model. This dramatically shortens the time it takes to execute the sweep.</p>
286290
<p>Progress is reported using the Simulation Manager. We can see if any warnings or errors have occurred during any of the tests and see how long each run has taken.</p>
287291
<pre class="codeoutput">Starting parallel pool (parpool) using the 'Processes' profile ...
288292
Connected to parallel pool with 4 workers.
289-
188 simulations completed in 745.5389 seconds.
293+
188 simulations completed in 728.8652 seconds.
290294
</pre>
291-
<h2 id="6">Check Run Validity</h2>
295+
<h2 id="7">Check Run Validity</h2>
292296
<p>The outputs of the test sweep are checked to make sure the runs are all valid. A test run is deemed invalid if any of the following thresholds are exceeded for an unacceptable period of time:</p>
293297
<div>
294298
<ol>
@@ -300,7 +304,7 @@ <h2 id="6">Check Run Validity</h2>
300304
<p>Plot show the values of the measurements for all the runs, and a count of the valid runs is displayed. If any run is invalid, we may need to reconsider our parameter ranges.</p>
301305
<pre class="codeoutput">Number of valid runs: 188
302306
</pre>
303-
<img vspace="5" hspace="5" src="suspOpt_sweep_param_limits_04.png" alt=""> <img vspace="5" hspace="5" src="suspOpt_sweep_param_limits_05.png" alt=""> <img vspace="5" hspace="5" src="suspOpt_sweep_param_limits_06.png" alt=""> <h2 id="7">Extract Performance Metrics</h2>
307+
<img vspace="5" hspace="5" src="suspOpt_sweep_param_limits_04.png" alt=""> <img vspace="5" hspace="5" src="suspOpt_sweep_param_limits_05.png" alt=""> <img vspace="5" hspace="5" src="suspOpt_sweep_param_limits_06.png" alt=""> <h2 id="8">Extract Performance Metrics</h2>
304308
<p>For all runs, performance metrics are calculated.</p>
305309
<div>
306310
<ol>
@@ -314,7 +318,7 @@ <h2 id="6">Check Run Validity</h2>
314318
</div>
315319
<p>The impact of the parameters on the performance metric are plotted. The plot shows (Metric with parameter at max value - Metric with parameter at min value)/(maximum observed performance metric value).</p>
316320
<p>This simple measure indicates how sensitive the metric is to the parameter value. A more rigorous sensitivity analysis should be performed to truly determine parameter sensitivity. The plots show that the design parameters have a relatively small impact on the braking distance.</p>
317-
<img vspace="5" hspace="5" src="suspOpt_sweep_param_limits_07.png" alt=""> <img vspace="5" hspace="5" src="suspOpt_sweep_param_limits_08.png" alt=""> <img vspace="5" hspace="5" src="suspOpt_sweep_param_limits_09.png" alt=""> <h2 id="9">Identify Sensitive Values Based on Variance Threshold</h2>
321+
<img vspace="5" hspace="5" src="suspOpt_sweep_param_limits_07.png" alt=""> <img vspace="5" hspace="5" src="suspOpt_sweep_param_limits_08.png" alt=""> <img vspace="5" hspace="5" src="suspOpt_sweep_param_limits_09.png" alt=""> <h2 id="10">Identify Sensitive Values Based on Variance Threshold</h2>
318322
<p>Based on the above result, we can see many parameters have a relatively small impact on the performance metrics. To limit the design space, we pick the parameters with the largest impact on the ride comfort and roll stability metrics and combine them into a single list.</p>
319323
<pre class="codeoutput">
320324
ans =
@@ -361,7 +365,7 @@ <h2 id="6">Check Run Validity</h2>
361365
{'HP_A2_Up_WCtz'} {'Vehicle.Chassis.SuspA2.Linkage.Upright.sWheelCentre.Value' } 3 true 0.28 0.38 0.33
362366

363367
</pre>
364-
<h2 id="10">Identify Top 10 Parameters Based on Variance Only</h2>
368+
<h2 id="11">Identify Top 10 Parameters Based on Variance Only</h2>
365369
<p>That list is then trimmed to a list of the 10 parameters for the remainder of our design space investigation. Working with only 10 parameters accelerates the process of exploring the design workflow.</p>
366370
<pre class="codeoutput">
367371
ans =
@@ -392,6 +396,8 @@ <h2 id="10">Identify Top 10 Parameters Based on Variance Only</h2>
392396
##### SOURCE BEGIN #####
393397
%% Create Virtual Test with Performance Metrics
394398
%
399+
400+
%% Overview
395401
% This example individually tests the vehicle model with one parameter
396402
% value set to one of its range limits. This simple sweep ensures that
397403
%
@@ -678,8 +684,8 @@ <h2 id="10">Identify Top 10 Parameters Based on Variance Only</h2>
678684
679685
%%
680686
681-
bdclose all
682-
close all
687+
%bdclose all
688+
%close all
683689
684690
##### SOURCE END #####
685691
-->
0 Bytes
Loading
100 Bytes
Loading
0 Bytes
Loading
0 Bytes
Loading
-144 Bytes
Loading
2 Bytes
Loading

0 commit comments

Comments
 (0)