Can anyone suggest how to speed up the simulation?

2 ビュー (過去 30 日間)
Vishal Naik
Vishal Naik 2024 年 2 月 20 日
コメント済み: Vishal Naik 2024 年 5 月 7 日
Here, I have uploaded matlab code and simulink model. The procedure to run the simulink is as follows:
  1. Open trail_0 and run it.
  2. Open 'Three_R_Robot_Adaptive' and run it.
According to me, 'Polynomial Trajectory' and 'para_estimation block' in 'Three_R_Robot_Adaptive.slx' is taking a lot of time. I will be very thankful, if anyone suggest a solution for it.
  3 件のコメント
Vishal Naik
Vishal Naik 2024 年 2 月 20 日
Thank you, I will look at it.
Vishal Naik
Vishal Naik 2024 年 2 月 27 日
I tried, but it did not work. Another reason might be that I am not an expert in MATLAB. I am in an intermiddient level.

サインインしてコメントする。

採用された回答

Gyan Vaibhav
Gyan Vaibhav 2024 年 4 月 16 日
Hi Vishal,
So, I tried running your simulink model, and seems to run for eternity. But if you look closely at the status where it shows the simulation percentage, one thing becomes evident that the solver's step size is way smaller, and for even for it to simulate one-thousandth of a second it would take way more time. This is probably due to the relative tolerance of the solver, which is currently 1e-4. However, if you try to reduce the tolerance it gives an error which is probably because of how your model blocks are configured.
You can go to the Debug tab->Performance Advisor-> Solver Profiler, and run it for some time and then you can pause to get the statistics upto that time. For the current simulation the avg step size comes out to be of around 1e-10.
Similarly, you can identify the blocks taking the most time, Debug tab->Performance Advisor.
So, here are few ways I think you can approach to reduce the step size:
  1. Try changing to some more appropriate solver.
  2. Try reducing the relative tolerance, and make the appropriate changes in the model.
  3. Follow this official answer: https://www.mathworks.com/matlabcentral/answers/94052-how-can-i-speed-up-simulation-of-my-simulink-model
Hope this helps.
Thanks
Gyan
  1 件のコメント
Vishal Naik
Vishal Naik 2024 年 5 月 7 日
Thank you. Sorry, for late reply

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeTroubleshooting についてさらに検索

製品


リリース

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by