Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 20

GNE 333 - Engineering Analysis 1

Part 2 – Root Finding Methods

Open Methods

Dr. Yves Mansour


yves.mansour@lau.edu.lb

03/27/2024 GNE 333 - Engineering Analysis 1 – Part 2 – Root Finding Methods – Open Methods 1
Objectives
 Recognizing the difference between bracketing and open methods for root
location.

 Understanding the fixed-point iteration method and how you can evaluate its
convergence characteristics.

 Knowing how to solve a roots problem with the Newton-Raphson method and
appreciating the concept of quadratic convergence.

 Knowing how to implement both the secant and the modified secant methods.

 Knowing how to use MATLAB’s built-in function to estimate roots.

03/27/2024 GNE 333 - Engineering Analysis 1 – Part 2 – Root Finding Methods – Open Methods 2
Open Methods versus Bracketing Methods
Bracketing methods Open methods Open methods
(Converging) (Diverging)

When the open methods converge they usually do so


much more quickly than the bracketing methods.

03/27/2024 GNE 333 - Engineering Analysis 1 – Part 2 – Root Finding Methods – Open Methods 3
Fixed-Point Method
The function = 0 is rearranged so that is on the left-
hand side of the equation:
𝑥=𝑔 ( 𝑥)
This transformation can be accomplished by algebraic
manipulation or by adding to both sides of = 0

The root of = 0 corresponds to the intersection point


between and
Given an initial guess at the root , a new estimate is
obtained from the iterative formula

Iteration are repeated until: ¿ 𝜀𝑠

03/27/2024 GNE 333 - Engineering Analysis 1 – Part 2 – Root Finding Methods – Open Methods 4
Example 6.1

~ Constant

Linear
convergence

03/27/2024 GNE 333 - Engineering Analysis 1 – Part 2 – Root Finding Methods – Open Methods 5
Example 6.1

03/27/2024 GNE 333 - Engineering Analysis 1 – Part 2 – Root Finding Methods – Open Methods 6
Cobweb Plots


′ − 1< 𝑔 ( 𝑥𝑟 ) < 0
0 <𝑔 ( 𝑥 𝑟 ) < 1

𝑥𝑟 𝑥𝑟
Step convergence Spiral convergence

03/27/2024 GNE 333 - Engineering Analysis 1 – Part 2 – Root Finding Methods – Open Methods 7
Cobweb Plots (cont.)

𝑔 ′ ( 𝑥 𝑟 ) >1


𝑔 ( 𝑥 𝑟 ) <− 1

𝑥𝑟 𝑥𝑟
Step divergence Spiral divergence

03/27/2024 GNE 333 - Engineering Analysis 1 – Part 2 – Root Finding Methods – Open Methods 8
Fixed-Point Method Convergence
The approximation error of the fixed-point method at iteration is: 𝐸𝑖 +1 =|𝑥𝑖 +1 − 𝑥𝑖|
But since and , then:

𝐸𝑖 +1 =|𝑔 ( 𝑥 𝑖 ) − 𝑔 ( 𝑥 𝑖 −1 )|=
𝑥 𝑖 − 𝑥𝑖 − 1 |
𝑔 ( 𝑥𝑖 ) − 𝑔 ( 𝑥 𝑖 −1 )
|𝑥 𝑖 − 𝑥𝑖 −1| |
According to the derivative mean-value theorem:
𝑔 ( 𝑥 𝑖 ) −𝑔 ( 𝑥𝑖 − 1 )
=𝑔 ′ ( 𝜉 ) where 𝜉 ∈[𝑥 𝑖−1 , 𝑥 𝑖 ]
𝑥 𝑖 − 𝑥 𝑖 −1
Consequently, =
The approximation error of the fixed-point method decreases (the method converges) if
< 1, where is at the root vicinity.(When applying numerical methods to find the root of a function, the vicinity is where the iterative
process converges, getting closer to the root with each step.)
03/27/2024 GNE 333 - Engineering Analysis 1 – Part 2 – Root Finding Methods – Open Methods 9
Newton-Raphson Method
Perhaps the most used of all root-locating formulas because of its convergence property.
The first derivative at is equal to the slope:

Which can be rearranged to yield to the iterative


Newton-Raphson formula:

It can be shown that Newton-Raphson method


has quadratic convergence: 𝑥𝑖 +2

const.
03/27/2024 GNE 333 - Engineering Analysis 1 – Part 2 – Root Finding Methods – Open Methods 10
Example 6.2

03/27/2024 GNE 333 - Engineering Analysis 1 – Part 2 – Root Finding Methods – Open Methods 11
Convergence Difficulties of Newton-Raphson Method
Although the Newton-Raphson method is often very efficient, there are situations
where it performs poorly.
Difficulties may arise when the function has
an extremum or a small slope near the root.

Oscillations around a local extremum


Choose as close as possible to the root.

Convergence stagnation around


an inflexion point
03/27/2024 GNE 333 - Engineering Analysis 1 – Part 2 – Root Finding Methods – Open Methods 12
Example 6.4

03/27/2024 GNE 333 - Engineering Analysis 1 – Part 2 – Root Finding Methods – Open Methods 13
Secant Method
A potential problem in implementing the Newton-Raphson method is the evaluation of
the function derivative.
𝑓 (𝑥)
In the secant method is approached using a
backward finite-difference scheme:
𝑓 ( 𝑥 𝑖 −1 )

Substituting this expression of in Newton-


Raphson results in the secant iterative formula:
𝑓 ( 𝑥𝑖)
𝑥
𝑥𝑖 +1𝑥𝑖 𝑥𝑖 −1
Notice that the approach requires 2 initial estimates
and of , but no bracketing is necessary.

03/27/2024 GNE 333 - Engineering Analysis 1 – Part 2 – Root Finding Methods – Open Methods 14
Problem Statement: Implement secant method to determine the mass of the bungee jumper
with a drag coefficient of 0.25 kg/m to have a velocity of 36 m/s after 4 s of free fall. The
acceleration of gravity is 9.81 m/s².Take initial guess 50 kg and 75 kg

03/27/2024 GNE 333 - Engineering Analysis 1 – Part 2 – Root Finding Methods – Open Methods 15
Modified Secant Method
Rather than using two arbitrary values to estimate the derivative, an alternative approach
involves a fractional perturbation of the independent variable to estimate
where is a small perturbation of .

This approximation is substituted into Newton-Raphson equation to yield the following


iterative formula of the modified secant method:

The smaller the closer the behavior of the modified secant method to that of Newton-
Raphson, without the need to find the expression of .
The modified secant method may suffer the same convergence difficulties as Newton-
Raphson. Problems arise when become too small.

03/27/2024 GNE 333 - Engineering Analysis 1 – Part 2 – Root Finding Methods – Open Methods 16
Example 6.5

03/27/2024 GNE 333 - Engineering Analysis 1 – Part 2 – Root Finding Methods – Open Methods 17
03/27/2024 GNE 333 - Engineering Analysis 1 – Part 2 – Root Finding Methods – Open Methods 18
Matlab Functions
The “fzero” function is designed to find the real root of a single equation. It combines
bracketing techniques (robustness) and open methods (convergence speed).
Its simplest syntax is:
where “function” is the name of the function being evaluated and “x0” is an initial guess.
To find a root in a specific interval, two values bracketing the root must be specified.

Example: roots of

03/27/2024 GNE 333 - Engineering Analysis 1 – Part 2 – Root Finding Methods – Open Methods 19
Matlab Functions (cont.)
MATLAB has an excellent built-in capability to find the roots of a polynomial.
The “roots” function has the syntax: x = roots(C)
Where C is a row vector containing the coefficients of the polynomial:
C(1)*X^N + ... + C(N)*X + C(N+1)
Example: zeros of
>> a = [1 -3.5 2.75 2.125 -3.875 1.25];
>> roots(a)
ans =
2.0000 + 0.0000i
-1.0000 + 0.0000i
1.0000 + 0.5000i
1.0000 - 0.5000i
0.5000 + 0.0000i
03/27/2024 GNE 333 - Engineering Analysis 1 – Part 2 – Root Finding Methods – Open Methods 20

You might also like