资源描述:
《Newton迭代法算法报告.doc》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、实验题目4Newton迭代法摘要为初始猜测,则由递推关系产生逼近解的迭代序列,这个递推公式就是Newton法。当距较近时,很快收敛于。但当选择不当时,会导致发散。故我们事先规定迭代的最多次数。若超过这个次数,还不收敛,则停止迭代另选初值。前言利用牛顿迭代法求的根程序设计流程否是否是是定义输入开始输出迭代失败标志输出输出奇异标志结束否问题1(1)程序运行如下:r=NewtSolveOne('fun1_1',pi/4,1e-6,1e-4,10)r=0.7391(2)程序运行如下:r=NewtSolv
2、eOne('fun1_2',0.6,1e-6,1e-4,10)r=0.5885问题2(1)程序运行如下:r=NewtSolveOne('fun2_1',0.5,1e-6,1e-4,10)r=0.5671(2)程序运行如下:r=NewtSolveOne('fun2_2',0.5,1e-6,1e-4,20)r=0.5669问题3(1)程序运行如下:①p=LegendreIter(2)p=1.00000-0.3333p=LegendreIter(3)p=1.00000-0.60000p=Legendr
3、eIter(4)p=1.00000-0.857100.0857p=LegendreIter(5)p=1.00000-1.111100.23810②p=LegendreIter(6)p=1.00000-1.363600.45450-0.0216r=roots(p)'r=-0.932469514203150-0.6612093864662650.9324695142031530.661209386466264-0.2386191860831970.238619186083197用二分法求根为:r=B
4、inSolve('LegendreP6',-1,1,1e-6)r=-0.932470204878826-0.661212531887755-0.2386200573979590.2386001275510200.6611926020408160.932467713647959(1)程序运行如下:①p=ChebyshevIter(2)p=1.00000-0.5000p=ChebyshevIter(3)p=1.00000-0.75000p=ChebyshevIter(4)p=1.00000-1.00
5、0000.1250p=ChebyshevIter(5)p=1.00000-1.250000.31250②p=ChebyshevIter(6)p=1.00000-1.500000.56250-0.0313r=roots(p)'r=-0.965925826289067-0.7071067811865480.9659258262890680.707106781186547-0.2588190451025210.258819045102521用二分法求根为:r=BinSolve('ChebyshevT6
6、',-1,1,1e-6)r=-0.965929926658163-0.707110969387755-0.2588289221938780.2588189572704080.7071059869260200.965924944196429与下列代码结果基本一致,只是元素顺序稍有不同:j=0:5;x=cos((2*j+1)*pi/2/(5+1))x=0.9659258262890680.7071067811865480.258819045102521-0.258819045102521-0.707
7、106781186547-0.965925826289068(2)程序运行如下:①p=LaguerreIter(2)p=1-42p=LaguerreIter(3)p=1-918-6p=LaguerreIter(4)p=1-1672-9624p=LaguerreIter(5)p=1.0000-25.0000200.0000-600.0000600.0000-120.000②p=LaguerreIter(5)p=1.0000-25.0000200.0000-600.0000600.0000-120.
8、000r=roots(p)'r=12.6408008442757327.0858100058588913.5964257710407111.4134030591065200.263560319718141用二分法求根为:r=BinSolve('LaguerreL5',0,13,1e-6)r=0.2635603145677221.4134030561057893.5964257656311507.08581000536072012.640800843813590(1)程序运行如下:①p=Hermi