Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Solving Simultaneous Equations with Matrices

by tsee (Curate)
on Apr 28, 2004 at 15:08 UTC ( #348854=note: print w/ replies, xml ) Need Help??


in reply to Solving Simultaneous Equations with Matrices

Another alternative would be to use Math::Symbolic to solve certain classes of equations. The manual of Math::Symbolic::MiscAlgebra has the following on it:

linear_solve Calculates the solutions x (vector) of a linear equation system of the form "Ax = b" with "A" being a matrix, "b" a vector and the solution "x" a vector. Due to implementation limitations, "A" must be a quadratic matrix and "b" must have a dimension that is equivalent to that of "A". Furthermore, the determinant of "A" must be non-zero. The algorithm used is devised from Cramer's Rule and thus inefficient. The preferred algorithm for this task is Gaussian Elimination. If you have a matrix and a vector of real numbers, please consider using either Math::MatrixReal or Math::Pari instead.

Note that the complexity of Cramer's rule is O(n!) whereas Gaussian Elimination works in O(n^3) as noted by others in this thread.

Steffen


Comment on Re: Solving Simultaneous Equations with Matrices
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://348854]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (7)
As of 2015-07-30 05:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (270 votes), past polls