How to play with the Simulink Solver Parameters to reduce the Sampling Frequency?

2 次查看(过去 30 天)
I'm a newby in Simulink. I have a Simulink model running at a high sampling frequency. When I reduce it (doing all the necessary changes in the model), the simulation stops after few ms. The error is due to a algebraic loop that Simulinks can't resolve. But it was able to resolve it at higher Fs!! How can I play with the solver parameters?? I've already played with set_param('Model','AlgebraicLoopSolver','LineSearch') and TrustRegion and I've tried to reduce RelTol but without any succes...

回答(2 个)

Aniruddha Katre
Aniruddha Katre 2017-3-23
If you have algebraic loops in the model that are causing these issues, playing with the solver step size is not the best way to resolve it.
Algebraic loops are caused by non-deterministic loops in your model. For example, if you have a variable "y" on both sides of an equation: y = u - y, where you are solving for y. This can result in an algebraic loop.
The best way to resolve them is to take a look at your equations and rearrange them such that the algebraic loops don't occur. The previous equation could be re-written as y = u/2 instead.
Here's a useful documentation link on algebraic loops and how to resolve them: https://www.mathworks.com/help/simulink/ug/algebraic-loops.html

Julie SERIS
Julie SERIS 2017-3-23
Thank you Aniruddha. Unfortunately my model is really more complicated than a simple equation: y = u - y I've already tried to get rid of the algebraic loops but it doesn't seem feasible. What I don't understand is why it is working at a really high Fs and not at a smaller one... This is not an issue of frequency content or aliasing stuff, since the 2 Fs I'm using are far enought to avoid this kind of problems. It seems the solver is not well set for the lowest sampling frequency, or something like that.

类别

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

产品

Community Treasure Hunt

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

Start Hunting!

Translated by