How to speed up multi body simulations that are using fast restart for multiple shooting trajectory optimization?

6 次查看(过去 30 天)
Hello,
I have a simscape multi body simulation that I simulate using Fast Restart and optimize with fmincon. Each simulation of roughly 4 seconds simulation time takes about 0.3 seconds to run. I want to do something called "multiple shooting" where I chop up that 4 seconds into about 20 segments of 0.2 seconds of simulation time each to do trajectory optimization. However when I do so, each of these segments still takes about 0.3 seconds of real time to run making the whole 4 seconds of simulation time take 6 seconds or real time, rather than 0.3 seconds. This is a very meaningful change to me because fmincon will perform these simulations thousands of times. Do you have a suggestion of how I can speed this up? One more detail - I need to change some parameters between each 0.2 second simulation. Thanks!

回答(1 个)

Steve Miller
Steve Miller 2019-4-2
Hi Max,
I have a few examples that handle optimization and parameter sweeps using Fast Restart. I would recommend looking at this one - Four Bar Linkage Optimization in Simscape
It shows both a parameter sweep and an optimization using Fast Restart, where link lengths are adjusted until the tip follows a desired trajectory. It is worth looking at even if you are doing something other than a four-bar linkage as an example of how to set up the model to run these kind of analyses.
--Steve

类别

Help CenterFile Exchange 中查找有关 Applications 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by