Warning: Matrix is close to singular or badly scaled ( simulink model with simscape blocks simpowersystems)
25 次查看(过去 30 天)
显示 更早的评论
I have my model having simpower systems generating the follwoing warnings. solutions are availalbe for matlab code but none for simulink model containing simscape blocks.
----------------------------------------------------------------------------------------------------------
Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 1.667047e-18.
Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 1.667047e-18.
----------------------------------------------------------------------------------------------------------
Thanks in Advance
0 个评论
采纳的回答
Joel Van Sickel
2020-9-2
Hello Sreeraj,
there is the chance you can get good results even with this warning, so you might be able to ignore it. The main issue is likely that you have an area where resistances are too low. I see this warning the most when using specialized power systems and having breakers in the system. In those cases, increasing the breaker resistance will make the error go away. If you have other components with very low resistance, you could also try increasing the resistance of them.
Regards,
Joel
更多回答(2 个)
Pemendra Kumar Pardhi
2020-9-2
Dear Sreeraj
This kind of error is occure whenever your simulink model having denomenator zero,
If you are using for code genration please try this procces,
Go on configuration parametrs> diagnostics > consecutive zero crossing violation> none
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/355229/image.png)
Rom Lhx
2020-11-13
Hello Sreeraj,
In complement of the answer of Joel, here is the answer from our Technical Support to a similar pain:
The reason you are seeing this error is that a matrix somewhere in your model has a large 'scale' difference.
For instance, take the example of the following 2x2 matrix:
- A=[1e8,0;0,1e-8]
The singular values of this matrix differ by 16 orders of magnitude and solving a linear system such as 'Ax=b' will trigger this RCOND warning message.
You can see this for example:
- b = [1;1]
- A\b % solves for x in Ax=b
MATLAB warns that this may lead to errors, in particular for badly conditioned matrices, small changes in 'b' could lead to large changes in 'x'. Documentation for the condition number can be found here: https://uk.mathworks.com/help/matlab/ref/rcond.html
You can highlight the ill-conditioned matrix by tracing it back to a specific block. The power_analyze function may be useful for this, documentation can be found here: https://uk.mathworks.com/help/physmod/sps/powersys/ref/power_analyze.html .
Looking at the condition number of the corresponding state-space matrix will help you pin down the origin of the issue. This can be achieved for example by running: sps = power_analyze('sys','structure') rcond(sps.A)
Regards,
Romain
1 个评论
Kevin Pilgrim
2021-1-5
Thanks for the detailed feedback. Could you provide further information to "trace back" the origin of the problem? What numbers/state/values should I pay attention to to find the error?
rcond(sps.A) is 8.4e-24 for my state matrix A.
I know that block is causing the issue (by commenting it in and out), but I would like to gain some insights how the warning is caused in order to improve my model!
Thanks!
Kevin
社区
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Trimming and Linearization 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!