第五节松弛法_第1页
第五节松弛法_第2页
第五节松弛法_第3页
第五节松弛法_第4页
第五节松弛法_第5页
已阅读5页,还剩9页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

第五节松弛法第1页,课件共14页,创作于2023年2月§5RelaxationMethods第2页,课件共14页,创作于2023年2月§5RelaxationMethods第3页,课件共14页,创作于2023年2月Gauss-SeidelIterativeMethod…………写成矩阵形式:BGauss-Seidel

迭代阵§5RelaxationMethods第4页,课件共14页,创作于2023年2月Gauss-Seidel…………第5页,课件共14页,创作于2023年2月§5RelaxationMethods第6页,课件共14页,创作于2023年2月§5RelaxationMethods第7页,课件共14页,创作于2023年2月定理设A

可逆,且aii0,松弛法从任意出发对某个收敛

(L)<1。§5RelaxationMethods第8页,课件共14页,创作于2023年2月§5RelaxationMethods定理

(Kahan必要条件)设A

可逆,且aii0,松弛法从任意出发收敛0<<2

。证明:,而且收敛|i|<1总成立已知收敛|det(L)|<1|det(L)|=|1|n<10<<2

第9页,课件共14页,创作于2023年2月§5RelaxationMethods定理

(Ostrowski-Reich充分条件)若A对称正定,且有0<<2,则松弛法从任意出发收敛。(证明以后给出)Q:Whatfactordeterminesthespeedofconvergence?A:

Thesmaller

(B)is,thefastertheiterationswillconverge.对于SOR法,希望找使得(L)

最小。第10页,课件共14页,创作于2023年2月§5RelaxationMethods定理若A

为对称正定三对角阵,则且SOR的最佳松弛因子

/*optimalchoiceofforSORmethod*/为,此时。例:,考虑迭代格式问:取何值可使迭代收敛?

取何值时迭代收敛最快?解:考察B=I+A

的特征根1=1+,2=1+3

收敛要求

(B)<1-2/3<<0

(B)=

max{|1+

|,|1+3

|}

当取何值时最小?-2/3-1/30=-1/2第11页,课件共14页,创作于2023年2月§5RelaxationMethodsLab08.SORMethod UsetheSORmethodtosolveagivenn×nlinearsystemwithaninitialapproximationandasetof’s.Input Thereareseveralsetsofinputs.Foreachset: The1stlinecontainsaninteger100

n

0whichisthesizeofamatrix.n=1signalstheendoffile. Thefollowingnlinescontaintheaugmentedmatrixinthefollowingformat:Thenumbersareseparatedbyspacesandnewlines.ThenextlinecontainsarealnumberTOL,whichisthetolerancefor||·||norm,andanintegerN

0whichisthemaximumnumberofiterations.Thelastlineofeachtestcasecontainsanintegerm>0,followedbymreal’s.第12页,课件共14页,创作于2023年2月§5RelaxationMethodsOutput(representsaspace)Foreach,theremustbeasetofoutputsinthefollowingformat:

The1stlinecontainsanandthecorrespondingnumberofiterationstaken.IntheCprintf:fprintf(outfile,"%4.2f%d\n",omega,iter_no);Thecorrespondingsolutionorerrormessagesaretobeprintedasthefollowing:

EachentryofthesolutionistobeprintedasintheCfprintf:fprintf(outfile,"%12.8f\n",x);

IfthematrixAhasazerocolumn,printthemessage“Matrixhasazerocolumn.Nouniquesolutionexists.\n”.

IfthemethodfailstogiveasolutionafterNiterations,printthemessage“Maximumnumberofiterationsexceeded.\n”.

Ifthereisanentryofthatisoutoftherange[2127,2127],printthemessage“Noconvergence.\n”.Theoutputsoftwotestcasesmustbeseperatedbyablankline.注意:检查每个aii时,先向下找最大元,若非0则交换到对角线上;否则向上找最大元,若非0则将该行加到第i行上。第13页,课件共14页,创作于2023年2月§5RelaxationMethodsSampleInput(representsaspace)34–101–14–140–14–30.000001100021.051.2310–109–110–270–41060.000000001100011–1

SampleOutput(represen

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论