Professional Documents
Culture Documents
Reducing Error
Horners Method
Whenever you do an arithmetic operation (+ - / *), you have the potential for
error.
Horner's Method rearranges a polynomial P(x) into a form that involves fewer
arithmetic operations.
2 3 4 N
P( x) := a + a x + a x + a x + a x .. a x
0 1 2 3 4 N
(1 (2 (3
H( x) := a + x a + x a + x a + xa
0 4 )) )
Horners Method Generalizes this idea into tabular form (synthetic division),
Convergence ()
:= x x
i+1 i
Residual ()
( i+1)
:= F x
If
( 1) ( 1) < 0
F a F c Then Root is between a1 and c1
( 1) ( 1) > 0
F a F c Then Root is betweetn c1 and b1
1
:= ( b a)
n ( n 1)
2
1
C x ( b a)
n 0 n
2
ln
b a
tol n
ln( 2 )
IF
d For All Iterations
g( x) < 1
dx
Newton Raphson Method
x := x
( i)
f x
i+1 i
d
f (x )
dx i
Iterate until
tol
tol
Secant Method
Converges Super-Linearly
Only Requires F(x)
Requires 2 Initial Guesses
x := x
( i)( i i1)
f x x x
i+1 i f (x ) f (x )
i i 1
Solving Simultaneous Linear Equations
A set of simultaneous equations can be represented by a matrix of coefficients [A] times a
vector of variables {x} set equal to a vector of the right hand side values {b}.
3x+5y-z=10
7x-2y+3z=12
x+5y-4z=-1
3 5 1 x 10
7 2 3 y := 12
1 5 4 z 1
[A] {x} {b}
For [A]*{x}={b} to have a unique solution, all equations must be linearly independent.
This is guaranteed by:
det( A) 0
a11 a12 a1 , N
U := 0 a22 a2 , N
0 0 aNN
Lower Triangular
a11 0 0
L := a21 a22 0
aN1 aN2 aNN
Direct Methods
Exact if there is no round off
Solve a problem in a countable number of steps
Major source of error is round off
Applicable if number of equations N < 2000
FLOP count is approx N^3
Use EROs to convert original problem into one that is solveable
Gaussian Elimination
Uses an upper triangular matrix to solve the equation:
U x := b
mod
Where b_mod is the RHS modified due to EROs.
Uses Back Substitution to solve.
Gauss-Jordan Elimination
Uses a diagonalized matrix to solve the equation:
D x := b
mod
Then "Solves"
L U Decomposition
Factors a matrix into the product of both upper and lower triangular matrices.
A := L U
Solves Equation:
L Z := b
Where
Z := U x
Only Applies to Tri-Diagonal Equations:
1 3 0 0 0
6 2 4 0 0
0 4 3 7 0
0 0 2 4 1
0 0 0 2 5
Crout Method
Diagonals of upper triangular matrix equal 1
Dolittle Method
Diagonals of lower triangular matrix equal 1
Thomas Algorithm
Stores information with the use of 4 vectors
Vectors:
{A} = Diagonal of Tri-Diag Matrix
{B} = Super Diagonal of Tri-Diag Matrix
{C} = Sub Diagonal of Tri-Diag Matrix
{b} = Any RHS Vector