1. Trang chủ
  2. » Công Nghệ Thông Tin

A textbook of Computer Based Numerical and Statiscal Techniques part 41 pptx

10 294 0

Đang tải... (xem toàn văn)

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 10
Dung lượng 130,69 KB

Nội dung

386 COMPUTER BASED NUMERICAL AND STATISTICAL TECHNIQUES 2.2. 2.2. 2. Solve the following system of equations using Gauss-Elimination method: (a) 1xyz−+= (b) 362xyz++= 323 6xyz−+ − =− 427xyz−+= 2545xyz−+= [Ans. −2, 3, 6] 349xy z−+ = [Ans. 2, –1, 1 2 ] (c) 54xyzu+++= 712zyzu+++= 65xy zu++ +=− 6xyzu+++=− [Ans. 1, 2, –1, –2] 3.3. 3.3. 3. What do you understand by ill-conditioned equations? Consider the following system of equations: 100 200 100xy−= 200 401 100xy−+ = Determine, whether given system is ill-conditioned or not. 4.4. 4.4. 4. Solve the following system of equations by Jacobi’s iterations method: (a) 2217xy z+− = (b) 52 12xyz++= 320 18xyz+−=− 4215xyz++= 2 3 20 25xy z−+ = [Ans. 1, –1, 1] 2520xyz++= [Ans. 1.08, 1.95, 3.16] 5.5. 5.5. 5. Using Gauss-Seidel method, solve the following system of equations: (a) 10 12xyz++= (b) 25xyz−+= 210 13xyz++= 23 2 7yz+−= 221014xy z++ = [Ans. 1, 1, 1] 2310xyz++= [Ans. 3, 2, 1] (c) 20 2 17xy z+− =− 320 18xyz+−=− 2 3 20 25xy z−+ = [Ans. 1, –1, 1] GGG CHAPTER 9 Curve Fitting 9.1 INTRODUCTION In many branches of applied mathematics and engineering sciences we come across experiments and problems, which involve two variables. For example, it is known that the speed v of a ship varies with the horsepower p of an engine according to the formula p = a + bv 3 . Here a and b are the constants to be determined. For this purpose we take several sets of readings of speeds and the corresponding horsepowers. The problem is to find the best values for a and b using the observed values of v and p. Thus the general problem is to find a suitable relation or law that may exist between the variables x and y from a given set of observed values (x i , y i ), i = 1, 2, , n. Such a relation connecting x and y is known as empirical law. The process of finding the equation of the curve of best fit, which may be most suitable for predicting the unknown values, is known as curve fitting. Therefore, curve fitting means an exact relationship between two variables by algebraic equations. There are following methods for fitting a curve: I. Graphic method II. Method of group averages III. Method of moments IV. Principle of least square. Out of above four methods, we will only discuss and study here principle of least square. 9.2 PRINCIPLE OF LEAST SQUARES The method of least square is probably the most systematic procedure to fit a unique curve through the given data points. Y P(x,y) 111 P(x,y) iii P(x,y) nnn L 2 e 1 L 1 e 2 P 2 L i L n M 1 M 2 M i M n X O FIG. 9.1 387 388 COMPUTER BASED NUMERICAL AND STATISTICAL TECHNIQUES Let the curve 21 m yabxcx kx − =+ + + (1) be fitted to the set of n data points ()()() 11 22 33 ,, ,, , xy xy xy , , () ,. nn xy At (x = x i ) the observed (or experimental) value of the ordinate is = iii ypm and the corresponding value on the fitting curve ()i is 2 m ii i abx cx kx +++ ii LM = which is the expected or calculated value. The difference of the observed and the expected value is P i M i − L i M i = e i (say) this difference is called error at (x = x i ) clearly some of the error 123 , , , , eee , in ee will be positive and other negative. To make all errors positive we square each of the errors i.e., =++++++ 22222 123 in Seeeee the curve of best fit is that for which es ′ are as small as possible i.e. S, the sum of the square of the errors is a minimum this is known as the principle of least square. 9.2.1 Fitting of Straight Line Let a straight line yabx=+ (1) Which is fitted to the given date points ()()() () 11 22 33 , , , , , , , , nn xy xy xy xy . Let y λ be the theoretical value for 1 x then 11 eyy λ =− ⇒ () 11 1 ey abx =−+ ⇒ () 2 2 11 1 eyabx =−− Now we have 222 2 123 n Seee e =+++ + 1 1 n i i Se = = ∑ 2 1 () n ii i Syabx = =−− ∑ By the principle of least squares, the value of S is minimum therefore 0 S a ∂ = ∂ (2) And 0 S b ∂ = ∂ (3) On solving equations () 2 and () 3 , and dropping the suffix, we have ynab x=+ ∑∑ (4) 2 xy a x b x=+ ∑∑∑ (5) The equation () 3 and () 4 are known as normal equations. On solving equations () 3 and () 4 , we get the value of a and b. Putting the value of a and b in equation () 1 , we get the equation of the line of best fit. 9.2.2 Fitting of Parabola Let a parabola 2 yabxcx=+ + (1) which is fitted to a given date () 11 , xy , () 22 , xy , () 33 , xy , , () , nn xy Let y λ be the theoretical value for 1 x then 11 eyy λ =− CURVE FITTING 389 ⇒ () =−+ + 2 11 1 1 ey abxcx ⇒ () 2 22 11 11 eyabxcx =−−− Now we have 2 1 n i i Se = = ∑ () 2 2 11 1 n i i Syabxcx = =−−− ∑ By the principle of least squares, the value of S is minimum therefore, 0 S a ∂ = ∂ , 0 S b ∂ = ∂ and 0 S c ∂ = ∂ (2) Solving equation (2) and dropping suffix, we have 2 ynab xc x=+ + ∑∑∑ (3) 23 xy a x b x c x=+ + ∑∑∑∑ (4) 2234 xy a x b x c x=++ ∑∑∑∑ (5) The equation, (3), (4) and (5) are known as normal equations. On solving equations (3), (4) and (5), we get the value of a, b and c. Putting the value of a, b and c in equation (1), we get the equation of the parabola of best fit. 9.2.3 Change of Scale When the magnitude of the variable in the given data is large number then calculation becomes very much tedious then problem is further simplified by taking suitable scale when the value of x are given at equally spaced intervals. Let h be the width of the interval at which the values of x are given and let the origin of x and y be taken at the point 00 , xy respectively, then putting () 0 xx u h − = and 0 vyy=− If m is odd then, () () middle term interval x u h − = But if m is even then, u = x – mean of two middle term 1 2 interval af af Example 1. Find the best-fit values of a and b so that yabx=+ fits the data given in the table. x01234 y11.83.34.56.3 390 COMPUTER BASED NUMERICAL AND STATISTICAL TECHNIQUES Sol. Let the straight line is yabx=+ (1) 2 01 00 11.8 1.8 1 23.3 6.6 4 3 4.5 13.5 9 4 6.3 25.2 16 10 16.9 47.1 30 2 x y xy x xy xy x == = = ∑∑ ∑ ∑ Normal equations are: ynab x=+ ∑∑ (2) 2 xy a x b x=+ ∑∑∑ (3) Here 5,n = 10,x = ∑ 16.9,y = ∑ 47.1xy = ∑ 2 30 x = ∑ Putting these values in normal equations we get, 16.9 5 10ab=+ 47.1 10 30ab=+ On solving these two equations we get, 0.72, 1.33.ab== So required line 0.72 1.33yx=+ . Ans. Example 2. Fit a straight line to the given data regarding x as the independent variable. x 1234 56 y 1200 900 600 200 110 50 Sol. Let the straight line obtained from the given data by yabx=+ (1) Then the normal equations are ynab x=+ ∑∑ (2) xy ∑ = axbx+ ∑∑ 2 (3) 2 1 1200 1 1200 2 900 4 1800 3 600 9 1800 4 200 16 800 5 110 25 550 6 50 36 300 21 3060 91 6450 2 xyx xy xy x xy == = = ∑∑ ∑ ∑ CURVE FITTING 391 Putting all values in the equations () 2 and (3), we get 621 3060 ab+ = 6450 21 91ab =+ Solving these equations, we get 1361.97a = and 243.42b =− hence the fitted equation is y = 1361.97 – 243.42x. Ans. Example 3. Find the least square polynomial approximation of degree two to the data. x 01234 y –4 –1 4 11 20 also compute the least error. Sol. Let the equation of the polynomial be 2 yabxcx=+ + (1) 22 3 4 22 3 4 04 00 0 0 0 11 11 1 1 1 24 84 16 8 16 3 11 33 9 99 27 81 4 20 80 16 320 64 256 10 30 120 30 434 100 354 x y xy x x y x x xyxy x xy x x − −− − == = = = = = ∑∑∑ ∑ ∑ ∑ ∑ The normal equations are : 2 ynab xc x=+ + ∑∑∑ (2) =+ + ∑∑∑∑ 23 xy a x b x c x (3) 2234 xy a x b x c x=++ ∑∑∑∑ (4) Here 5,n = 10,x = ∑ 30,y = ∑ 120,xy = ∑ 2 30, x = ∑ 2 434, xy= ∑ 3 100, x = ∑ 4 354. x = ∑ Putting all these values in () 2 , () 3 and () 4 , we get 30 5 10 30abc=+ + (5) 120 10 30 100ab c =++ (6) 434 = 30a +100b +354c (7) On solving these equations, we get 4,a =− b = 2, 1.c = Therefore required polynomial is 2 42 yxx=− + + , errors = 0. Ans. 392 COMPUTER BASED NUMERICAL AND STATISTICAL TECHNIQUES Example 4. Fit a second-degree parabola to the following data taking x as the indenpendent variable. x 123456789 y 2 6 7 8 10 11 11 10 9 Sol. The equation of second-degree parabola is given by 2 yabxcx=+ + and the normal equations are : 2 ynab xc x=+ + ∑∑∑ 23 xy a x b x c x=+ + ∑∑∑∑ 2 234 xy a x b x c x=++ ∑∑∑∑ (1) Here 9n = . The various sums are appearing in the table as follows: 2234 22 3 4 12 2 1 2 1 1 26 12 4 24 8 16 37 21 3 63 27 81 4 8 32 16 128 64 256 5 10 50 25 250 125 625 6 11 66 36 396 216 1296 7 11 77 49 539 343 2401 8 10 80 64 640 512 4096 9 09 81 81 729 729 6561 45 74 421 279 2771 2025 15333 x y xy x x y x x xyxy x xy x x======= ∑∑∑ ∑ ∑ ∑ ∑ Putting these values of ,x ∑ ,y ∑ 2 , x ∑ ,xy ∑ 2 , xy ∑ 3 , x ∑ and 4 , x ∑ in equation () 1 and solving the equations for ,ab and ;c we get 0.923;a =− 3.520;b = 0.267.c =− Hence the fitted equation is 2 0.923 3.53 0.267 yxx=− + − . Ans. Example 5. Show that the line of fit to the following data is given by 0.7 11.28yx=+ . x 0 5 10 15 20 25 y 12 15 17 22 24 30 Sol. Here 6m = (even) Let 0 12.5, x = 5,h = 0 20 y = (say)      CURVE FITTING 393 Then, 12.5 2.5 x u − = and 20vy=− , we get x y uvuv 2 u 012 –5–8 4025 515 –3–5 15 9 10 17 –1 –3 3 1 15 22 1 2 2 1 20 24 3 4 12 9 25 30 5 10 50 25 0u = ∑ 0v = ∑ 122uv = ∑ 2 70 u = ∑ The normal equations are : 06 0ab=+× 0a⇒= 122 0 70 1.743abb=×+ ⇒= Thus line of fit is 1.743 .vu= or () 12.50 20 1.743 7 8.175 2.5 x yx −  −= =−   or 0.7 11.285yx=+ . Ans. Example 6. Fit a second-degree parabola to the following data by least square method. x 1929 1930 1931 1932 1933 1934 1935 1936 1937 y 352 356 357 358 360 361 361 360 359 Sol. Taking 0 1933, x = 0 357 y = then () 0 xx u h − = x 1933ux=− y 357vy=− uv 2 u 2 uv 3 u 4 u 1929 –4 352 –5 20 16 –80 –64 256 1930 –3 360 –1 3 9 –9 –27 81 1931 –2 357 0 0 4 0 –8 16 1932 –1 358 1 –1 1 1 –1 1 1933 0 360 3 0 0 0 0 0 1934 1 361 4 4 1 4 1 1 1935 2 361 4 8 4 16 8 16 1936 3 360 3 9 9 27 27 81 1937 4 359 2 8 16 32 64 256 Total u = ∑ 0 v = ∑ 11 uv = ∑ 51 2 u = ∑ 60 2 uv= ∑ –9 3 u = ∑ 0 4 u = ∑ 708 Here 1h = Taking 0 uxx=− and 0 , vyy=− therefore 1933ux=− and 357vy=− Then the equation 2 yabxcx=+ + is transformed to 2 vABuCu=+ + (1) 394 COMPUTER BASED NUMERICAL AND STATISTICAL TECHNIQUES Normal equations are: 2 9 vABuCu=+ + ∑∑∑ ⇒ 11 9 60AC=+ 23 uv A u B u C u=+ + ∑∑∑∑ ⇒ 17/20B = 2234 uv A u B u C u=++ ∑∑∑∑ ⇒ 960 708AC −= + On solving these equations, we get 694 , 231 A = 17 20 B = and 247 924 C =− ∴ 2 694 17 247 231 20 924 vuu=+− ⇒ ()() 2 694 17 247 357 1933 1933 231 20 924 yxx −=+ − −+− ⇒ () () 2 2 694 17 32861 247 247 247 357 3866 1933 231 20 20 924 924 924 yxxx −=+ − − − − −+ ⇒ () 2 2 694 32861 247 17 247 3866 247 1933 231 20 924 20 924 924 yxxx × =− − ++ − ⇒ 2 3 1643.05 998823.36 357 0.85 1033.44 0.267 yxxx=− − + + + − ⇒ 2 1000106.41 1034.29 0.267 yxx=− + − . Ans. Example 7. Fit second degree parabola to the following x 01234 y 1 1.8 1.3 2.5 6.3 Sol. Here 5m = (odd) therefore 0 2 x = Now let 2,ux=− vy= and the curve of fit be 2 vabucu=+ + . x y uvuv 2 u 2 uv 3 u 4 u 01–21–2 4 4–816 1 1.8 –1 1.8 –1.8 1 1.8 –11 2 1.3 0 1.3 0 0 0 0 0 3 2.5 1 2.5 2.5 1 2.5 1 1 4 6.3 2 6.3 12.6 4 25.2 8 16 Total 0 12.9 11.3 10 33.5 0 34 Hence the normal equations are: 2 5 vabucu=+ + ∑∑∑ 23 uv a u b u c u=+ + ∑∑∑∑ 2234 uv a u b u c u=++ ∑∑∑∑ CURVE FITTING 395 On putting the values of u ∑ , v ∑ etc. from the table in these, we get 12.9 5 10 ,ac=+ 11.3 10 ,b= 33.5 10 34 .ac=+ On solving these equations, we get 1.48,a = 1.13b = and 0.55c = Therefore the required equation is 2 1.48 1.13 0.55 vuu=+ + . Again substituting =−2ux and vy= , we get 2 1.48 1.13( 2) 0.55( 2) yxx=+ −+ − or 2 1.42 1.07 0.55 yxx=− + . Ans. 9.2.4 Fitting of an Exponential Curve Suppose an exponential curve of the form bx yae = Taking logarithm on both the sides, we get 10 10 10 log log log yabxe=+ i.e., YABx=+ (1) where 10 10 log , log YyAa== and 10 log Bb e= . The normal equations for () 1 are, Y nA B x=+ ∑∑ 2 Y xAxBx=+ ∑∑∑ On solving above two equations, we get A and B. then logaanti A= , 10 log B b e = 9.2.5 Fitting of the Curve y = ax + bx 2 Error of estimate for i th point () , ii xy is () 2 iiii eyaxbx =−− We have, 2 1 n i i Se = = ∑ () 2 2 1 n iii i yaxbx = =−− ∑ By the principle of least square, the value of S is minimum ∴ 0 S a ∂ = ∂ and 0 S b ∂ = ∂ . the value of a, b and c in equation (1), we get the equation of the parabola of best fit. 9.2.3 Change of Scale When the magnitude of the variable in the given data is large number then calculation. term 1 2 interval af af Example 1. Find the best-fit values of a and b so that yabx=+ fits the data given in the table. x01234 y11.83.34.56.3 390 COMPUTER BASED NUMERICAL AND STATISTICAL TECHNIQUES Sol taking suitable scale when the value of x are given at equally spaced intervals. Let h be the width of the interval at which the values of x are given and let the origin of x and y be taken

Ngày đăng: 04/07/2014, 15:20

TỪ KHÓA LIÊN QUAN