• No results found

1 — BASIC CONCEPTS IN ERROR ESTIMATION

N/A
N/A
Protected

Academic year: 2021

Share "1 — BASIC CONCEPTS IN ERROR ESTIMATION"

Copied!
21
0
0

Loading.... (view fulltext now)

Full text

(1)

Basic Concepts in Numerical Analysis Accuracy of numbers

Definition and Sources of errors Accuracy and Precision Sources of Errors

Error Definition Propagation of Errors

Error in Addition of Numbers Error in Product of Numbers Error in Division of Numbers A General Formula for Error

Function Approximation The theory of Invers problem Error in Series Approximation Floating point Representation

1 — BASIC CONCEPTS IN ERROR ESTIMATION

1.1 Basic Concepts in Numerical Analysis

Numerical Analysis is a part of mathematics concerned with devising methods, called numeri- cal algorithms, for obtaining numerical approximate solutions to mathematical problems and, importantly, being able to estimate the error involved. A major advantage for numerical method is that a numerical answer can be obtained even when a problem has no analytical solution.

1.1.1 Accuracy of numbers

1. Exact Number: Number with which no uncertainly is associated to no approximation is taken, are known as exact numbers e.g., 5,21

6 ,12

3 , ...etc. are exact numbers.

2. Approximate Number: There are numbers, which are not exact, e.g., 2 = 1.41421...,e = 2.7183...., etc. are not exact numbers since they contain infinitely many non-recurring digits. Therefore the numbers obtained by retaining a few digits, are called approximates numbers, e.g., 3.142, 2.718 are the approximate values ofπ and e.

3. Significant Figures: The significant figures are the number of digits used to express a number. The digits 1, 2, 3, 4, 5, 6, 7, 8, 9 are significant digits. ‘0’ is also a significant figure except when it is used to fix the decimal point or to fill the places of unknown or discarded digits.

Example 1.1 Each numbers 5879, 3.487, 0.4762,0.2056, 256800 contains four sig- nificant figures while the numbers 456,2.63,0.0486,0.00382,0.000376 contains only three significant figures since zeros only help to fix the position of the decimal point.

4. Round off Number: The process of cutting off super-flouts digits and retaining as many digits as desired is known as rounding off a number or we can say that process of dropping unwanted digits is called rounding-off. To round-off the number to n significant figures, discard all digits to the right of nth digit and if this discarded number is

(a) Less than 5 in (n + 1)thplace, leave the nth digit unaltered e.g., 8.893 to 8.89 (b) Greater than 5 in (n + 1)thplace, increase the nth digit by unity e.g., 5.3456 to 5.346 (c) Exactly 5 in (n+1)thplace, increase the nth digit by unity if it is odd otherwise leave

it unchanged. e.g., 11.675 to 11.68, 11.685 to 11.68.

(2)

1.2 Definition and Sources of errors 1.2.1 Accuracy and Precision

All numerical methods involve approximations due to either limits in the algorithm or physical limits in the computer hardware. Errors associated with measurements or calculations can be characterized with reference to their accuracy and precision.

Definition 1.2.1 Accuracy refers to how closely a computed or measured value agrees with the true value.

Precision refers to how closely individual computed or measured values agree with each other.

Inaccuracy (also known as bias) is the systematic deviation from the truth.

Imprecision (uncertainty) refers to the magnitude of the scatter.

Figure 1.1: An example from marksmanship illustrating the concepts of accuracy and precision:

(a) inaccurate and imprecise, (b) accurate and imprecise, (c) inaccurate and precise, and (d) accurate and precise.

1.2.2 Sources of Errors

When a computational procedure is involved in solving a scientific-mathematical problem, errors often will be involved in the process. A rough classification of the kinds of original errors that might occur is as follows:

• Modelling Errors: Mathematical modelling is a process when mathematical equations are used to represent a physical system. This modeling introduces errors and are called modelling errors.

• Blunders and Mistakes: Blunders occur at any stage of the mathematical modeling process and consist to all other components of error. Blunders can be avoided by sound knowledge of fundamental principles and with taking proper care in approach and design to a solution. Mistakes are due to the programming errors.

• Machine Representation and Arithmetic Errors: These errors are inevitable when us- ing floating-point arithmetic when using computers or calculators. Examples are rounding and chopping errors.

