comparison between larange and spline interpolation so sánh larange và spline

9 103 0
  • Loading ...
1/9 trang

Thông tin tài liệu

Ngày đăng: 23/04/2017, 19:53

Comparison between LAGRANGE and Spline InterpolationUniv.Prof. Dr.Ing. habil. Josef BETTENRWTH Aachen University Mathematical Models in Materials Science and Continuum Mechanics Augustinerbach 420 D52056 A a c h e n , Germany Abstract In this worksheet a comparison between the LAGRANGE and the Spline Interpolation is discused based upon eleven interpolating points. In this case we arrive at a LAGRANGE polynomial of degree ten. Highdegree polynomials have an oscillatory character and aretherefore not ever suitable as interpolation functions. An alternative approach is given by a spline interpolation a piecewise approximation. In order to arrive at a smooth interpolation a cubic spline is often used. In the following it has been shown that highdegree splines are similar to LAGRANGE polynomials. A spline of degree = infinity is identical to the LAGRANGE approximation. LAGRANGE InterpolationGiven n + 1 distinct points xk, k = 0,1,...,n and the corresponding values f(xk) the LAGRANGE interpolation polynomial is defined as: > restart:> P(x):=Sum(f(xk)Ln,k(x),k=0..n);:= () Px ∑= k 0n() f xk() L, nkxWhere for every k = 0,1,...,n we introduce a LAGRANGE basic function: > restart:> Ln,k(x):=Product((xxi)(xkxi),i=0..n), ki;:= () L, nkx , ∏= i 0n− xxi− xkxi≠ ki> Ln,k(xi):=deltaik=piecewise(i=k,1, ik,0);:= () L, nkxi= δik{1 = ik0 ≠ ik1Example: Given the following experimental data > restart:> DATA:=xk,yk=0,120,1,139,2,134,3,149, 4,124,5,145,6,118,7,112,8,127,9,125,10,113;DATA , xkyk, 0 120 , 1 139 , 2 134 , 3 149 , 4 124 , 5 145 , 6 118 ,,,,,,, = := , 7 112 , 8 127 , 9 125 , 10 113 ,,, > L10,k(x):=Product((xxi)(xkxi),i=0..10); ki;:= () L, 10 kx ∏= i 010− xxi− xkxi≠ ki> L10,k(x):=value(%%);() L, 10 kx ()− xx0()− xx1()− xx2()− xx3()− xx4()− xx5()− xx6()− xx7()− xx8:= ()− xx9()− xx10()− xkx0()− xkx1()− xkx2()− xkx3()− xkx4()− xkx5()− xkx6(()− xkx7()− xkx8()− xkx9()− xkx10)> L10,k(xk):=1;:= () L, 10 kxk1example for k = 4 > L10,4(x):=(%%)(xkx4)(xx4);() L, 10 4x := ()− xx0()− xx1()− xx2()− xx3()− xx5()− xx6()− xx7()− xx8()− xx9()− xx10()− xkx0()− xkx1()− xkx2()− xkx3()− xkx5()− xkx6()− xkx7()− xkx8()− xkx9()− xkx10> L10,4(x):= subs({xk=4,seq(xk=k,k=0..3),seq(xk=k,k=5..10)},%);:= () L, 10 4xx()− x 1( ) − x 2( ) − x 3( ) − x 5( ) − x 6( ) − x 7( ) − x 8( ) − x 9( ) − x 1017280> L10,4(4):=subs(x=4,%);:= () L, 10 441> L10,4(x):=expand(%%);() L, 10 4x117280x10175760x931480x822812880x7343435760x61633135760x57285878640x4− + − + − + := 71689480x3675148x21052x − + − Graphical representation of this LAGRANGE function> alias(th=thickness,co=color):> p1:=plot(L10,4(x),x=0..10,th=3,co=black): 2> p2:=plotstextplot(5,2,`LAGRANGE Basic Function L10,4(x)`):> plotsdisplay(seq(pk,k=1..2));Further LAGRANGE basic functions are illustrated in the next Figure. > for i from 0 to 10 do L10,i(x):=L10,k(x)(xkxi)(xxi) od:> These functions can be printed, if the doloop is ending with a semicolon. A colon can be used instead of a semicolon if we do not want to see the output,e.g. if you do not need to look at an intermediate result or if an output will be very large. > With values xk,k=0..10 we find: > for i from 0 to 10 do L10,i(x):=subs({xk=xi},{seq(xk=k,k=0..10)}, L10,i(x)) od:> furthermore > for i from 0 to 10 do L10,i(x):=expand(L10,i(x)) od: > graphical representation: > alias(th=thickness,co=color,sc=scaling):> p1:=plot({L10,2(x),L10,4(x),L10,5(x),L10,7(x)}, x=0..10,8..8,th=3,co=black,axes=boxed): > p2:=plotstextplot({5,4,`LAGRANGE Basic Functions`, 5,4,`L10,k(x), k = 2, 4, 5, 7`}):> plotsdisplay(seq(pk,k=1..2));3With these LAGRANGE functions and the values f(xk) = yk we arríve at the following interpolation polynom of degree ten:> P10(x):=Sum(ykappaL10,kappa(x),kappa=0..10);:= () P10x ∑= κ 010yκ() L, 10 κx> We read from the dataset > with(linalg):Warning, the protected names norm and trace have been redefined and unprotected > yk:= matrix(1,11,120,139,134,149,124,145,118,112,127,125,113);:= yk120 139 134 149 124 145 118 112 127 125 113> mean_value:=127.8; := mean_value 127.8> The LAGRANGE functions can be posted in a matrix with 11 rows and one column,i.e. a columnvector:> L10,k(x):=matrix(11,1,seq(L10,k(x),k=0..10)):> Thus, we find the polynomial P10(x) by the matrix product: > P10(x):=multiply(yk,L10,k(x));() P10x := 12050015392520x374884337200x249669450990720x389226678640x51877447386400x62185637560x7+ − + + − + ⎡⎣⎢44081117280x8392336288x938511814400x101116259589362880x4− + − − ⎤⎦⎥> P10(x):=120+(50015392520)x(374884337200)x2+ (49669450990720)x3(1116259589362880)x4+ (89226678640)x5(1877447386400)x6+(2185637560)x7 (4081117280)x8+(392336288)x9(38511814400)x10;() P10x 12050015392520x374884337200x249669450990720x389226678640x51877447386400x6+ − + + − := 2185637560x74081117280x8392336288x938511814400x101116259589362880x4+ − + − − This polynomial together with the experimental data is represented in the next Figure. > alias(th=thickness,co=color):> p1:=plot(P10(x),x=0..10,th=3,co=black,axes=boxed): > p2:=plot(rhs(DATA),x=0..10,50..400,ytickmarks=4, style=point,symbol=cross,symbolsize=50,th=3,co=black):> p3:=plot(127.8,x=0..10,linestyle=4,th=2,co=black):> p4:=plotstextplot(5,300,`LAGRANGE Polynom P10(x)`):> plotsdisplay(seq(pk,k=1..4));The dotted line in this Figure characterizes the mean value 127.8 of the experimental data. Because of its oscillatory character the polynomial P10(x) is less suitable as an interpolation function. In order to arrive at a smooth interpolation a cubic spline should be prefered. Cubic Spline in Comparison with the LAGRANGE Interpolation Polynom P10(x)It is very comfortable to arrive at spline functions by utilizing the Maple progamm Curve 5Fitting as we can see in the following. > restart: with(stats): with(CurveFitting):> data:=0,120,1,139,2,134,3,149,4,124, 5,145,6,118,7,112,8,127,9,125,10,113;data , 0 120 , 1 139 , 2 134 , 3 149 , 4 124 , 5 145 , 6 118 , 7 112 , 8 127 ,,,,,,,,, := , 9 125 , 10 113 ,> datay:=120,139,134,149,124,145,118,112,127,125,113;:= datay ,,,,,,,,,, 120 139 134 149 124 145 118 112 127 125 113> mean_value:=evalf(describemean(datay),4);:= mean_value 127.8> cubic spline S3(x)> S3(x):=Spline(data,x,degree=3);:= () S3x⎧⎩⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎨+ − 1204228519151316x1353515151316x3< x 1+ − + 6834207756589314237964x673425975658x23135991151316x3< x 2− + − 375083517565874325395151316x1627134975658x22385557964x3< x 3− + − + 47062093439207764503151316x8090431991x25915229151316x3< x 4− + − 14071848537829369695849151316x2071945537829x26115195151316x3< x 5− + − + 37087815575658413082301151316x3683890575658x24321847151316x3< x 6− + − 17487133375658132667187151316x864021975658x2731389151316x3< x 7− + − 14445101337829230407781151316x781084537829x2734897964x3< x 8− + − + 1067919953782977082497964x3605613439x2566545151316x3< x 9− + − + 6916961687854791785151316x283984575658x2189323151316x3otherwiseThe above LAGRANGE interpolation polynom is written as: > P10(x):=120+(50015392520)x(374884337200)x2+ (49669450990720)x3(1116259589362880)x4+ (89226678640)x5(1877447386400)x6+ (2185637560)x7(4081117280)x8+(392336288)x9 (38511814400)x10;() P10x 12050015392520x374884337200x249669450990720x31116259589362880x489226678640x5+ − + − + := 61877447386400x62185637560x74081117280x8392336288x938511814400x10− + − + − > The cubic spline, the LAGRANGE polynom, and the data values > are represented in the following Figure. > alias(th=thickness,co=color):> p1:=plot(S3(x),x=0..10,50..400,th=3,co=black): > p2:=plot(P10(x),x=0..10,th=1,co=black,axes=boxed):> p3:=plot(data,style=point,symbol=cross, symbolsize=50,th=3,co=black):> p4:=plot(127.8,x=0..10,linestyle=4,th=2,co=black):> p5:=plotstextplot({5,350,`Cubic Spline S3(x)`, 5,300,`LAGRANGE P10(x)`}):> plotsdisplay(seq(pk,k=1..5));The dotted line characterizes the mean value 127.8 of the experimental data. This Figure shows the smooth cubic spline and the more or less oscillating LAGRANGE polynomial, which is not suitable as an intepolating function. HighDegree Splines Sn(x) in Comparison with the LAGRANGE Polynom P10(x) As mentioned obove spline functions of arbitrary degree can be easyly found by utilizing the MAPLE program Curve Fitting. > for i in 3,10,15,20,21 do 7Si(x):=Spline(data,x,degree=i) od:> S3(x):=Spline(data,x,degree=3):> S10(x):=Spline(data,x,degree=10):> S15(x):=Spline(data,x,degree=15):> S20(x):=Spline(data,x,degree=20):> S21(x):=Spline(data,x,degree=21):> > graphical representation in the next Figure > alias(th=thickness,co=color):> p1:=plot({S3(x),S10(x),S15(x),S20(x),S21(x)}, x=0..10,50..400,th=1,co=black):> p2:=plot(P10(x),x=0..10,th=3,co=black): > p3:=plot(data,style=point,symbol=cross,symbolsize=50, th=3,co=black,axes=boxed,ytickmarks=4):> p4:=plot(127.8,x=0..10,linestyle=4,th=2,co=black):> p5:=plotstextplot({5,350,`Splines S3,10,15,20,21(x)`, 5,300,`LAGRANGE P10(x)`}):> plotsdisplay(seq(pk,k=1..5));This Figure illustrates that by increasing the degree the splines are more and more similar to the LAGRANGE polynom (thick line). A spline of degree = infinity is identical to the LAGRANGE approximation as can be proved by introducing the Ltwo error norm: > L2:=sqrt((110)Int((P10(xi)Sn(xi))2,xi=0..10));8:= L211010 d⌠⌡⎮010()− () P10ξ () Snξ2ξ> for i in 3,10,15,20,21 do L2i:= evalf(sqrt((110)int((P10(x)Si(x))2,x=0..10)),4) od;:= L2361.64:= L21055.30:= L21527.92:= L2205.206:= L2210.> L2infinity:= Limit(sqrt((110)Int((P10(xi)Sn(xi))2,x=0..10)), n=infinity)=0;:= L2∞= lim→ n ∞11010 d⌠⌡⎮010()− () P10ξ () Snξ2x 0We see for degree = 21 the spline curve is already identical to the LAGRANGE polynom.SummaryThis paper is concerned with both the LAGRANGE and the spline interpolation. Based upon a given set of eleven experimental data we arrive at a LAGRANGE interpolation polynom of degree ten. Because of its oscillation property the LAGRANGE polynomial is not suitable to interpolate the given experimental data. Thus, the spline interpolation has been discused as an alternative approach. Especially, the common cubic spline leads to a smooth interpolation. Furthermore, it has been illustrated that highdegree splines are approaching to LAGRANGE polynomials. A spline of degree = infinity is identical to the LAGRANGE approximation. > 9 Comparison between LAGRANGE and Spline Interpolation Univ.-Prof Dr.-Ing habil Josef BETTEN RWTH Aachen University Mathematical Models in Materials Science and Continuum Mechanics Augustinerbach 4-20 D-52056 A a c h e n , Germany Abstract In this worksheet a comparison between the LAGRANGE and the Spline Interpolation is discused based upon eleven interpolating points In this case we arrive at a LAGRANGE polynomial of degree ten High-degree polynomials have an oscillatory character and are therefore not ever suitable as interpolation functions An alternative approach is given by a spline interpolation - a piecewise approximation In order to arrive at a smooth interpolation a cubic spline is often used In the following it has been shown that high-degree splines are similar to LAGRANGE polynomials A spline of degree = infinity is identical to the LAGRANGE approximation LAGRANGE Interpolation Given n + distinct points x[k], k = 0,1, ,n and the corresponding values f(x[k]) the LAGRANGE interpolation polynomial is defined as: > restart: > P(x):=Sum(f(x[k])*L[n,k](x),k=0 n); n P( x ) := ∑ f( x ) L n, k( x ) k k=0 Where for every k = 0,1, ,n we introduce a LAGRANGE basic function: > restart: > L[n,k](x):=Product((x-x[i])/(x[k]-x[i]),i=0 n), ki; n Ln, k( x ) := x − xi ∏x i=0 k − xi ,k≠i > L[n,k](x[i]):=delta[ik]=piecewise(i=k,1, ik,0); Ln, k( xi ) := δik = { 1 i=k i≠k Example: Given the following experimental data > restart: > DATA:=[x[k],y[k]]=[[0,120],[1,139],[2,134],[3,149], [4,124],[5,145],[6,118],[7,112],[8,127],[9,125],[10,113]]; DATA := [ xk, yk ] = [ [ 0, 120 ], [ 1, 139 ], [ 2, 134 ], [ 3, 149 ], [ 4, 124 ], [ 5, 145 ], [ 6, 118 ], [ 7, 112 ], [ 8, 127 ], [ 9, 125 ], [ 10, 113 ] ] > L[10,k](x):=Product((x-x[i])/(x[k]-x[i]),i=0 10); ki; 10 L10, k( x ) := x − xi ∏x i=0 k − xi k≠i > L[10,k](x):=value(%%); L10, k( x ) := ( x − x0 ) ( x − x1 ) ( x − x2 ) ( x − x3 ) ( x − x4 ) ( x − x5 ) ( x − x6 ) ( x − x7 ) ( x − x8 ) ( x − x9 ) ( x − x10 ) ( ( xk − x ) ( xk − x1 ) ( xk − x ) ( xk − x3 ) ( xk − x ) ( xk − x5 ) ( xk − x ) ( xk − x7 ) ( xk − x8 ) ( xk − x9 ) ( xk − x10 ) ) > L[10,k](x[k]):=1; L10, k( xk ) := example for k = > L[10,4](x):=(%%)*(x[k]-x[4])/(x-x[4]); L10, 4( x ) := ( x − x0 ) ( x − x1 ) ( x − x2 ) ( x − x3 ) ( x − x5 ) ( x − x6 ) ( x − x7 ) ( x − x8 ) ( x − x9 ) ( x − x10 ) ( xk − x0 ) ( xk − x1 ) ( xk − x2 ) ( xk − x3 ) ( xk − x5 ) ( xk − x6 ) ( xk − x7 ) ( xk − x8 ) ( xk − x9 ) ( xk − x10 ) > L[10,4](x):= subs({x[k]=4,seq(x[k]=k,k=0 3),seq(x[k]=k,k=5 10)},%); x ( x − ) ( x − ) ( x − ) ( x − ) ( x − ) ( x − ) ( x − ) ( x − ) ( x − 10 ) 17280 > L[10,4](4):=subs(x=4,%); L10, 4( x ) := L10, 4( ) := > L[10,4](x):=expand(%%); L10, 4( x ) := − 17 31 2281 34343 163313 728587 x10 − x + x − x + x − x + x 17280 5760 480 2880 5760 5760 8640 71689 6751 105 x + x − x 480 48 Graphical representation of this LAGRANGE function > alias(th=thickness,co=color): > p[1]:=plot(L[10,4](x),x=0 10,th=3,co=black): > p[2]:=plots[textplot]([5,-2,`LAGRANGE Basic Function L[10,4](x)`]): > plots[display](seq(p[k],k=1 2)); Further LAGRANGE basic functions are illustrated in the next Figure > for i from to 10 L[10,i](x):=L[10,k](x)*(x[k]-x[i])/(x-x[i]) od: > # These functions can be printed, if the doloop is ending with a semicolon A colon can be used instead of a semicolon if we not want to see the output,e.g if you not need to look at an intermediate result or if an output will be very large > # With values x[k],k=0 10 we find: > for i from to 10 L[10,i](x):=subs({x[k]=x[i]},{seq(x[k]=k,k=0 10)}, L[10,i](x)) od: > # furthermore > for i from to 10 L[10,i](x):=expand(L[10,i](x)) od: > # graphical representation: > alias(th=thickness,co=color,sc=scaling): > p[1]:=plot({L[10,2](x),L[10,4](x),L[10,5](x),L[10,7](x)}, x=0 10,-8 8,th=3,co=black,axes=boxed): > p[2]:=plots[textplot]({[5,4,`LAGRANGE Basic Functions`], [5,-4,`L[10,k](x), k = 2, 4, 5, 7`]}): > plots[display](seq(p[k],k=1 2)); With these LAGRANGE functions and the values f(x[k]) = y[k] we arríve at the following interpolation polynom of degree ten: > P[10](x):=Sum(y[kappa]*L[10,kappa](x),kappa=0 10); 10 P10( x ) := ∑y κ L10, κ( x ) κ=0 > # We read from the data-set > with(linalg): Warning, the protected names norm and trace have been redefined and unprotected > y[k]:= matrix(1,11,[120,139,134,149,124,145,118,112,127,125,113]); yk := [120 139 134 > mean_value:=127.8; > > > > 149 124 145 118 112 127 125 113] mean_value := 127.8 # The LAGRANGE functions can be posted in a matrix with 11 rows and one column,i.e a columnvector: L[10,k](x):=matrix(11,1,[seq(L[10,k](x),k=0 10)]): # Thus, we find the polynomial P[10](x) by the matrix product: P[10](x):=multiply(y[k],L[10,k](x)); P10( x ) := 5001539 37488433 496694509 8922667 18774473 218563 ⎡ ⎢⎢ 120 + x− x + x + x − x + x 2520 7200 90720 8640 86400 7560 ⎣ 40811 3923 3851 10 1116259589 ⎤ x + x − x − x ⎥⎥ ⎦ 17280 36288 1814400 362880 > P[10](x):=120+(5001539/2520)*x-(37488433/7200)*x^2+ (496694509/90720)*x^3-(1116259589/362880)*x^4+ (8922667/8640)*x^5-(18774473/86400)*x^6+(218563/7560)*x^7(40811/17280)*x^8+(3923/36288)*x^9-(3851/1814400)*x^10; − P10( x ) := 120 + + 5001539 37488433 496694509 8922667 18774473 x− x + x + x − x 2520 7200 90720 8640 86400 218563 40811 3923 3851 10 1116259589 x − x + x − x − x 7560 17280 36288 1814400 362880 This polynomial together with the experimental data is represented in the next Figure > alias(th=thickness,co=color): > p[1]:=plot(P[10](x),x=0 10,th=3,co=black,axes=boxed): > p[2]:=plot(rhs(DATA),x=0 10,50 400,ytickmarks=4, style=point,symbol=cross,symbolsize=50,th=3,co=black): > p[3]:=plot(127.8,x=0 10,linestyle=4,th=2,co=black): > p[4]:=plots[textplot]([5,300,`LAGRANGE Polynom P[10](x)`]): > plots[display](seq(p[k],k=1 4)); The dotted line in this Figure characterizes the mean value 127.8 of the experimental data Because of its oscillatory character the polynomial P[10](x) is less suitable as an interpolation function In order to arrive at a smooth interpolation a cubic spline should be prefered Cubic Spline in Comparison with the LAGRANGE Interpolation Polynom P[10](x) It is very comfortable to arrive at spline functions by utilizing the Maple progamm Curve Fitting as we can see in the following > restart: with(stats): with(CurveFitting): > data:=[0,120],[1,139],[2,134],[3,149],[4,124], [5,145],[6,118],[7,112],[8,127],[9,125],[10,113]; data := [ 0, 120 ], [ 1, 139 ], [ 2, 134 ], [ 3, 149 ], [ 4, 124 ], [ 5, 145 ], [ 6, 118 ], [ 7, 112 ], [ 8, 127 ], [ 9, 125 ], [ 10, 113 ] > datay:=[120,139,134,149,124,145,118,112,127,125,113]; datay := [ 120, 139, 134, 149, 124, 145, 118, 112, 127, 125, 113 ] > mean_value:=evalf(describe[mean](datay),4); mean_value := 127.8 > # cubic spline S[3](x) > S[3](x):=Spline([data],x,degree=3); ⎧ 4228519 1353515 ⎪ x− x 120 + ⎪ 151316 151316 ⎪ ⎪ 6834207 931423 6734259 3135991 ⎪ + x− x + x ⎪ 75658 7964 75658 151316 ⎪ ⎪ ⎪ 37508351 74325395 16271349 238555 ⎪ − x + x − x ⎪ 75658 151316 75658 7964 ⎪ ⎪ 4706209 207764503 809043 5915229 ⎪ + x− x + x ⎪ − ⎪ 3439 151316 1991 151316 ⎪ ⎪ 140718485 369695849 20719455 6115195 ⎪ x+ x − x − ⎪ 37829 151316 37829 151316 ⎪ S3( x ) := ⎨⎪ 36838905 4321847 ⎪ 370878155 413082301 x− x + x + ⎪− ⎪ 75658 151316 75658 151316 ⎪ ⎪ 174871333 132667187 8640219 731389 ⎪ x x − x − + ⎪ 75658 151316 75658 151316 ⎪ ⎪ 144451013 230407781 7810845 73489 ⎪ − x+ x − x ⎪ ⎪ 37829 151316 37829 7964 ⎪ ⎪ 106791995 7708249 360561 566545 ⎪ − + x− x + x ⎪ 37829 7964 3439 151316 ⎪ ⎪ 6916961 54791785 2839845 189323 ⎪ − + x− x + x ⎪ 6878 151316 75658 151316 ⎩ x > The dotted line characterizes the mean value 127.8 of the experimental data This Figure shows the smooth cubic spline and the more or less oscillating LAGRANGE polynomial, which is not suitable as an intepolating function High-Degree Splines S[n](x) in Comparison with the LAGRANGE Polynom P[10](x) As mentioned obove spline functions of arbitrary degree can be easyly found by utilizing the MAPLE program Curve Fitting > for i in [3,10,15,20,21] > > > > > > > > > > > > > > S[i](x):=Spline([data],x,degree=i) od: S[3](x):=Spline([data],x,degree=3): S[10](x):=Spline([data],x,degree=10): S[15](x):=Spline([data],x,degree=15): S[20](x):=Spline([data],x,degree=20): S[21](x):=Spline([data],x,degree=21): # graphical representation in the next Figure alias(th=thickness,co=color): p[1]:=plot({S[3](x),S[10](x),S[15](x),S[20](x),S[21](x)}, x=0 10,50 400,th=1,co=black): p[2]:=plot(P[10](x),x=0 10,th=3,co=black): p[3]:=plot([data],style=point,symbol=cross,symbolsize=50, th=3,co=black,axes=boxed,ytickmarks=4): p[4]:=plot(127.8,x=0 10,linestyle=4,th=2,co=black): p[5]:=plots[textplot]({[5,350,`Splines S[3,10,15,20,21](x)`], [5,300,`LAGRANGE P[10](x)`]}): plots[display](seq(p[k],k=1 5)); This Figure illustrates that by increasing the degree the splines are more and more similar to the LAGRANGE polynom (thick line) A spline of degree = infinity is identical to the LAGRANGE approximation as can be proved by introducing the L-two error norm: > L[2]:=sqrt((1/10)*Int((P[10](xi)-S[n](xi))^2,xi=0 10)); 10 ⌠ ⎮ ( P ( ξ ) − S ( ξ ) )2 dξ ⎮ 10 n ⌡ L2 := 10 10 > for i in [3,10,15,20,21] L[2][i]:= evalf(sqrt((1/10)*int((P[10](x)-S[i](x))^2,x=0 10)),4) od; L2 := 61.64 L2 := 55.30 10 L2 := 27.92 15 L2 := 5.206 20 L2 := 21 > L[2][infinity]:= Limit(sqrt((1/10)*Int((P[10](xi)-S[n](xi))^2,x=0 10)), n=infinity)=0; 10 L2 := lim 10 ∞ n → ∞ 10 ⌠ ⎮ ( P ( ξ ) − S ( ξ ) )2 dx = 10 n ⎮ ⌡ We see for degree = 21 the spline curve is already identical to the LAGRANGE polynom Summary This paper is concerned with both the LAGRANGE and the spline interpolation Based upon a given set of eleven experimental data we arrive at a LAGRANGE interpolation polynom of degree ten Because of its oscillation property the LAGRANGE polynomial is not suitable to interpolate the given experimental data Thus, the spline interpolation has been discused as an alternative approach Especially, the common cubic spline leads to a smooth interpolation Furthermore, it has been illustrated that high-degree splines are approaching to LAGRANGE polynomials A spline of degree = infinity is identical to the LAGRANGE approximation >
- Xem thêm -

Xem thêm: comparison between larange and spline interpolation so sánh larange và spline, comparison between larange and spline interpolation so sánh larange và spline, comparison between larange and spline interpolation so sánh larange và spline

Gợi ý tài liệu liên quan cho bạn

Nhận lời giải ngay chưa đến 10 phút Đăng bài tập ngay