geofizyk
04-13-2004, 11:15 AM
I have two questions regarding solving linear equations.
1. I have a set of linear equations with more equations than unknowns. Some of the equations are linearly dependent so in reality there are less equations than unknowns,
therefore, there is no unique solution. Moreover, my matrix is sparse. SVDCMP (chapter 2.6) can give one solution after zeroing the small eigenvalues (numerically close to zero). This solution is linear least squares type and this is exactly what I need. The only problem is that for many unknowns it is slow. I was thinking that maybe there is some kind of iterative method which can give me a solution with certain accuracy where I would be able to control the number of iterations and the time of calculations. My question is: what would be the best iterative method for my purpose?
2. I tried to use the conjugate gradient method for sparse linear systems. Since the method is for square matrices therefore the only idea I had is to multiply both sides of equations by the transpose of matrix A. I realize that by multiplying by transpose the matrix is no more sparse, but still this is iterative method. As a test I used a matrix (4x5) and compared the results with those achieved by svdcmp. I thought they should be the same, but they are different! So my question is: why they are different?
Please help me with these 2 questions
Pawel Zych
1. I have a set of linear equations with more equations than unknowns. Some of the equations are linearly dependent so in reality there are less equations than unknowns,
therefore, there is no unique solution. Moreover, my matrix is sparse. SVDCMP (chapter 2.6) can give one solution after zeroing the small eigenvalues (numerically close to zero). This solution is linear least squares type and this is exactly what I need. The only problem is that for many unknowns it is slow. I was thinking that maybe there is some kind of iterative method which can give me a solution with certain accuracy where I would be able to control the number of iterations and the time of calculations. My question is: what would be the best iterative method for my purpose?
2. I tried to use the conjugate gradient method for sparse linear systems. Since the method is for square matrices therefore the only idea I had is to multiply both sides of equations by the transpose of matrix A. I realize that by multiplying by transpose the matrix is no more sparse, but still this is iterative method. As a test I used a matrix (4x5) and compared the results with those achieved by svdcmp. I thought they should be the same, but they are different! So my question is: why they are different?
Please help me with these 2 questions
Pawel Zych