Speed up the optimization toolbox problem

6 views (last 30 days)
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

Answers (1)

Walter Roberson
Walter Roberson on 9 May 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 Comments
Ranjith Prakash
Ranjith Prakash on 9 May 2022
Hi,
can you give more insight on that ways?
Thanks
Ranjith
Walter Roberson
Walter Roberson on 9 May 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++.

Sign in to comment.

Categories

Find more on Get Started with Optimization Toolbox in Help Center and File Exchange

Products


Release

R2018b

Community Treasure Hunt

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

Start Hunting!