• Mathematical Approximation Errors: This error is also known as a truncation error or discretisation error. These errors arise when an approximate formulation is made to a problem that otherwise cannot be solved exactly.

(3)

1.2 Definition and Sources of errors 7 1.2.3 Error Definition

Errors are introduced by the computational process itself. Computers perform mathematical operations with only a finite number of digits.

Definition 1.2.2 If the number xais an approximation to the exact result xe, then the difference xe− xais called error. Hence

Error = True value-Approximate value In numerical computations, we come across the following types of errors:

1. Inherent errors 2. Round-off errors 3. Truncation errors

4. Absolute and relative errors Inherent errors

Inherent errors are the errors that pre exist in the problem statement itself before its solution is obtained. Inherent errors exist because the data being approximate or due to the limitations of the calculations using digital computers. Inherent errors cannot be completely eliminated but can be minimised if we select better data or by employing high precision computer computations.

Round-off errors

The round-off error is the quantity, which arises from the process of rounding off numbers.

It sometimes also called numerical error. The round-off error can be reduced by carrying the computation to more significant figures at each step of computation. At each step of computations, retain at least one more significant figure than that given in the data, perform the last operation, and then round off.

To round-off the number to n significant figures, discard all digits to the right of nth digit and if this discarded number is

• less than 5 in (n + 1)th place, leave the nth digit unaltered e.g., 8.893 to 8.89

• greater than 5 in (n + 1)th place, increase the nth digit by unity e.g., 5.3456 to 5.346

• exactly 5 in (n + 1)th place, increase the nthdigit by unity if it is odd otherwise leave it unchanged. e.g., 11.675 to 11.68, 11.685 to 11.68

Truncation errors

Truncation errors are defined as those errors that result from using an approximation in place of an exact mathematical procedure. Truncation error results from terminating after a finite number of terms known as formula truncation error or simply truncation error.

Let a function f (x) is infinitely differentiable in an interval which includes the point x = a. Then the Taylor series expansion of f (x) about x = a is given by

f (x) =

n=0

f(n)(a)

n! (x − a)n (1.1)

If the series is truncated after n terms, then it is equivalent to approximating f (x) with a polynomial of degree n –1.

fn(x) ≈n−1

k=0

f(k)(a)

k! (x − a)k (1.2)

The error in approximating En(x) is equal to the sum of the neglected higher order terms and is often called the tail of the series. The tail is given by

En(x) ≈ f (x) − fn(x) = f(n)(ξ)

n! (x − a)n (1.3)

(4)

It is possible sometimes to place an upper bound on the x of En(x) depending on the nature of function f (x).

If the maximum value of | fn(x)| over the interval [a, x] is known or can be estimated, then Mn(x) ≈ max

a≤ξ≤x| f(n)(ξ)| (1.4)

From Eqs. (1.3) and (1.4), the worst bound on the size of the truncation error can be written as En(x) ≤Mn(x)|x − a|n

n! (1.5)

If h = x − a, then the truncation error En(x) is said to be of order O(hn). In other words, as h → 0,En(x) → 0 at the same rate as hn.

Hence

O(hn)≈ chn h << 1 where c is a non-zero constant.

Example 1.2 Computing surface area of earth using the formula V = 4πr2involves several

approximations.

Solution:

• Earth is modeled as sphere, idealizing its true shape.

• Value for radius is based on emperical measurements and previous computations

• value for π requires truncating infinite process

• values for input data and results of arthimetic operations are rounded in computer.

Absolute and relative errors

Definition 1.2.3 If xT is the exact or true value of a quantity and xAis its approximate value, then |xT− xA| is called the absolute error Ea. Therefore absolute errors.

Ea=|xT− xA| and relative error is defined by

Er=

xT− xA

xT

provided xT�= 0 or xT is not too close to zero. The percentage relative error is Ep=100Er=100

xT− xA

xT

Example 1.3 An approximate value ofπ is given by xA =22

7 =3.1428571 and its true value is x = 3.1415926. Find the absolute and relative errors.

Solution: Given xT =3.1415926 and xA=3.1428571, then Ea = |xT− xA| = |3.1415926 − 3.1428571| = 0.0012645 Er = |Ea|

|xT|=

0.0012645 3.1415926

� = 0.0004025 Ep = 100Er=0.04025%

(5)

1.2 Definition and Sources of errors 9

