Platform: All Platforms Versions: All versions

Problem Description

What does the error message "Singular Matrix" mean?

Solution

The problem is that the stiffness matrix of the linear system is singular and the linear solver cannot invert it. Examples of practical modeling situations where this can occur are:

  • One, or more, of the relevant material properties is zero. Or, the material properties become zero during the solution while solving a nonlinear problem. If you are solving a nonlinear problem, see also: Improving Convergence of Nonlinear Stationary Models. If you are solving a linear problem, see also: What to do when a linear stationary model is not solving

  • Your problem (equation system combined with the boundary conditions) is over- or underspecified. Check the equations and boundary conditions. You will often see this error if you have an ill-posed initial condition. It can be a good start to look at the initial condition and set it to some educated guess. Another example can be if you apply periodic boundary conditions when the PDE problem you solve does not permit such a solution. Yet another example is a Navier-Stokes problem where the pressure is unconstrained on the boundaries. You will need to make a point constraint somewhere.

  • You have specified a dependency of an expression defined in terms of coordinate derivatives of the solution variable. As the default initial guess into nonlinear systems is a constant (making the initial guess for the solution-derivative dependent expression zero), this can cause the equation to become singular.  The cure is to specify an initial value with a non-zero derivative, such as 1e-6*sqrt(x^2+y^2+z^2). This problem can sometimes occur when working with nonlinear materials, for example nonlinear magnetic materials (magnetic saturation effects).

  • You are solving a nonlinear eigenvalue problem with a zero linearization point. Examples of models that often result in a nonlinear eigenvalue problem are eigenfrequency analyses with PMLs or lossy materials, in RF or acoustics. To avoid the error message, you need to specify a non-zero, possibly complex-valued eigenvalue linearization point in the Study->Solver Configurations->Solver->Eigenvalue Solver settings window. Once you have a first solution, use the Global Evaluation under Results->Derived Values to evaluate the expression lambda for the solution that you are interested in. Enter its value as the new eigenvalue linearization point, solve again, and repeat the process until the eigenvalue no longer changes. This should usually not take more than a few iterations.