Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
LECTURE 2 OF 4 7.0 NUMERICAL METHODS 7.2 Solutions of Non-Linear Equations LEARNING OUTCOMES: At the end of the lesson, students should be able to: a) To discuss the iteration method by writing f(x)=0 in the form of x=g(x). The iteration scheme is n=1,2,3…. xn1 g( xn ) b) Identify that the iteration method fails ' g when ( x1 ) 1 in the neighborhood of the roots of the equation Example: (1) Solve x2 – 4x – 5 = 0 => ( x + 1 )( x – 5) = 0 x = -1 or x = 5 The roots of the equation (2) Solve x3 – ex = 0 We cannot find the exact root of the above equation Numerical Method ( ITERATION METHOD) can be used to find approximate roots / solutions. 7.2 (1) : ITERATION METHOD The steps are : 1. Find an initial approximate value x1 . 2. Rewrite the equation in the form : x = g(x), g(x) is called the iteration function 3. Find g’(x) 4. This method fails if So we are looking for g ( x1 ) 1 ' g ( x1 ) 1 ' How to find an initial approximate value ? 2 Methods Graphical Algebraic Graphical Method Sketch the graph y = f(x) .The real root the point where the graph intercept at x-axis OR Rewrite f(x) = 0 to a new form : F(x) = G(x) Sketch the graph y = F(x) and y = G(x). The real root the point of intersection between the two graphs. Algebraic Method •Find two values a and b such that f(a) and f(b) have different signs •At least one root must lie between a and b if f(x) is continuous. Example Locate the approximate value of the equation ln x x 4 0 by using the graphical method. Solution y The intersection is approximately at x = 2.9 3 4 y = ln x x y=-x+4 Example 1 Show that the equation x3 – 6x + 7 = 0 has a root between -3 and -2. Find the root of the equation correct to 3 d.p. using the Iteration Method. Solution Let f(x) = x3 – 6x + 7 f(-3) = (-3)3 -6(-3) + 7 = -2 < 0 f(-2) = (-2)3 – 6(-2) + 7 = 11 > 0 different sign Since f(-3) < 0 and f(-2) > 0 , thus one of the the roots is between -3 and -2 Let x1 = -2.5 the initial approximate value Determine g(x) by writing f(x) = 0 to a new form : x = g(x) x 6x 7 0 3 6x x 7 3 x 7 x 6 3 x 7 g( x ) 6 3 x 6x 7 3 x 6x 7 3 g( x ) 3 6x 7 g( x ) x1 2.5 CHECK x 7 g( x ) 6 2 1 x ' 2 g ( x) 3 x 6 2 x1 2.5 3 ( 2.5) g ( x) 2 2 ' 3.125 1 x2 3 3 6x 7 6( 2.5) 7 Therefore, g(x) is 2.80204 an iteration x function 3 6( 2.80204) 7 3 2.87696 an 2.89495 g(x)xis4 not iteration x5function 2.89923 x6 2.90025 x7 2.90049 The required solution is x= - 2.900 USING THE CALCULATOR To find the approximate root for x3 – 6x + 7 = 0 x1 = -2.5 , iteration function : g ( x ) 3 6x 7 Key in MODE 1 (COMP) ALPHA Y ALPHA = 3 (6 ALPHA X – 7) CALC (X?) -2.5 = (-2.80204 ..) CALC Ans = ( -2.87696…) CALC Ans = ( -2.89495…) CONTINUE THE PROCESS UNTILL YOU GET THE SAME ANSWER FOR AT LEAST TWICE Example 2 1 Show that the equation x 4 0 x Has a root between 0.2 and 0.3. Taking 0.2 2 as the first approximation, find the root of the equation correct to 3d.p . Solution At least one root 1 must lie between f ( x) x 4 0.2 and 0.3 x 1 2 f (0.2) (0.2) 4 0.96 0.2 1 2 f (0.3) (0.3) 4 0.756 0.3 2 1 1 2 x 40 x 4 x xTherefore, g(x) is 1 an iteration x function 2 x 4 1 1 2 g( x ) 2 x 4 x 4 2 x ' g ( x) 2 2 ( x 4) 2 2(0.2) 0.0245 1 g (0.2) 2 2 ((0.2) 4) ' x g( x ) x 4 2 1 x1 0.2 1 x2 0.24752 2 (0.2) 4 1 x3 0.24623 2 (0.24752) 4 1 x4 0.24627 2 (0.24623) 4 The required solution is 0.246 Example 3 Using the iteration method, find the x solution of f ( x ) x e near x1 0.5 correct to 3 d.p. Solution: x x e x=g(x) g( x ) e x g ( x ) e ' x Given x1 = -0.5, 0.5 g ( 0.5) e 0.6065 1 ' x g( x ) e 0.56844 x1 0.5 x9 e 0.56641 0.56641 x2 e 0.5 0.60653 x e 0.56756 10 x3 e 0.60653 0.54524 0.56756 x e 0.56691 0.54524 11 x4 e 0.57970 0.56691 x12 e 0.56728 0.57970 x5 e 0.56006 0.56006 x6 e 0.57117 x7 e 0.57117 0.56486 0.56486 x8 e 0.56844 x The required solution is - 0.567