Simulink using with fmincon
35 views (last 30 days)
Show older comments
Hello guys. I would like to ask you about how to use fmincon to optimize simulink model.
I have a function that returns scalar constant that i want to minimize. I get this constant from simulink but, when i use fmincon to optimize model parameters to minimize this constant. It is changing parameters in workspace but simulink always returns the same scalar constant like if it wouldn't change at all.
How can i force matlab to change this constants inside if simulink while fmincon is running?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/997960/image.jpeg)
Here you can see that i'm using fmincon on minimisation_of_vibration_absorber function
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/997965/image.jpeg)
in this function i linearize simulink model and geting transfer function numenator
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/997970/image.jpeg)
red blocks are blocks that have parameters defined in workspace that i would like to optimize
Every time my optimization function fmincon returns absolutely unchanged numenator even if constants has been changed in workspace.
Thank you!
0 Comments
Answers (1)
Alan Weiss
on 15 May 2022
Perhaps you can look at some worked examples and figure it out:
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation
0 Comments
See Also
Categories
Find more on Manual Performance Optimization in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!