Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

1/28/2019

Roots of Equations
BITS Pilani Pratik N Sheth
Pilani Campus Department of Chemical Engineering

Contents

• Open Method
• Secant Method
• System of nonlinear equations
• Error analysis

2
Dr Pratik N Sheth, Dept of Chemical Engg, BITS Pilani, Pilani Campus

BITS Pilani
Pilani Campus

Open Method

1
1/28/2019

Secant Method

• A potential problem in implementing the Newton-


Raphson method is the evaluation of the derivative.
• Although this is not inconvenient for polynomials and
many other functions, there are certain functions whose
derivatives may be extremely difficult or inconvenient to
evaluate.
• For these cases, the derivative can be approximated by
a backward finite divided difference, as in

4
Dr Pratik N Sheth, Dept of Chemical Engg, BITS Pilani, Pilani Campus

Secant Method

5
Dr Pratik N Sheth, Dept of Chemical Engg, BITS Pilani, Pilani Campus

Problem

36 m/s
10 s.

f‘(m)=(9.81/15){(1-exp(-150/m))-(150/m)(exp(-150/m)}
6
Dr Pratik N Sheth, Dept of Chemical Engg, BITS Pilani, Pilani Campus

2
1/28/2019

Newton Raphson Method Solution


mi f(mi) f'(mi) mi+1 f(mi+1) ea %
10 -29.460002 0.653996799 55.04609509 -29.460002
55.04609509 -2.359552801 0.494318326 59.8194419 -2.359552801 7.979591006
59.8194419 -0.065266019 0.467117883 59.95916256 -0.065266019 0.23302637
59.95916256 -5.46442E-05 0.466335842 59.95927974 -5.46442E-05 0.000195429
59.95927974 -3.84048E-11 0.466335186 59.95927974 -3.84048E-11 1.37346E-10

Secant Method Solution (xi-1 =1 and xi = 10)

mi f(mi) f(mi-1) f'(mi) mi+1 ea %


10 -29.460002 -35.346 0.653999778 55.0458899
55.0458899 -2.359654217 -7.044771591 0.520568597 59.57873 7.608151614
59.57873 -0.17786919 -4.625904673 0.494226165 59.9386244 0.600438073
59.9386244 -0.009633522 -4.439007592 0.492152674 59.9581986 0.032646503
59.9581986 -0.000504168 -4.428864224 0.492040006 59.9592233 0.001708909
7
Dr Pratik N Sheth, Dept of Chemical Engg, BITS Pilani, Pilani Campus

Modified Secant Method

Secant Method Solution (xi-1 =1 and xi = 10)

mi f(mi) f(mi-1) f'(mi) mi+1 ea %


10 -29.460002 -35.346 0.653999778 55.0458899
55.0458899 -2.359654217 -7.044771591 0.520568597 59.57873 7.608151614
59.57873 -0.17786919 -4.625904673 0.494226165 59.9386244 0.600438073
59.9386244 -0.009633522 -4.439007592 0.492152674 59.9581986 0.032646503
59.9581986 -0.000504168 -4.428864224 0.492040006 59.9592233 0.001708909
8
Dr Pratik N Sheth, Dept of Chemical Engg, BITS Pilani, Pilani Campus

Modified Secant Method


Secant Method Solution (xi-1 =0.1 and xi = 10)

mi f(mi) f(mi-0.1) f'(mi) mi+1 ea %


10 -29.460002 -29.5254017 0.653997015 55.0460802
55.0460802 -2.359560164 -2.409020924 0.494607596 59.8166502 7.975321238
59.8166502 -0.066570092 -0.113311454 0.467413622 59.95907244 0.237532415
59.95907244 -9.66717E-05 -0.046758284 0.46661612 59.95927961 0.000345528
59.95927961 -5.80826E-08 -0.046661554 0.466614961 59.95927974 2.07602E-07
Secant Method Solution (xi-1 =1 and xi = 10)

mi f(mi) f(mi-1) f'(mi) mi+1 ea %


10 -29.460002 -35.346 0.653999778 55.0458899
55.0458899 -2.359654217 -7.044771591 0.520568597 59.57873 7.608151614
59.57873 -0.17786919 -4.625904673 0.494226165 59.9386244 0.600438073
59.9386244 -0.009633522 -4.439007592 0.492152674 59.9581986 0.032646503
59.9581986 -0.000504168 -4.428864224 0.492040006 59.9592233 0.001708909
9
Dr Pratik N Sheth, Dept of Chemical Engg, BITS Pilani, Pilani Campus

3
1/28/2019

10
Dr Pratik N Sheth, Dept of Chemical Engg, BITS Pilani, Pilani Campus

Other topics

Brent’s Method
Modified Newton Raphson method for multiple roots
System of Nonlinear Equations

11
Dr Pratik N Sheth, Dept of Chemical Engg, BITS Pilani, Pilani Campus

System of Nonlinear
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,

• The solution of this system consists of a set of x values


that simultaneously result in all the equations equaling 12
zero. Dr Pratik N Sheth, Dept of Chemical Engg, BITS Pilani, Pilani Campus

4
1/28/2019

System of Nonlinear
Equations
• Fixed point iteration method & Newton Raphson Method

13
Dr Pratik N Sheth, Dept of Chemical Engg, BITS Pilani, Pilani Campus

x y xi+1 yi+1
1.5 3.5 2.214285714 -24.375
2.21428571 -24.375 -0.209105181 429.713648
-0.2091052 429.713648 0.023169557 -12778.04178
0.02316956 -12778.042 -0.000782551 383377.6746

x y xi+1 yi+1
1.5 3.5 2.17944947 2.86050599
2.17944947 2.86050599 1.94053388 3.04955067
1.94053388 3.04955067 2.02045629 2.98340475
2.02045629 2.98340475 1.99302813 3.00570436
1.99302813 3.00570436 2.00238524 2.9980543
14
Dr Pratik N Sheth, Dept of Chemical Engg, BITS Pilani, Pilani Campus

Error Analysis – FPI Method

• Single variable nonlinear equation


• Equation

• True solution

15
Dr Pratik N Sheth, Dept of Chemical Engg, BITS Pilani, Pilani Campus

5
1/28/2019

Error Analysis – FPI Method

• Notice also that if the derivative is positive, the errors will


be positive, and hence, the iterative solution will be
monotonic (Fig. 6.3a and c).
• If the derivative is negative, the errors will oscillate (Fig.
6.3b and d).
• An offshoot of the analysis is that it also demonstrates
that when the method converges, the error is roughly
proportional to and less than the error of the previous
step.
• For this reason, simple fixed point iteration is said to be
linearly convergent.

16
Dr Pratik N Sheth, Dept of Chemical Engg, BITS Pilani, Pilani Campus

Convergence

17
Dr Pratik N Sheth, Dept of Chemical Engg, BITS Pilani, Pilani Campus

Divergence

18
Dr Pratik N Sheth, Dept of Chemical Engg, BITS Pilani, Pilani Campus

6
1/28/2019

Fixed point iteration method

• The previous example illustrates the most serious


shortcoming of simple fixed-point iteration—that is,
convergence often depends on the manner in which the
equations are formulated.
• Additionally, even in those instances where convergence
is possible, divergence can occur if the initial guesses
are insufficiently close to the true solution.
• Using reasoning similar to that in Box 6.1, it can be
demonstrated that sufficient conditions for convergence
for the two-equation case are

19
Dr Pratik N Sheth, Dept of Chemical Engg, BITS Pilani, Pilani Campus

Newton Raphson Method

20
Dr Pratik N Sheth, Dept of Chemical Engg, BITS Pilani, Pilani Campus

Newton Raphson Method

21
Dr Pratik N Sheth, Dept of Chemical Engg, BITS Pilani, Pilani Campus

7
1/28/2019

Newton Raphson Method

22
Dr Pratik N Sheth, Dept of Chemical Engg, BITS Pilani, Pilani Campus

Error Analysis: Newton


Raphson Method

23
Dr Pratik N Sheth, Dept of Chemical Engg, BITS Pilani, Pilani Campus

Error Analysis: Newton


Raphson Method
• The error is roughly proportional to the square of the
previous error.
• This means that the number of correct decimal places
approximately doubles with each iteration.
• Such behavior is referred to as quadratic convergence.

24
Dr Pratik N Sheth, Dept of Chemical Engg, BITS Pilani, Pilani Campus

8
1/28/2019

Thanks

25
Dr Pratik N Sheth, Dept of Chemical Engg, BITS Pilani, Pilani Campus

You might also like