-
Notifications
You must be signed in to change notification settings - Fork 175
Open
Labels
L: Electrical.PolyphaseIssue addresses Modelica.Electrical.PolyhaseIssue addresses Modelica.Electrical.PolyhaseL: Electrical.QuasiStaticIssue addresses Modelica.Electrical.QuasiStaticIssue addresses Modelica.Electrical.QuasiStaticL: MathIssue addresses Modelica.MathIssue addresses Modelica.Math
Description
- 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
byrank(A)<size(A,1)
, but I wouldn't recommend usingModelica.Math.Matrices.rank
as 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). - It also recommends using
solve
instead of usingdet
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.
Metadata
Metadata
Assignees
Labels
L: Electrical.PolyphaseIssue addresses Modelica.Electrical.PolyhaseIssue addresses Modelica.Electrical.PolyhaseL: Electrical.QuasiStaticIssue addresses Modelica.Electrical.QuasiStaticIssue addresses Modelica.Electrical.QuasiStaticL: MathIssue addresses Modelica.MathIssue addresses Modelica.Math