Example: tourism industry

LECTURE 3 LAGRANGE INTERPOLATION

CE30125 - LECTURE 3p. 3 LAGRANGE INTERPOLATION Fit points with an degree polynomial = exact function of which only discrete values are known and used to estab-lish an interpolating or approximating function = approximating or interpolating function. This function will pass through allspecified INTERPOLATION points (also referred to as data points or nodes).N1+Nthf1x0g(x)f(x ) N1+gx gx N1+CE30125 - LECTURE 3p. The INTERPOLATION points or nodes are given as:: There exists only one degree polynomial that passes through a given set of points. It s form is (expressed as a power series):where = unknown coefficients, ( coefficients). No matter how we derive the degree polynomial, Fitting power series LAGRANGE interpolating functions Newton forward or backward interpolationThe resulting polynomial will always be the same!

Power Series Fitting to Define Lagrange Interpolation • must match at the selected data points : : • Solve set of simultaneous equations • It is relatively computationally costly to solve the coefficients of the interpolating func-tion (i.e. you need to program a solution to these equations). gx fx gx o = f o a o a 1 x o a 2 x o 2 a N x o

Tags:

  Equations, Lagrange, Interpolation, Lagrange interpolation

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Advertisement

Transcription of LECTURE 3 LAGRANGE INTERPOLATION

1 CE30125 - LECTURE 3p. 3 LAGRANGE INTERPOLATION Fit points with an degree polynomial = exact function of which only discrete values are known and used to estab-lish an interpolating or approximating function = approximating or interpolating function. This function will pass through allspecified INTERPOLATION points (also referred to as data points or nodes).N1+Nthf1x0g(x)f(x ) N1+gx gx N1+CE30125 - LECTURE 3p. The INTERPOLATION points or nodes are given as:: There exists only one degree polynomial that passes through a given set of points. It s form is (expressed as a power series):where = unknown coefficients, ( coefficients). No matter how we derive the degree polynomial, Fitting power series LAGRANGE interpolating functions Newton forward or backward interpolationThe resulting polynomial will always be the same!

2 Xo fxo fo x1 fx1 f1 x2 fx2 f2 xN fxN fN NthN1+gx aoa1xa2x2a3x3 aNxN+++++=aii0N =N1+NthCE30125 - LECTURE 3p. Series Fitting to Define LAGRANGE INTERPOLATION must match at the selected data points : : Solve set of simultaneous equations It is relatively computationally costly to solve the coefficients of the interpolating func-tion ( you need to program a solution to these equations ).gx fx gxo fo = aoa1xoa2xo2 aNxoN++++fo=gx1 f1 = aoa1x1a2x12++ aNx1N++f1=gxN fN = aoa1xN+a2xN2 aNxNN+++fN=1xoxo2 xoN1x1x12 x1N 1xNxN2 xNNaoa1:aNfof1:fN=gx CE30125 - LECTURE 3p. INTERPOLATION Using Basis Functions We note that in general Letwhere = polynomial of degree associated with each node such that For example if we have 5 INTERPOLATION points (or nodes)Using the definition for : ; ; ; ;,we have:gxi fi=gx fi Vix i0=N =Vix NiVixj 0 ij 1 i = j gx3 foVox3 f1V1x3 f2V2x3 f3V3x3 f4V4x3 ++++=Vixj V0x3 0=V1x3 0=V2x3 0=V3x3 1=V4x3 0=gx3 f3=CE30125 - LECTURE 3p.

3 How do we construct ? Degree Roots at (at all nodes except ) Let The function is such that we do have the required roots, it equals zero at nodes except at node Degree of is However in the form presented will not equal to unity at We normalize and define the LAGRANGE basis functions Vix Nxox1x2 xi1 xi1+ xN xiVixi 1=Wix xxo xx1 xx2 xxi1 xxi1+ xxN =Wixox1x2 .. , xN xiWix NWix xiWix Vix Vix xxo xx1 xx2 xxi1 xxi1+ xxN xixo xix1 xix2 xixi1 xixi1+ xixN ---------------------------------------- ---------------------------------------- ---------------------------------------- --------------------------------=CE30125 - LECTURE 3p. Now we have such that equals: We also satisfy The general form of the interpolating function with the specified form of is: The sum of polynomials of degree is also polynomial of degree is equivalent to fitting the power series and computing coefficients.

4 Vix Vixi Vixi xixo xix1 xix2 xixi1 1 xixi1+ xixN xixo xix1 xix2 xixi1 xixi1+ xixN ---------------------------------------- ---------------------------------------- ---------------------------------------- ------------------------------------=Vix i 1=Vixj 0 for ij =V1x2 x2xo 1 x2x2 x2x3 x2xN x1xo 1 x1x2 x1x3 x1xN ---------------------------------------- ---------------------------------------- -------------------------0==gx Vix gx fiVix i0=N =NNgx ao aN CE30125 - LECTURE 3p. Linear INTERPOLATION Using Basis Functions Linear LAGRANGE is the simplest form of LAGRANGE INTERPOLATION where and N1= gx fiVix i0=1 =gx foVox f1V1x +=Vox xx1 xox1 ---------------------x1x x1xo --------------------- == V1x xxo x1xo ---------------------=x0(x)V0 (x)x1V1(x) - LECTURE 3p.

