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
Quartic function wikipedia , lookup
System of polynomial equations wikipedia , lookup
Horner's method wikipedia , lookup
Weber problem wikipedia , lookup
System of linear equations wikipedia , lookup
Interval finite element wikipedia , lookup
Root-finding algorithm wikipedia , lookup
NUMERICAL ANALYSIS (MTH603) Solution of Assignment # 1(F all 2005) Please read the following instructions before attempting the solution of this assignment. (i) (ii) (iii) (iv) In order to attempt this assignment you should have full command on first seven lectures of MTH603. Don’t use colorful background and you should remember that if we found the solution files of some students are same then we will reward zero marks to all those students. Try to make solution by yourself and protect your work from other students, otherwise you and the student who send same solution file as you will be given zero marks. Try to get the concepts, consolidate your concepts and ideas from these questions which you learn in the first seven lectures. Also remember that you are supposed to submit your assignment in Word format any other like scan images etc will not be accepted and we will give zero marks correspond to these assignments. Note: There are two types of question in this assignment (i) Graded Questions (ii) Questions for Practice. Each Graded Question carry 10 marks and Questions for Practice have zero marks, but you are advised to solve all the questions as it will help you in understanding of the concepts. 1. Define the absolute error and percentage error and explain the difference between absolute error and relative error. 2. Determine the absolute error, relative error and the error bounds of 48.242 Q2 is graded question. Solution: Consider z = xn ,z - ez = (x –e1)n where ez and e1 errors in z and x. n n e z ez x e1 x n 1 1 Expanding by binomial theorem we get, x 1 z ez x n ne1 x n1 Since z x n so we have ez ne1 x n1 Dividing by z x n ez x n1 e 1 ne1 n z ne1 z x z x By definition we have, ez 1 e ne1 n 1 z x x 1 1 e Hence we have RE n 1 here we have n= and e1 103 x=48.242 2 2 x RE e1 1 1 103 . 0.005 103 x 2 2 48.242 Now AE=RE x 6.946 = 0.034 10 3 Error Bounds = 6.946 0.034 10-3 3. Compute the difference 2.03 2 correct to five significant figures. So relative error is RE n 4. Evaluate the polynomial y x 3 5x 2 6 x 0.55 at x 2.73. upto 3decimal places with truncation. Also, evaluate the percentage error. Q4 is graded question. Solution: y 2.73 5 2.73 6 2.73 0.55 3 2 20.346417 37.2645 16.38 0.55 0.011917 up to 3 decimal places it becomes 0.012 , so we have Absolute Error= 0.011917 0.012 0.000083 Absolute Error 0.000083 0.00696 (Up to five decimal places) True value 0.011917 Percentage Error = 100 Re lative Error 100 0.00696 0.696% . Relative Error = 5. Expand the function f x Cosx in Taylor’s series and obtain a fourth-degree polynomial to 3-decimal place when x 1.5 , x0 0 . 6. If the length l and the width w of a rectangle are in error by 1.0 and 0.5 respectively and the value of l is 10 cm and that of w is 6 cm. Give the error bounds of the area of the rectangle and that of l . w Q6 is graded question. Solution: 2 First of all note that if we take z l w then relative error of z will be given ez e e 1 2 (You can prove that) here e1=1 and e2 =0.5 and we have l =10, z l w e 1 0.5 0.1 0.083 0.183 w =6. Thus the relative error is given by RE z z 10 6 AE 10 here , z 1.667 and RE 0.183 So we Now as we know that RE z 6 have AE z RE 1.667 0.183 0.305061 . Now required Error bounds can be obtained by the formula z AE 1.667 0.305061 by RE 7. Solve x 2 x upto 4-decimal places using Bisection method. 8. Use the bisection method to find a solution accurate to within 10 3 for x tan x on [4,4.5]. 9. Find an approximation to method. 3 25 correct to with in 10 4 using the bisection Q9 is graded question. Solution: Let x 3 25 then we have to find out the roots of the equation x3 25 0 40 30 20 10 2.5 3 3.5 4 -10 Note that if we take f ( x) x3 25 then we have f ( x) 0 also note that f (2.75) 20.797 25 0 and f (3) 27 25 0 so the real root of the equation lies between 2 and 3 as it is also clear from the graph of the function plotted above. Also we are required to find the approximation correct up to 10-4 decimal places which means that 1 0.0001 that is correct up to 4 we have to find the approximation correct up to 10000 decimal places. Take a b f(a) f(b) f(m) ab m 2 2.75 3 2.875 -4.2031 2 -1.2363 3 2.875 3 2.9375 -1.2362 2 0.347412 2.875 2.9375 2.90625 -1.2362 0.347412 -0.452972 ……. …… …… …… ……. ……. Carry on in this way unless up to 4 decimal places your values became same and after certain number of iterations your answer will be 2.924072. NOTE: Number of iterations depends on the choice of the interval which you take, if we pick the interval [2.75 3] then after approximately 15 iterations you will get the required answer correct up to 4 decimal places and if you take the interval [2 3] then you may get the required accuracy after more than fifteen iterations. 10. Find a real solution of the equation f ( x) x 3 5 x 2 29 0 using regula falsi method correct to 4 significant figures taking x1 5 and x2 6 . Q10 is graded question. Solution: 5 5.2 5.4 5.6 5.8 6 -5 -10 -15 -20 -25 Since we are given the values x1 5 and x2 6 so f ( n) x f ( x2 ) x2 f ( x1 ) f ( x1 ) x1 x2 f ( x2 ) n 1 f ( x2 ) f ( x1 ) 5 6 5.8056 -29 7 -1.8473 5.8056 6 5.8462 -1.8492 7 -0.0033 …….. …….. …….. …… …. …. Carry on in this way unless up to 4 decimal places your values became same and after certain number of iterations your answer will be 5.8479. NOTE: Graph of the given equation is drawn just for your understanding so that you would be able to realize about the root. 11. Use method of False-Position to find the solution accurate to within 10 3 for Sinx e x 0 . 12. Use a fixed point iteration method to determine a solution accurate to within 10 2 for a sin x x 0 on [1, 2]. 4 13. Use a fixed point iteration procedure to find an approximation to accurate with in 10 4 . 3 that is 14. Use a fixed point iteration method to determine a solution accurate to within 10 2 for a sin x x 0 on [1, 2]. 15. Discuss the difference between fixed point method and Newton-Raphson method. 16. Use Newton’s Method to find the solution accurate to with in 10 4 for the following problem a) ln( x 1) cos( x 1) 0 1.2 x 2 b) e x 3x 2 0 0 x 1 and 3 x 5 17. The volume V of liquid in a spherical tank of radius r is related to the h 2 3r h depth h of the liquid by V . Determine h using Newton3 Raphson method, given r 1m and V 0.5m 3 upto 3-decimal places Q17 is graded question. Solution: Since we are given r=1 and V=0.5 also we have 3.142 by putting these 3.142h 2 3 h 0.5 1.5 9.426h 2 3.142h3 values we get 3 3 3.142h 9.426h 2 1.5 0 -1 -0.5 0.5 1 -2 -4 -6 -8 -10 First of all note that f (h) 3.142h3 9.426h2 1.5 then f (h) 9.426h2 18.852h we can note that f(0) = 1.5 >0 and f(1)<0 so the root lies between 0 and 1. From the graph it is quiet clear that the required root of the above polynomial lies some where near 0.5 and -0.5, so we can take the initial approximation as x0=1 5 xn 1 xn 4.784 1 0.508 0.492 f ( x0 ) f ( xn ) 1 For n=0 we have x1 x0 f ( x0 ) f ( xn ) 9.426 0.407 1 0.058 0.434 f ( x1 ) 0.492 f ( x1 ) 6.993 Carry on in this way unless up to 3 decimal places your values became same. For n=1 we have x2 x1 NOTE: Graph of the given equation is drawn just for your understanding so that you would be able to realize about the root. 6