p1031

# p1031 - SECTION 1 INTRODUCTION 1 Motivation Example 1 1...

This preview shows pages 1–5. Sign up to view the full content.

i SECTION 1: INTRODUCTION ................................................................................................................. 1 Motivation Example 1 : ............................................................................................................................ 1 Motivation Example 2 : ............................................................................................................................ 2 Motivation Example 3: ............................................................................................................................. 4 Motivation Example 5 :........................................................................................................................... 11 The Bisection Algorithm: ....................................................................................................................... 14

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
EE103 Lecture Notes, Fall 2007, Prof S.E. Jacobsen Section 1 1 SECTION 1: INTRODUCTION This section contains several examples that demonstrate a few issues that arise in the area of engineering and scientific computing. Motivation Example 1 1 : We are all familiar with the quadratic formula for finding the roots of the quadratic equation, 2 ax bx c 0,a 0 ++ = . Of course, the two roots are given by the expression 2 b b4 a c 2a −± . Leta 1, b 62.1, c 1 == = . The roots of the equation 2 62.1 1 0 xx + += are, approximately (to seven decimal places), 12 r =-0.0161072 and r -62.0838928 = . Now, assume we have a finite precision machine (computer, calculators, etc.) that only can provide "four digit arithmetic" (to be defined later) to compute the two roots. Of course, we'd hope that the answers would be close to the two roots given above, expressed in "four digit arithmetic". That is, we'd like the answers to be close to 1 r 0.01611 = and 2 r 62.08 = − . Now, using only four digit arithmetic, we compute 22 b 4ac (62.1) 4.0 = 3856-4.0 3852 62.06 −= = = . We'll use the notation 1 fl(r ) , for the four digit approximation to the root 1 r , to emphasize the fact that the answer is an approximation ("fl" stands for "floating point"). We then have that 1 fl(r ) ( 62.1 62.06)/2 0.02 =− + . Therefore, the absolute error is given by 11 |fl(r ) r| | 0.02 0.01611| 0.00389 + = , but the relative or percentage error, using four digit arithmetic, is given by 1 1 |fl(r ) 0.00389 2.4x10 |r| 0.01611 =≈ . That is, the percentage error is approximately 24%, an error that is clearly unacceptable. However, note that we may write
EE103 Lecture Notes, Fall 2007, Prof S.E. Jacobsen Section 1 2 22 2 b b4 a c b a c ( b a c ) 2 2a 2a (b b 4 a c ) b + 4 c ba c −+ −− == . If we use this expression we get, using four digit arithmetic, 1 2.000 2.000 fl(r ) 0.01610 62.10 62.06 124.2 = + and, therefore, 4 11 1 |fl(r ) r| 0.00001 6.2x10 |r| 0.01611 =≈ , a far more acceptable percentage error ( 62 % 1000 ). The lesson: When using finite precision arithmetic, the manner by which a mathematical expression is formulated may have a serious impact upon the accuracy of the computed result. Motivation Example 2 2 : Consider the simple 2x2 system of linear equations 12 kk x x 2 (1 10 )x x 2 10 + = ++ = + The exact solution of this system is, clearly, ** (x , x ) (1, 1) = . However, imagine that we have no idea what the solution is but that someone has suggested a solution; for instance, it has been suggested that the solution is (x , x ) (0, 2) = . It appears to be natural to "test" the suggested solution by "plugging" that solution into the given system of equations. Upon doing so, we can compute the absolute errors (i.e., for each equation, we compute the difference between the two sides of the equation). Such errors are often called "residual errors". We get 2 k 21 2 e 2 (x x ) = 0 e2 1 0 ( ( 1 1 0 ) xx ) 1 0 =− + =+ − + + = 1 From Burden and Faires 2 From Burden and Faires

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
EE103 Lecture Notes, Fall 2007, Prof S.E. Jacobsen Section 1 3 For instance, if k=6, we see the residual errors are quite small and, if we do not know better, we may be satisfied with 12 (x , x ) (0, 2) =
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 16

p1031 - SECTION 1 INTRODUCTION 1 Motivation Example 1 1...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online