Example 1.4 Round-off the number 75462 to four significant digits and then calculate its

absolute, relative and percentage error.

Soluton: After rounded-off the number to four significant digits we get 75460. Therefore, Ea = |x − xa| = |75462 − 75460| = 2

Er = Ea

x = 2

75462 =0.0000265 Ep = 100Er=0.00265%

Example 1.5 Three approximate value of number 1

3 are given 0.30, 0.33 and 0.34, 1. Find the absolute, relative and percentage errors for each approximation.

2. Which of these three is the best approximation?

Solution:

1. Given xT=1

3 and xA=0.333, then (a) Ea=|xT− xA| = |1

3 − 33 100|= 1

30 Er=

Ea

xT

� =

301 13

= 3 30 = 1

10 Ep=100Er=10%

(b) Ea=|xT− xA| =

1 3 −

33 100

� = 1 300 Er=

Ea

xT

� =

3001 13

= 3

300= 1 100 Ep=100Er=1%

(c) Ea=|xT− xA| =

1 3 −

34 100

� = 2 300 Er=

Ea

xT

� =

3002 13

= 6

300= 1 Ep=100Er=2% 50

2. Here the error is least when approximate value is 0.33. Hence 0.33 is the best approxima- tion.

R • We say that xAapproximates x correct to k decimal places, if k is the largest positive integer such that the absolute error

Ea=|x − xA| < 0.5 × 10−k

• An approximation xAapproximates x correct to k significant digits, if k is the largest positive integer such that the absolute error

Ea=|x − xA| < 0.5 × 10t−k+1 where t is the largest integer such that 10t≤ |x|

Example 1.6 If x = 135.2469208, then xA =135.25 approximates x correct to five sig- nificant digits since 2 is the largest integer such that 102≤ |x| and 5 is the largest integer

(6)

with

|x − xA| = 0.0030792 < 0.005 = 0.5 × 10−2=0.5 × 102−5+1

Exercise 1.1 Let the solution of a problem be xA=35.25 with relative error in the solution atmost 2% find the range of values upto 4 decimal digits, within which the exact value of the

solution must lie.

Answer 34.5588 < x < 35.9694

Exercise 1.2 Given the trigonometric function f (x) = sinx, 1. expand f (x) about x = 0 using Taylor series

2. truncate the series to n = 6 terms

3. find the relative error at x =π4 due to truncation in (b)

4. determine the upper bound on the magnitude of the relative error at x =π

4 and express it as a percent.

1.3 Propagation of Errors

Definition 1.3.1 An algorithm is a procedure that describes a finite sequence of steps to be performed in a specified order to solve a given problem.

Definition 1.3.2 Propagated Errors is an error in the succeeding steps of an algorithm due to an occurrenec of an earlier error.

Propagated error is of critical importance:

• If errors are magnified continuously as the algorithm continues eventually they will over shadow the true value and hence destroying the validity of the algorithm and we call such algorithm us unstable.

• If errors made at initial stage die out as the algorithm continues, the algorithm is said to be stable. Usually the initial error induced will not die out to the last stage of the algorithm.

But to consider the stability of an algorithm we consider two cases: Suppose that an error e0is introduced at initial stage of the algorithm and after ‘n’ subsequence operations of the algorithm, Enerror is resulted which is the propagated error:

– If |En| ≤ kne0where k is a constant the propagated error is said to be linear growth and the algorithm is stable. Linear growth of error is usually unvoidable and is acceptable and algorithms that show linear growth are considered to be stable.

– If |En| ≥ kne0 for some k > 1, the propagated error is exponential. Exponential growth of error should be avoided. An algorithms that show exponential growth are said to be unstable.

1.3.1 Error in Addition of Numbers

Theorem 1.3.1 If two numbers are added, the upper limit of the absolute error in the result is the sum of the absolute errors in the two numbers.

Proof. Let Eabe the absolute error in a, Ebbe the absolute error in b, Ea+bbe the absolute error

(7)

1.3 Propagation of Errors 11 in a + b and xa+bbe the approximate value of (a + b).

Hence,

Ea+b = |(a + b) − xa+b| = |(a + b) − (xa+xb)| = |(a − xa) + (b − xb)|

≤ |a − xa| + |b − xb|

= Ea+Eb

1.3.2 Error in Product of Numbers

