Professional Documents
Culture Documents
----------------------------------------------------------------------------------------------------------------
Chapter Two Solution of Nonlinear Equations
----------------------------------------------------------------------------------------------------------------
Whereas sin could be put in to the form of eqn(1) by adding x to both sides to yield
The utility of eqn(1) is that it provides a formula to predict a new value of x as a function of
an old value of x . Thus, given an initial guess at the root , eqn(1) can be used to
compute a new estimate as expressed by the iterative formula ). The
sequence has the pattern
=g( )
=g( )
=g( )
| | %
Example 1
Use simple fixed point iteration to locate the root of .
n:
Sol the function can be separated directly and expressed in the form of eqn(1) as:
= , starting with an initial guess of this iteration can be applied to compute
Iteration
0 0 -
1 1.000000 100.0
2 0.367879 171.8
3 0.692201 46.9
4 0.500473 38.3
5 0.606244 17.4
6 0.545396 11.2
7 0.579612 5.90
8 0.560115 3.48
9 0.571143 1.93
10 0.564879 1.11
Thus, each iteration brings the estimate closer to the true value of the root: 0.56714329
Theorem
An equation f ( x) 0 , where f (x) is a real continuous function, has at least one root
between x and xu if f ( x ) f ( xu ) 0 (See Figure 1).
Note that if f ( x ) f ( xu ) 0 , there may or may not be any root between x and xu
(Figures 2 and 3). If f ( x ) f ( xu ) 0 , then there may be more than one root between x
and xu (Figure 4). So the theorem only guarantees one root between x and xu .
Bisection method
Since the method is based on finding the root between two points, the method falls
under the category of bracketing methods.
Since the root is bracketed between two points, x and xu , one can find the mid-
point, x m between x and xu . This gives us two new intervals
1. x and x m , and
2. x m and xu .
f (x)
xℓ
x
xu
Figure 1 At least one root exists between the two points if the function is real, continuous,
and changes sign.
f (x)
x
xℓ xu
Figure 2 If the function f (x) does not change sign between the two points, roots of
the equation f ( x) 0 may still exist between the two points.
f (x) f (x)
xℓ xu
x x
xℓ xu
Figure 3 If the function f (x) does not change sign between two points,
there may not be any roots for the equation f ( x) 0 between the two points.
f (x)
xu
xℓ x
Figure 4 If the function f (x) changes sign between the two points, more than one root for
the equation f ( x) 0 may exist between the two points.
Is the root now between x and x m or between x m and xu ? Well, one can find the sign of
f ( x ) f ( xm ) , and if f ( x ) f ( xm ) 0 then the new bracket is between x and x m , otherwise,
it is between x m and xu . So, you can see that you are literally halving the interval. As one
repeats this process, the width of the interval x , xu becomes smaller and smaller, and you
can zero in to the root of the equation f ( x) 0 . The algorithm for the bisection method is
given as follows.
Example 1
Thermistors are temperature-measuring devices based on the principle that the thermistor
material exhibits a change in electrical resistance with a change in temperature. By
measuring the resistance of the thermistor material, one can then determine the temperature.
For a 10K3A Betatherm thermistor,
Thermally
conductive epoxy
coating
T
where T is in Kelvin and R is in ohms.
A thermistor error of no more than 0.01C is acceptable. To find the range of the
resistance that is within this acceptable limit at 19 C , we need to solve
1.129241 10 3 2.341077 10 4 ln( R) 8.775468 10 8 ln R
1 3
19.01 273.15
and
1.129241 10 3 2.341077 10 4 ln( R) 8.775468 10 8 ln R
1 3
18.99 273.15
Use the bisection method of finding roots of equations to find the resistance R at 18.99 C .
Conduct three iterations to estimate the root of the above equation. Find the absolute relative
approximate error at the end of each iteration and the number of significant digits at least
correct at the end of each iteration.
Solution
Solving
1.129241 10 3 2.341077 10 4 ln( R) 8.775468 10 8 ln R
1 3
18.99 273.15
we get
f ( R) 2.341077 10 4 ln( R) 8.775468 10 8 ln R 2.293775 10 3
3
Lets us assume
R 11000, Ru 14000
Check if the function changes sign between R and Ru .
f ( R ) f (11000)
2.341077 10 4 ln(11000) 8.775468 10 8 ln 11000 2.293775 10 3
3
4.4536 10 5
f ( Ru ) f (14000)
2.341077 10 4 ln(14000) 8.775468 10 8 ln 14000 2.293775 10 3
3
1.7563 10 5
Hence
f R f Ru f 11000 f 14000 4.4536 10 5 1.7563 10 5 0
So there is at least one root between R and Ru , that is, between 11000 and 14000 .
Iteration 1
The estimate of the root is
R Ru
Rm
2
11000 14000
2
12500
f ( Rm ) f (12500)
2.341077 10 4 ln(12500) 8.775468 10 8 ln 12500 2.293775 10 3
3
1.1655 10 5
f R f Rm f 11000 f 12500 4.4536 10 5 1.1655 10 5 0
Hence the root is bracketed between Rm and Ru , that is, between 12500 and 14000 . So, the
lower and upper limits of the new bracket are
R 12500, Ru 14000
At this point, the absolute relative approximate error a cannot be calculated as we do not
have a previous approximation.
Iteration 2
The estimate of the root is
R Ru
Rm
2
12500 14000
2
13250
f Rm f 13250
2.341077 10 4 ln 13250 8.775468 10 8 ln 13250 2.293775 10 3
3
3.3599 10 6
f R f Rm f 12500 f 13250 1.1655 10 5 3.3599 10 6 0
Hence, the root is bracketed between R and Rm , that is, between 12500 and 13250 .
So the lower and upper limits of the new bracket are
R 12500, Ru 13250
The absolute relative approximate error a at the end of Iteration 2 is
Rmnew Rmold
a 100
Rmnew
13250 12500
100
13250
5.6604%
None of the significant digits are at least correct in the estimated root
Rm 13250
as the absolute relative approximate error is greater than 5% .
Iteration 3
R Ru
Rm
2
12500 13250
2
12875
f Rm f 12875
2.341077 10 4 ln 12875 8.775468 10 8 ln 12875 2.293775 10 3
3
4.0403 10 6
f R f Rm f 12500 f 12875 1.1654 10 5 4.0398 10 6 0
Hence, the root is bracketed between Rm and Ru , that is, between 12875 and 13250 .
So, the lower and upper limits of the new bracket are
R 12875, Ru 13250
The absolute relative approximate error a at the end of Iteration 3 is
Rmnew Rmold
a 100
Rmnew
12875 13250
100
12875
2.9126%
One of the significant digits is at least correct in the estimated root of the equation as the
absolute relative approximate error is less than 5% .
Seven more iterations were conducted and these iterations are shown in the Table 1.
Iteration R Ru Rm a % f Rm
d) For functions f (x) where there is a singularity 1 and it reverses sign at the
singularity, the bisection method may converge on the singularity (Figure 7). An
example includes
1
f ( x)
x
where x 2 , xu 3 are valid initial guesses which satisfy
f ( x ) f ( xu ) 0
However, the function is not continuous and the theorem that a root exists is also
not applicable.
f (x)
f (x)
Introduction
Method such as the bisection method of finding roots of a nonlinear equation f ( x) 0
require bracketing of the root by two guesses. Such method is called bracketing methods.
These methods are always convergent since they are based on reducing the interval between
the two guesses so as to zero in on the root of the equation.
In the Newton-Raphson method, the root is not bracketed. In fact, only one initial
guess of the root is needed to get the iterative process started to find the root of an equation.
The method hence falls in the category of open methods. Convergence in open methods is
not guaranteed but if the method does converge, it does so much faster than the bracketing
methods.
Derivation
The Newton-Raphson method is based on the principle that if the initial guess of the root of
f ( x) 0 is at x i , then if one draws the tangent to the curve at f ( xi ) , the point xi 1 where
the tangent crosses the x -axis is an improved estimate of the root (Figure 1).
Using the definition of the slope of a function, at x xi
f xi = tan θ
f xi 0
= ,
xi xi 1
which gives
f xi
xi 1 = xi (1)
f xi
Equation (1) is called the Newton-Raphson formula for solving nonlinear equations of the
form f x 0 . So starting with an initial guess, x i , one can find the next guess, xi 1 , by
using Equation (1). One can repeat this process until one finds the root within a desirable
tolerance.
Algorithm
The steps of the Newton-Raphson method to find the root of an equation f x 0 are
1. Evaluate f x symbolically
2. Use an initial guess of the root, x i , to estimate the new value of the root, xi 1 , as
f xi
xi 1 = xi
f xi
3. Find the absolute relative approximate error a as
xi 1 xi
a = 100
xi 1
4. Compare the absolute relative approximate error with the pre-specified relative
error tolerance, s . If a > s , then go to Step 2, else stop the algorithm. Also,
check if the number of iterations has exceeded the maximum number of iterations
allowed. If so, one needs to terminate the algorithm and notify the user.
f (x)
f (xi+1)
θ
x
xi+2 xi+1 xi
Example 1
Thermistors are temperature-measuring devices based on the principle that the thermistor
material exhibits a change in electrical resistance with a change in temperature. By
measuring the resistance of the thermistor material, one can then determine the temperature.
For a 10K3A Betatherm thermistor,
Thermally
conductive epoxy
coating
the relationship between the resistance R of the thermistor and the temperature is given by
1.129241 10 3 2.341077 10 4 ln( R) 8.775468 10 8 ln R
1 3
T
where T is in Kelvin and R is in ohms.
A thermistor error of no more than 0.01C is acceptable. To find the range of the
resistance that is within this acceptable limit at 19C ,
we need to solve
1.129241 10 3 2.341077 10 4 ln( R) 8.775468 10 8 ln R
1 3
19.01 273.15
and
1.129241 10 3 2.341077 10 4 ln( R) 8.775468 10 8 ln R
1 3
18.99 273.15
Use the Newton-Raphson method of finding roots of equations to find the resistance R at
18.99 C . Conduct three iterations to estimate the root of the above equation. Find the
absolute relative approximate error at the end of each iteration and the number of significant
digits at least correct at the end of each iteration.
Solution
Solving
1.129241 10 3 2.341077 10 4 ln( R) 8.775468 10 8 ln R
1 3
18.99 273.15
we get
f R 2.341077 10 4 ln( R) 8.775468 10 8 ln R 2.293775 10 3
3
15000
5
3.5383 10
15000
1.7230 10 8
15000 2053.5
12946
The absolute relative approximate error a at the end of Iteration 1 is
R1 R0
a 100
R1
12946 15000
100
12946
15.862%
The number of significant digits at least correct is 0, as you need an absolute relative
approximate error of less than 5% for one significant digit to be correct in your result.
Iteration 2
The estimate of the root is
f R1
R2 R1
f R1
Iteration 3
The estimate of the root is
f R2
R3 R2
f R2
2.341077 10 4 ln(13078) 8.775468 10 8 ln 130783
2.293775 10 3
13078 4 7
2.341077 10 2.6326404 10 {ln(13078)} 2
13078
8
1.2914 10
13078
1.9710 10 8
13078 0.65519
13078
The absolute relative approximate error a at the end of Iteration 3 is
R3 R2
a 100
R3
13078 13078
100
13078
0.0050097%
Hence the number of significant digits at least correct is given by the largest value of m for
which
a 0.5 10 2m
0.0050097 0.5 10 2m
0.010019 10 2m
log0.010019 2 m
m 2 log0.010019 3.9992
So
m3
The number of significant digits at least correct in the estimated root 13078 is 3.
0 5.0000
1 3.6560
2 2.7465
3 2.1084
4 1.6000
5 0.92589
6 –30.119
7 –19.746
8 –12.831
9 –8.2217
10 –5.1498
11 –3.1044
12 –1.7464
13 –0.85356
14 –0.28538
15 0.039784
16 0.17475
17 0.19924
18 0.2
3. Division by zero
For the equation
f x x 3 0.03x 2 2.4 106 0
the Newton-Raphson method reduces to
x 0.03xi 2.4 106
3 2
xi 1 = xi i
3xi 0.06 xi
2
For x0 0 or x0 0.02 , division by zero occurs (Figure 4). For an initial guess close to
0.02 such as x0 0.01999 , one may avoid division by zero, but then the denominator in the
formula is a small number. For this case, as given in Table 2, even after 9 iterations, the
Newton-Raphson method does not converge.
Iteration
xi f ( xi ) a %
Number
0 0.019990 1.6000010-6
1 –2.6480 18.778 100.75
2 –1.7620 –5.5638 50.282
3 –1.1714 –1.6485 50.422
4 –0.77765 –0.48842 50.632
5 –0.51518 –0.14470 50.946
6 –0.34025 –0.042862 51.413
7 –0.22369 –0.012692 52.107
8 –0.14608 –0.0037553 53.127
9 –0.094490 –0.0011091 54.602
1.00E-05
f(x)
7.50E-06
5.00E-06
2.50E-06
0.00E+00
x
-0.03 -0.02 -0.01 0 0.01 0.02 0.03 0.04
-2.50E-06
0.02
-5.00E-06
-7.50E-06
-1.00E-05
f ( xi ) f ( xi 1 )
f ( xi ) (2)
xi xi 1
Substituting Equation (2) in Equation (1) gives
f ( xi )( xi xi 1 )
xi 1 xi (3)
f ( xi ) f ( xi 1 )
The above equation is called the secant method. This method now requires two initial
guesses, but unlike the bisection method, the two initial guesses do not need to bracket the
root of the equation. The secant method is an open method and may or may not converge.
However, when secant method converges, it will typically converge faster than the bisection
method. However, since the derivative is approximated as given by Equation (2), it typically
converges slower than the Newton-Raphson method.
The secant method can also be derived from geometry, as shown in Figure 1. Taking
two initial guesses, xi 1 and xi , one draws a straight line between f ( xi ) and f ( xi 1 ) passing
through the x -axis at xi 1 . ABE and DCE are similar triangles.
Hence
AB DC
AE DE
f ( xi ) f ( xi 1 )
xi xi 1 xi 1 xi 1
On rearranging, the secant method is given as
f ( xi )( xi xi 1 )
xi 1 xi
f ( xi ) f ( xi 1 )
f (x)
f (xi) B
f (xi–1) C
E D A
x
xi+1 xi–1 xi
Example 1
Thermistors are temperature-measuring devices based on the principle that the thermistor
material exhibits a change in electrical resistance with a change in temperature. By
measuring the resistance of the thermistor material, one can then determine the temperature.
For a 10K3A Betatherm thermistor,
Thermally
conductive epoxy
coating
the relationship between the resistance R of the thermistor and the temperature is given by
1.129241 10 3 2.341077 10 4 ln( R) 8.775468 10 8 ln R
1 3
T
where T is in Kelvin and R is in ohms.
A thermistor error of no more than 0.01C is acceptable. To find the range of the
resistance that is within this acceptable limit at 19C , we need to solve
1.129241 10 3 2.341077 10 4 ln( R) 8.775468 10 8 ln R
1 3
19.01 273.15
and
1.129241 10 3 2.341077 10 4 ln( R) 8.775468 10 8 ln R
1 3
18.99 273.15
Use the secant method of finding roots of equations to find the resistance R at 18.99 C .
Conduct three iterations to estimate the root of the above equation. Find the absolute relative
approximate error at the end of each iteration and the number of significant digits at least
correct at the end of each iteration.
Solution
Solving
1.129241 10 3 2.341077 10 4 ln( R) 8.775468 10 8 ln R
1 3
18.99 273.15
We get
f ( R) 2.341077 10 4 ln( R) 8.775468 10 8 ln R 2.293775 10 3
3
Let us take the initial guesses of the root of f R 0 as R1 14000 and R0 15000 .
Iteration 1
The estimate of the root is
3.5383 10 5
f R1 2.341077 10 4 ln R1 8.775468 10 8 ln R1 2.293775 10 3
3
1.7563 10 5
15000
3.5383 10 15000 14000
5
R1
3.5383 10 1.7563 10
5 5
= 13014
The absolute relative approximate error a at the end of Iteration 1 is
R1 R0
a 100
R1
13014 15000
100
13014
15.257 %
The number of significant digits at least correct is 0, as you need an absolute relative
approximate error of less than 5% for one significant digit to be correct in your result.
Iteration 2
The estimate of the root is
f R1 R1 R0
R2 R1
f R1 f R0
f R1 2.341077 10 4 ln R1 8.775468 10 8 ln R1 2.293775 10 3
3
1.2658 10 6
13014
1.2658 10 13014 15000
6
R2
1.2658 10 3.5383 10
6 5
13083
The absolute relative approximate error a at the end of Iteration 2 is
R2 R1
a 100
R2
13083 13014
100
13083
0.52422%
The number of significant digits at least correct is 1, because the absolute relative
approximate error is less than 5% .
Iteration 3
The estimate of the root is
f R2 R2 R1
R3 R2
f R2 f R1
f R2 2.341077 10 4 ln R2 8.775468 10 8 ln R2 2.293775 10 3
3
8.8907 10 8
R3 13083
8.8911 10 8 13083 13014
8.8911 10 8 1.2658 10 6
13078
The absolute relative approximate error a at the end of Iteration 3 is
R3 R2
a 100
R3
13078 13083
100
13078
0.034415%
The number of significant digits at least correct is 3, because the absolute relative
approximate error is less than 0.05% .
Where the coefficients may be real or complex. We will concentrate on polynomials with
real coefficients. The polynomial equation = 0 has exactly n roots, which may be real
or complex. If the coefficients are real, the complex roots always occur in conjugate pairs
( + i , - i ), where and are the real and imaginary parts, respectively. For real
coefficients, the number of real roots can be estimated from the rule of Descartes:
-The number of positive, real roots equals the number of sign changes in the
Expression for , or less by an even number.
-The number of negative, real roots is equal to the number of sign changes in ,
Or less by an even number.
Example2.2.1:
consider . Since the sign changes twice, = 0 has either
two or zero positive real roots. On the other hand =
contains a single sign change; hence possesses one negative real zero.
Evaluation of Polynomials
Deflation of Polynomials
After a root r of = 0 has been computed, it is desirable to factor the polynomial as
follows:
(2.2.1)
This procedure, known as deflation or synthetic division, involves nothing more than
computing the coefficients of . Since the remaining zeros of are also the
zeros of , the root finding procedure can now be applied to rather than
. Deflation thus makes it progressively easier to find successive roots, because the
degree of the polynomial is reduced every time a root is found. Moreover, by eliminating
the roots that have already been found, the chances of computing the same root more than
once are eliminated.
If we let
Laguerre’s Method
Laguerre’s formulas are note easily derived for a general polynomial Pn(x).However, the
Derivation is greatly simplified if we consider the special case where the polynomial has a
zero at x = r and (n− 1) zeros at x = q. If the zeros were known, this polynomial can be
written as
(a)
Our problem is now this: given the polynomial in Eq. (a) in the form
Determine (note that is also unknown). It turns out that the result, which is exact for the
special case considered here, works well as an iterative formula with any polynomial.
Differentiating Eq. (a) with respect to x, we get
Thus
(b)
(2.2.3b)
If we solve Eq. (2.2.3a) for and substitute the result into Eq. (2.2.3b), we obtain a
Quadratic equation for . The solution of this equation is the Laguerre’s formula
(2.2.4)
√
The procedure for finding a zero of a general polynomial by Laguerre’s formula is:
1. Let be a guess for the root of = 0 (any value will do).
2. Evaluate , and .
4. Determine the improved root from Eq. (2.2.4) choosing the sign that results in the
larger magnitude of the denominator (this can be shown to improve convergence).
5. Let ← and repeat steps 2–5 until | | < ε or | − | < ε, where ε is the error
tolerance.
EXAMPLE 2.2.2
A zero of the polynomial is = 6. Deflate the
polynomial with Horner’s algorithm, i.e., find so that ( − 6) = .
EXAMPLE 2.2.3
A root of the equation is approximately .
find a more accurate value of this root by one application of Laguerre’s iterative formula.
Solution
Use the given estimate of the root as the starting value. Thus
The term under the square root sign of the denominator in Eq. (2.2.4) becomes
Now we must find which sign in Eq. (2.2.4) produces the larger magnitude of the
denominator:
| | | |
3.06448
| | | |
Using the minus sign, we obtain from Eq. (4.16) the following improved approximation for
the root
This approximation is already quite close to the exact value = 3.2 − 0.8 .