二维泊松方程很基础详细的求解过程.docx

上传人:b****7 文档编号:11196554 上传时间:2023-02-25 格式:DOCX 页数:19 大小:19.36KB
下载 相关 举报
二维泊松方程很基础详细的求解过程.docx_第1页
第1页 / 共19页
二维泊松方程很基础详细的求解过程.docx_第2页
第2页 / 共19页
二维泊松方程很基础详细的求解过程.docx_第3页
第3页 / 共19页
二维泊松方程很基础详细的求解过程.docx_第4页
第4页 / 共19页
二维泊松方程很基础详细的求解过程.docx_第5页
第5页 / 共19页
点击查看更多>>
下载资源
资源描述

二维泊松方程很基础详细的求解过程.docx

《二维泊松方程很基础详细的求解过程.docx》由会员分享,可在线阅读,更多相关《二维泊松方程很基础详细的求解过程.docx(19页珍藏版)》请在冰豆网上搜索。

二维泊松方程很基础详细的求解过程.docx

二维泊松方程很基础详细的求解过程

 

Topic2:

EllipticPartialDifferentialEquations

 

Lecture2-4:

Poisson’sEquation:

MultigridMethods

 

Wednesday,February3,2010

 

Contents

 

1MultigridMethods

 

2MultigridmethodforPoisson’sequationin2-D

 

3SimpleV−cyclealgorithm

 

4RestrictingtheResidualtoaCoarserLattice

 

1

 

2

 

3

 

5

 

7

 

1MULTIGRIDMETHODS

 

5ProlongationoftheCorrectiontotheFinerLattice

 

6Cell-centeredandVertex-centeredGridsandCoarsenings

 

7Boundarypoints

 

8RestrictionandProlongationOperators

 

9ImprovementsandMoreComplicatedMultigridAlgorithms

 

8

 

8

 

11

 

11

 

15

 

1

 

MultigridMethods

 

Themultigridmethodprovidesalgorithmswhichcanbeusedtoacceleratetherateofconvergenceof

iterativemethods,suchasJacobiorGauss-Seidel,forsolvingellipticpartialdifferentialequations.

 

Iterativemethodsstartwithanapproximateguessforthesolutiontothedifferentialequation.Ineach

iteration,thedifferencebetweentheapproximatesolutionandtheexactsolutionismadesmaller.

 

Onecananalyzethisdifferenceorerrorintocomponentsofdifferentwavelengths,forexamplebyusing

Fourieranalysis.Ingeneraltheerrorwillhavecomponentsofmanydifferentwavelengths:

therewillbe

 

2

 

2MULTIGRIDMETHODFORPOISSON’SEQUATIONIN2-D

 

shortwavelengtherrorcomponentsandlongwavelengtherrorcomponents.

 

AlgorithmslikeJacobiorGauss-Seidelarelocalbecausethenewvalueforthesolutionatanylatticesite

dependsonlyonthevalueofthepreviousiterateatneighboringpoints.Suchlocalalgorithmsaregenerally

moreefficientinreducingshortwavelengtherrorcomponents.

 

Thebasicideabehindmultigridmethodsistoreducelongwavelengtherrorcomponentsbyupdatingblocks

ofgridpoints.ThisstrategyissimilartothatemployedbyclusteralgorithmsinMonteCarlosimulations

oftheIsingmodelclosetothephasetranstiontemperaturewherelongrangecorrelationsareimportant.In

fact,multigridalgorithmscanalsobecombinedwithMonteCarlosimulations.

 

2

 

MultigridmethodforPoisson’sequationin2-D

 

Withasmallchangeinnotation,Poisson’sequationin2-Dcanbewritten:

∂2u

∂x2

 

+

∂2u

∂y2

 

=−f(x,y),

wheretheunknownsolutionu(x,y)isdeterminedbythegivensourcetermf(x,y)inaclosedregion.Let’s

considerasquaredomain0≤x,y≤1withhomogeneousDirichletboundaryconditionsu=0onthe

perimeterofthesquare.TheequationisdiscretizedonagridwithL+2latticepoints,i.e.,Linterior

pointsand2boundarypoints,inthexandydirections.Atanyinteriorpoint,theexactsolutionobeys

