05.numerical Methods Chapter4 2 OpenMethod
05.numerical Methods Chapter4 2 OpenMethod
05.numerical Methods Chapter4 2 OpenMethod
• Open Methods
❑Newton’s Method
❑Secant Method
❑Fixed-Point Method
Bahar
Ayhan
Numerical Methods
Civil Engineering Department
IV. Solving Nonlinear Equations: Open Methods >> Newton’s Method (Newton-Raphson Method)
Bahar
Ayhan
Numerical Methods
Civil Engineering Department
IV. Solving Nonlinear Equations: Open Methods >> Newton’s Method (Newton-Raphson Method)
f ( x1 )
Solving the equation above for x2 gives: x2 = x1 −
f ( x1 )
General form of the equation for determining the next solution xi+1 from the present
solution xi :
f ( xi )
x =x − i +1
f ( xi )
i
(General iteration formula for Newton’s method)
Bahar
Ayhan
Numerical Methods
Civil Engineering Department
IV. Solving Nonlinear Equations: Open Methods >> Newton’s Method (Newton-Raphson Method)
f ( x2 ) = f ( x1 ) + ( x2 − x1 ) f ( x1 ) + 2! ( x2 − x1 ) f ( x1 ) + ...
1 2
f ( xi )
xi +1 = xi −
f ( xi )
Bahar
Ayhan
Numerical Methods
Civil Engineering Department
IV. Solving Nonlinear Equations: Open Methods >> Newton’s Method (Newton-Raphson Method)
Bahar
Ayhan
Numerical Methods
Civil Engineering Department
IV. Solving Nonlinear Equations: Open Methods >> Newton’s Method (Newton-Raphson Method)
xi +1 − xi
xi
2. Tolerance in f(x)
The iterations are stopped when the absolute value of f(xi) is smaller than a some number δ
f ( xi )
Bahar
Ayhan
Numerical Methods
Civil Engineering Department
IV. Solving Nonlinear Equations: Open Methods >> Newton’s Method (Newton-Raphson Method)
Bahar
Ayhan
Numerical Methods
Civil Engineering Department
IV. Solving Nonlinear Equations: Open Methods >> Newton’s Method (Newton-Raphson Method)
Bahar
Ayhan
Numerical Methods
Civil Engineering Department
IV. Solving Nonlinear Equations: Open Methods >> Secant Method
The Secant Method is a scheme for finding a numerical solution of an equation of the form f(x) =0.
The method uses two points in the neighborhood of the solution to determine a new estimate for the solution.
The two points (marked as x1 and x2 in the figure) are used to define a straight line (secant line) and the point
where the line intersects the x-axis (marked as x3 in the figure) is the new estimate for the solution.
Bahar
Ayhan
Numerical Methods
Civil Engineering Department
IV. Solving Nonlinear Equations: Open Methods >> Secant Method
f ( x1 ) − f ( x2 ) f ( x2 ) − 0 f ( x2 ) ( x1 − x2 )
= x3 = x2 −
x1 − x2 x2 − x3 f ( x1 ) − f ( x2 )
Bahar
Ayhan
Numerical Methods
Civil Engineering Department
IV. Solving Nonlinear Equations: Open Methods >> Secant Method
f ( x2 ) ( x1 − x2 ) f ( xi ) ( xi −1 − xi )
x3 = x2 − xi +1 = xi −
f ( x1 ) − f ( x2 ) f ( xi −1 ) − f ( xi )
Numerical Methods
Civil Engineering Department
IV. Solving Nonlinear Equations: Open Methods >> Secant Method
f ( xi )
f ( xi ) ( xi −1 − xi ) xi +1 = xi −
xi +1 = xi − f ( xi −1 ) − f ( xi )
f ( xi −1 ) − f ( xi ) It is not necessary to know the
( xi −1 − xi ) analytical form of f`(x) in Secant
method (unlike Newton’s method)
f ( xi )
xi +1 = xi −
f ( xi ) Newton’s Method equation
Bahar
Ayhan
Numerical Methods
Civil Engineering Department
IV. Solving Nonlinear Equations: Open Methods >> Fixed-Point Iteration Method
The method is a scheme for solving an equation of the form f(x) =0.
The method is carried out by rewriting the equation: x = g ( x )
Numerical Methods
Civil Engineering Department
IV. Solving Nonlinear Equations: Open Methods >> Fixed-Point Iteration Method
xi +1 = g ( xi )
The function g(x) is called the iteration function.
Bahar
Ayhan
Numerical Methods
Civil Engineering Department
IV. Solving Nonlinear Equations: Open Methods >> Fixed-Point Iteration Method
The values of x that are obtained are successive iterations that progressively converge
toward the solution.
Bahar
Ayhan
Numerical Methods
Civil Engineering Department
IV. Solving Nonlinear Equations: Open Methods >> Fixed-Point Iteration Method
From 𝑥2 a vertical line is drawn toward the curve 𝑦 = 𝑔 𝑥 . The intersection point is
now 𝑥2 , 𝑔 𝑥2 and the value 𝑔 𝑥2 = 𝑥3 .From point 𝑥2 , 𝑔 𝑥2 a horizontal line is
drawn again toward y=x and the intersection point gives the location of 𝑥3
As the process continues the intersection points converge toward the fixed point > the true solution xTS.
Bahar
Ayhan
Numerical Methods
Civil Engineering Department
IV. Solving Nonlinear Equations: Open Methods >> Fixed-Point Iteration Method
It is possible that the iterations will not converge toward the fixed point >> diverge
away.
Even though the starting point is close to the solution, subsequent points are moving
away from the solution.
Bahar
Ayhan
Numerical Methods
Civil Engineering Department
IV. Solving Nonlinear Equations: Open Methods >> Fixed-Point Iteration Method
The form f(x)=0 does NOT lend itself to deriving an iteration formula of the
form 𝑥 = 𝑔(𝑥).
In such a case, one can always add and substract 𝑥 to 𝑓 𝑥 to obtain
𝑥 + 𝑓 𝑥 − 𝑥 = 0.
The equation can be rewritten in the form that can be used in the fixed-point
iteration method.
x = x + f ( x) = g ( x)
Bahar
Ayhan
Numerical Methods
Civil Engineering Department
IV. Solving Nonlinear Equations: Open Methods >> Fixed-Point Iteration Method
There might be more than one form that can be used, or it may be that none of the
forms are appropriate so that the fixed-point iteration method cannot be used to solve
the equation.
In cases where there are multiple solutions, one iteration function may yield one root,
while a different function yields other roots.
Bahar
Ayhan
Numerical Methods
Civil Engineering Department
IV. Solving Nonlinear Equations: Open Methods >> Fixed-Point Iteration Method
g ( x ) 1
Bahar
Ayhan
Numerical Methods
Civil Engineering Department
IV. Solving Nonlinear Equations: Open Methods >> Fixed-Point Iteration Method
xe 0.5 x
+ 1.2 x − 5 = 0
A plot of the function shows that the equation has a
solution between x=1 and x=2.
Bahar
Ayhan
Numerical Methods
Civil Engineering Department
IV. Solving Nonlinear Equations: Open Methods >> Fixed-Point Iteration Method
xe0.5 x + 1.2 x − 5 = 0
xe0.5 x + 1.2 x − 5 = 0
Case b : 5 5
x = 0.5 x g ( x ) = 0.5 x
e + 1.2 e + 1.2
−5e0.5 x
g ( x ) =
2 (e + 1.2 )
2
0.5 x
−5e(0.5)(1)
g (1) = = −0.5079
2 (e + 1.2 )
2
(0.5)(1)
−5e(0.5)(2)
g (2) = = −0.4426
2 (e + 1.2 )
2
(0.5)(2)
Bahar
Ayhan
Numerical Methods
Civil Engineering Department
IV. Solving Nonlinear Equations: Open Methods >> Fixed-Point Iteration Method
xe0.5 x + 1.2 x − 5 = 0
Case c: 5 − 1.2 x
5 − 1.2 x
x= g ( x) =
e 0.5 x e0.5 x
−3.7 + 0.6 x
g ( x) =
e0.5 x
−3.7 + (0.6)(1)
g (1) = (0.5)(1)
= −1,8802
e
−3.7 + (0.6)(2)
g (2) = (0.5)(2)
= −0.9197
e
Bahar
Ayhan
Numerical Methods
Civil Engineering Department
IV. Solving Nonlinear Equations: Open Methods >> Fixed-Point Iteration Method
g ( x ) 1
These results show that the iteration function g(x) from Case b is the one should be used !
5
xi +1 = 0.5 xi
e + 1.2
Bahar
Ayhan
Numerical Methods
Civil Engineering Department
IV. Solving Nonlinear Equations: Open Methods >> Fixed-Point Iteration Method
5
xi +1 = 0.5 xi Starting with x=1...
e + 1.2
5 5
x2 = = 1.7552 x5 = = 1.4776
e (0.5)(1)
+ 1.2 e (0.5)(1.5622)
+ 1.2
5 5
x3 = = 1.3869 x6 = = 1.5182
e (0.5)(1.7552)
+ 1.2 e (0.5)(1.4776)
+ 1.2
5 5
x4 = = 1.5622 x7 = = 1.4986
e (0.5)(1.3869)
+ 1.2 e (0.5)(1.5182)
+ 1.2
The values calculated in the iterations are converging toward the actual solution x=1.5050
Bahar
Ayhan
Numerical Methods
Civil Engineering Department
IV. Solving Nonlinear Equations: Open Methods >> Fixed-Point Iteration Method
Bahar
Ayhan
Numerical Methods
Civil Engineering Department
Numerical Methods
Numerical Methods
Civil Engineering Department