Getting Started Documentation Glish Learn More Programming Contact Us
Version 1.9 Build 1556
News FAQ
Search Home


next up previous contents index
Next: lsfit.inityonly - Function Up: lsfit - Tool Previous: lsfit.accumulate - Function


lsfit.solve - Function



Package utility
Module mathematics
Tool lsfit


solves for the unknowns (x)


Synopsis
solve(yy)


Arguments

yy   vector of new driving values (Input)
    Allowed: double
    Default: F


Returns
solution vector


Description
Returns a solution vector $ \vec{x}\,$ of values for the unknowns. The accumulation matrix and vector are not affected, so accumulation may continue after a solve. In general, the solution is for the y-values given to .accumulate(). But it is also possible to solve the same system of equation for a new vector (yy), without doing a new inversion. Obviously, yy must be of the same length as the original one, and the same weights are used. For this option to work, the switch 'keep' set in init() must be T (default). The new vector yy replaces the internal vector.






Example

include "lsfit.g"
nuk := 5;                         # nr of unknowns
print 'xxin=',xxin := [1:nuk];    # simulated input values
lsf.init(nuk);                    # initialise matrix and vector
print lsf.status();               # optional
for (i in [1:(nuk-1)]) {
    for (j in [(i+1):nuk]) {
        aa := rep(0,nuk);         # coefficient vector
        aa[i] := 1;
        aa[j] := 1;
        yy1[i] := xxin[i]*aa[i] + xxin[j]*aa[j]; # driving value
        lsf.accumulate(aa,yy1[i]);     # accumulate equation
    }
}
xx1 := lsf.solve( );   # solve for input vector yy1
xx2 := lsf.solve(yy2); # solve for other vector yy2
xx3 := lsf.solve(yy3); # solve for other vector yy3
xx4 := lsf.solve(yy4); # solve for other vector yy4


next up previous contents index
Next: lsfit.inityonly - Function Up: lsfit - Tool Previous: lsfit.accumulate - Function   Contents   Index
Please send questions or comments about AIPS++ to aips2-request@nrao.edu.
Copyright © 1995-2000 Associated Universities Inc., Washington, D.C.

Return to AIPS++ Home Page
2006-10-15