Speed up the optimization toolbox problem
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hii,
I am doing an optimization task for a model created in simscape. i have done the code and installed optimization toolbox. while running the code it is taking a lot of time to run the simulation. It takes nearly a day to finidh it. how can i s[eed up the time of simulation? i know few options like accelerator and changing compile time to run time in simscape preferences. I need to know if there is any other easy way to solve this issue.
Thanks
Ranjith
0 Commenti
Risposte (1)
Walter Roberson
il 9 Mag 2022
No, there are no easier ways.
There are some ways that might improve performance even more than using rapid acceleration, but they are not easier ways.
2 Commenti
Walter Roberson
il 9 Mag 2022
In some cases you use tools to linearize sections of models.
In some cases you can divide simulations into independent pieces and use parsim() to simulate in parallel. The pieces must not interact for this to work. You would typically use this kind of technique for sweeping a parameter.
In some cases you can bundle a bunch of functionality into a single MATLAB Function Block that vectorizes or uses parfor()
In some cases it requires rethinking the implementation of the model to see if there are alternatives to sections that might be faster.
Sometimes that involves switching to algorithms that might be theoretically slower but due to the smaller problem size might be slower than you could do more directly. For example if you were sorting a vector of three elements, the cost of starting a Quick Sort might be more than just using if/elseif chains.
Sometimes it involves switching to Level 2 S functions implemented in C or C++.
Vedere anche
Categorie
Scopri di più su Manual Performance Optimization in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!