Partial preview of the text
Download interpolation main topic and more Exercises Mathematical Methods for Numerical Analysis and Optimization in PDF only on Docsity!
PYeNSE Course No. ME 3121 Numerical Computation for Mechanical Engineers Course Plan Topic No. of Classes Reference Books Interpolation 6 Classes 1&3 Numerical Differentiation and Integration 4, 3 Solution of Transcendental/Nonlinear Equations 6 __,, 1&3 Solution of Linear Algebraic Equations 4, 2&3 Curve Fitting 3. 4, 2&3 Eigen value and Eigen vectors 2 4 3 Solution of Ordinary Differential Equations 74, 2&3 Solution of Partial Differential Equations Ts 2&4 Reference Books Numerical Mathematical Analysis Numerical Methods for Engineers Introductory Methods of Numerical Analysis Computational Fluid Flow and Heat Transfer Total- 39 Classes By James B. Scarborough By S.C. Chapra & R.P. Canale By S.S. Sastry By K. Muralidhar & T. Sundararajon Interpolation This Chapter introduces the students to: 1. Interpolate a data within or outside (a bit away from the table) a set of tabular values of equal and unequal intervals. 2. Deduce the various formulae or methods for interpolation. At the end of study of this Chapter students will be able to: 1. Understand various formulae or methods for interpolation. 2. Solve the problems of determining the values in between two given data in a set of tabular values using different formulae and to compare their accuracy. Interpolation : It has been defined as the art of reading between the lines of a table , and in elementary mathematics the term usually denotes the process of computing intermediate values of function from a set of given or tabular values of that function. In higher mathematics we frequently have to deal with functions whose analytical form is either totally unknown or else is of such a nature (complicated or otherwise) that the function cannot easily be subjected to such operations as may be required. Table 1: Diagonal Difference Table fy fay fay fay fly fay Ay lay | Xo Yo Ayo yy Y1 A’yo Ay, A*Yo 2H Y2 A’y, A*Yy Ay, Ay, A*Yo X3 ¥3 A’y, Aty, A® yo Ay; Ay, A’y, A’yy X4 Y4 A’y, A‘y, ASy, Ay, Ay; A*’y, 2G Ys A*y, Aty; Ays A*y, Xe Ye A’ys AY6 xy y7 Table 2:Horizontal Difference Table SC COE CC Xo Yo 2S) v1 Ai Yo X Y2 ALY; AoYo %3 ¥3 AvY¥o — Asyi A3Yo X4 Y4 A1ys AvYo A3y, Asyo 2S Ys Av ys Asys Asyy Ay, AsYo X6 Ye AL Ys Ay Y4 A3Y3 Mayo Asy, AG Yo x 7 Ai Ye Ao Ys A3Y4 Auy3 Aso Ay Avo Newton Forward Interpolation Formula : Our objective is to find suitable polynomial for replacing any given function over a given interval. Let y= f(x) denotes a function which takes the values VoYu""y,for the equidistant values Xo,X,,""" x,of independent variable x and (x) denotes a polynomial of the nth degree. This polynomial may be written in the form (P(X) = Agta, (X-Xq) + Ay (X-Xq)(X-X,) + A3(X-Xq)(X-X4)(X-XQ) Fo +a, (X-Xg)(X- Now we have to determine the values of a, a,, a>"""a, SO as to make (p(X) = Yor P(X1) = Vz, P(X2)=y3 etc. As x values are equidistant then x,-xg= h, x,- X, = 2h, etc. From eqn.(1)we may have P(X) = ao OF, Yo =a 1.8. Ag= Vo Again (x4) = = Yq = Agta, (X,-Xo) i= % _ Virz~Vo AYo OF, ay = Again @(K,) = = Vz = Agta, (Xq-Xq) +A (X_-Xo) (XQ-X4) = Vot (¥1 “Vo)/h.(Xq-X) + Ay (Xq-Xp) (XX) =Yot “5 .2h + a,.2h.h — ¥-2y,+ _ Ay or, a, => Oh ms he 3 3 Similarly, a, =22—222*3=Yo AY _ AY 6h? 321K 3th A'yy A'y, and a, =————_—— n...4.3.2.1h" nth" Now putting the values of a,,a,,a,°"a,, in eqn.(1) we have A IN IN P(x) = yy + rile) + si emer atte Xp Kr— x, (x —ax, A esesnsetatsesesesatnene sessnseeussesuasesnasesessesnesen “t re XyNx—a, x— xy essere —¥, 5) steesesesaessseve( 2) This is the usually written NFFI. This formula is for forward interpolation because it contains values of tabulated functions from y, onward to the right(forward from yo) and none to the left of this value. This is mainly used to interpolate the values near the beginning of a set values and for extrapolating values of y at a short distance backward(to the left) from yo. The starting point yy may be any tabular value, but then the formula will contain only those value of y which one after the value chosen as starting point. Diagonal difference table is used for this formula. Newton’s Formula for Backward Interpolation: Newton’s Formula for Forward Interpolation cannot be used for interpolating a value of y near the end of the tabular values. To derive a formula for this case we write the polynomial in the following form: To determine the values of ao, aj, a>...a, SO as to Make (P(x) = y,, P(Xy_1) = Yp-1 ete. (x,) = Vn = ao SO, ao= Vp, (Xp-1) = Var = Ag +Aq(X%p-1 — Xn) =y, + a,(-h) OF, a, = (Y, ~ Yaa/h = Ay,/h Similarly, a,= A,y,/2!h2, a, = Ay, /3!h3, a, = A,y, /4!h"........... Therefore, An 3) Ay 3, =| i) Suh | ta | ha =y=y t+ + + TP iiecccsssseccceesssseceeessssanees P=Y= I, ( ra) 2laha«aey)ala hoa h nutans iaralary Gara Goad ed ee) n Lh kA h h This is Newton’s formula for Backward Interpolation in terms of x. Again this formula can be modified in the previous way putting u=(x—x,)/h or, x =x, + hu Again, (x — x, _,)/h= {x - (x, —h)}/h=(x—xn)/ht+ h/h=ut+1 P(x) = P(x, +hu)= y, tuAyy, + wurDa,y, +u((u +Du +2))=3<" a Hh eecccceccecccccesceeceees cee ececeeeececeecececeesececeeseeeeeeee +u(u+1\ut 2)........(u+n—1)S2 Awa Thus 6(1,2,3) = 6(2,3,1) = 6(3,2,1) = 6(2,1,3) = 6(3,1,2) etc. Hence the general form of divided difference is as follows- _ y + Yo 8 Os. X00 1 Re a)= Ge a) * Ceo) Gg leg Ra) + v1 Vn (x, —x) (x, — Xp ).-- Oe, —~x,) (x, —x) (x, — xo), mad | ).---G, —x,4) Relation between. Simple difference and Divided Difference : To compare these two, let us consider equal interval for both the cases and the following differences are found. 2"4 Diff. (For equal interval) Simple Diff. Divided Diff. 2m Diff. (For equal interval) Simple Diff. Divided Diff. (x), %,x,)= ya + Bal (y2—-y,)—-(y1 -yo) mm (x, -x5)(%-%) (x, x0) (x, x2) My = 2-2, + Yo Yo (x, —x,)(% —%) Yo 7 ma WCW) hh _ 32 72V t+ Vo 2h? So, the divided diff = simple diff. x" 3° _ Diff. (For equal interval) Simple Diff. Divided Diff. MYo = 3-392 +3 —Yo O32 %22%12%0) = ¥3 —3)24+3)1—- Yo 3h.2h.h — ¥3 = 392 +3): = Vo So, the divided diff = Simple diff. xs In general sense, Divided diff. = Simple diff. x! nth” 1 nth” .. Divided Diff.= Simple Diff x 31h? Putting this value in eqn. 6 we have , Y= Vo +(e — Xo ) LF. 1 + He — % OC, X0> * )] = Vo +e — Xo OX 0 1) + Ce — Xo) (Ce — 1) Se, X95 1 eevee ees (7) From eqn.3 d(x, Xo> x,)= 5(%o- X1> x2 )+ e — x2 Sx, Xo> X1> x2) Putting this value in eqn.7 V = Vo +X Xo JO(Kos %1) + — X 0) % — % EM» X15 2) + (2 = x) (2 — x, (2 = 5) S (2, qo Hy 5 Ky eveececeseseececeseeeeeeseeeeteeseneees (8) Now from eqn.(4) putting the value of 5(x,x5,x1,X,) in eqn. 8 Y =Yo +(X—Xp )B(Xo, x1) +(K— Xo) (XX) B(Kp, x1, X2)+ (x—xq)(x-x1) (xp )8(xo, X1, XQ; X3)+(x—X9)(x—x)(K-xp)(x—xs B(x, XQ, Xy,X2, xs) Similarly we could write Y= Yq + (eH) O(a, ¥)+ (4) (8—¥, JB, 535) + (0-35) (8- 4) (0-2, J8(H, 45,45) + (x — x.) (x—x, )(« — x, ). seeeeeees (x — x, J5(x, X95 X15 X25 X35 seeeeeeeeen x, seeeesseeeeeeeeed (10) This is Newton's law for General interpolation [i.e, for both equal & unequal intervals]. Since we have considered the function y is a polynomial of n degree. So the last term of the above equation is after (n+1)th term hence it is called remainder. “Remainder, — 2... =(«—x.) (@—,) (=) — x, O(%, Xo ys Has ey) We get, (x —x,)(x—x,). eee (x—x,) (x—x,)(x—~x,) teeeeees (x—x,) » > Ge x) Oe — y eoneeXp — x, ) 7°” (ey Xp) Oe, — Xp oven, =x, > (x=) &—~,) @— 3)... @—x,) (x= Xo) =»)... = x, 1) * Gey x0) Ory — ,) Op Hy ones — x, ) 72 Ee, xy), x ere, =, 4)” for x =xo, x1-.......xn respectively. The values of independent variables may or may not be equidistant. Central Difference Interpolation Formulae Central difference in used for interpolation near middle of a difference table. This formulae employ differences lying as nearly as possible on a horizontal line through in diagonal difference table. x y Ay A’y A*y A‘y X4 Y.4 Ay, X 3 Y3 A’, Ay; A*y 4 Xp Y-2 A’y. AYty.4 Ay. Ay; Xy Y-1 A’y., Ay; Ay. Ay, Xo Yo A’y., A‘y., AY A*y. x V1 AY, A‘y.; Ay, A*Yo % Y2 d’y.4 Ayo Ay, A*y, X3 Y3 d’Y.4 Ay3 X4 Yq