数学与应用数学专业论文英文文献翻译

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

Chapter3InterpolationInterpolationistheprocessofdefiningafunctionthattakesonspecifiedvaluesatspecifiedpoints.Thischapterconcentratesontwocloselyrelatedinterpolants,thepiecewisecubicsplineandtheshape-preservingpiecewisecubicnamed“pchip”.3.1TheInterpolatingPolynomialWeallknowthattwopointsdetermineastraightline.Moreprecisely,anytwopointsintheplane,),(11yxand),(11yx,with)(21xx,determineauniquefirstdegreepolynomialinxwhosegraphpassesthroughthetwopoints.Therearemanydifferentformulasforthepolynomial,buttheyallleadtothesamestraightlinegraph.Thisgeneralizestomorethantwopoints.Givennpointsintheplane,),(kkyx,nk,,2,1,withdistinctkx’s,thereisauniquepolynomialinxofdegreelessthannwhosegraphpassesthroughthepoints.Itiseasiesttorememberthatn,thenumberofdatapoints,isalsothenumberofcoefficients,althoughsomeoftheleadingcoefficientsmightbezero,sothedegreemightactuallybelessthan1n.Again,therearemanydifferentformulasforthepolynomial,buttheyalldefinethesamefunction.Thispolynomialiscalledtheinterpolatingpolynomialbecauseitexactlyre-producesthegivendata.nkyxPkk,,2,1,)(,Later,weexamineotherpolynomials,oflowerdegree,thatonlyapproximatethedata.Theyarenotinterpolatingpolynomials.ThemostcompactrepresentationoftheinterpolatingpolynomialistheLa-grangeform.kkkjjkjyxxxxxP)(Therearentermsinthesumand1ntermsineachproduct,sothisexpressiondefinesapolynomialofdegreeatmost1n.If)(xPisevaluatedatkxx,alltheproductsexceptthektharezero.Furthermore,thekthproductisequaltoone,sothesumisequaltokyandtheinterpolationconditionsaresatisfied.Forexample,considerthefollowingdataset:x=0:3;y=[-5-6-116];Thecommanddisp([x;y])displays0123-5-6-116TheLagrangianformofthepolynomialinterpolatingthisdatais)16()6()2)(1()1()2()3)(1()6()2()3)(2()5()6()3)(2)(1()(xxxxxxxxxxxxxPWecanseethateachtermisofdegreethree,sotheentiresumhasdegreeatmostthree.Becausetheleadingtermdoesnotvanish,thedegreeisactuallythree.Moreover,ifweplugin2,1,0xor3,threeofthetermsvanishandthefourthproducesthecorrespondingvaluefromthedataset.PolynomialsareusuallynotrepresentedintheirLagrangianform.Morefre-quently,theyarewrittenassomethinglike523xxThesimplepowersofxarecalledmonomialsandthisformofapolynomialissaidtobeusingthepowerform.Thecoefficientsofaninterpolatingpolynomialusingitspowerform,nnnncxcxcxcxP12211)(can,inprinciple,becomputedbysolvingasystemofsimultaneouslinearequationsnnnnnnnnnnnyyycccxxxxxxxxx21212122212121111111ThematrixVofthislinearsystemisknownasaVandermondematrix.Itselementsarejnkjkxv,ThecolumnsofaVandermondematrixaresometimeswrittenintheoppositeorder,butpolynomialcoefficientvectorsinMatlabalwayshavethehighestpowerfirst.TheMatlabfunctionvandergeneratesVandermondematrices.Forourex-ampledataset,V=vander(x)generatesV=00011111842127931Thenc=V\y’computesthecoefficientsc=1.00000.0000-2.0000-5.0000Infact,theexampledatawasgeneratedfromthepolynomial523xx.OneoftheexercisesasksyoutoshowthatVandermondematricesarenonsin-gularifthepointskxaredistinct.ButanotheroneoftheexercisesasksyoutoshowthataVandermondematrixcanbeverybadlyconditioned.Consequently,usingthepowerformandtheVandermondematrixisasatisfactorytechniqueforproblemsinvolvingafewwell-spacedandwell-scaleddatapoints.Butasageneral-purposeapproach,itisdangerous.Inthischapter,wedescribeseveralMatlabfunctionsthatimplementvariousinterpolationalgorithms.Allofthemhavethecallingsequencev=interp(x,y,u)Thefirsttwoinputarguments,xandy,arevectorsofthesamelengththatdefinetheinterpolatingpoints.Thethirdinputargument,u,isavectorofpointswherethefunctionistobeevaluated.Theoutput,v,isthesamelengthasuandhaselements))(,,()(kuyxterpinkvOurfirstsuchinterpolationfunction,polyinterp,isbasedontheLagrangeform.ThecodeusesMatlabarrayoperationstoevaluatethepolynomialatallthecomponentsofusimultaneously.functionv=polyinterp(x,y,u)n=length(x);v=zeros(size(u));fork=1:nw=ones(size(u));forj=[1:k-1k+1:n]w=(u-x(j))./(x(k)-x(j)).*w;endendv=v+w*y(k);Toillustratepolyinterp,createavectorofdenselyspacedevaluationpoints.u=-.25:.01:3.25;Thenv=polyinterp(x,y,u);plot(x,y,’o’,u,v,’-’)createsfigure3.1.Figure3.1.polyinterpThepolyinterpfunctionalsoworkscorrectlywithsymbolicvariables.Forexample,createsymx=sym(’x’)ThenevaluateanddisplaythesymbolicformoftheinterpolatingpolynomialwithP=polyinterp(x,y,symx)pretty(P)produces-5(-1/3x+1)(-1/2x+1)(-x+1)-6(-1/2x+3/2)(-x+2)x-1/2(-x+3)(x-1)x+16/3(x-2)(1/2x-1/2)xThisexpressionisarearrangementoftheLagrangeformoftheinterpolatingpoly-nomial.SimplifyingtheLagrangeformwithP=simplify(P)changesPtothepowerformP=x^3-2*x-5Hereisanotherexample,withadatasetthatisusedbytheothermethodsinthischapter.x=1:6;y=[161821171512];disp([x;y])u=.75:.05:6.25;v=polyinterp(x,y,u);plot(x,y,’o’,u,v,’-’);produces123456161821171512createsfigure3.2.Figure3.2.FulldegreepolynomialinterpolationAlreadyinthisexample,withonlysixnicelyspacedpoints,wecanbegintoseetheprimarydifficultywithfull-degreepolynomialinterpolation.Inbetweenthedatapoints,especiallyinthefirstandlastsubintervals,thefunctions

1 / 17
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功