US - TMC - 03 - Non-Linear Equations - 2024
US - TMC - 03 - Non-Linear Equations - 2024
6
3 5
2
1
9 7
8
Motivation
•Why?
− b b 2
− 4ac
ax 2 + bx + c = 0 x =
2a
•But
ax5 + bx 4 + cx 3 + dx 2 + ex + f = 0 x = ?
sin x + x = 0 x = ?
3
Nonlinear Equation
Solvers
All Iterative
4
PART A
BRACKETING METHODS
Bracketing Methods
(Or, two point methods for finding roots)
6
Parts (a) and (c) indicate that if
both f (x ) and f (x ) have the
l u
7
1. The Bisection Method
For the arbitrary equation of one variable, f(x)=0
4. Compare 𝜀𝑠 with 𝜀𝑎
Thus, after six iterations εa finally falls below εs = 0.5%, and the computation can be
terminated.
The False-Position Method
(Regula-Falsi)
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 l(xr)=0, l(x) is the linear approximation of f(x).
12
Procedure
1. Find a pair of values of x, xl and xu such that fl=f(xl) <0
and fu=f(xu) >0.
2. Estimate the value of the root from the following
formula
xl f u − xu f l
xr =
fu − fl
and evaluate f(xr).
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)
If f(xr)>0 then xu=xr == > fu=f(xr)
If f(xr)=0 then you have found the root and need go no further!
13
Example #2
Use the false-position method to determine the root of the same equation
investigated in Example #1
As in Example #1, initiate the computation with guesses of xl =12 and xu =16.
PART B
OPEN METHODS
Open Methods
Open methods are based on formulas that require only a
single starting value of x or two starting values that do not
necessarily bracket the root.
16
Simple Fixed-point Iteration
Rearrange the function so that x is on the left side of
the equation:
f ( x) = 0 g ( x) = x
xk = g ( xk −1 ) xo given , k = 1, 2, ...
17
Example :
f ( x) = x 2 − x − 2 x0
g ( x) = x 2 − 2
or
g ( x) = x + 2
or
2
g ( x) = 1 +
x
18
Example #2
Use simple fixed-point iteration to locate the root of
f (x) = e−x − x.
The function can be separated as
xi+1 = e−xi
Starting with an initial guess of x0 = 0, this iterative
equation can be applied to compute
20
Conclusion
Fixed-point iteration converges if
g ( x) 1 (slope of the line f(x) = x)
21
1. Newton-Raphson Method
Most widely used method.
x 2
f ( xi +1 ) = f ( xi ) + f ( xi )x + f ( xi ) + Ox 3
2!
The root is the value of x i +1 when f(x i +1 ) = 0
Rearrangin g,
0 = f(x i ) + f (x i )( xi +1 − xi )
f ( xi )
xi +1 = xi −
f ( xi )
22
A convenient method for functions whose derivatives can
be evaluated analytically. It may not be convenient for
functions whose derivatives cannot be evaluated
analytically.
23
Example #3
Use the Newton-Raphson method to estimate the root of f (x) =e−x − x, employing an
initial guess of x0 = 0.
Four cases where the Newton-
Raphson method exhibits poor
convergence
25
2. Secant Method
A slight variation of Newton’s method for functions whose
derivatives are difficult to evaluate. For these cases the
derivative can be approximated by a backward finite
divided difference.
f ( xi ) − f ( xi −1 )
f ( xi )
xi − xi −1
xi − xi −1
xi +1 = xi − f ( xi ) i = 1,2,3,
f ( xi ) − f ( xi −1 )
26
•Requires two initial estimates of x , e.g, xo, x1.
However, because f(x) is not required to change signs
between estimates, it is not classified as a “bracketing”
method.
•The scant method has the same properties as
Newton’s method. Convergence is not guaranteed for all
xo, f(x).
27
28
Example #4
Use the secant method to estimate the root of f(x)=e−x − x . Start with initial
estimates of x−1 = 0 and x0 = 1.0.
Multiple Roots
“Multiple root” corresponds to a point where a function is
tangent to the x axis.
Difficulties
Function does not change sign at the multiple root, therefore,
cannot use bracketing methods.
Both f(x) and f′(x)=0, division by zero with Newton’s and Secant
methods.
30
Multiple Roots
31
Example #4
Use both the standard and modified Newton-Raphson methods to evaluate the multiple root
of f(x) = (x − 3)(x − 1)(x − 1), with an initial guess of x0 = 0.
The first derivative of f(x) is f’(x) = 3x2 − 10x + 7, and therefore, the standard Newton-Raphson
method for this problem is
Systems of Linear Equations
To this point, we have focused on the determination of
the roots of a single equation. A related problem is to
locate the roots of a set of simultaneous equations,
f1 ( x1 , x2 , x3 , , xn ) = 0
f 2 ( x1 , x2 , x3 , , xn ) = 0
f n ( x1 , x2 , x3 , , xn ) = 0
33
Fixed-Point Iteration
Use fixed-point iteration to determine the roots of
u(x, y) = x2 + xy − 10 = 0
v(x, y) = y + 3xy2 − 57 = 0
Note that a correct pair of roots is x = 2 and y = 3. Initiate the computation with
guesses of x = 1.5 and y = 3.5.
We have
𝑥= 10 − 𝑥𝑦
57−𝑦
𝑦=
3𝑥
𝑥= 10 − 2.17945(2.86051) = 1.94053
57−2.86051
𝑦= = 3.04955
3(1.94053)
Determinant of the
Jacobian of the
system.
36
Example #5
Use the multiple-equation Newton-Raphson method to determine roots of
u(x, y) = x2 + xy − 10 = 0
v(x, y) = y + 3xy2 − 57 = 0
Note that a correct pair of roots is x = 2 and y = 3. Initiate the computation with guesses of x =
1.5 and y = 3.5.
PART C
ROOTS OF POLYNOMIALS
Roots of Polynomials
The roots of polynomials such as
f n ( x) = ao + a1 x + a2 x 2 + + an x n
40
Conventional Methods
The efficacy of bracketing and open methods depends
on whether the problem being solved involves complex
roots. If only real roots exist, these methods could be
used.
41
Müller Method
Müller’s method obtains a root estimate by
projecting a parabola to the x axis through three
function values.
42
Müller Method
The method consists of deriving the coefficients of
parabola that goes through the three points:
f 2 ( x) = a( x − x2 ) 2 + b( x − x2 ) + c
f ( xo ) − f ( x2 ) = a ( xo − x2 ) 2 + b( xo − x2 )
f ( x1 ) − f ( x2 ) = a ( x1 − x2 ) 2 + b( x1 − x2 )
44
If
h o = x1 - x o h1 = x 2 - x1
f ( x1 ) − f ( x o ) f ( x 2 ) − f ( x1 )
o = 1 =
x1 − x o x 2 − x1
We have
x 2 − x 0 = h1 + h 0
0 h 0 = f ( x1) − f ( x 0 )
1h1 = f ( x 2 ) − f ( x1)
f ( x 2 ) − f ( x 0 ) = 0 h 0 + 1h1
So ,
2
( ho + h1 ) b − ( ho + h1 ) a = ho o + h11
2
h1b − h1 a = h11
1 − o
a= b = ah1 + 1 c = f ( x2 )
h1 + ho 45
Roots can be found by applying an alternative form of
quadratic formula:
− 2c
x3 = x2 +
b b 2 − 4ac
The error can be calculated as
x3 − x2
a = 100%
x3
±term yields two roots, the sign is chosen to agree with
b. This will result in a largest denominator, and will give
root estimate that is closest to x2.
46
Once x3 is determined, the process is repeated
using the following guidelines:
1. If only real roots are being located, choose the
two original points that are nearest the new
root estimate, x3.
2. If both real and complex roots are estimated,
employ a sequential approach just like in
secant method, x1, x2, and x3 to replace xo,
x1, and x2.
47
Example #6
Use Müller’s method with guesses of x0, x1, and x2 = 4.5, 5.5, and 5, respectively, to
determine a root of the equation f(x) = x3 − 13x − 12
Note that the roots of this equation are −3, −1, and 4.
Polynomial order reduction
It is based on dividing a polynomial by a factor (x-t)
Any Questions?