Algebra/Matrix
Expert: Scott A Wilson - 12/21/2009
QuestionHi Scott,
I have to develop a c program which can balance a chemical equation by the method of 'Generalized matrix inverse method for balancing chemical equation and their stability'. But I am using a little different method. where I am not able to find complete step to find rank of a matrix. I don't be able to develop the algorithm for that.
Main Qus:
starting from a matrix how I can make its left rowXrow a unit matrix by just Adding & Subtracting only rows of that matrix.
Example:
main matrix:
1 0 0 -1 0 1 0 0 0
2 1 1 -3 0 0 1 0 0
0 1 2 -1-1 0 0 1 0
0 1 0 0-1 0 0 0 1
After operation:(r2-2r1;r3-r2;r4-r2;r2-r3;r4+r3;r1+r4;r2+r4)
1 0 0 0 -2 5 -2 1 1
0 1 0 0 -1 0 0 0 1
0 0 1 0 -1 2 -1 1 0
0 0 0 1 -2 4 -2 1 1
(I know the operation for the above matrix but not for all)
Is there is any general rule or method that if I apply that same rule into all matrix I get the result. so there is no need to find which row of that matrix is added or subtracted with other. that is the starting procedure is same for all(its simplify my C++ code/algorithm) but the solution should use only add/subtraction of rows?
please help me...Rahul
AnswerJust for fun I'm working on a program that can solve a matrix, find the inverse,
or divide it into upper and lower triangular matrices. It is written in C++.
It is still having a minor problem when trying to do the inverse, but the rest works.
It also assume write now that the matrix is square of size N and has order N.
This means that all of the rows are linearly independent of each other.
If you want a copy of the program in C++, I could mail it to you.
I will only mail again if I get any response that says to do that.