Date post: | 21-Jun-2015 |
Category: |
Documents |
Upload: | mohammad-tawfik |
View: | 970 times |
Download: | 5 times |
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Roots of Nonlinear Equations
Open Methods
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Objectives
• Be able to use the fixed point method to find a root of an equation
• Be able to use the Newton Raphson method to find a root of an equations
• Be able to use the Secant method to find a root of an equations
• Write down an algorithm to outline the method being used
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Fixed Point Iterations
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
kk xgx 1
Fixed Point Iterations
• Solve 0xf
0 xgxxf
• Rearrange terms:
• OR
xgx
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
In some cases you do not get a solution!
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Example
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Example
22 xxxf Which has the solutions -1 & 2
To get a fixed-point form, we may use:
22 xxg
xxg 21 2 xxg
12
22
x
xxg
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
First trial!
• No matter how close your initial guess is, the solution diverges!
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Second trial
• The solution converges in this case!!
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Condition of Convergence
• For the fixed point iteration to ensure convergence of solution from point xk we should ensure that
1' kxg
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Fixed Point Algorithm
1. Rearrange f(x) to get f(x)=x-g(x)
2. Start with a reasonable initial guess x0
3. If |g’(x0)|>=1, goto step 2
4. Evaluate xk+1=g(xk)
5. If (xk+1-xk)/xk+1< s; end
6. Let xk=xk+1; goto step 4
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Newton-Raphson Method
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Newton’s Method: Line Equation
121
21 ' xfxx
yym
The slope of the line is given by:
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Newton’s Method: Line equation
121
1 ' xfxx
xf
11
12 ' xf
xfxx
kk
kk xf
xfxx
'1
Newton-RaphsonIterative method
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Newton’s Method: Taylor’s Series
1121 ' xfxxxf 11
12 ' xf
xfxx
kk
kk xf
xfxx
'1
Newton-RaphsonIterative method
11212 ' xfxxxfxf
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Example
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Newton-Raphson Algorithm
1. From f(x) get f’(x)
2. Start with a reasonable initial guess x0
3. Evaluate xk+1=xk-f(xk)/f’(xk)
4. If (xk+1-xk)/xk+1< s; end
5. Let xk=xk+1; goto step 4
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Convergence condition!
• Try to derive a convergence conditions similar to that of the fixed point iteration!
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Secant Method
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Secant Method
21
21
2
2
xx
yy
xx
yy
The line equation is given by:
2
21
221 0xx
yy
yxx
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Secant Method
2
21
221 0xx
yy
yxx
21
2122 yy
xxyxx
kk
kkkkk xfxf
xxxfxx
1
11
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Secant Algorithm
1. Select x1 and x2
2. Evaluate f(x1) and f(x2)
3. Evaluate xk+1
4. If (xk+1-xk)/xk+1< s; end
5. Let xk=xk+1; goto step 3
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Why Secant Method?
• The most important advantage over Newton-Raphson method is that you do not need to evaluate the derivative!
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Comparing with False-Position
• Actually, false position ensures convergence, while secant method does not!!!
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Conclusion
• The fixed point iteration, Newton-Raphson method, and the secant method in general converge faster than bisection and false position methods
• On the other hand, these methods do not ensure convergence!
• The secant method, in many cases, becomes more practical than Newton-Raphson as derivatives do not need to be evaluated
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Homework #2
• Chapter 6, p 157, numbers:6.1,6.2,6.3
• Homework due next week