Solving General Linear Equations
- To: mathgroup at smc.vnet.net
- Subject: [mg71832] Solving General Linear Equations
- From: "David Park" <djmp at earthlink.net>
- Date: Thu, 30 Nov 2006 06:05:39 -0500 (EST)
Dear MathGroup,
I would like to solve a general set of linear equations and obtain not only the overall solution but also the submatrices that go into determining the solution. I know, more or less, how to do it but I don't know how to do it elegantly with Mathematica. I would appreciate any suggestions on the best way to do this.
In the following notation small letters are vector and capital letters are matrices and I have put the dimensions of the vectors and matrices in brackets. So the general form of the equations are:
y[m] == M[m,n].x[n]
where n > m and the rank of M is r < m.
Then I would like to have the solution in the form:
x[r] == A[r,r].y[r] + B[r,n-r].x[n-r]
y[m-r] == C[m-r,r].y[r]
I need to know how the x's and y's are selected from the original set, and I want the matrices A, B and C.
I could append an IdentityMatrix[m] to M and then RowReduce but then I need an algorithm to partition properly, or do it visually.
A test case might be:
testmat = {{1, 1, 0, 1}, {1, 1, 1, 2},
{2, 2, 1, 3}}
yvector = {2, 1, 3} or maybe {y1, y2, y3}
David Park
djmp at earthlink.net
http://home.earthlink.net/~djmp/