Accelerating the compilation time of optimisation problem
5 views (last 30 days)
I am running a optimization problem in simulink. Its a constrained non-linear optimization with fmincon solver. The issue i am facing is the larger runtime for the problem due to larger compilation time at each iteration. I have a model with large no of thermal masses. When i simplyfy the model with less number of thermal networks and elements, the model is running faster. I need to know what can be done to improve this compilation time when i have large thermal masses for a model.
Andy Bartlett on 27 Jul 2022
Edited: Andy Bartlett on 27 Jul 2022
You can get dramatic speed-ups across multiple simulation by using Simulink's Fast Restart and several related features. See this Youtube on Simulink Fast Restart. You may also wish to explore accelerator and rapid accelerator. The key thing for this to work is that your optimization search is only making "tunable" changes such as adjusting the value of tunable model parameters and possibly externally fed input signals.
If you are rewiring blocks, replacing blocks, changing data types, dimensions, complexity, ..., then a full re-compile of the Simulink model will be needed after each "structural" change. But between each "structural" change, you can still leverage all the speed-up opportunities to explore "tunable" changes.
There is also a product Simulink Design Optimization dedicated to this type of optimzation loops wrapped around a Simulink model. That product is aware of and designed to leverage speed-up opportunities. For example, watch Youtube on Fast Restart for Simulink Design Optimization.