Results 1 to 4 of 4

Math Help - fastest solution to simultaneous linear equations

  1. #1
    Newbie
    Joined
    Aug 2011
    Posts
    2

    fastest solution to simultaneous linear equations

    Hi, I'm writing a program which solves for a list of coefficients in
    matrix form:
    b = [b1,b2,b3...]

    The equation I'm trying to solve is:
    Ab = z
    where A is a symmetric matrix and z has the same dimensions as b.

    The obvious solution is b = invs(A) z. However A is at least a 12x12 so
    the inverse takes a long time to calculate (obviously).
    Is there some other method which is faster?

    Thanks in advance
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Super Member Aryth's Avatar
    Joined
    Feb 2007
    From
    USA
    Posts
    652
    Thanks
    2
    Awards
    1

    Re: fastest solution to simultaneous linear equations

    Well, technically, as long as the matrix is not symbolic or ridiculously complex, the inverse method should work. But if you want another method, try LU decomposition followed by either the Gauss-Seidel method or the Jacobi method. Not sure how much faster these methods will be though. They are well researched if you want to find either an algorithm or just a mathematical representation of them somewhere.
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    Aug 2011
    Posts
    2

    Re: fastest solution to simultaneous linear equations

    Thanks, I will look into them
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Super Member TheChaz's Avatar
    Joined
    Nov 2010
    From
    Northwest Arkansas
    Posts
    600
    Thanks
    2

    Re: fastest solution to simultaneous linear equations

    Quote Originally Posted by fredhenry View Post
    Thanks, I will look into them
    fred,
    I don't know if you've seen it yet, but CRG posted a good answer at a cross-posting local...
    http://www.mymathforum.com/viewtopic...=linear#p88811

    -----------------

    Quote Originally Posted by CRGreathouse
    As a rule of thumb, never invert.

    Usually equations like this are solved directly. For example, in gp (see my .sig):
    Code:
    A=mathilbert(12) \\ example matrix
    b=vectorv(12,i,i) \\ example column vector
    matsolve(A,b)
    This is fast -- the example system can be solved in less than 400 microseconds on my machine, even using rational arithmetic. The 100x100 version takes 40 milliseconds at 28-digit precision.

    What language are you using?
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Finding a solution for non-linear simultaneous equations
    Posted in the Advanced Algebra Forum
    Replies: 2
    Last Post: March 6th 2012, 04:10 AM
  2. [SOLVED] Solution to 3 simultaneous equations
    Posted in the Pre-Calculus Forum
    Replies: 1
    Last Post: January 9th 2011, 04:12 AM
  3. Replies: 12
    Last Post: June 23rd 2010, 08:37 AM
  4. Replies: 1
    Last Post: March 24th 2010, 12:14 AM
  5. Replies: 3
    Last Post: February 27th 2009, 07:05 PM

Search Tags


/mathhelpforum @mathhelpforum