@@ -68,7 +68,7 @@ solves the problem.
68
68
:alt: Metabolic efficiency example
69
69
:class: bg-primary
70
70
:align: center
71
- :scale : 80%
71
+ :width : 80%
72
72
```
73
73
74
74
The two pictures above both show the result of a parameter study. The
@@ -144,16 +144,16 @@ model view:
144
144
145
145
## Running the Optimization Study
146
146
147
- Select ` Main.OptStudy.Optimization ` from the operation dropdown, click the Run button,
148
- and ensure the model view is open. The model starts
149
- cycling and after a few rounds you will notice the saddle position changing,
150
- but not in a systematic grid like in the parameters study. What you will see
151
- is gradual changes back and forth in different directions until the changes
152
- wear off and the position converges.
147
+ Select ` Main.OptStudy.Optimization ` from the operation dropdown, click the Run
148
+ button, and ensure the model view is open. The model starts cycling and after a
149
+ few rounds you will notice the saddle position changing, but not in a systematic
150
+ grid like in the parameters study. What you will see is gradual changes back and
151
+ forth in different directions until the changes wear off and the position
152
+ converges.
153
153
154
154
Every time you see the left-most number changing in the Output window it is
155
155
an indication that the optimizer has picked a new optimization direction to try.
156
- You should see the number increasing in slow steps up to 4 before the process
156
+ You should see the number increasing in slow steps up to 6 before the process
157
157
stops and the system announces that it is finished. Please notice that the
158
158
changes of saddle position in the last several steps is very minute, which is
159
159
typical for optimization: the first steps bring large changes and large
@@ -171,10 +171,10 @@ with the Metabolism parameter study open? It should look like this:
171
171
172
172
If not, please run the ParamStudy again and plot the surface. When you
173
173
have this surface ready, please open another Chart window by clicking
174
- ` View ` ->\`\` Charts\`\` -> \`\` Chart2\`\ ` . In the new window, please expand the tree
175
- down to Main.OptStudy.Output.Metab. Then click the Val variable
174
+ ` View ` ->` Charts ` -> ` Chart2 ` . In the new window, please expand the tree
175
+ down to ` Main.OptStudy.Output.Metab ` . Then click the ` Val ` variable
176
176
under Metab. This produces a simple 2-D graph showing the development of
177
- the metabolism over the 4 iterations:
177
+ the metabolism over the 6 iterations:
178
178
179
179
``` {image} _static/Optimization_studies/metabcon2.png
180
180
:alt: Chart Opttudy 1
@@ -197,7 +197,6 @@ The optimal solution in the Model View looks like this:
197
197
198
198
``` {image} _static/Optimization_studies/bikeopt2.png
199
199
:alt: Final Model view
200
- :class: bg-primary
201
200
:align: center
202
201
```
203
202
@@ -211,12 +210,13 @@ An interesting way to investigate the convergence is to plot it in the
211
210
variable/objective space rather than over the iterations. This is what
212
211
we need the window with the parameter study surface for. At the top of
213
212
this window you will find panels listing series and data to be plotted.
214
- Please right-click in the series window and select "New ":
213
+ Please right-click in the series window and select "Add ":
215
214
216
215
``` {image} _static/Optimization_studies/newseries.png
217
216
:alt: Chart New Series
218
217
:class: bg-primary
219
218
:align: center
219
+ :width: 65%
220
220
```
221
221
222
222
This will give you a blank "Series 1". When you highlight it by clicking
@@ -225,23 +225,18 @@ right-hand pane is empty. We are going to fill in the `SaddleHeight` and
225
225
` SaddlePos ` variables from the OptStudy as Abscissa and Abscissa2,
226
226
respectively. This is done by selecting Abscissa and Abscissa2 in turn
227
227
and then expanding the ` OptStudy ` branch until the ` SaddleHeight.Val ` and
228
- ` SaddlePos.Val ` , respectively, can be selected:
229
-
230
- ``` {image} _static/Optimization_studies/selectheight.png
231
- :alt: Chart select height
232
- :class: bg-primary
233
- :align: center
234
- ```
228
+ ` SaddlePos.Val ` , respectively, can be selected.
235
229
236
230
Finally, in the ` Value ` field select ` OptStudy.Metab.Val ` and look carefully
237
231
at the plot. You will see that an additional polyline has been added. It
238
232
originates approximately at the middle of the surface and shows the path
239
233
the optimization process has taken through the design space to the
240
- minimum point. You can change the color of the line by clicking the second
241
- leftmost button (![ chartsettings.png] ( _static/Optimization_studies/chartsettings.png ) ) in the toolbar directly over the graphics
242
- pane. This gives you access to all the settings and lets you control the
243
- appearance of graphs in detail. Under Chart->Series->Series1->Lines the following
244
- parameters is set: ` RGB = {1,0,0} ` , i.e. red, and ` Thickness = 4 ` .
234
+ minimum point. You can change the color of the line by clicking the Property
235
+ Window button (![ chartsettings.png] ( _static/Optimization_studies/chartsettings.png ) )
236
+ in the toolbar directly over the graphics pane. This gives you access to all the
237
+ settings and lets you control the appearance of graphs in detail. Under
238
+ Chart->Series->Series1->Lines the following parameters is set: ` RGB = {1,0,0} ` ,
239
+ i.e. red, and ` Thickness = 4 ` .
245
240
246
241
``` {image} _static/Optimization_studies/optpath2.png
247
242
:alt: Chart OptPath
@@ -251,7 +246,7 @@ parameters is set: `RGB = {1,0,0}`, i.e. red, and `Thickness = 4`.
251
246
252
247
## Caveat when Running Optimization Studies
253
248
254
- This plot illustrates the convergence history in the "landscape" of the
249
+ The above plot illustrates the convergence history in the "landscape" of the
255
250
objective function. Here we can see the reasons for the convergence
256
251
being as it is. Actually, the optimum value lies in a relatively flat
257
252
region and therefore the exact mathematical location of the optimum may
@@ -329,7 +324,7 @@ optimization problem stated in the beginning of this lesson, we have
329
324
only less-than-or-equal-to constraints, but there is only a minus sign
330
325
in difference of making a greater-than-or-equal-to into a
331
326
less-than-or-equal-to constraint. You can put this minus sign manually
332
- or you can use Type = ` GreaterThanZero ` , which is equivalent. Notice that
327
+ or you can use ` Type = GreaterThanZero ` , which is equivalent. Notice that
333
328
equality constraints are in principle also a possibility, but currently
334
329
the optimization solvers in AnyBody do not handle this type of
335
330
constraints. Moreover, it is most often possible to handle equality
@@ -354,15 +349,17 @@ convergence picture:
354
349
:alt: Metab value vs Steps
355
350
:class: bg-primary
356
351
:align: center
352
+ :width: 75%
357
353
```
358
354
359
- If you alo re-run the parameter study, you can get this picture of the
355
+ If you also re-run the parameter study, you can get this picture of the
360
356
convergence:
361
357
362
358
``` {image} _static/Optimization_studies/optpath2_constrained.png
363
359
:alt: opt Study constrained
364
360
:class: bg-primary
365
361
:align: center
362
+ :width: 60%
366
363
```
367
364
368
365
We see that the result is indeed a compromise since the objective
@@ -378,6 +375,7 @@ looks like:
378
375
:alt: SeatDist vs Steps
379
376
:class: bg-primary
380
377
:align: center
378
+ :width: 70%
381
379
```
382
380
383
381
where it is obvious how the optimizer hits the constraint, bounces off,
@@ -393,7 +391,6 @@ picture below:
393
391
394
392
``` {image} _static/Optimization_studies/BikeOpt2_constrained.png
395
393
:alt: Final model view 2
396
- :class: bg-primary
397
394
:align: center
398
395
```
399
396
0 commit comments