Theorem 1.3.2 The maximum absolute error in the product of two numbers a and b is aEb+bEa+EaEbwhere Eaand Ebare the absolute error in a and b.

Proof.

Eab = |ab − xaxb| = |ab − (a + (xa− a))(b + (xb+b))|

= |ab − [ab + a(xb− b) + b(xa− a) + (xa− a)(xb− b)]|

= |a(b − xb) +b(a − xa) + (a − xa)(xb− b)|

≤ a|b − xb| + b|a − xa| + |a − xa||xb− b|

= aEb+bEa+EaEb

1.3.3 Error in Division of Numbers

Theorem 1.3.3 The maximum absolute error in the quotienta

bof the two number is bEa− aEb

b2(1 +Eb2 b )

Proof. Exercise

Example 1.7 Evaluate 3 +

5 +

7 to four significant digits and find its absolute and

relative errors.

Solution: We have

3 = 1.732,

5 = 2.236, and

7 = 2.646 Hence the sum

S = 3 +

5 +

7 = 1.732 + 2.236 + 2.646 = 6.614 Since the absolute error in each number is 0.5 × 10−3, then

Ea=0.0005 + 0.0005 + 0.0005 = 0.0015 ≤ 0.005

Thus the total absolute error shows that the sum is correct up to 3 significant figures. Therefore, S = 6.61

Er=Ea

S =0.0015

6.61 =0.0002

Exercise 1.3 Find the relative error in the calculation of 3.724 × 4.312 and determine the interval in which true result lies. Given that the numbers 3.724 and 4.312 are correct to last

(8)

digit?

Answer: Eab(max)=0.00401825 , and Er(max)=0.000250235 The true value lies between (16.05386975, 16.06190625)

1.4 A General Formula for Error 1.4.1 Function Approximation

Let y = f (x) and suppose that the quantity x is subject to an error, sayΔx. Then the error Δy is given by

Δy = Δx f(x +Δx) In the case of several variables, consider the function

F = f (x1,x2, ...,xn) where x1,x2,x3, ...,xnare variables.

SupposeΔxirepresents error in each xi, so that the error in F is

F +ΔF = f (x1+Δx1,x2+Δx2, ...,xn+Δxn) (1.6) Taylor’s series expansion of the right hand side of Eq. (1.6) gives

F +ΔF = f (x1,x2, ...,xn) +

n i=1

∂ f

∂xiΔxi+O(Δx2i) (1.7)

If we assume the errors in xi as small, and Δxi

xi <<1 o that the second and higher powers ofΔxi

can be ignored, Eq. (1.7) gives ΔF =n

i=1

∂ f

∂xiΔxi= ∂ f

∂x1Δx1+ ∂ f

∂x2Δx2+ ... + ∂ f

∂xnΔxn

The relative error Er is then given by Er=Δ f

f = ∂ f

∂x1

∂x1

f + ∂ f

∂x2

∂x2

f + ... + ∂ f

∂xn

∂xn

f

Replacing the function f (h) with its approximationφ(h) and denoting the known error bound as µ(hn), where n is a positive integer, we have

| f (h) − φ(h)| ≤ µ|hn| for small h

Thus,φ(h) approximates f (h) with order of approximation O(hn)and we can write f (h) =φ(h) + O(hn)

Example 1.8 Let r = 3h(h6− 2). Find the percentage error in r at h = 1 if the percentage

error in h is 5

(9)

1.4 A General Formula for Error 13 Solution: We have Δr = Δhdr

dh =Δh(21h6− 6)

Δr

r 100 = Δh

r (21h6− 6)100 = Δh

3h(h6− 2)(21h6− 6)100

= (21h6− 6) 3h6− 6

Δh

h 100 =21 − 6

3 − 6 (5) = −25%

Ep = |Δr

r 100| = 25%

Example 1.9 Determine the maximum relative error for the function F = 3x2y2+5y2z2− 7x2z2+38

For x = y = z = 1 andΔx = −0.05,Δy = 0.001 and Δz = 0.02 Solution: F = 3x2y2+5y2z2− 7x2z2+38

∂F

∂x = 6xy2− 14xz2

∂F

∂y = 6x2y + 10yz2

∂F

∂x = 10y2z − 14x2z (ΔF)max=|∂F

∂xΔx|+|∂F

∂yΔy|+|∂F

