Simulink model very slow when integrates

조회 수: 22 (최근 30일)
Roxanna Moores
Roxanna Moores 2012년 10월 17일
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?

답변 (2개)

Ryan G
Ryan G 2012년 10월 17일
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
Ryan G
Ryan G 2012년 10월 18일
편집: Ryan G 2012년 10월 18일
It sounds like there is some confusion between terms and what different things do. I want to clarify things as it will help you now and in the future when determining issues.
1) Fixed step and discrete are different. You have a fixed-step solver but the ODE solver is not discrete, it takes little steps between the specified fixed step.
2) Parallel computing acts on the ENTIRE model, not just portions. It does not sound like you would want that for this.
Based on what you wrote nothing sounds particularly complicated. It is important to note you want things working smoothly before doing accelerator or parallel computing.
Since your profile says you're at volvo, I would highly recommend creating a service request. The tech support team at mathworks is pretty quick and you can send your model along with the request and see what you're doing wrong.
I would specify what you do/don't understand about Simulink and your model and ask for help understanding this a bit better. As you work with Simulink and understand the terminology it becomes much easier to search for answers.
I would also suggest sending a link to this thread to show what has been recommended already.
Roxanna Moores
Roxanna Moores 2012년 10월 18일
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
K E 2012년 10월 18일
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