MATLAB Answers

Simulink model very slow when integrates

조회 수: 11(최근 30일)
Roxanna Moores
Roxanna Moores 17 Oct 2012
I have a Simulink model that does many integrations. If the data input is steady state, then the model is fairly quick. When the data input is very transient, the model slows down significantly, especially when I try to add it to a bigger model where my model is a sub-component. The model uses ODE15s already, and it is variable step. When I try to go to discrete mode, I get rate transition errors, but when I try to embedd rate transition blocks, the sw gives an error. Any suggestions?


Ryan G
Ryan G 17 Oct 2012
It sounds like the model is behaving as expected with a variable step ODE solver. Essentially it will take bigger (faster) steps when the data is steady.
When you transition to discrete solver, is it also fixed step? There are 2 potential issues:
1) if fixed step, you must make sure the rate transitions make sense
2) Discrete solvers require discrete blocks such as discrete integrator instead of 1/s
What is the first error you see?
Finally, sometimes your model may be optimized for speed as much as possible and given the complexity of the system it just runs slow. A couple things you can do is utilize parallel computing for multiple runs, use accelerator/rapid accelerator and model references to speed up simulink and finally you can potentially look for places in your model to simplify the system.
  댓글 수: 4
Roxanna Moores
Roxanna Moores 18 Oct 2012
ok, thank you. I will go ahead and create the service request. While I have worked with Simulink somewhat, I am new to this optimization aspect of it. I am also working on the links also sent below. I am hoping between the links and the service request, that I can possibly find a solution.

댓글을 달려면 로그인하십시오.

K E 18 Oct 2012
I agree with Ryan on the cause and possible steps. In case it is helpful, here are some general links on speeding up model execution: a blog post, a Mathworks note, and a webinar.

Community Treasure Hunt

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

Start Hunting!

Translated by