Least Square Method for solving system of equations So I am following this procedure through MathCad, but when I get to the bottom of page 3, he says I can use a built in command, which he doesn't include.  So I am trying to figure out how to solve this equation that has 50 equations and only three unknowns.  From my little linear algebra exposure, I remember this has doesn't work.  But the link says he solves it via least squares.  I am not sure how to do this, so any help would be appreciated, and any idea on how to do it in mathcad would be MAJORLY appreciated.  Thanks!
 A: $(X^TX)\beta = (X^Ty)$
$\beta$ is the least square solution
A: Within Mathcad the Built-In commands for performing a Least Squares fit are part of a 'Solve' block.  A solve block is defined by using the $ Given $ keyword, followed by the functions to solve, followed by either $ Find $ or $ Minerr $.  So, the basic template is:
$$\begin{align}
& a:=1 \\
& b:=1 \\
& c:=1 \\
& d:=1 \\
& e:=1 \\
& Given \\
& Function(a,b,c) = Value \\
& Function(c,d,e) = Value \\
& . \\
& . \\
& . \\
& Minerr(a,b,c,d,e) = Result
\end{align}$$
Now, to select an appropriate Minimization method, right click on the $ Find $ keyword and you will be presented with a list of Methods to choose from:

Now, getting back to page 3 of the document you have referred to.  To implement this in Mathcad you would put the $ N=50 $ equations inbetween the $ Given $ and $ Minerr $ keywords:
$$\begin{align}
& u1:=1 \\
& u2:=1 \\
& u3:=1 \\
& C_{i,j}:=w_j*\frac{e^{\frac{-(tpoints_i-pos_j)^2}{w_r^2+(w_j)^2}}}{[w_r^2+(w_j)^2]^{1/2}}\\
& Given \\
& C_{1,1}*u1+C_{1,2}*u2+C_{1,3}*u3 = Y_1 \\
& C_{2,1}*u1+C_{2,2}*u2+C_{2,3}*u3 = Y_2 \\
& C_{3,1}*u1+C_{3,2}*u2+C_{3,3}*u3 = Y_3 \\
& . \\
& . \\
& . \\
& C_{N,1}*u1+C_{N,2}*u2+C_{N,3}*u3 = Y_N \\
& Find(u1,u2,u3) = \begin{pmatrix}u1 & u2 & u3\end{pmatrix}
\end{align}$$
You will end up with a vector containing $ u1, u2, u3 $ with the optimum values for the set of equations.
The reality is, you would probably want to create a program within the worksheet to construct the equations used between $ Given $ and $ Minerr $, as this will save on typing for one and make changes to the model easier - but that is another Thread in it's own right.  
One last point, the initial guess values for the unknown parameters $ u1, u2, u3 $ should be as close to the expected values as possible.  I have used 1 above, but this probably isn't a very good guess value for your situation.
Hope this helps.
