二维泊松方程很基础详细的求解过程.docx
- 文档编号:11196554
- 上传时间:2023-02-25
- 格式:DOCX
- 页数:19
- 大小:19.36KB
二维泊松方程很基础详细的求解过程.docx
《二维泊松方程很基础详细的求解过程.docx》由会员分享,可在线阅读,更多相关《二维泊松方程很基础详细的求解过程.docx(19页珍藏版)》请在冰豆网上搜索。
二维泊松方程很基础详细的求解过程
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
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 二维 方程 基础 详细 求解 过程