Simulink model very slow when integrates
12 次查看(过去 30 天)
显示 更早的评论
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?
0 个评论
回答(2 个)
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
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.
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.
0 个评论
另请参阅
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!