This web page contains example programs that will be covered in class.
Programs are written in Java and Matlab.
Web page in progress!!!
BASIC NUMERICAL ANALYSIS 
PROGRAM OUTPUT AND SOURCE CODE 
Loss of Numerical Precision.
This program illustrates the limitations of finite precision
representation of floating point numbers,
and how seemingly simple calculations can lead to a steady accumulation
of numerical errors.
This program works through three experiments:
(1) Simple arithmetic (4.0/3.0) with floating point (32bit) numbers;
(2) Simple arithmetic (4.0/3.0) with double precision floating point (64bit) numbers; and
(3) Simple arithmetic with a number (0.10) whose binary representation
contains an infinite series of digits.

Standalone Program:
NumericalPrecision.java Program Output: output 
Substractive Cancellation.
Subtractive cancellation occurs when two numbers of almost equal value are subtracted.
The result is a loss of significant digits.
This program illustrates two common strategies for avoiding
subtractive cancellation:
(1) rewrite arithmetic expressions to avoid subtraction; and
(2) replace an arithmetic expression with an approximation
that evaluates to a more accurate numerical value.

Standalone Program:
SubtractiveCancellation.java Program Output: output 
Root finding with the Method of Bisection.
Demonstrate use of bisection method to compute roots of the quadratic.
f(x) = (x3)*(x3)  2; 
Mfiles:
myfunc3.m bisection.m testroot1.m Program Output: output 
Root finding with the Newton Raphson Algorithm.
Demonstrate use of newtonraphson algorithm by computing roots of
the quadratic equation
f(x) = (x3)*(x3)  2; The derivative is given by: df(x)/dx = 2x  6. 
Mfiles:
myfunc3.m myfunc3dfdx.m newtonraphson.m testroot2.m Program Output: output 
Gauss Elimination.

Mfiles:
gaussnaive.m gausspivot.m testgauss1.m Program Output: output 
Gauss Seidel Iteration. 
Mfiles:
gaussseidel.m testgaussseidel.m Program Output: output 
ACKNOWLEDGEMENTS
Developed in February 2007 by Mark Austin
Copyright © 2007,
Department of Civil and Environmental Engineering, University of Maryland