NUMERICAL METHODS Coverage: Roots of Equations Systems of Linear Algebraic Equations Curve Fitting Differentiation Integration Ordinary Differential Equations Definition of Terms: Numerical Methods - These are techniques by which mathematical problems are formulated so that they can be solved with arithmetic operations. Root – a value that will satisfy an equation as equal to zero. Example: if f(x) = x + 5 is a function and we will substitute x by -5 then evaluating f(x) we will get f(x) = 0. In that case, -5 is the root of f(x). Root then is the value of x that satisfies f(x) as equal to zero when evaluated. BISECTION METHOD This is one of the oldest and perhaps the simplest root finding method. Steps to use bisection method in finding the root of an equation: 1. Begin with equation f(x) = 0. 2. Using the sign-change condition, find two values of x, say a and b, which bracket the real root of the given equation. 3. Take the midpoint of the interval [a,b] as the initial estimate x for the root. Real Root Estimated Root x = (a+b) / 2 4. The root is within the estimated root and one of the interval. Use sign-change condition to determine the root. 5. The next estimate of root is again the midpoint of the interval. 6. The process can be repeated by any number of times until the root is obtained or until a desired degree of accuracy has been obtained. Example: Use bisection method to find for the root of f(x) = x – 2 + ln x Solution: Step 1: Let f(x) = 0 Step 2: Find two values of x, say a and b, which bracket the root of the given equation. Let us say, we will take or assume: a = 1 and b = 2 Evaluating f(x) using the values of a and b, we will get: f(a) = -1 f(b) = 0.69315 these assumed values of the variables a and b brackets the root of the function since f(a) is negative and f(b) is positive. We may then use a and b to solve for the root. Step 3: Take the midpoint x of the interval [a,b] as the initial estimate of root x = ((a+b)/2 = (1+2)/2 = 1.5 Step 4: Use sign-change condition to determine the root. Substituting the values of a, x and b to f(x) , we will get: fx and fb have opposite signs, meaning the estimated root is bracketed by x and b. Step 5: The next estimate of root is again the midpoint of the interval that brackets the root. assign the next value of a as 1.5 and b as 2 then. Step 6: The process can be repeated many of times until the root is obtained or until a desired degree of accuracy has been obtained. The table for the solution is as follows: a 1 1.5 1.5 1.5 1.5 1.531250000 1.546875000 1.554687500 1.554687500 1.556640625 1.556640625 1.557128906 1.557128906 1.557128906 1.557128906 1.557128906 1.557144165 1.557144165 1.557144165 1.557144165 1.557145119 1.557145596 x 1.5 1.75 1.625000000 1.562500000 1.531250000 1.546875000 1.554687500 1.558593750 1.556640625 1.557617188 1.557128906 1.557373047 1.557250977 1.557189941 1.557159424 1.557144165 1.557151794 1.557147980 1.557146072 1.557145119 1.557145596 1.557145834 b 2 2 1.750000 1.625000 1.562500 1.562500 1.562500 1.562500 1.558593750 1.558593750 1.557617188 1.557617188 1.557373047 1.557250977 1.557189941 1.557159424 1.557159424 1.557151794 1.557147980 1.557146072 1.557146072 1.557146072 fa -1 -0.094534892 -0.094534892 -0.094534892 -0.094534892 -0.042665605 -0.016888233 -0.004037939 -0.004037939 -0.000829321 -0.000829321 -2.74129E-05 -2.74129E-05 -2.74129E-05 -2.74129E-05 -2.74129E-05 -2.35485E-06 -2.35485E-06 -2.35485E-06 -2.35485E-06 -7.88723E-07 -5.66079E-09 fx -0.0945 0.3096 0.110507816 0.008787103 -0.042665605 -0.016888233 -0.004037939 0.002377722 -0.000829321 0.000774397 -2.74129E-05 0.000373504 0.000173049 7.28187E-05 2.27031E-05 -2.35485E-06 1.01741E-05 3.90965E-06 7.77401E-07 -7.88723E-07 -5.66079E-09 3.8587E-07 Therefore: The root of f(x) = x – 2 + ln x is approximately equal to 1.557145834 fb 0.69315 0.69315 0.30961579 0.11050782 0.0087871 0.0087871 0.0087871 0.0087871 0.00237772 0.00237772 0.0007744 0.0007744 0.0003735 0.00017305 7.2819E-05 2.2703E-05 2.2703E-05 1.0174E-05 3.9096E-06 7.774E-07 7.774E-07 7.774E-07