10.07.2015 Views

Underdetermined and Overdetermined Systems and Least Squares

Underdetermined and Overdetermined Systems and Least Squares

Underdetermined and Overdetermined Systems and Least Squares

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Underdetermined</strong><strong>and</strong><strong>Overdetermined</strong>Linear Algebraic <strong>Systems</strong>ES100March 1, 1999T.S. Whitten


Objectives● Define underdetermined systems● Define overdetermined systems● <strong>Least</strong> <strong>Squares</strong> Examples


ReviewB500 N∑F x= 0 ; 500 − F sin 45°=BC0F BC∑Fy=0 ; F cos 45° − F =BCBA0F BA⎡−sin 45°⎢⎣ cos 45°142 4coefficients0⎤⎥ ⋅⎦143 4⎡F⎤ BC⎢ ⎥123 ⎣FBA⎦variables=⎡−⎢⎣500⎤⎥0 ⎦


Review cont.⎡−sin 45°⎢⎣ cos 45°142 4coefficients0⎤⎥ ⋅⎦143 4⎡F⎤ BC⎢ ⎥123 ⎣FBA⎦variables=⎡−⎢⎣500⎤⎥0 ⎦The system of matrices above is of the form:Ax = b<strong>and</strong> can be solved using MATLAB left division thus, x = A\bresults in a 1×2 matrix of values for F BC <strong>and</strong> F BA


Review Summary● A system of two Equations <strong>and</strong> twounknowns may yield a unique solution.● The exception is when the determinant of A isequal to zero. Then the system is said to besingular.● The left division operator will solve thelinear system in one step by combining twomatrix operations●A\B is equivalent to A -1 *B


Graphical Representation ofUnique vs. Singular <strong>Systems</strong>unique solutionyxsingular system


<strong>Underdetermined</strong> <strong>Systems</strong>● A system of linear equations is may beundetermined if;1 The determinant of A is equal to zeroA = 02 The matrix A is not square, i.e. the are moreunknowns than there are equationsx + 3 y + 2z=x+ y + z= 42⎡1⎢⎣131⎡x⎤2⎤⎢ ⎥ ⎡ ⎤⎥ ⋅ 2⎢y⎥=1⎢ ⎥⎦⎢ ⎥⎣4⎦⎣z⎦


<strong>Overdetermined</strong> <strong>Systems</strong>● The converse of an underdetermined systemis an overdetermined system where there aremore equations than there are variables● This situation arises frequently inengineering. For example: suppose a linearrelationship is expected between x <strong>and</strong> y <strong>and</strong>there are multiple data points.


Data Distribution of LinearPhenomenayexperimental datax


Data Distribution of LinearPhenomenayexperimental datay = mx + bxThe line y = mx + b, that best describes thisdata is obtained by the method of least squares


Method of <strong>Least</strong> <strong>Squares</strong>}(x 1 ,y 1 )(x 2 ,y 2 )J = ∑( mx )i+ b−y iJ {i=12}J 1J 3(x 3 ,y 3 )nThe line that results in theminimum value of J isthe least squares linear fitto the data.2


Exampley2520151050datalinear fit0 5 10 15t data1 3.002 3.163 5.664 8.155 11.846 13.857 14.888 17.679 16.5310 21.65t


The <strong>Overdetermined</strong> System● Once the curve fit is obtained, a y-value maybe interpolated for any x-value within the x-data range (sometimes extrapolation ispossible).● In the following example, fmins is used tominimize the sum of the squared residualswith respect to the slope <strong>and</strong> intercept.


Flowchart for least.mload data.txtassign columnscall fminsassign outputcalculatelineplotlineplot data points<strong>and</strong> linegenerate xvector


Run least.m


Solving The <strong>Overdetermined</strong>System, Method II● Solving the overdetermined system iscarried out the same way as the other linearalgebra solutions using the left divisionmethod⎡m⎤x = ⎢ = A \b⎥⎣ ⎦B


Method II (cont’d)● If the system is not overdetermined, themethod will not work


<strong>Overdetermined</strong> system cont.⎡ 1⎢⎢5⎢⎣101m+ b5m+ b10m+ b111⎤⎥⎥⎥⎦⋅⎡⎢⎣mb=3.00= 11.84= 21.65⎤⎥⎦=⎡ 3.00 ⎤⎢ ⎥⎢11.84⎥⎢⎣21.65⎥⎦A x Bt data1 3.002 3.163 5.664 8.155 11.846 13.857 14.888 17.679 16.5310 21.65


Program least2.mStartLoad the dataBuild matrix APrint slope,interceptGenerate x, y pairsusing fitBuild matrix bLeft divide(parameters=A\B)Plot data<strong>and</strong>fit-generated x,y setStop


Run least2.m

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!