Speed up the optimization toolbox problem
조회 수: 4 (최근 30일)
이전 댓글 표시
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
답변 (1개)
Walter Roberson
2022년 5월 9일
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
Walter Roberson
2022년 5월 9일
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++.
참고 항목
카테고리
Help Center 및 File Exchange에서 Manual Performance Optimization에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!