solutions_chapter1_odd_problems_cee-305

solutions_chapter1_odd_problems_cee-305 - ’a ’ Problem...

Info iconThis preview shows pages 1–24. Sign up to view the full content.

View Full Document Right Arrow Icon
Background image of page 1

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

View Full DocumentRight Arrow Icon
Background image of page 2
Background image of page 3

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

View Full DocumentRight Arrow Icon
Background image of page 4
Background image of page 5

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

View Full DocumentRight Arrow Icon
Background image of page 6
Background image of page 7

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

View Full DocumentRight Arrow Icon
Background image of page 8
Background image of page 9

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

View Full DocumentRight Arrow Icon
Background image of page 10
Background image of page 11

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

View Full DocumentRight Arrow Icon
Background image of page 12
Background image of page 13

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

View Full DocumentRight Arrow Icon
Background image of page 14
Background image of page 15

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

View Full DocumentRight Arrow Icon
Background image of page 16
Background image of page 17

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

View Full DocumentRight Arrow Icon
Background image of page 18
Background image of page 19

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

View Full DocumentRight Arrow Icon
Background image of page 20
Background image of page 21

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

View Full DocumentRight Arrow Icon
Background image of page 22
Background image of page 23

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

View Full DocumentRight Arrow Icon
Background image of page 24
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ’a ’ % Problem Set (Kata, Ngugwg, Keg; Ears) Chapter 01.01 Introduction to Numerical Methods COMPLETE SOLUTION SET 1. Give one example of an engineering problem where each of the following mathematical procedure is used. If possible, draw from your experience in other classes or from any professional experience you have gathered to date. a) Differentiation b) Nonlinear equations d) Regression e) Interpolation f) Integration g) Ordinary differential equations {RAGE} o i 3 01.01.10 "2 _ (,‘haptcr 01.01 3. Solve the following system of simultaneous linear equations by any method 25a+ 5b +c 2106.8 64a+8b+c=l77.2 144a +12!) + c 2 279.2 Solution 25a+5b+02106.8 (1) ,, , , ,, ,, l44a+l2b+c = 279.2 (3) Subtract Equation (1) from Equation (2) gives 39a + 3b : 70.4 (4) Subtract Equation (1) from Equation (3) gives ll9a+7b=l72.4 (5) From Equation (4), a : 70.4 ~ 3b (6) 39 Substituting the value of a from Equation (6) in Equation (5) gives 1 19(29’113—13] + 7b : 172.4 39 214.81 49.15381) + 7b : 172.4 —2.1538b : ~42.4l b 2 42.41 2.1538 : 19.69 F rom Equation (4), 70.4 ~ 309.69) 39 = 0.2905 From Equation (1), c :106.8—25a~5b :106.8— 25(02905) — 509.69) 21.0857 (1: So (a,b,c) = (0.2905, 19.69, 1.0857) 01.01.12 Chapter 01.01 5. Integrate exactly 3/2 y sin 2x (be 0 Solution 71/2 3; I sin 2xdx : [~ cosax) - 2 2 if}? 1353 69 01.0144 , ' Chapter ()1 .(ll 7. Solve the following ordinary differential equation exactly Also find y(0), gyx—(O), y(2.5), 5342.5) x Solution —+ = X, 0 =5 l y e y() The homogeneous solution for the above equation is given by (D + I)y : 0 The characteristic equation for the above equation is given by r+l:0 The solution to the equation is r 2 —l y}! : ke‘lx The particular part of the solution is of the form Ae“ yp : Axe" d p)+yp:e"‘ Ae'x — Axe" + Axe” : e" 0 : e'x A :1 Hence the particular part of the solution is y P : xe" The complete solution is given by y : y H + y P = ke” + xe" The constant C can be obtained by using the initial condition y(0) : 5 Am=a4+wwzs k : 5 The complete solution is X y : 5e” + xe— Thus, NO) = 5 (11.01.15 01.01 y(2.5) : 0.61563 -— (2.5) = —0.53352 dx Problem Set Chapter 01.02 Measuring Error COMPLETE SOLUTION SET l. The trigonometric function sin(x) can be calculated by using the following infinite series sin(x) :x—£+§:—i+ .... .. 3! 5! 7! ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, series? b) What is the value of sin(2.17) by using the first four terms in the given series? 0) Use your calculator for the true value of sin(2.l7) ? d) What is the true error for answer in part (a)? e) What is the absolute true error for answer in part (a). i) What is the relative true error for answer in part (a). g) What is the absolute relative true error for answer in part (a). h) What is the approximate error for answer in part (b)? i) What is the absolute approximate error for answer in part (b). 3') What is the relative approximate error for answer in part (b). k) What is the absolute relative approximate error for answer in part (b). 1) Assume that you do not know the exact vaiue of sin(2.17) , how many significant digits are at least correct if you use four terms in the series? m) What should be the ore-specified reiative error tolerance if at least 4 significant digits are required to be correct in calculating sin(2.l7) ? Solutions 2.173 2.175 + 3! 5! = 2.17 — 1.703 + 0.4009 2 0.8679 3 5 7 b) sin(2.i7) = 2.17-333~+3;§’..-3:§_ 3! Si 7! z 2.17 —~ 3 .703 + 0.4009 — 0‘64495 = 0.8229 c) sin(2.i7) = 0.8257 a) sin(2.i7) : 2.17 — d) E, = True value — Approximate value E‘ = 0.8257 —— 0.8679 : —0.0422 0 l .022 Chapter 0 l .02 e) [at :1- 0.04221 : 00422 f) 6’: True Value _ — 0.0422 6,— 0.8257 :—0.0511 or —5.11% g) Fla—005111200511 or 511% True Error : 0.8229 — 0.8679 : ~0 .04 5 i) {Edi = l— 0.045l : 0.045 Approximate Error Present Approximation _ — 0.045 a— 0.8229 ~0.05468 or —5.468% k) lea; = l~ 0.05468l = 0.05468 or 5.468% l) If lea] < 0.5 x 102'” , then at least m significant digits are correct in the answer. Since lea] = 5.468 < 0.5 x102‘m m : 0 Thus, no significant number of digits can be claimed to be correct. m) If lea! < 0.5 x 102‘“ , then at least m significant digits are correct in the answer. If m z 4 then [ea] < 0.5)(1025‘1 2 0.005% E {E E .022 01.034 Chapter 0 I .02 3. A Maclaurin series for a function is given by 3 5 f(x)=x—3€—+x—+ .... .. How many terms should be used in the series to consider that at least 2 significant digits are correct in your answer for f (0.1) ? Solution f(x) =16 f(0.1) 20.1 Next find the value for two terms 3 f(x)=X~—:—! 0.13 f(0. 1) = 0.1— 3! : 0.09983 Find the approximate error E0 = [0.09983 — 0.1] : 0.00017 0.00017 0.09983 : 0.17% Thus, using two terms will have an answer with at least 2 significant digits Since H = z 0.17% < 0.5 x1027" for a maximum of m = 2 , we have at least 2 significant digits correct in the answer. Ea 0% i333 0 l .021) Chapter 0 l .02 5. The function e" can be calculated by using the following infinite Maclaurin series 2 3 4 r x x x e‘ :l+x+~——+-——+-——+ ...... .. 2! 3! 4! a) Use 5 terms to calculate the value of eo'9 ? b) How many significant digits in my calculation would be correct if I use 5 terms? 0) How do I know that I have used enough terms to calculate eo‘9 , if I pre~ specify a tolerance of 0.05%? What is the minimum number of terms I V are the sources of error coming from in the above series? Solution x2 x3 x4 a) ex:l+x+———+——+~—+ ...... .. 2! 3! 4! 2 3 4 e‘"9 21+ 0.9+ 0'9 + 0'9 + 0‘9 2! 3! 4! : 2.4538 b) Using 4 terms eo'9 : 2.4265 '6“; : 2.4538~2.4265 X I00 2.4538 : 1.1 126% Hence we have at least one significant digit correct in the value of 1309 : 2.4538 0) Number Of Answer lEal leal % terms r 1 l - - J 2 1.9 0.9 47.36 _ 3 2.305 0.405 17.57 4 2.426 0.121 4.987 5 2.453 0.027 1.100 j 6 2.4587 0.0057 0.2318 7 2.4595 0.0008 0.0325 Hence, at least 7 terms are needed to achieve a tolerance of 0.05% d) Errors are mainly coming from truncation error as we are using only a finite number of terms in the series. However, round-off error is also involved as we are calculating the individual terms approximately “Mam; g “:2 0 i .018 “a “g Chapter 01.02 3,2; , W» 7. What is the correct normalized scientific notation for 0.029411765 with 4 significant digits? Solution 2.941x10“2 €33 .612 Problem Set Chapter 01.03 Sources of Error COMPLETE SOLUTION SET 1. What is the round off error in representing 200/3 in a 6~significant digit computer that chops the last significant digit? Solution Chopping would give gig—g = 66.6666 The round off error would then be @9 ~ 66.6666 = 0.000066 or 2 3 30000 {53193} {)l .03.. .Jv.) 3. What is the truncation error in the calculation of the f ’(x) that uses the approximation « f(x+A’C)*f(x) x z: W f ( ) Ax for f(x):x3, Ax:0.4,and x:5. Solution . ~ f(5+0.4)~f(5) f (5) ~ mm 5.43 — 53 0.4 : 8l .16 The exact solution is f (x) = x3 f '(x) 2 3x2 f '(5) = 3 x 52 = 75 Thus, the true error from truncation is E, = 75 ~ 81 .l6 =~6.l6 ()l .035 a ()l .03 9 5. The integral Ixzdx can be calculated approximately by finding the area of the four 3 rectangles as shown in Figure 1. What is the truncation error due to this approximation? 3’ 30“ O O 1.5 3 4.5 6 7.5 9 10.5 12 Figure 2 Plot of y = x2 showing the approximate area under the curve from x = 3 to x = 9 using four rectangles. Solution The exact solution is 9 3 9 3 3 3 93 33 i;— ~ g = 234 The approximate solution Atx:3,y:32=9 A,=1.5x9 :135 At x=4.5, y=4.52 =20.25 A2 :l.5x20.25 =30.375 g? i} 3 113$} Chapter 01 .03 At x26, 32:62 :36 A321.5><36 ~ =54 At x275, 37:7,52 :5625 A4 =1.5x56.25 284.375 IxzdxasAl +143 +A3 +114 3 My.“ WWWWWM’m‘“h'W"’MWW3T3i§ufifif§7§rmwfli§7§flww = 182.25 Thus, the true error from truncation is E1, =2 234 432.25 251.75 31.6.1334 Problem Set Chapter 01.04 Binaw Representation COMPLETE SOLUTION SET 1. Convert the following 3) (19)10 "7’ b) (75)“) = (7)2 lution 3) (19)10 : (?)2 Quotient l Remainder I 19/2 9 1 9/2 4 1 4/2 2 0 I 2/2 1 0 1 1/2 0 1 The binary representation is therefore (1.9),0 =(10011)2 b) (75% = (?)2 I Quotient Remainder 1 75/2 37 1 1 37/2 18 1 I 18/2 9 1 0 1 9/2 4 1 [ 4/2 I 2 0 1 2/2 I 1 0 1 1/2 0 1 The binary representation is therefore (75)10 = (100101 1)2 {ii 184} 0104.3 01.04 3. Convert the following a) (0.375).O = (‘2)2 b) (0.075)... = (‘2). Solution 3) (0‘375)10 2 (?)2 Number Number after Decimal Number before Decimal 0.375 x 2 0.750 0.750 0 0.750x 2 1.500 0.500 l The binary representation is therefore (0.375)10 = (001 1)2 b) (0.075)"; = (’02 l— Number Number after Decimal l Number before Decimal 0.075 x 2 0.150 0.150 1 0 0.150x 2 0.300 0.300 0 0.300 x 2 0.600 0.600 0 0.600 x 2 1.20 0.200 1 0.200 x 2 0.400 0.400 I 0 0.400 x 2 0.300 0.800 1 0 The binary representation‘is therefore (0.075)10 40.000100)2 Note the representation is only approximate 5. Convert the following a) (19.375)10 = (?.?)2 b) (75.075)10 = (2.?)2 Solution a) (19.375)10 = (17.?)2 Integer Part: [ Quotient Remainder 19/ 9 1 4/2 2 0 I 2/2 1 0 _ 1/2 0 1 1 Fractional Part: I Number Number after Decimal Number before Decimal 0.375 x 2% 0.750 0.750 0 0.750 x 2 1.500 0.500 1 0.500x2 L 1.000 0 1 (19.375)10 =(10011.011)2 b) (75.075)10 = (?.?)2 Integer Portion: ’7 Quotient l Remainder I 75/2 37 1 1 I 37/2 18 1 } 18/2 9 0 t 9/2 4 1 4/2 2 0 2/2 1 0 1/2 0 l Decimal Portion: Number l_Number after Decimal Number before Decimal 0.075 x 2 0.150 0.150 0 1 0.150 x 2 0.300 0.300 0 I 0.300 x 2 0.600 0.600 0 0.600 x 2 1.20 0.200 ‘l 1 0.200 x 2 0.400 0.400 0 0.400 x 2 0.800 0.800 r 0 0.800 x 2 1.600 0.600 i 0.600 x 2 1.200 0.200 1 1 0] .04.6 Chapter 01.04 (75.075)10 g (100101100010011)2 {1:552 Problem Set Chapter 01.05 Floating Point Representation COMPLETE SOLUTION SET 1. A hypothetical computer stores real numbers in floating point format in 8-bit words. The first bit is used for the sign of the number, the second bit for the sign of the exponengthe nexttwo bits forthe magnitude of the exponent; and their-next four bits r for the magnitude of the mantissa. Represent 3.1415 in the 8-bit format. ,,,,,,,,,,,,,,, ,, ,, “WW. ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, ., Finding (3)lo = (?????)2 Quotient 1 1 l2 Hence (3)Io :(11)2 Finding (0.1415)lo = 17????)2 ' - Number after decimal Number before decimal 0.1415 x 2 0.233 0.283 0.283 x 2 0.566 0.566 0 0.132 x 2 0.264 0.264 (0.1415)m .2. (0.901...)2 (3.14415)10 561.001...)2 41.1001...)2 xzmw =’(i.iooi...)2 x2101): Sign number bit 2 0 Sign exponent bit 2 O Bits inmantissa 21001 Bits in exponent 2 01 Representation is r manna 6:653 I, 01.053 01.05 ti?» 3. A hypothetical computer stores real numbers in floating point format in 10-bit words. The first bit is used for the sign of the number, the second bit for the sign of the exponent, the next three bits for the magnitude of the exponent, and the next five bits for the magnitude of the mantissa. Represent -0.0456 in the 10-bit format. Solution Finding (0.0456)10 = (32???)2 , l 0.0456x2 0.0912 0.0912 0 0.0912x2 0.1824 0.1824 __. 0 } 0.1824x2 1 0.3648 0.3648 0 0.3648 x 2 0.7296 0.7296 0 0.7296 x 2 1.4592 04592 M 1 0.4592 x 2 0.9184 0.9184 0 0.9184x2 1.8368 0.8368 H 1 0.8368 x 2 1 1.6736 0.6736 1 1 0.6736 x 2 1.3472 0.3472 1 l { 0.3472x 2 0.6944 1 0.6944 0 J (0.0456)10 s(0.0000101110...)2 =(1.01110...)2 x 21% =(1.011 10...)2 x 21"“)2 Sign number bit 2 1 Sign exponent bit :1 Bits in mantissa : 01 110 Bits in exponent : 101 Representation is IIJLDIOIHOLLJIIIIOI {iii} . UH Wt f3 E: 1‘ m 5. A machine stores floating point numbers in 7—bit words. Empioy first bit for the Sign ef the number, second one for the Sign of the exponent, next two for the magnitude of the exponent, and the last three for the magnitude of the mantissa. a) By magnitude, what are the smaiiest negative and positive numbers in the system? b) By magnitude, what are the largest negative and positive numbers in the c) What is the machine epsilon? WWW/MW”.totmnew“.fl_.~41)sHReptesenteeljnthelzbit/iotmatt__we.wetW.N,tweWe.tween.meflmflwwflwwwWWW“ e) Represent 3.623 in the 7~bit format. 8 What is the next higher number, x2 after x1= 0 1 1 O 1 1 0 in the 7-bit format. g) Find 3": “‘1 from part (1‘) and cempare with the machine epsiion. x; Selution a) The smallest number is 0111000 Sign number hit 2 0 Sign of number is positive Sign exponent hit z 1 Sign of exponent is negative Bits in exponent :11 11 21x2’+1x2‘> ( )2 : (3)19 Bits in mantissa = 000 (1.900)2 :1x29 +0x2" +0><z2‘2 +Ox2”3 Hence, the number in base 10 is 1x 2‘3 2: 0.125 The answer is «0125,0125 b) The largest number is 001} l 1 i Sign number hit 2 0 Sign of number is positive Sign exponent hit = 0 Sign of exponent is positive (11)2 21x21+1x20 01.056 2W7 Chapter ("11 .(15 ' " (ff) : (3)10 Bits in mantissa:111 (1.111)2 :1x2°+1><2" +1><272 +1x2‘3 : 1.875 Hence, the number in base 10 is. 1 .875 x 23 = 15 The answer is 0) 6much : 2—3 = 0.125 d) e1 = 2.718 Finding (2)10 42:12???)Z 1 Quotient Remainder 2/2 1 0 1/2 0 1 Hence (2)10 = (10)2 Finding (0.718),O = (7????)2 Number Number after decimal Number before decimal I 0.718x2 1.436 0.436 1 0.436 x 2 0.872 0.872 0 0.872 x 2 1.744 0.744 1 1 0.744 x 2 1.488 0.488 1 (0.718)10 ; (0.101 . . .)2 (2.718)10 ; (10.101...)2 = (1.0101...)2 x 2010 = (1.0101...)2 x210”: Sign number bit : 0 Sign exponent bit 2 0 01.057 01.0 1} 1 Bits in mantissa = 010 Bits in exponent : 01 Representation is 0001010 e) Finding (3)10 = (8????)2 Quotient Remainder 3/2 1 1 1/2 1 0 1 1 Hence (3)]IO =: (1 I)2 Finding (0.623)10 = (9????)2 Number FNumber afier decimal Number before decimal_‘l 0.623 x 2 i 1.246 0.246 1 0.246 x 2 0.492 0.492 0 0.492 x 2 0.984 0.984 0 0.984 x 2 1.968 1 0.968 1 (0.623)10 2 (0.1001 . “)2 (3.623)l0 z. (1 1.1001 ...)2 :(i.11001...)2><2(1)‘0 =(1.11001...)2x2(0‘>2 Sign number bit 2 0 Sign exponent bit : O Bits in mantissa :110 Bits in exponent : 01 Representation is unnn f) Thenumber 3:, i501 101 10 Sign number bit : 0 Sign of number is positive Sign exponent bit : 1 Sign of exponent is negative Bits in exponent : 10 (10)2 21x21+0x20 : (2)10 01.058 g (f‘hzlptei‘ 01.05 Bits in mantissa =110 (1.110)2 21x20 +1><271+1x272 +0x2‘3 = 1.75 Hence, the number, x], in base 10 is 1.75 x 2’2 = 0.4375 The next number, x2, is 0110111 Sign number bit : 0 , ,,, Sign exponent bit =1 Sign of exponent is negative Bits in exponent : 10 (10)2 :1x21+0x20 : (2)10 Bits in mantissa =11 1 (1.111)2 =.~1x20 +1><2-l +1x2‘2 +1><2'3 = 1.875 Hence, the number, x2 , in base 10 is 1.875 x 2'2 = 0.46875 g) x2 " x1 _ 0.46875 u 0.4375 7 0.4375 : 0.07142 This vaiue is 1ess than the machine epsilon of 6mm: 0.125. This is always going to be the case for all numbers that can be represented by this system. x1 ...
View Full Document

This note was uploaded on 10/14/2011 for the course CEE 305 taught by Professor Nguyen,d during the Spring '08 term at Old Dominion.

Page1 / 24

solutions_chapter1_odd_problems_cee-305 - ’a ’ Problem...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online