MATLAB Answers

Warning: Matrix is close to singular or badly scaled ( simulink model with simscape blocks simpowersystems)

52 ビュー (過去 30 日間)
Sreeraj A
Sreeraj A 2020 年 9 月 2 日
コメント済み: Kevin Pilgrim 2021 年 1 月 5 日
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

採用された回答

Joel Van Sickel
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
  1 件のコメント
Sreeraj A
Sreeraj A 2020 年 9 月 3 日
Hello Joel,
Thank you for the information. I have ideal switches in my model and when commented out the usage the warnigns go away ensuring the source of the warning. I will look further on how can i increase the resistance in the path and clear the warning.
Thank you very much.

サインインしてコメントする。

その他の回答 (2 件)

Pemendra Kumar Pardhi
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
  1 件のコメント
Sreeraj A
Sreeraj A 2020 年 9 月 3 日
Hello !
Thanks for the suggetion. I have tried the method and still the warnings are there.

サインインしてコメントする。


Romain Lachaux
Romain Lachaux 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
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

サインインしてコメントする。

コミュニティ

Community Treasure Hunt

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

Start Hunting!

Translated by