Re: solution of linear equations [message #29382] |
Mon, 18 February 2002 08:23 |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
dinhnq@yahoo.com (Dinh Huong) writes:
> Dear All,
>
> I am trying to find the solution for a series linear equations: Ax =
> 0, where A is a n by m matric, x is a n dimmensions vector. In my
> particular example, n=12, m=70, an overdetermined systems, can anyone
> kindly tell the method in IDL? I used SVDC and followed the way
> indicated in 'Using IDL' (page 348) but only obtained 0 for x,
> obviously this method can only return zero whenever B = 0. Any other
> suggestions? Thank in advance.
Hi Dinh--
If you thinking of a linear least-squares solution, this can be
commonly done with a QR decomposition of your matrix A. I'll leave
you to look up QR in something like Numerical Recipes (which doesn't
have much).
The heart of MPFIT, a *non*linear fitter, is a procedure which
linearizes the function, and then does exactly a QR factorization. I
have ripped out those routines into QRFAC and QRSOLV, and put them on
my web page. Perhaps these will help. See the EXAMPLE documentation
for QRSOLV to see how you would solve an equation.
Basically, you want to do,
QRFAC, A, R
X = QRSOLV(A, R, B)
where B is a zero-vector. Note that A is destroyed in the
factorization.
Good luck,
Craig
http://cow.physics.wisc.edu/~craigm/idl/idl.html (under Math)
--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
|
|
|