Contents

Aaron Klapheck

% In class 21-Feb-08
clear, clc, home
fprintf('The date and time: %s \n', datestr(now))
The date and time: 18-Mar-2008 14:20:59 

Notes

 Numerical Analysis
 Numerical Analysis is used when closed-form solutions do not exist.
 Relative error will be emphasized. In particular if the magnitudes of
 numbers in the model are very small or very large, use relative error
 to address accuracy.
 Deffinitions
 Accuracy: degree to which measurements deviate from the true value.
 Precision: measure of random deviation.
 Bias: measure of systematic deviation. (average error)
 Standard Deviation: is a function of variance (s)
     s = sigma^2 = summation from (i = 1 to n) of [(x_i - x_bar)^2/(n-1)],
     where x_bar is the average.
     note: see statistics book for more info.
 Systems of n Equations
 A large system: n > 3
 A small system: n < 3 or n = 3
 ex 1: n = 2
         4x - 2y = 12
         -3x - y = -4
     can be solved by: method of substitution, Cramer's Rule, Gauss
     Method, or by Graphical method (graph in matlab)
     Cramer's Rule
             A          X       B
         [4,-2;-3,-1]*[x;y] = [12;4]
         x = [12,-2;4,-1]/A
         y = [4,12;-3,4]/A
         The determinat of the coefficient matrix is calld the dell
         factor, denominator approaches 0, then a solution does not exist.
     Gauss's Method
         Ax=b
         A^-1*A*x=A^-1*b
         Ix=A^-1*b
         x=A^-1*b
         note: A^-1*b is represented in MATLAB is A\b
 Rank
     the rank of a matrix provides information about the solution of the
     system.
     Rank: # of independant rows
         Ex 2:
             x + y = 5       ...(4a)
             3x + 3y = 15    ...(4b)
             (4b)=3*(4a) therefore Rank is 1 because there is only one
             linearly independant equation.
             Rank(R) = 1, nuber of solutions(n) = 2
             (R<n therefore not linearly independant matrix)

Solving Systems of Equations

clear, clc, home
fprintf('The date and time: %s \n \n', datestr(now))

disp('%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%')
disp('%                                               %')
disp('%         Purpose: Systems of Equations         %')
disp('%                                               %')
disp('%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%')

A = [1,1;3,3], b = [5;15]
Rank = rank(A)
A\b
% displays a random answer because det(A) = 0.

A = [1,-1;8,3], b = [5;15]
Rank = rank(A)
A\b
The date and time: 18-Mar-2008 14:21:00 
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                               %
%         Purpose: Systems of Equations         %
%                                               %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

A =

     1     1
     3     3


b =

     5
    15


Rank =

     1

Warning: Matrix is singular to working precision.

ans =

     5
     0


A =

     1    -1
     8     3


b =

     5
    15


Rank =

     2


ans =

    2.7273
   -2.2727