Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Solving Singular matrices

  1. Mar 11, 2015 #1

    How would you solve a singular matrix? ie when determinant is zero.

    Lets assume an equation, (1) Ax+By=E and (2) Cx+Dy=F

    if the determinant; AD-BC = 0, and therefore the matrix is singular, How to go around solving the equation?

    LU decomposition, Gaussian elimination?

    Ideally I am looking for a method which could be "easily" implemented in a code.

  2. jcsd
  3. Mar 11, 2015 #2


    Staff: Mentor

    That is a system of two equations (not one) in two unknowns, so presumably your matrix is 2 x 2.
    The system might have no solution or it might have an infinite number of solutions.
    A couple of examples might help to shed some light here.
    Example 1.
    x + 2y = 3
    2x + 4y = 6
    The equations in this system are equivalent, so geometrically the two equations represent a single line. Here there are an infinite number of solutions. Each point on the first line is also on the second line.

    Example 2.
    x + 2y = 3
    2x + 4y = 1
    The equations in this system represent two parallel lines with no common point of intersection. The system has no solutions.

    Assuming that your systems consist of two equations in two unknowns, I would focus my efforts on those systems for which the discriminant is nonzero (i.e., the systems that have a unique solution). Once you determine that the discriminant is nonzero, you could use Cramer's Rule to determine the solution.

    If the discriminant is zero, I don't see any point in trying to use Gaussian elimination or LU decomposition. In a system of two equations with two unknowns for which the discrimant is zero, there will either be an infinite number of solutions or no solution at all.
  4. Mar 14, 2015 #3
    thanks a lot :smile:
  5. Mar 14, 2015 #4

    Stephen Tashi

    User Avatar
    Science Advisor

    Look up algorithms for computing the "generalized inverse" of a matrix.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook