0% found this document useful (0 votes)
2 views

Chapter 2

Chapter Two discusses the roots of nonlinear equations in one variable, focusing on methods for solving these equations, including algebraic, graphical, and numerical methods. It details bracketing methods like the bisection and false position methods, as well as open methods such as fixed-point iteration, Newton-Raphson, and the secant method. The chapter emphasizes the importance of these methods in various scientific and engineering applications for finding roots of equations efficiently.

Uploaded by

dawitkebede1619
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Chapter 2

Chapter Two discusses the roots of nonlinear equations in one variable, focusing on methods for solving these equations, including algebraic, graphical, and numerical methods. It details bracketing methods like the bisection and false position methods, as well as open methods such as fixed-point iteration, Newton-Raphson, and the secant method. The chapter emphasizes the importance of these methods in various scientific and engineering applications for finding roots of equations efficiently.

Uploaded by

dawitkebede1619
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 30

Chapter Two

Roots of Nonlinear Equations in One Variable


Contents of lecture:
I. Algebraic method
II. Graphic method
III. Numerical methods consist:
I. Bracketing method includes:
Bisection & False position.
II. Open method includes
Fixed point, Newton Raphson & Secant.

1
Introduction
• Equations need to be solved in all areas of science and engineering in the form of f (x) = 0 are said to be non-
linear where the degree of the equation is greater than one (variable change b/n two entities)
• The solutions (values of x) are known as the roots of the equation f (x) = 0, or the zeroes of the function f (x).

 This is generally said to be Solving non-linear Equations.

2
Fig: Illustration of equations with no, one, or several solutions.
Algebraic method
This method is solving the equations that are in the form of
ax2 +bx +c=0 or that can be reduced to this form easily.
To solve f ( x ) ax 2  bx  c 0,

3
it is clear that we use quadratic equation soln method.

Eg. find the root of


f(x)=2x2+6x+4=0

• The quadratic formula is Algorithm for solving for the real


roots of a quadratic equation.

• There are many other functions for which the root cannot be
determined so easily. For this cases, the graphical or numerical
methods provide efficient to obtain the answer.
Graphical methods
A simple method for obtaining an estimate of the root of the
equation f (x)=0 is to make a plot of the function and observe
where it crosses the x-axis.
By plotting the graph f (x) Vs X on
Example: Obtain an initial
an Excel we can estimate the
approximation to a root of the

4
crossing point
Equation f(x)=cos x – x e =0
x

From the table we find that the function From the graph we can approximate
f (x)= 0 has at least one root in the the crossing point between 0.4 – 0.6
interval (0.5 -1). While the exact root is 0.517757363
Numerical methods

The methods used for solving non-linear equations numerically can


be divided into two broad groups bracketing and open Methods.

5
1. Bracketing methods: is based on the fact that a function
typically changes signs in the vicinity of a root. Require two
starting values of Xl and Xu values that necessarily bracket the root.

1. Bisection
2. False position.

2. Open Methods: require only a single starting values of X


or two values that do not necessarily bracket the root.
1. Fixed point,
2. Newton Raphson
3. Secant.
Bracketing methods: Bisection Method
• The basic algorithm for the bisection method relies on
repeated application of the intermediate value theorem.
• If f (x) is a continuous function on some interval [a,b] and

6
f(a)*f(b) <0, then the equation f(x) =0; has at least one real
root or an odd number of roots in the interval [a,b].
i.e. Given the interval (a, b) in which solution exists:
Then : c = (a + b)/2,
if f(c)= 0, then c is an exact solution,
else if f(a)*f(c) < 0 then the root lies in the interval (a, c),
else the root lies in the interval (c, b).
Steps for Bisection Method
1. Choose xl and xu as two
guesses for the root such that
f(xl) f(xu) < 0
2. Estimate the root, xm of the

7
equation f (x) = 0 as the mid-
point between xl and xu as:

3. Now check the following


If f(xl) f(xm) < 0, then the root lies between xl and xm; then xl =
xl ; xu = xm.
If f(xl) f(xm) > 0, then the root lies between xm and xu; then xl =
xm ; xu = xu
If f(xl) f(xm) = 0; then the root is xm. Stop the step if this is
Cont’d

4. New estimate:

Eg1. f(x)=6x2+12x-30=0, Eg2. 2-x+lnx=0


find at least one root?

8
Approximate relative Error:
Advantages
• Always convergent.
• The root bracket gets halved with each iteration – error

9
minimization is guaranteed.
• Possible to estimate the number of iteration required.
 If Δx(0)is the original interval; the number of
bisections (n) required to attain a prescribed absolute
error, e is:
Disadvantages of bisection method

1. Slow convergence; If one of the initial


guesses is close to the root.
Multiple roots in an interval [a1, b1] if
f(a1)f(b1)<0

10
2. If a function f(x) is such that it just
touches the x-axis it will be unable to
find the lower and upper guesses.

3. Function changes sign but root


does not exist
Bracketing methods: Regular Falsi/ false position/

or linear interpolation Method

This method is similar to the bisection method in that requires two

11
initial guesses values.
However, instead of simply dividing the region in two, a linear
interpolation is used to obtain a new point which is (hopefully, but
not necessarily) closer to the root than the equivalent estimate for
the bisection method.

If a real root is bounded by xl and xu of f(x)=0, then we can


approximate the solution by doing a linear interpolation between the
points [xl, f(xl)] and [xu, f(xu)] to find the xr value such that f(xr)=0,
f(x) is the linear approximation of f(x).
An alternative method that exploits this graphical insight is to join
f(Xl) and f(Xu) by a straight line. The intersection of this line with
the x-axis is represents an improved estimate of the root.

12
• The fact that the replacement of the curve by a straight line gives a
“false position” of the root is the origin of the name.
The procedure is similar to the Bisection method; the only difference
is the method used for calculating the root (Xm)

1.Find a pair of values of x, xl and xu such that fl=f(xl)<0 and fu=f(xu)


>0.

13
2. Estimate the value of the root from the following formula given and
evaluate f(xr) ~~0
3. Use the new point to replace one of the original points,
keeping the two points on opposite sides of the x axis.

If f(xr)<0 then xl=xr == > fl=f(xr)

14
If f(xr)>0 then xu=xr == > fu=f(xr)

If f(xr)=0 then you have found the root and do not need to
go further!
4. See if the new xl and xu are close enough for convergence to
be declared. If they are not go back to step 2.
Eg1. f(x)=6x2+12x-30=0, Eg2. 2-x+lnx=0
find at least one root?
Why bracketing method?
– Always converges for a single root.

• Note: Always check by substituting estimated root in the original


equation to determine whether f(xr) ≈ 0. Otherwise, the relative error

15
can miss-lead us.
• Generally In the bracketing method:
the root is located within an interval prescribed by a lower and an
upper bound.
Repeated application of these methods always results in closer
estimates of the true value of the root.
Such methods are said to be convergent, because they move closer
to the truth as the computation progresses.
3.2 Open Method
Basic Concepts in open methods
•Open methods:
 are based on formulas that require only a single starting values of

16
X or two values that do not necessarily bracket the root.
As such, they sometimes diverge.
When the open methods converge, they usually do so much more
quickly than the bracketing methods.
•Types of the method:
Fixed-point
Newton-Raphson Method
The Secant Method
Fixed-point Iteration
Fixed-point iteration (one-point iteration or successive
substitution) rearrange the function f(x)=0 so that x is on the left-
hand side of the equation like:
x = g(x)
Algebraic manipulation or simply adding x to both sides of the
original equation.
Given an initial guess at the root xi, then x = g(x) can be used to
compute a new estimate xi+1 as expressed by the iterative formula
xi+1 = g(xi)
Solution: X0=0, f(0)=2
e.g solve f(x) =2-x+lnx=0, X1=2, f(2)=2.693
X2=2.693, f(2.693)=2.991
hint x=2+lnx X3=2.991, f(2.991)= 3.096
ᵋa= (3.096-2.991)*100/3.096 =3.4%

17
Newton-Raphson Method

Newton Raphson method is the Most widely used method.

Based on Taylor series expansion: is convenient method for

18
functions whose derivatives can be evaluated analytically.
• Geometrically, Xi+1 can be interpreted as the value of X at which a
line, passing through the point (Xn,f(Xn)) and tangent to the curve f(x)
at that point, crosses the y axis.
• If we continue the process we get the following scheme

19
Cont’d

Iterative formula can be generalized as:

20
Initial guessed Root
Termination Criteria & Error Estimates

21
 Is as small number as 10-3 or 10-6
Conclusion on N-R Method

• Requires derivative of the function: f’= df/dx


• Very fast convergence in most cases (Quadratic convergence) !!

22
• May not converge if the estimate is far off.
• May not converge if the derivative (slope) at an estimate is close to
zero.
Mistake (Pitfalls) of the Newton – Raphson Method

• If the local min/max is selected as an initial guess,

23
The Secant Method

• A potential problem in implementing the Newton – Raphson method is


the evaluation of the derivative.
• For these cases the derivative can be approximated by a backward

24
finite divided difference.
• The first derivative of the function f can be approximated using the
finite difference method(FDM).
Substituting this approximation in the Newton – Raphson
formula, to yield the following iterative equation.
f ( xi ) xi  xi  1
xi 1 xi  ' xi  f ( xi )( )
f ( xi ) f ( xi )  f ( xi  1 )

25
xi 2,3,4,...

 Requires two initial estimates of x; like: x0, x1.


 Because f(x) is not required to change signs between
estimates, it is not classified as a “bracketing” method.
 Has the same properties as Newton’s method and

convergence is not guaranteed for all x0, f(x).


Cont’d

26
Convergence of the root using the secant method to
exact root

e.g. solve f(x) =2-x+lnx, hint xi-1 =0 & x=3


Advantages of secant method:
• It converges faster than a linear rate so it is more rapidly
convergent than the bisection method.
• It does not require the use of the derivative of the
function, something that is not available in a number of

27
applications.
• It requires only one function evaluation per iteration,
as compared with Newton’s method which requires two.
Disadvantages of secant method:
• It may not converge.
• There is no guaranteed error bound for the computed
iterates.
• It is likely to have difficulty if f ‘(α) = 0. This means the x-
axis is tangent to the graph of y = f (x) at x = α.
Example2: A mass balance for a pollutant in a well-mixed lake can
be written as:

Given the parameter values V = 1 × 106m3, Q = 1 × 105 m3/yr,


W = 1 × 106 g/yr, and k = 0.25 g0.5/m1.5yr, use the different method to
solve for the steady-state concentration.
Employ an initial guess of c = 4 g/m3. Perform till 5th iterations and
determine the percent relative error after the third iteration.

Hint: Use fixed point iteration


X5=4.599456 and ℰa=1.46%
28
Example3:
You are designing a spherical tank below to hold water for a
small village in a developing country. The volume of liquid it
can hold can be computed as

V=3.14*h2(9-h)/3

where V = volume [m3], h = depth of water in tank [m], and R =


the tank radius [m].
If R = 3 m, to what depth must the tank be filled so that it holds
30 m3? Use three iterations of the false-position method to
determine your answer. Determine the approximate relative
error after each iteration. Employ initial guesses h is 0 and R.
Check the solution to be=2.027507
29
Note that the complete solutions of the
example function are: 2-x+ln(x)=0
Use Newton RM, take initial guess x=3
--------------------------------------------------------
-----
(Given Where the stopping criteria are to
the order of = 10^-5 i.e. the change of f(x)
should be to the value of = 10^-5)

30

You might also like