Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Modelica/Electrical/Polyphase/Basic/MutualInductor.mo
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ model MutualInductor "Linear mutual inductor"
parameter Real epsilon=1e-9 "Relative accuracy tolerance of matrix symmetry";
parameter SI.Inductance L[m, m] "Mutual inductance matrix";
initial equation
if abs(Modelica.Math.Matrices.det(L)) < epsilon then
if Modelica.Math.Matrices.rcond(L) < epsilon then
Modelica.Utilities.Streams.print("Warning: mutual inductance matrix singular!");
end if;
equation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ model MutualInductor "Linear mutual inductor"
parameter Real epsilon=1e-9 "Relative accuracy tolerance of matrix symmetry";
parameter SI.Inductance L[m, m] "Mutual inductance matrix";
initial equation
if abs(Modelica.Math.Matrices.det(L)) < epsilon then
if Modelica.Math.Matrices.rcond(L) < epsilon then
Modelica.Utilities.Streams.print("Warning: mutual inductance matrix singular!");
end if;
equation
Expand Down
13 changes: 6 additions & 7 deletions Modelica/Math/package.mo
Original file line number Diff line number Diff line change
Expand Up @@ -2579,18 +2579,17 @@ result = Matrices.<strong>det</strong>(A);
This function returns the determinant \"result\" of matrix A
computed by a LU decomposition with row pivoting. For details about determinants, see
<a href=\"http://en.wikipedia.org/wiki/Determinant\">http://en.wikipedia.org/wiki/Determinant</a>.
Usually, this function should never be used, because
Usually, this function should not be used, because
there are nearly always better numerical algorithms
as by computing the determinant. Examples:
than computing the determinant. Examples:
</p>

<ul>
<li> Use <a href=\"modelica://Modelica.Math.Matrices.rank\">Matrices.rank</a>
to compute whether det(A) = 0 (i.e., Matrices.rank(A) &lt; size(A,1)).</li>

<li> Use <a href=\"modelica://Modelica.Math.Matrices.solve\">Matrices.solve</a>
to solve the linear equation A*x = b, instead of using determinants to
compute the solution.</li>
to solve the linear equation A*x = b.</li>

<li> Use <a href=\"modelica://Modelica.Math.Matrices.rcond\">Matrices.rcond</a>(A)>=epsilon
to check that the system is well-conditioned and not singular.</li>
</ul>

<h4>See also</h4>
Expand Down
Loading