∂zΔz| = 0.496 (Er)max=(ΔF)max

F =0.496

39 =0.01272 1.4.2 The theory of Invers problem

To find the error in the function F = f (x1,x2, ...,xn)is to have a desired accuracy and to evaluate errorsΔx1,Δx2, ...,Δxnin x1,x2, ...,xnwe haveΔF = ∂ f

∂x1Δx1+ ∂ f

∂x2Δx2+ ... + ∂ f

∂xnΔxn

Using the principle of equal effects, which states ∂ f

∂x1Δx1= ∂ f

∂x2Δx2= ... = ∂ f

∂xnΔxnthis implies thatΔF = n∂ f

∂xiΔxi

⇒ Δxi= ΔF n∂ f

∂xi

This form is useful where error in dependent variable is given and also we are to find errors in both independent variables

Example 1.10 The percentage error in z which is given by z = x2

2y+y 2

(10)

is not allowed to exceed 0.2%. Find allowable error in x and y when x = 4.5cm andy = 5.5cm

Solution: Percentage error in z = Δz

z 100 = 0.2

⇒ Δz = 0.2

100z = 0.2 100

(4.5)2 2(5.5)+5.5

2

=0.0092

∂z x =x

y =0.8182 and

∂z y =−x2

2y2 +1

2=0.1653 Hence,

Δx = Δz

2∂z

∂x

= 0.0092

2(0.8182) =0.0092

1.6364 =0.00562

Δy = Δz

2∂z

∂y

= 0.0092

2(0.1653) =0.0092

0.3306 =0.0278

1.4.3 Error in Series Approximation

The error committed in a series approximation can be evaluated by using the remainder after n terms. Taylor’s series for f(x) at x = x0is given by,

f (x) = f (x0) + (x − a) f(x0) +(x − x0)2

2! f��(x0) + ... +(x − x0)n−1

(n − 1)! f(n−1)(x0) +Rn(x) where Rn(x) =(x − x0)n

n! f(n)(ξ); x0≤ ξ ≤ x

This term Rn(x) is called remainder term and for a convergent series it tends to zero as n → ∞.

Thus if we approximate f(x) by the first n terms of a series then maximum error committed in this approximation is given by the Rn(x) and if accuracy required is already given then it is possible to find the number of terms n such that the finite series yields the required accuracy.

Example 1.11 Find the number of terms of the exponential series such that their sum gives

the value of excorrect to six decimal places at x = 1.

Solution: The exponential series is given by, ex=1 + x +x2

2!+x3

3!+ ... + x(n−1)

(n − 1)!+Rn(x) (1.8)

where Rn(x) =xn

n!eξ,0 <ξ < x Maximum absolute error atξ = x is

Ea(max)=xn n!ex and Maximum Relative Error is

Er(max)=xn n!

Hence Er(max)at x = 1, is 1

n!. For a six decimal accuracy at x = 1, we get

(11)

1.5 Floating point Representation 15 1

n!<1

2 ×10−6⇒ n! > 2 × 106⇒ n = 10 Therefore, we get n = 10.

Hence we have 10 terms of series (1.8) to obtain the sum correct to 6 decimal places.

1.5 Floating point Representation

Let us consider non-zero decimal number x. An n-digit floating-point number with base b has the form:

x = ±1(0.d1d2d3...dn)bbe

where d1,d2, ...,dnare integers and satisfies 0 ≤ di<b, e is integer exponent and b is the base.

Also (0.d1d2d3...dn)bis a b-fraction called the mantissa, and it lies between +1 and -1. We can represent floating-point numbers with three binary fields: a sign bitδ, an exponent field e, and a fraction field ¯x.

1 bit 2-9 bit 10-32 bit

δ e ¯x

The sign bit is 0 for positive numbers and 1 for negative numbers.

To generate a biased 127 exponent, take the value of the signed exponent and add 127.

Converting a decimal number to a floating point number.

1. Take the integer part of the number and generate the binary equivalent.

2. Take the fractional part and generate a binary fraction 3. Then place the two parts together and normalise.

Example 1.12 Represent the decimal number 23.5 in 32-bit floating point binary format

Solution: Step 1: Convert decimal number to binary representation (23)10= (10111)2and (0.5)10= (0.1)2

we get (23)10= (10111.1)2

Step 2: Normalise the floating point