ui,j=

1

4

 

ui+1,j+ui−1,j+ui,j+1+ui,j−1+h2fi,j.

 

3

 

2MULTIGRIDMETHODFORPOISSON’SEQUATIONIN2-D

 

Thealgorithmusesasuccessionoflatticesorgrids.Thenumberofdifferentgridsiscalledthenumberof

multigridlevels.Thenumberofinteriorlatticepointsinthexandydirectionsisthentakentobe2,so

thatL=2+2,andthelatticespacingh=1/(L−1).Lischoseninthismannersothatthedownward

multigriditerationcanconstructasequenceofcoarserlatticeswith

2−1→2−2→...→20=1

interiorpointsinthexandydirections.

 

Supposethatu(x,y)istheapproximatesolutionatanystageinthecalculation,anduexact(x,y)isthe

exactsolutionwhichwearetryingtofind.Themultigridalgorithmusesthefollowingdefinitions:

 

·Thecorrection

v=uexact−u

isthefunctionwhichmustbeaddedtotheapproximatesolutiontogivetheexactsolution.

·Theresidualordefectisdefinedas

r=

2

u+f.

 

Noticethatthecorrectionandtheresidualarerelatedbytheequation

2

 

v=

 

2

 

uexact+f−

 

2

 

u+f=−r.

ThisequationhasexactlythesameformasPoisson’sequationwithvplayingtheroleofunknownfunction

andrplayingtheroleofknownsourcefunction!

4

 

3SIMPLEV−CYCLEALGORITHM

 

3

 

SimpleV−cyclealgorithm

 

Thesimplestmultigridalgorithmisbasedonatwo-gridimprovementscheme.Considertwogrids:

 

·afinegridwithL=2+2pointsineachdirection,and

·acoarsegridwithL=2−1+2points.

 

Weneedtobeabletomovefromonegridtoanother,i.e.,givenanyfunctiononthelattice,weneedto

ableto

 

·restrictthefunctionfromfine→coarse,and

·prolongateorinterpolatethefunctionfromcoarse→fine.

 

Giventhesedefinitions,themultigridV−cyclecanbedefinedrecursivelyasfollows:

 

·If

 

=0thereisonlyoneinteriorpoint,sosolveexactlyfor

u1,1=(u0,1+u2,1+u1,0+u1,2+h2f1,1)/4.

 

·Otherwise,calculatethecurrentL=2+2.

 

5

 

3SIMPLEV−CYCLEALGORITHM

 

·Performafewpre-smoothingiterationsusingalocalalgorithmsuchasGauss-Seidel.Theideaisto

damporreducetheshortwavelengtherrorsinthesolution.

·Estimatethecorrectionv=uexact−uasfollows:

–Computetheresidual

ri,j=

1

h2

 

[ui+1,j+ui−1,j+ui,j+1+ui,j−1−4ui,j]+fi,j.

–Restricttheresidualr→Rtothecoarsergrid.

–SetthecoarsergridcorrectionV=0andimproveitrecursively.

–ProlongatethecorrectionV→vontothefinergrid.

·Correctu→u+v.

·Performafewpost-smoothingGauss-Seidelinterationsandreturnthisimprovedu.

 

HowdoesthisrecursivealgorithmscalewithL?

Thepre-smoothingandpost-smoothingJacobiorGauss-

Seideliterationsarethemosttimeconsumingpartsofthecalculation.RecallthatasingleJacobior

Gauss-SeideliterationscaleslikeO(L2).Theoperationsmustbecarriedoutonthesequenceofgridswith

2→2−1→2−2→...→20=1

interiorlatticepointsineachdirection.Thetotalnumberofoperationsisoforder

 

L2

 

n=0

 

1

22n

 

≤L2

 

1

 

1.

6

 

4RESTRICTINGTHERESIDUALTOACOARSERLATTICE

 

ThusthemultigridV−cyclescaleslikeO(L2),i.e.,linearlywiththenumberoflatticepointsN!

 

4

 

RestrictingtheResidualtoaCoarserLattice

 

ThecoarserlatticewithspacingH=2hisconstructedasshown.Asimplealgorithmforrestrictingthe

