Re: Decompose a matrix [message #57689 is a reply to message #57688] |
Wed, 19 December 2007 05:16  |
jameskuyper
Messages: 79 Registered: October 2007
|
Member |
|
|
d.poreh@gmail.com wrote:
> Folks
> I have a problem could anyone help me?
> Let:
> A = [[ 0,0,1], $
> [ 0,1,0], $
> [ 0,0,0]]
> B = [0.5,0.5,1]
>
> ; Decompose A
> SVDC, A, W, U, V
> ; Solve A.X=B
> X=SVSOL(U, W, V, B)
> new_B=A##X
> IDL> print,new_B
> 0.500000
> 0.500000
> 0.000000
> Why new_B is not equal to B' ?
Because there is no value of X such that A.X=B. That's because one of
the eigenvalues of A is 0. What this means is that while the possible
values for X fill a three-dimensional universe, the possible values for
A.X only cover a flat two-dimensional plane within that universe.
Whenever B is not on that plane, A.X = B cannot be solved. Matrix
inversion fails in this case, because A doesn't have an inverse. What
SVD does in this case is calculate the value of X such that A.X comes as
close to B as possible while remaining on that flat plane. That is the
advantage of using SVD over ordinary matrix inversion techniques.
Of course, a better solution is to re-define your problem so an exact
solution is possible.
|
|
|