% BRIEF RECAP of October 20th, 1998 NEEP271 lecture
% written by Fabian Waleffe 98/10/20
%
% We talked about exam 1 briefly, reviewed least-squares,
% linear fits, how to use Matlab's A\b to do more general
% linear fits, e.g. how to find a, b, c in 
%
%    y(t)= a sin(t) + b sin(2 t) + c sin(3 t)
% 
% given the M data points (t_i, y_i), i= 1,..., M
% 
% The idea is to write this problem as an overdetermined 
% linear system of equations Ax=b then use Matlab's x=A\b
% For the example above the matrix A is the M-by-3 matrix 
%
% A=[  sin(t1)   sin(2 t1)  sin(3 t1)     b=[ y1
%      sin(t2)   sin(2 t2)  sin(3 t2)         y2
%        :           :          :              :
%        :           :          :              :
%      sin(tm)   sin(2 tm)  sin(3 tm)]        ym ]
%
%
% Also talked about linear systems of equations A x =b
% whose Matlab solution is simply x=A\b (again! but here
% we get an exact solution because we have as many equations
% as unknowns). The only problem  is to be able to construct
%  A and b for the particular problem
%
% Illustration: deriving the equations for a MASS-SPRING CHAIN
% in equilibrium => Sum of forces = 0 for each mass. 
% 
% We will demo this using Matlab on R, Oct 22