I am trying to create a Gauss Algorithm in PHP. Can anyone help me? I can't even find that much info on it.
Gauss Algorithm
Started by dirkfirst, May 20 2006 10:57 AM
6 replies to this topic
#1
Posted 20 May 2006 - 10:57 AM
|
|
|
#2
Posted 06 August 2006 - 09:43 AM
Never even heard of it. What is a Gauss Algorithm.
#3
Posted 06 August 2006 - 10:01 AM
erm...is that something to do with a matrix to solve a system of equations or something?
#4
Posted 11 August 2006 - 03:43 PM
Found this on the net:
In mathematics, Gaussian elimination or Gauss-Jordan elimination, named after Carl Friedrich Gauss and Wilhelm Jordan (for many, Gaussian elimination is regarded as the front half of the complete Gauss-Jordan elimination), is an algorithm in linear algebra for determining the solutions of a system of linear equations, for determining the rank of a matrix, and for calculating the inverse of an invertible square matrix. ...
In mathematics, Gaussian elimination or Gauss-Jordan elimination, named after Carl Friedrich Gauss and Wilhelm Jordan (for many, Gaussian elimination is regarded as the front half of the complete Gauss-Jordan elimination), is an algorithm in linear algebra for determining the solutions of a system of linear equations, for determining the rank of a matrix, and for calculating the inverse of an invertible square matrix. ...
#5
Posted 11 August 2006 - 09:09 PM
i love math, and would love to help you, but my linear algrabra class is 2 years away, and therefor have no idea what to do.
is this what your trying to do? http://mathforum.org...view/53207.html
if not search here for gaussian http://mathforum.org/dr.math/ a lot of people stop by there for help with algorithm's; if they dont have the one your looking for you can submit a question (make sure you say your a student or they wont reply) and they can give you what you would need to do step by step. After that, if you need help with putting it into php i could try and give you a hand.
hth
is this what your trying to do? http://mathforum.org...view/53207.html
if not search here for gaussian http://mathforum.org/dr.math/ a lot of people stop by there for help with algorithm's; if they dont have the one your looking for you can submit a question (make sure you say your a student or they wont reply) and they can give you what you would need to do step by step. After that, if you need help with putting it into php i could try and give you a hand.
hth
#6
Posted 21 August 2006 - 12:59 PM
Reminds me of a Gauss cannon, ha ha. However, that Gauss-Jordan elimination thing sounds very useful for mathematics.
#7
Posted 23 August 2006 - 04:05 PM
Gauss-Jordan Elimination is useful for inverting matrices, among other things... which can provide easy solutions to large systems of equations. I don't know a lot about how PHP stores variables, but I can definitely help with the algorithm. It'll be a little messy because you'll be doing a lot of nested For loops.
I'll assume you're storing your matrix in an array. The basic idea is to think of each row as a vector.
[1 2 3 4 5] <-- vector 1
[2 3 4 5 6] <-- vector 2
[3 4 5 6 7] <-- vector 3
[4 5 6 7 8] <-- vector 4
[5 6 7 8 9] <-- vector 5
Let A be the matrix, V[m] be a row from A, m be the row index, n be the column index. Then what you'll do is:
You'll have to tweak that a bit, but that's the basic algorithm.
I'll assume you're storing your matrix in an array. The basic idea is to think of each row as a vector.
[1 2 3 4 5] <-- vector 1
[2 3 4 5 6] <-- vector 2
[3 4 5 6 7] <-- vector 3
[4 5 6 7 8] <-- vector 4
[5 6 7 8 9] <-- vector 5
Let A be the matrix, V[m] be a row from A, m be the row index, n be the column index. Then what you'll do is:
For n = 1 to 5 Do
Let c=A[n,n]
if c<>0
For m = 1 to 5 Do
if m<>n then
V[m]=V[m]-A[m,n]/c*V[n]
end if
end For
end if
end For
You'll have to tweak that a bit, but that's the basic algorithm.


Sign In
Create Account


Back to top