5 Given the following data: Find the linear interpolating function LAGRANGE basis functions are: and Interpolating function g(x) is:xo2 = = Vox 5x 3----------- = V1x x2 3-----------=gx +=CE30125 - LECTURE 3p. = V0 (x)4242x1 = V1(x)x0 = 2x1 = 5xx0 = 2x1 = 5g(x) = V0(x) + (x)CE30125 - LECTURE 3p. Quadratic INTERPOLATION Using Basis Functions For quadratic LAGRANGE INTERPOLATION , N=2 wheregx fi Vix i0=2 =gx foVox f1V1x f2V2x ++= Vox xx1 xx2 xox1 xox2 ---------------------------------------- --= V1x xxo xx2 x1xo x1x2 ---------------------------------------- --= V2x xxo xx1 x2xo x2x1 ---------------------------------------- --=CE30125 - LECTURE 3p. Note that the location of the roots of , and are defined such that thebasic premise of INTERPOLATION is satisfied, namely that.

6 Thus:x0 V0 (x) xx2 V1(x) V2(x)V0x V1x V2x gxi fi=gxo Voxo foV1xo f1V2xo f2++f0==gx1 Vox1 foV1x1 f1V2x1 f2++f1==gx2 Vox2 foV1x2 f1V2x2 f2++f2==CE30125 - LECTURE 3p. Given the following data: Find the quadratic interpolating function LAGRANGE basis functions are Interpolating function g(x) is:xo3= fo1=x14 =f12=x25 =f24=gx Vox x4 x5 34 35 ----------------------------------=V1x x3 x5 43 45 ----------------------------------=V2x x3 x4 53 54 ----------------------------------=gx ++=CE30125 - LECTURE 3p. V0 (x) V2(x)x1 = 4x0 = 3x2 = = 4x0 = 3x2 = 5x1 = 4x0 = 3x2 = V1(x)x1 = 4x0 = 3x2 = (x) = V0(x) + (x) + (x) CE30125 - LECTURE 3p. Cubic INTERPOLATION Using Basis Functions For Cubic LAGRANGE INTERPOLATION , N=3 Example Consider the following table of functional values (generated with ) Find xln= gx foxx1 xx2 xx3 xox1 xox2 xox3 ---------------------------------------- ------------------------f1xxo xx2 xx3 x1xo x1x2 x1x3 ---------------------------------------- ------------------------+= f2xxo xx1 xx3 x2xo x2x1 x2x3 ---------------------------------------- ------------------------f3xxo xx1 xx2 x3xo x3x1 x3x2 ---------------------------------------- ------------------------++CE30125 - LECTURE 3p.

7 ---------------------------------------- ---------------------------------------- ---------------- = ---------------------------------------- ---------------------------------------- ---------------- ---------------------------------------- ---------------------------------------- ---------------- ---------------------------------------- ---------------------------------------- ---------------- =CE30125 - LECTURE 3p. Associated with LAGRANGE INTERPOLATION Using Taylor series analysis, the error can be shown to be given by: where derivative of evaluated at Notes If = polynomial of degree where , then for all xTherefore will be an exact representation of ex fx gx =ex Lx fN1+ = xo xN fN1+ N1th+=fx Lx xxo xx1 xxN N1+ !

8 ---------------------------------------- -----------------------a n N1th degree polynomial+==fx MMN fN1+ x 0 = ex 0=gx fx CE30125 - LECTURE 3p. Since in general is not known, if the interval is small and if does not change rapidly in the interval where . can be estimated by using Finite Difference ( ) formulae will significantly effect the distribution of the error is a minimum at the center of and a maximum near the edges using 6 point INTERPOLATION looks like: at all data points largest . becomes very large outside of the interval. xoxN fN1+ x ex Lx fN1+ xm xmxoxN+2------------------=fN1+ Lx Lx xoxN Lx 012 34 5Lx 0=Lx 0x1 4x5 Lx CE30125 - LECTURE 3p. As the size of the interpolating domain increases, so does the maximum error withinthe interval As increases from a small value, However as for a given and thus Therefore convergence as does not necessarily occur!

9 ! Properties of will also influence error as and varyDxNxo =Lmaxx0xxN emaxx0xxN NLmaxx0xxN emaxx0xxN NNCRIT Lmaxx0xxN xoxN emaxx0xxN NfN1+ DNCE30125 - LECTURE 3p. Estimate the error made in the previous example knowing that (usuallywe do not have this information). fx x ln=ex Lx fN1+ xm ex xxo xx1 xx2 xx3 31+ !--------------------------------------- ------------------------------------ f31+ xm 31+ !--------------------------------------- ---------------------------------------- ---------------------------------------- ---------f31+ f4 =CE30125 - LECTURE 3p. We estimate the fourth derivative of f(x) using the analytical function itself Therefore Exact error is computed as: Therefore error estimate is excellent Typically we would also have to estimate using a Finite Difference ( )approximation (a discrete differentiation formula).

10 Fx xln=f1 x x1 =f2 x x2 =f3 x 2x3 =f4 x 6x4 =f4 = =Ex ==fN1+ xm CE30125 - LECTURE 3p. OF LECTURES 2 AND 3 Linear INTERPOLATION passes a straight line through 2 data points. Power series data points degree polynomial find coefficients bysolving a matrix LAGRANGE INTERPOLATION passes an degree polynomial through data points Use specialized nodal functions to make finding easier. where = the interpolating function approximating f(x) fi = the value of the function at the data (or INTERPOLATION ) point i = the LAGRANGE basis function Each LAGRANGE polynomial or basis function is set up such that it equals unity at thedata point with which it is associated, zero at all other data points and nonzero +NthNthN1+gx gx fiVix i0=N =gx Vix CE30125 - LECTURE 3p.


Related search queries