residualtothecoarserlatticeistosetitsvaluetotheaverageofthevaluesonthefoursurroundinglattice

points(cell-centeredcoarsening):

 

7

 

6CELL-CENTEREDANDVERTEX-CENTEREDGRIDSANDCOARSENINGS

 

RI,J=

 

1

4

 

[ri,j+ri+1,j+ri,j+1+ri+1,j+1],i=2I−1,j=2J−1.

 

5

 

ProlongationoftheCorrectiontotheFinerLattice

 

HavingrestrictedtheresidualtothecoarserlatticewithspacingH=2h,weneedtosolvetheequation

2

 

V=−R(x,y),

withtheinitialguessV(x,y)=0.Thisisdonebytwo-griditeration

V=twoGrid(H,V,R).

Theoutputmustnowbeinterpolatedorprolongatedtothefinerlattice.Thesimplestprocedureistocopy

thevalueofVI,Jonthecoarselatticetothe4neighboringcellpointsonthefinerlattice:

vi,j=vi+1,j=vi,j+1=vi+1,j+1=VI,J,

 

i=2I−1,j=2J−1.

 

6

 

Cell-centeredandVertex-centeredGridsandCoarsenings

 

Inthecell-centeredprescription,thespatialdomainispartitionedintodiscretecells.Latticepointsare

definedatthecenterofeachcellasshowninthefigure:

 

8

 

6CELL-CENTEREDANDVERTEX-CENTEREDGRIDSANDCOARSENINGS

 

Thecoarseningoperationisdefinedbydoublingthesizeofacellineachspatialdimensionandplacinga

coarselatticepointatthecenterofthedoubledcell.

 

Notethatthenumberoflatticepointsorcellsineachdimensionmustbeapowerof2ifthecoarsening

operationistoterminatewithasinglecell.Inthefigure,thefinestlatticehas23=8cellsineachdimension,

and3coarseningoperationsreducethenumberofcellsineachdimension

23=8→22=4→21=2→20=1.

 

Notealsothatwiththecell-centeredprescription,thespatiallocationoflatticesiteschangeswitheach

coarsening:

coarselatticesitesarespatiallydisplacedfromfinelatticesites.

 

Avertex-centeredprescriptionisdefinedbypartitioningthespatialdomainintodiscretecellsandlocating

thediscretelatticepointsattheverticesofthecellsasshowninthefigure:

 

9

 

6CELL-CENTEREDANDVERTEX-CENTEREDGRIDSANDCOARSENINGS

 

Thecoarseningoperationisimplementedsimplybydroppingeveryotherlatticesiteineachspatialdimension.

 

Notethatthenumberoflatticepointsineachdimensionmustbeonegreaterthanapowerof2ifthe

coarseningoperationistoreducethenumberofcellstoasinglecoarsestcell.Intheexampleinthefigure

thefinestlatticehas23+1=9latticesitesineachdimension,and2coarseningoperationsreducethe

numberofverticesineachdimension

23+1=9→22+1=5→21+1=3.

 

Thevertex-centeredprescriptionhasthepropertythatthespatiallocationsofthediscretizationpointsare

notchangedbythecoarseningoperation.

 

10

 

8RESTRICTIONANDPROLONGATIONOPERATORS

 

7

 

Boundarypoints

 

Let’sassumethattheoutermostperimeterpointsaretakentobetheboundarypoints.Thebehaviorof

theseboundarypointsisdifferentinthetwoprescriptions:

 

·Cell-centeredPrescription:

Theboundarypointsmoveinspacetowardsthecenteroftheregion

ateachcoarsening.Thisimpliesthatonehastobecarefulindefiningthe“boundaryvalues”ofthe

solution.

·Vertex-centeredPrescription:

Theboundarypointsdonotmovewhenthelatticeiscoarsened.

Thismakeiteasierinprincipletodefinetheboundaryvalues.

 

Thesetwodifferentbehaviorsoftheboundarypointsmakethevertex-centeredprescriptionalittlemore

convenienttouseinmultigridapplications.However,thereisnoreasonwhythecell-centeredprescription

shouldnotworkaswell.

 

8

 

RestrictionandProlongationOperators

 

Inthemultigridmethoditisnecessaryt

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 经管营销 > 经济市场

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1