You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently a test of the type Modelica.Math.Matrices.det(L)>=epsilon is used in two cases, Modelica.Electrical.Polyphase.Basic.MutualInductor and Modelica.Electrical.QuasiStatic.Polyphase.Basic.MutualInductor. As noted in Prefer warning instead of print message #4685 that is problematic for several reasons, and not normally used in numerical analysis.
These are in fact the only uses of the determinant function inside MSL, and should likely be replaced based on the updated recommendations from the next item. (The description of epsilon might also be updated for these models.)
The recommendation for not using Modelica.Math.Matrices.det in its documentation should be updated:
The current documentation says: "Usually, this function should never be used, because there are nearly always better numerical algorithms as by computing the determinant." I believe "as" is a common German false-friend-error and should be "than". Additionally "Usually ... should never..." seems odd, and I would prefer "Usually... should not...".
It recommends replacing det(A)=0 by rank(A)<size(A,1), but I wouldn't recommend using Modelica.Math.Matrices.rank as it involves singular-value-decomposition which is even more expensive and still has some scaling issues, but instead recommend using Modelica.Math.Matrices.rcond (which completely avoids the scaling issue).
It also recommends using solve instead of using det to solve systems of equations. I obviously agree with the recommendation, but even mentioning that you could use the determinant in that way seems weird to me.
So perhaps something like:
Use Modelica.Math.Matrices.solve(A,b) to solve systems of equations and Modelica.Math.Matrices.rcond(A)>=epsilon to check that the system is well-conditioned and not singular.
Modelica.Math.Matrices.det(L)>=epsilonis used in two cases, Modelica.Electrical.Polyphase.Basic.MutualInductor and Modelica.Electrical.QuasiStatic.Polyphase.Basic.MutualInductor. As noted in Prefer warning instead of print message #4685 that is problematic for several reasons, and not normally used in numerical analysis.These are in fact the only uses of the determinant function inside MSL, and should likely be replaced based on the updated recommendations from the next item. (The description of epsilon might also be updated for these models.)
Modelica.Math.Matrices.detin its documentation should be updated:det(A)=0byrank(A)<size(A,1), but I wouldn't recommend usingModelica.Math.Matrices.rankas it involves singular-value-decomposition which is even more expensive and still has some scaling issues, but instead recommend usingModelica.Math.Matrices.rcond(which completely avoids the scaling issue).solveinstead of usingdetto solve systems of equations. I obviously agree with the recommendation, but even mentioning that you could use the determinant in that way seems weird to me.So perhaps something like:
Use
Modelica.Math.Matrices.solve(A,b)to solve systems of equations andModelica.Math.Matrices.rcond(A)>=epsilonto check that the system is well-conditioned and not singular.