10111.1 = 1.01111 × 24 Step 3: Put it together

• Assign the sign (δ = 0)

• Mantissa. Remember to ignore the leading 1. In this case 1.01111 ⇒ 01111000000000000000000

• exponent. Add 127 to the exponent and get: 127 + 4 = 131 Convert 131 to binary: (131)10= (10000011)2

So finally we have:

δ e ¯x

0 10000011 01111000000000000000000

(12)
(13)

Introduction Locating Roots Bisection Method False Position method Secant Method

Newton-Raphson Method Fixed point Iteration

Convergence

2 — NONLINEAR EQUATION

2.1 Introduction

A problem of great importance in science and engineering is that of determining the roots/zeros of an equation of the form

f (x) = 0 A polynomial equation of the form

f (x) = pn(x) = anxn+an−1xn−1+ ... +a1x + a0=0 is called an algebraic equation.

An equation which contains polynomials, exponential functions, logarithmic functions, trigono- metric functions etc. is called a transcendental equation. For example,

x4− 3x2+1, 4x6+x5− 3x2− 1, x3− 3x + 6 are algebraic (polynomial) equations, and

cosx − 3x + 5 = 0, ex− 3x2, tanx = x are transcendental equations.

2.2 Locating Roots

Definition 2.2.1 A number r , real or complex, for which f (r) = 0 is called a root of the equation f (x) = 0 or a zero of f .

Geometrically, a root of an equation f (x) = 0 is the value of x at which the graph of the equation y = f (x) intersects the x-axis.

Theorem 2.2.1 Intermediate Value Theorem (IVT)

If f ∈ C[a,b] and k is any number between f(a) and f(b), then there exist a number c in (a, b) for which f (c) = k

(14)

Theorem 2.2.2 IVT for Locating root

If f ( x ) is continuous on [a , b], f (a) and f (b) are of opposite signs, then there exists at least one number x0in (a , b) such that f (x0) =0.

Figure 2.1: Solution of f (x) = 0 between x = a and x = b

There are two types of methods available to find the roots of algebraic and transcendental equations of the form f (x) = 0.

1. Direct Methods: Direct methods give the exact value of the roots in a finite number of steps. We assume here that there are no round off errors. Direct methods determine all the roots at the same time.

2. Indirect or Iterative Methods: Indirect or iterative methods are based on the concept of successive approximations. The general procedure is to start with one or more initial approximation to the root and obtain a sequence of iterates (xk)which in the limit converges to the actual or true solution to the root. Indirect or iterative methods determine one or two roots at a time.

The indirect or iterative methods are further divided into two categories: bracketing and open methods. The bracketing methods require the limits between which the root lies, whereas the open methods require the initial estimation of the solution.

2.3 Bisection Method

Suppose that f (x) is continuous on an interval a ≤ x ≤ b and that f (a) f (b) < 0 then by IVT the equation f (x) = 0 has atleast one real root or an odd number of real roots in the interval (a,b).

Let the first approximation to the root be m1=1

2(a + b).

If f (m1) =0, then m1is the required root.

If f (m1)�= 0, then the root lie either in the interval (a,m1)or in the interval (m1,b).

• If f (m1)f (b) < 0, then the root lies in the interval (m1,b). Set a1=m1,b1=b

• If f (a) f (m1) <0, then the root lies in the interval (a,m1). Set a1=a,b1=m1

• I1= (a1,b1)contains the root of the function

⇒ |I1| = b1− a1=b −1

2(a + b) = 1

2(b − a).

The second approximation to the root now is

(15)

2.3 Bisection Method 19 m2=1

2(a1+b1).

If f (m2)�= 0, then the root lie either in the interval (a1,m2)or in the interval (m2,b1).

• If f (a1)f (m2) <0, then the root lies in the interval (a1,m2). Set a2=a1,b2=m2

• If f (m2)�= 0, then the root lie either in the interval (a1,m2)or in the interval (m2,b1). If f (b1)f (m2) <0, then the root lies in the interval (m2,b1). Set a2=m2,b2=b1

• I2= (a2,b2)contains the root of the function

⇒ |I2| = b2− a2= 1

22(b − a).

Repeating this procedure a number of times, we obtain the bisection method mk+1=1

2(ak+bk) where

(ak+1,bk+1) =

