Professional Documents
Culture Documents
US - TMC - 03 - Non-Linear Equations 2019 PDF
US - TMC - 03 - Non-Linear Equations 2019 PDF
•But
ax5 + bx 4 + cx 3 + dx 2 + ex + f = 0 x = ?
sin x + x = 0 x = ?
2
Nonlinear Equation
Solvers
All Iterative
3
PART A
BRACKETING METHODS
Bracketing Methods
(Or, two point methods for finding roots)
5
Parts (a) and (c) indicate that if
both f (x ) and f (x ) have the
l u
6
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).
11
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!
12
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 x l =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.
15
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, ...
16
Example :
f ( x) = x 2 − x − 2 x0
g ( x) = x 2 − 2
or
g ( x) = x + 2
or
2
g ( x) = 1 +
x
17
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
19
Conclusion
Fixed-point iteration converges if
20
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 )
21
A convenient method for functions whose derivatives can
be evaluated analytically. It may not be convenient for
functions whose derivatives cannot be evaluated
analytically.
22
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
24
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 )
25
•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).
26
27
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.
29
Multiple Roots
30
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
32
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.
35
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
39
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.
40
Müller Method
Müller’s method obtains a root estimate by
projecting a parabola to the x axis through three
function values.
41
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 )
43
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 44
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.
45
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.
46
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.
2. Bairstow’s Method
Bairstow’s method is an iterative approach loosely
related to both Müller and Newton Raphson methods.
f n ( x) = ao + a1 x + a2 x 2 + + an x n
f n −1 ( x) = b1 + b2 x + b3 x 2 + + bn x n −1
with a reminder R = b o , the coefficients are
calculated by recurrence relationship
bn = an
bi =a i +bi +1t i = n − 1 to 2
48
Example
To permit the evaluation of complex roots, Bairstow’s
method divides the polynomial by a quadratic factor x2-
rx-s:
f n − 2 ( x) = b2 + b3 x + + bn −1 x n −3 + bn x n − 2
R = b1 ( x − r ) + bo
Using a simple recurrence relationsh ip
bn = an
bn-1 = an-1 + rbn
bi = ai + rbi +1 + sbi + 2 i = n-2 to 0
50
For the remainder to be zero, bo and b1 must be zero.
However, it is unlikely that our initial guesses at the
values of r and s will lead to this result, a systematic
approach can be used to modify our guesses so that bo
and b1 approach to zero.
51
b1 b1
b1 (r + r , s + s ) = b1 + r + s
r s
b b
bo (r + r , s + s ) = bo + o r + o s
r s
assuming that the initial guesses are adequately
close to the values of r and s at roots. The changes
in s and r needed to improve our guesses will be
estimated as
b1 b1
r + s = −b1
r s
bo b
r + o s = −bo
r s
52
If partial derivatives of the b’s can be determined, then
the two equations can be solved simultaneously for the
two unknowns r and s.
Partial derivatives can be obtained by a synthetic
division of the b’s in a similar fashion the b’s themselves
are derived:
cn = bn
cn −1 = bn −1 + rcn
ci = bi + rci +1 + sci + 2 i = n − 2 to 2
where
bo bo b1 b1
= c1 = = c2 = c3
r s r s
53
Then
r
a ,r = 100%
r
r
a ,s = 100%
r
54
• The values of the roots are determined by
r r 2 + 4s
x=
2
• At this point three possibilities exist:
1. The quotient is a third-order polynomial or
greater. The previous values of r and s serve as
initial guesses and Bairstow’s method is applied
to the quotient to evaluate new r and s values.
2. The quotient is quadratic. The remaining two
roots are evaluated directly, using the above eqn.
3. The quotient is a 1st order polynomial. The
remaining single root can be evaluated simply as
x=-s/r.
55
Example #7
Employ Bairstow’s method to determine the roots of the polynomial
f5(x) = x5 − 3.5x4 + 2.75x3 + 2.125x2 − 3.875x + 1.25
Use initial guesses of r = s=−1 and iterate to a level of εs = 1%.
Example #7
Any Questions?
hvusynh@hcmiu.edu.vn