Presentation is loading. Please wait.

Presentation is loading. Please wait.

NUMERICAL METHODS WITH C++ PROGRAMMING

Similar presentations


Presentation on theme: "NUMERICAL METHODS WITH C++ PROGRAMMING"— Presentation transcript:

1 NUMERICAL METHODS WITH C++ PROGRAMMING
By Dr. RM. SOMASUNDARAM Dr. RM.CHANDRASEKARAN

2 ALGEBRAIC AND TRANSCENDENTAL EQUATIONS
Chapter 1 ALGEBRAIC AND TRANSCENDENTAL EQUATIONS

3 NUMERICAL METHODS WITH C++ PROGRAMMING
By Dr. RM. SOMASUNDARAM Dr. RM.CHANDRASEKARAN

4 PRELIMINARIES Bisection Method Regula Falsi Method
Newton Raphson Method Successive Approximation Method Secant Method Graffi Root Squaring Method

5 PRELIMINARIES Solution of equation f (x) = 0
A number  (real or complex) is a root of the equation f (x) =0 if f ( ) = 0. Location of the root Theorem If f(x) is a continuous function in the closed interval [a, b] and f (a). f (b) < 0 [i.e. f (a) and f (b) are of opposite signs] then the equation f (x) = 0 has at least one real root in the open interval (a, b).

6 BISECTION METHOD Locate the interval (a, b) in which root lies.
Bisect the interval (a, b). Choose the half interval in which the root lies. Bisect the half interval. Repeat the process until the root converges.

7 Example Repeat the process until the root converges to 1.3247.
Find the root of the equation x3 – x –1 = 0 by bisection method. Solution f(1). f(2) < 0 Hence a root lies in the interval (1,2). Bisecting , we get two half intervals (1,1.5) and (1.5,2). The root lies in (1,1.5). Repeat the process until the root converges to

8 Regula Falsi Method y x xi+2 xi xi+1 xi -1

9 REGULA FALSI METHOD Locate the interval (a, b) in which the root lies.
First Approximation to the root Locate the next interval (a, X0) or ( X0, b ) in which root lies. Repeat the process until the root converges.

10 Example Find the real root of x3 – 9x + 1 = 0. Solution
A root lies between 2 and 3. Applying Regula Falsi Method iteratively, the root converges to after 4 iterations.

11 SUCCESSIVE APPROXIMATION METHOD
Rewrite the equation f(x) = 0 in the form x = (x). Choose the initial approximation X0 x1 = (x0), x2 = (x1),…, The sequence of approximations converges to a root if | ' (x) | < 1 in the interval containing the root .

12 Example ’ (x) = (-½) sin x and | ’ (x) | < 1 in (0, π/2).
Solve cos x = 2x Solution ’ (x) = (-½) sin x and | ’ (x) | < 1 in (0, π/2). Choose x0 = π/2 = Successive approximation will yield the root as in th iteration.

13 NEWTON RAPHSON METHOD Locate the interval (a, b).
Choose a or b which is nearer to the root as the first approximation x0 to the root. Next approximation Repeat the process until the root converges.

14 Example Successive iterations will yield the root 1.2564.
Solve ex – 1 = 2x Solution The root is near 1. Take x1 = 1. x2 = x1 – = Successive iterations will yield the root

15 SECANT METHOD In Newton Raphson Method we have to evaluate f'(x) at every iteration. In this method f'(x) is approximated by the formula f'(xn) ~ Thus, xn+1 =

16 Example Find a root of x3 – 4x + 1 = 0 using secant method. Solution
The root lies in (0,1) as f(0) = 1 , f(1) = –2. Successive application of secant formula yields the root

17 Comparison

18 GRAEFFES’ ROOT SQUARING METHOD
This is a direct method. This method is used to find all the roots of a polynomial equation with real coefficients. For any nth degree polynomial equation the following results will apply. Results There will be n roots for an nth degree polynomial equation. There will be at least one real root if n is odd. Complex roots occur only in pairs. Descartes' rule of signs will be true.

19 Descartes’ Rule of Signs
Number of positive roots of f(x) = 0 is equal to the number of sign changes of the coefficients or is less than this number by an even integer. The number of negative roots of f(x) = 0 is obtained by considering the number of sign changes in f(–x).

20 Root Squaring Let f(x) = a0 xn + a1xn-1 + a2 xn-2 + L + an = 0
Then f(x) f(–x) = a02x2n – (a12 – 2a0a2) x2n-2 + (a22 – 2a1a3 + 2a0a4)x2n-4 + L + (-1)n an2 = 0. Substitute y = -x2 the equation reduces to yn + C1 yn-1 + C2 yn-2 + L + Cn-1 y + Cn = 0 where C1 = a12 – 2a0a2, C2 = a22 – 2a1a3 + 2a0a4, … Cn = an2 The derived polynomial is of the same degree as the original polynomial and its roots are – x12, – x22, …, –xn2 where x1, x2 , …, xn are the roots of the original polynomial. If we apply this root squaring process repeatedly it will yield successive derived polynomial having roots which are negative of successively higher even powers (2k after k squaring) of the roots of original polynomial.

21 Root Squaring After k squaring let the reduced polynomial be
yn + b1yn-1 + b2 yn-2 + L + bn = 0.Then the roots of this polynomial are: x1m, -x2m, …, - xnm where m = 2k. Let Ri = -xi2, i = 1, 2, …, n. Assuming |x1| > |x2| > L > |xn| we get |R1| > > |R2| > > |R3| … >> |Rn| Hence – b1 =  Ri = R1 b2 =  Ri Rj ~ R1R2 – b3 =  Ri Rj Rk ~ R1R2R3 (-1)nbn = R1R2 … Rn We get Ri = – i = 1, 2, …, n and |Ri| = Fix sign using Descartes’ rule and actual substituition.

22 Example Solve x3 – 2x2 – 5x + 6 = 0 using Root squaring method Solution

23 Squaring


Download ppt "NUMERICAL METHODS WITH C++ PROGRAMMING"

Similar presentations


Ads by Google