(ak,mk+1) i f f (ak)f (mk+1) <0 (mk+1,bk) i f f (mk+1)f (bk) <0

|In| = 1

2n(b − a)

We take the midpoint of the last interval as an approximation to the root.

This method always converges, if f (x) is continuous in the interval [a, b] which contains the root.

If an error toleranceε is prescribed, then the approximate number of the iterations required may be determined from the relation

1

2n(b − a) ≤ ε Taking both sides log

⇒ log� 1

2n(b − a)

≤ log(ε)

⇒ log(b − a) − nlog2 ≤ log(ε)

⇒ log(b − a) − log(ε) ≤ nlog2

⇒ n ≥log(b − a) − log(ε) log2 where n is a positive integre.

Example 2.1 Find the root of the equation x3− x − 4 = 0 between 1 and 2 to three places

of decimal by using Bisection method.

Solution: Let f (x) = x3− x − 4 = 0. Since f (1) = −4 and f (2) = 2 by IVT f has at least one real root in the interval (1,2).

Given tolerance errorε = 0.5 ×10−3, then we have at least 11 iteration to get the approximate root of f by bisection method correct to three decimal place.

First Iteration: m1=1 + 2

2 =1.5 and f (m1) =−2.125 Since f (1.5) f (2) < 0 the root lies in (1.5, 2).

Second iteration: m2=1.5 + 2

2 =1.75 and f (m2) =−0.3906 Since f (1.75) f (2) < 0 the root lies in (1.75, 2).

(16)

Third iteration: m3=1.75 + 2

2 =1.875 and f (m3) =0.717 Since f (1.75) f (1.875) < 0 the root lies in (1.75, 1.875).

Fourth iteration: m4=1.75 + 1.875

2 =1.8125 and f (m4) =0.142 Since f (1.75) f (1.875) < 0 the root lies in (1.75, 1.8125).

Fifth iteration: m5= 1.75 + 1.8125

2 =1.78125 and f (m5) =−0.1296 Since f (1.75) f (1.875) < 0 the root lies in (1.78125, 1.8125).

Repeating the process, the successive approximations are

m6=1.796875,m7=1.7890625,m8=1.7929688,m9=1.7949219,m10=1.7958984,m11=1.7963867 Hence the required root is x = 1.796 correct to three decimal place

Exercise 2.1 Use the Bisection method to determine the root of the function on the given interval with acuracy 10−4

1. f (x) = x6− x − 1 on [1, 2]

2. f (x) = cosx − 3x + 5 on [0,π 2] 3. xlogx = 1.2 on [2, 3]

2.4 False Position method

The method is also called linear interpolation method or chord method or regula-falsi method.

At the start of all iterations of the method, we require the interval in which the root lies. Let the root of the equation f (x) = 0, lie in the interval (xl,xu), that is, f (xl)f (xu) <0. Rather than bisecting the interval (a, b), it locates the root by joining f (xl)and f (xu)with a straight line. The intersection of this line with the x-axis represents an improved estimate of the root.

Figure 2.2: False-Position Method

Using similar triangles, shown in Figure (2.2), the intersection of the straight line with the x axis can be estimated as

f (xu)− 0

xu− xr =0 − f (xl) xr− xl

(17)

2.4 False Position method 21 which can be solved for

xr=xlf (xu)− xuf (xl) f (xu)− f (xl)

Procedure for the False Position Method to Find the Root of the Equation f (x) = 0

Step 1: Choose two initial guess values (approximations) x0and x1 (where x1>x0 ) such that f (x0).f (x1) <0.

Step 2: Find the next approximation x2using the formula x2=x0f (x1)− xuf (x0)

f (x1)− f (x0)

Step 3: If f (x2)f (x1) <0, then go to the next step. If not, rename x0as x1and then go to the next step.

Step 4: Evaluate successive approximations using the formula xn+1=xn−1f (xn)− xnf (xn−1)

f (xn)− f (xn−1) , where n= 2,3,...

But before applying the formula for xn+1, ensure whether f (xn−1).f (xn) <0; if not, rename xn−2 as xn−1and proceed.

Step 5: Stop the evaluation when |xn− xn−1| < ε, where ε is the prescribed accuracy (tolerance error).

Example 2.2 Using the False Position method, find a root of the function f (x) = ex− 3x2 correct to three decimal place. The root is known to lie between 0.5 and 1.0.

