Professional Documents
Culture Documents
Root Finding
Consider two towns, Zeigler and Felts, located as shown in the following diagram.
Pennsyltucky Petroleum wants to build a pipeline between the two towns. Because of the
differences of terrain, the cost to build the pipeline will be C1 million dollars per mile north of the
line WE, and C2 million dollars per mile south of the line.
This amounts to finding out where to place point P at which pipeline crosses the line WE.
Figure 1.0 :
N
Zeigler
P
W E
Felts
A. Bisection Method
The division of a curve, figure or an interval in two equal parts
Figure 1.1:
y
X1 X2
x
Root (X3)
or
X1 X3 X2 X1 X3 X 2
4. Use X3 as the new endpoint of the range that contains the solution.
Example:
2
Find the root of the equation: y = x – 6 using Bisection Method with ε ≥ 0.00001
f (x) approximately 0:
Procedure:
Example:
2
Find the root of the equation: y = x – 6 using Newton - Raphson Method with ε ≥ 0.00001
f(x) = x2 - 6
f’(x) = 2x
Root
C. Secant Method
Modification of Newton method with the derivative replaced by a difference expression
x= f(x0)
X0 - f(x0) – f(x00)___
x0 - X00
Procedure:
Example:
2
Find the root of the equation: y = x – 6 using Secant Method with ε ≥0.00001
Assume Xo = 5 , Xoo = 0
Root Error
Procedure:
1. Assume xo
2. Get x = f(xo) x = g(x)
3. Error check, absolute value of (x-xo) or ε =f(x)
4. Set xo=x if ε > e
Example:
2
Find the root of the equation: y = x + 2x – 1 using Fixed Point Iteration Method with ε = 0.00001
Y = f(x) ; set y = 0
1. 0= x2 + 2x -1 2. 2x = 1- x2
x2= 1 – 2x x = (1- x2)/2
x = √1 − 2𝑥
3. x2 = 1-2x 4. x2 + 2x = 1
x*x= 1-2x x(x+2) = 1
x = (1-2x)/x x = (1-x2) / 2
Assume Xo = 5
Do not converge
rd
Trial 3: Using 3 equation: x = (1-2x)/x
A. Jacobi Method
Given an equation with a variable, rearrange each equation to give a different
variable and put in the form:
X = Tx + C
I.E.:
1. a1x1+a2x2+a3x3 = a4
2. a5x1+a6x2+a7x3 = a8
3. a9x1+a10x2+a11x3 = a12
X = Tx + C
Values are:
x1 = 0.795817
x2 = - 0.96064
x3 = 0.963102
B.
X1 X2 X3
Initial Values 0 , 0 , 0
0
Example:
Find the values of x1, x2 & x3 of the given equation using Jacobi Method.
10x1 + 2x2 - x3 = 7 x1 =(-2x2 -+x3 + 7)/10
x1 + 8x2 + 3x3 = -4 x2 = (- x1 - 3x3 -4)/8
-2x1 - x2 + 10x3 = 9 x3 = (2x1 +x2 + 9)/10
Procedure:
1. Express all equations in the form f1(x1, x2, x3) = 0; f2 (x1, x2, x3) = 0; f3(x1, x2, x3) = 0.
2. Assume x1, x2, x3 : f1(x1, x2, x3) = R1 ; R1 = residual.
3. Choose the largest residual and adjust the variable corresponding to that R to relax R to 0.
4. If R2 is the largest residual, adjust x2 to make R2 equal to zero.
5. Apply x2 to the other equation.
f1(x1, x2, x3) = R1’
f2(x1, x2, x3) = R2’
f3(x1, x2, x3) = R3’
Example:
Find the values of x1, x2 & x3 of the given equation:
8x1 + x2 - x3 = 8 8x1 + x2 - x3 -8 = 0
2x1 + x2 + 3x3 = 12 2x1 + x2 + 3x3 -12 = 0
-x1 +7 x2 - 2x3 = 4 -x1 +7 x2 - 2x3 -4 = 0
-x1 - x2 + x3 +1 = 0
8 8
- 2x1 - x2 - x3 + 4 = 0
9 9 3
x1 - x2 + 2 x3 + 4 = 0
7 7 7
Reorder the equation so that the negative one coefficient is arranged in diagonal form
x1 = 1
x2 = 1
x3 = 1
A method of constructing new data points within the range of a discrete set of known data
points.
A. Tabular Interpolation
Example:
T P h
90° 0.699 58.06
100° 0.950 68.04
110° 1.276 78.01
115° Px hx
120° 1.695 87.99
Solving for Px
Px = 0.2095 + 1.276
Px = 1.4855
Solving for hx
hx = 78.01 + 5
hx = 83.01
A method of interpolation that uses a graph to estimate the value of the points
not present on the given data.
Example:
T P h
90° 0.699 58.06
100° 0.950 68.04
110° 1.276 78.01
115° Px hx
120° 1.695 87.99
Solving for Px
1.695
Px
1.276
0.950
T
100 110 120 130
115
Solving for hx
87.99
hx
78.01
68.04
T
100 110 120 130
115
Pj (x) = fj π x - xj where:
xj - xk j = no of terms
k=1
k≠j
Example:
Given the table of values, construct a working formula and find the interpolated value for
x = 3.
X f(x)
-2 4 Pj (x) = fj π x - xj
-1 1 xj - xk
0 0
1 1
2 4
When x = 3:
P4(x) = 0.055(3)4+0.055(3)3−0.222(3)2−0.222(3)
Procedure:
Example:
Xi P(x)
1 9 81 P12
2 8 64 P123
P23 P1234
3 6 36 P234
4 3 9 P34
P(10) = 100
The table corresponds with the formula P(x) = x2. Thus, P(10) = 100.
A. Trapezoidal Method
The trapezoidal method works by approximating the region under the graph of
the function as a trapezoid and calculating its area. It follows the form:
𝑏 𝑑𝑥
∫𝑎 𝑓(𝑥 )𝑑𝑥 ≅ ∑𝑛𝑖=1 2
[𝑓𝑖 + (𝑓𝑖 + 1)]
where dx = (b - a)/n ; n = no. of strips
This graph shows how a parabolic arc can be used in approximating a value for a certain
equation.
Example:
5
∫1 (1 + 𝑥 2 )𝑑𝑥
dx = (b-a) / n X F(x)
dx = (5-1)4 1 2
dx = 1 2 5
3 10
1 2 3 4 5
4 17
5 26
I ≅ (dx/2)(f1+2f2+2f3+2f4+f5)
I ≅ (1/2)(2+2(5)+2(10)+2(17)+(26))
I ≅ 46
𝑏
𝑑𝑥
∫ 𝑓(𝑥 )𝑑𝑥 ≅ [𝑓 + 4𝑓2 + 2𝑓3 + 4𝑓4 + ⋯ 𝑓5 ]
𝑎 3 1
This graph shows how a parabolic arc can be used in approximating a value for a
certain equation.
Example:
5
∫ (1 + 𝑥 2 )𝑑𝑥
1
dx = (b-a) / n
dx = (5-1)4
dx = 1
1 2 3 4 5
X F(x)
1 2
2 5
3 10
4 17
5 26
I ≅ (dx/3)(f1+4f2+2f3+4f4+f5)
I ≅ (1/3)(2+4(5)+2(10)+4(17)+(26))
I ≅ 45.333
Iz = Iy + 13(Iy-Ix)
Where:
(𝑏−𝑎)
hx = 2
ℎ𝑥
hy = 2
Example:
1.5
2
∫ (𝑒 −𝑥 )𝑑𝑥
0.2
𝑏−𝑎 1.5−0.2
hx = 2
= 2
= 0.65
Ix = 0.65
2
[𝑒 −(0.2)
2 2 2
+ 2(𝑒 −(0.85) ) + 𝑒 −(1.5) ] = 𝟎. 𝟔𝟔𝟐𝟏𝟏
ℎ𝑥 0.65
hx = = = 0.325
2 2
Iy = 0.325
2
[𝑒 −(0.2)
2 2 2 2 2
+ 2(𝑒 −(0.525) ) + 2(𝑒 −(0.85) ) + 2(𝑒 −(1.175) ) + 𝑒 −(1.5) ] = 𝟎. 𝟔𝟓𝟗𝟒𝟕
1.5
2
∫ (𝑒 −𝑥 )𝑑𝑥 = 𝟎. 𝟔𝟓𝟖𝟓𝟗
0.2
3. Horwitz, A. "A Version of Simpson's Rule for Multiple Integrals." J. Comput. Appl.
Math. 134, 1-11, 2001.
4. Yousef Saad, Iterative Methods for Sparse Linear Systems, 1st edition, PWS, 1996.
8. Josef Stoer and Roland Bulirsch, Introduction to Numerical Analysis. New York: Springer-
Verlag, 1980.