I cannot get the method documented in "Specify Independent Parameters for Optimization" to work

23 ビュー (過去 30 日間)
Jiarui
Jiarui 2024 年 2 月 29 日
回答済み: Samay Sagar 2024 年 4 月 25 日 9:02
I am trying to implement the method in the "Specify Independent Parameters for Optimization" section in this documentation: https://se.mathworks.com/help/sldo/ug/specify-parameters-to-optimize-gui.html , but after some testing I can't get it to work. I followed the example, but Kint does not change its value at all between iterations.
  2 件のコメント
Satwik
Satwik 2024 年 3 月 28 日 5:40
Could you please share the model you are working with so that I can reproduce the issue on my end.
Thanks!
Jiarui
Jiarui 2024 年 3 月 28 日 14:01
Thanks for the reply. Here is the test model I was using. The model itself just displays the values of x y and Kint. The init script is used to calculate Kint=x+y, via the method in the documentation. The .mat file is the response optimizer session. I set the optimization target as minimizing the Kint signal. When I run the optimization I could see the x and y values change but Kint remains the same. So in the end the optimization result is invalid.

サインインしてコメントする。

回答 (1 件)

Samay Sagar
Samay Sagar 2024 年 4 月 25 日 9:02
Based on my understanding, the issue you are encountering is because “Kint” is calculated in the Init script without linking to the Simulink model's execution. Hence it will not update during the optimization process.  To dynamically update “Kint”, consider implementing it directly within the Simulink model or using a MATLAB Function block that takes “x” and “y” as inputs and outputs “Kint”.
Hope this helps.

カテゴリ

Help Center および File ExchangeSimulink Design Optimization についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by