Solution: Let x0=0.5,x1=1. then we have, f (0.5) = 0.8987, f (1) = −0.2817. Thus, x2=x0f (x1)− x1f (x0)

f (x1)− f (x0) =0.88067

f (x2) =0.0858 Since f (x1)f (x2) <0, the root lies in the interval (0.88067, 1), then next approximation is,

x3=x1f (x2)− x2f (x1)

f (x2)− f (x1) =0.90852

f (x3) =0.00441. Since f (1) f (0.90852) < 0, the root lies in the interval (0.90852, 1), then next approximation is,

x4=x2f (x3)− x3f (x2)

f (x3)− f (x2) =0.90993

f (x4) =0.00022. Since f (1) f (0.90993) < 0, the root lies in the interval (0.90993, 1), then next approximation is,

x5=x3f (x4)− x4f (x3)

f (x4)− f (x3) =0.91000

f (x5) =0.00001. Since f (1) f (0.91000) < 0, the root lies in the interval (0.91000, 1), then next approximation is,

x6=x4f (x5)− x5f (x4)

f (x5)− f (x4) =0.91001 f (x6) =0.00000

Therefore, the root is 0.91 correct to four decimal places.

(18)

Exercise 2.2 1. Find a real root of cosx − 3x + 5 = 0. Correct to four decimal places using the method of False Position method.

2. Locate the intervals which contain the positive real roots of the equation x3−3x +1 = 0.

Obtain these roots correct to three decimal places, using the method of false position.

2.5 Secant Method

The Secant method is similar to the Regula-Falsi method, except for the fact that we drop the condition that f(x) should have opposite signs at the two points used to generate the next approximation. Instead, we always retain the last two points to generate the next. Thus, if xn−1 and xnare two approximations to the root, then the next approximation xn+1to root is given by

xn+1=xn−1f (xn)− xnf (xn−1)

f (xn)− f (xn−1) =xn (xn− xn−1)

f (xn)− f (xn−1)f (xn)

Example 2.3 Determine a root of the equation sinx + 3cosx − 2 = 0 using the secant

method.

Solution: Let x0=1,x1=1.5 The formula for x2is given by

x2=x0f (x1)− x1f (x0)

f (x1)− f (x0) =1.1846 x3=x1f (x2)− x2f (x1)

f (x2)− f (x1) =1.2056 x4=1.2078

x5=1.2078 Thus the required root is x= 1.2078

Exercise 2.3 1. Find a root of the equation x3− 8x − 5 = 0 using the secant method.

2. Calculate an approximate value for 434 using one step of the secant method with x0=3 and x1=2.

3. What is the appropriate formula for finding square roots using the secant method?

4. If xn+1=xn+(2−e(exnxn)(x−enxn−1−xn−1) )with x0=0 and x1=1, what is lim

n→∞xn?

2.6 Newton-Raphson Method

The Newton-Raphson method is the best-known method of finding roots of a function f (x). The method is simple and fast. Assume that f(x) is continuous and differentiable and the equation is known to have a solution near a given point.

If the initial guess at the root is xi, a tangent can be extended from the point [xi,f (xi)]. The point where this tangent crosses the x axis usually represents an improved estimate of the root.

As in Fig. 2.3, the first derivative at x is equivalent to the slope:

f(x) = f (xi)− 0 xi−1− xi

which can be rearranged to yield

References

Related documents

The problem of finding efficient, consistent estimators of parameters for a general regression function in the presence of covariate measurement error has not been solved. The

By separating the truncation error from the numerical basis approximation, we investigate the performance of B-Spline FEM in solving the 2D sound-hard scattering problem and

When the undetected error probability behaves irregularly with respect to ε, difficulties arise in finding a code, appropriate for error detection over a channel with not

Propagation of errors is the mathematical process of estimating the expected error in a calculated result caused by the errors associated with the measured variables used in the

We then consider true and 61 approximate errors for these parameters, and derive the registration model 62 error analytically using the estimation value and transformation parameter

The main feature of the proposed framework is that the method is able to control both discretisation and modelling (homogenisation) errors in a failure problem. Due to the

The error caused by using approximate input values to our numerical integration methods3. The error of our numerical integration method (if we assume

The dual weighted residual (DWR) method yields reliable a posteriori error bounds for linear output functionals provided that the error incurred by the numerical approximation of