1CCLalescuBTeacaandDCaratiImplementationofhighordersplineinterpolationsfortrackingtestparticlesindiscretizedeldssubmittedforpublication2 AratherinterestingobservationisthatfortheHermitespl ID: 364392
Download Pdf The PPT/PDF document "1IntroductionThepurposeofthisworkistocon..." is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
1IntroductionThepurposeofthisworkistoconstructsmoothinterpolantsforfunctionsthatareonlyknownonthenodesofaregularrectangulargrid.Cubicsplineshavere-centlybeenusedinthecontextofparticleorvirtualparticletrackingincomplexelds,[1,2,3].Amoreelaboratediscussiononintegratingparticletrajectoriesininterpolatedelds,andtheadvantagesofusinghigherordersplines,istobepublishedelsewere1.Inthisworkjustareviewoftheconstructionofthesplineinterpolationsispresented,withoutrigurousproofs.ConsiderthefunctionsofDvariablesf:RD!R(1)andassumetheycanonlybecomputedonthegridG=DYj=1hjZ;(2)where0hj1arethegridconstantsandhZ=fhzz2Zg;agridcellisdenedas:C(z1;z2;:::;zD)DYj=1[hjzj;hj(zj+1)](3)Basically,thevaluesf(x)areonlyavailableifx2G|thiscanhappenforavarietyofreasons,thesimplestbeingthattheyaremeasuredfromanexperiment.Inthefollowingwewillsaythatwearecomputingapproximationsoff.Inamoreriguroussettingwewouldsaythatwearebuildinganarrayofsplinefunctionsthatconvergetoacertainlimitundercertainconditions;whenthefunctionfissucientlynice(atermthatstillneedsacleardenition),itwillbeequaltothatlimit.Forinstance,oneofthepropertiesofthislimitisthatanyofitsTaylorexpansionsconvergeeverywhere(forexampleanyfunctionwithanitediscreteFourierrepresentation).ApolynomialsplineisafunctiondenedonRD,thatisapolynomialoneachcellandithascontinuousderivativeseverywhereuptoacertainorder.Notethatthesetofgridconstantsfhjgisagiven,andthelimitspokenofbeforeisthelimitofverylargeordersofthepolynomialsenteringthespline.ThislimitwillalwaysexistaslongasfiswelldenedonthegridG;itistruethatforcertainfunctionsthelimitsfordierentgridswillnotbeequal,butthesefunctionsareirrelevanthere. 1C.C.Lalescu,B.Teaca,andD.Carati,\Implementationofhighordersplineinterpolationsfortrackingtestparticlesindiscretizedelds",submittedforpublication.2 AratherinterestingobservationisthatfortheHermitesplinesexactly2D(m+1)Dinputvaluesf(l1;:::;lD)(i1;:::;iD)arerequiredforagivenn=2m+1,whileforgridsplinesqDinputvaluesarerequiredforagivenq(andm2g,thusn2q3).ThismeansthatgridsplinesgenerallyachieveagivendegreeofsmoothnessfromlessinformationthanaHermitespline|andthepriceisprobablyamuchlargererror.Also,thenumberofinputvaluesisthenumberoftermsinthesumtobecomputed,thusgridsplineswillbefastertocomputethanthecorrespondingHermitesplines(uptoamaximumqthatwilldependontheorder).Asanalnote,themixedderivativesoftheseeldsarealsosmooth:0@NYj=1@ @xjlj1As(n);0@NYj=1@ @xjlj1As(n;q)2Cmmaxfljg(21)(whenevermmaxfljg).4ImplementationofthegridsplinesInpracticetheHermitesplineswillprobablynotbeveryuseful,astheyrequiretoomuchmemory.Otherthanthat,theirimplementationshouldbesimilartothatofthegridsplines.Notethatwemention\parallelizedcodes"inthefollowing;thisrefersspecicallytocasesofcomputerprogramsthatrunonseveralprocessorsatonce,withthememorydividedbetweenthem,andtheseprogramsworkwithphysicalelds,eachprocessorkeepingasliceoftheseeldsinitsmemory.4.1Fullexpressionsofthe1DgridsplinesYouwillneedtouseacomputeralgebrasystem.Forq=4,denethefollowingfunctions:t(0;1)(h)=t0(0;1)+t1(0;1)h+t2(0;1)h2 2!(22)t(1;1)(h)=t0(1;1)+t1(1;1)h+t1(1;1)h2 2!(23)s(3;4)(x)=s(3;4)0+s(3;4)1x+s(3;4)2x2+s(3;4)3x3(24)s(5;4)(x)=s(5;4)0+s(5;4)1x+s(5;4)2x2+s(5;4)3x3+s(5;4)4x4+s(5;4)5x5(25)Afterwards,solvethefollowingsystemsofequations(symbolically):(t(0;1)(0)=f(0);t(0;1)(1)=f(1);t(0;1)(1)=f(1);t(1;1)(0)=f(1);t(1;1)(1)=f(0);t(1;1)(1)=f(2);(26)8]TJ ; -1;.93; Td; [00;:s(3;4)(0)=t0(0;1);s(3;4)(1)=t0(1;1);d dxs(3;4)(x)x=0=t1(0;1);d dxs(3;4)(x)x=1=t1(1;1);(27)6 input:fractionoutput: i=(n;q)i()(arrayofdimensionq)2.gridcoordinates input:\normal"pointcoordinates(x1;:::;xD)algorithm:computeeach^xjbxj=hjcandeach~x1xj=hj^xj.output:{thesetofintegers(^x1;:::;^xD){thesetoffractions(~x1;:::;~xD)3.splineformula input:{thesetoffractions(~x1;:::;~xD){thetypeofspline(n;q){apointer(orsimilarnotion)~ftoanarraycontainingtheinforma-tionaboutthelocaleld(thevaluesoftheeldonthenodesofthecellC(^x1;:::;^xD)andthenecessaryneighbouringcells),shiftedsuchthat~f(0;0;:::;0)=f(x1;:::;xD).algorithm:computethepolynomials(n;q)i(~xj)inthearray ij(bycallingthesplinepolynomialssubroutine),thencomputethesum^f=1+gXi1;:::;iD=0g~f(i1;:::;iD)DYj=1 ij;(31)notethattestingshowsitismoreecienttointroduceaslittledowhileloopsaspossible|forour3Dimplementation,forq=4thesumiswritteninfullinthesourcecode,asintroducingdowhiletypeloopsslowsdownthecodeconsiderably.Forhighervaluesofqwejusthaveonedowhileloopforoneofthevariables.output:theapproximation^f.4.wrapper input:{\normal"pointcoordinates(x1;:::;xD){apointerftothearraycontainingtheinformationabouttheentireeld{thetypeofspline(n;q)algorithm:putthelocaleldinthearray~ffromfandthencomputetheapproximation^f(usingtheabovesubroutines)output:theapproximation^f8 Thewrapperisveryusefulinthecaseofaparallelizedcode.Alltheop-erationsrelatedtobringingtogetherinformationspreadonpossiblyseveralprocessorscanbeplacedinsidethewrapper,allowingforeasydebuggingandmaintenanceofthecode.Asanexampleofaparallelizedversion,inourimplementationa3Deldisdividedalongthezcoordinatebetweenprocessors.Theeldisperiodicinalldirections,andobtaining~fimpliesalittlecareinregardstothezcoordinate,butitbasicallyjustrequiresanormaluseoftheMODULOoperator.Weimposethateachprocessorhasatleastqnodesonthezdirectioninitsmemory,sothattheformulacontainsatmostinformationfromtwoprocessors(\low"and\up").Wethencompute(31)oneachprocessor,onlyforthenodesthatarein\itsdomain",andwethensumthetworesultingvalues^f=^flow+^fup;theamountofinformationpassedbetweenprocessorsisthuskepttoaminimum.AAppendix:UniquenessConstructionforgeneralcase:t(i;g)(u)=2gXk1;:::;kD=0tk(i;g)DYj=1ukjj(32)s(n;q)(x)=nXk1;:::;kD=0s(n;q)kDYj=1xkjj(33)withi1;:::;iD2f0;1g.TheTaylorexpansions(thecentereddierences)aregivenbythesystemofequationst(i;g)(v)=f(i+v)(34)wherev1;:::;vD= g;g.Thissystemofequationshasauniquesolutiontk(i;g)f(k)(thereareasmanytk(i;g)astherearef(i+v),andthisisinfactasimpleLagrangeinterpolation).Thesplinesaregivenbythesystemofequations240@DYj=1d dxjlj1As(n;q)(x)35x=i=tl(i;g)(35)whichalsohasauniquesolution(andq2g+2),soformula(20)mustgivethisuniquesolution.Ageneralizationofthismethodwouldbetogotoothertypesofgrids.Forinstanceonecouldimaginethecasewhereinthreedimensionsthereisagridmadeupofequilateraltrianglesinthe(x;y)plane,andsquaresintheothertwoplanes.Whatchangesisthefactthatthesumsareabitmorecomplicated.ThecrucialpropertythathastobepreservedtohaveasmoothapproximationisthattheTaylorexpansionmustbethesamenomatterfromwhichcellweapproachagivennode.9