下载此文档

数值实验指导书.doc


文档分类:高等教育 | 页数:约12页 举报非法文档有奖
1/12
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/12 下载此文档
文档列表 文档介绍
数值实验指导书数值实验一实验名称: 非线性方程求根(Solution of Non-linear Equation) 实验目的: 掌握二分法、不动点迭代、牛顿迭代法等常用的非线性方程迭代算法;加深对不同算法收敛速度、对初值的依赖性等的认识。基本要求: 应用 C 语言或 Fortran 语言及 Matlab 编程,并上机调试通过; 2 学时。算法描述: 1. 计算( ) 0 f x ?的二分法( bisection Method ): P URPOSE: To find a solution to F(x)=0 given the continuous function F on the interval [A,B], where F(A) and F(B) have opposite signs INPUT: endpoints: A,B , tolerance: TOL> , maximum number of iterations N OUTPUT : approximation solution P or message that the algorithm fails Step 1 Set I=1 FA = F(A); FB=F(B) Step 2 While I N ? do Steps3-6 Step 3 Set P=A+(B-A)/2; FP=F(P). Step 4 IF FP=0 or (B-A)/2<TOL THEN OUTPUT (P) (pleted essfully) STOP E ND IF Step 5 Set I=I+1 Step 6 IF0 FA FP ? ? THEN Set A=P; FA=FP ELSE Set B=P; FB=FP END IF Step 7 OUTPUT ( Method failed after N iteration ) STOP 2. 计算?? x g x ?的不动点迭代( Fixed-Point Iteration ): PURPOSE : To find a solution to?? x g x ? given an initial approximation p 0 INPUT: initial approximation p 0; tolerance TOL ; maximum number of iterations N OUTPUT: approximation solution p or message of fails Step 1 Set I=1 Step 2 While I N ? do Steps 3-6 Step 3 Set0 ( ) P G P ?(compute iP ) Step 4 IF0 P P TOL ? ? THEN OUTPOT (P) (the procedure was essful.) STOP END IF Step 5 Set I=I+1 Step 6 Set 0 P P ?(Update 0P ) Step 7 OUTPUT ( Method failed after N iteration ) STOP 3. 计算( ) 0 f x ?的牛顿法( Mewton Method ): PURPOSE : To find a solution to?? 0 f x ? given an initial approximation 0p : INPUT: initial approximation 0p ; tolerance TOL; maximum number of iteration N. OUTPUT: approximate solution p or message of failure. Step 1 Set1i? Step 2 While i N ? do Steps 3-6 Step 3 Set???? 000 f p p p f p ? ??(*Compute ip *) Step 4 If0 p p TOL ? ? then O utput(p) Stop Step 5 Set 0 p p ? Step 6 Set1 i i ? ? Step 7 Output (The method failed after N iterations) (* The procedure was essful *) Stop. 实验步骤与注意事项: 1. 选择 C、 Fortran 语言或 Matlab 编写以上三种算法的通用程序。 2. 用同一初值, 用不同的迭代式求方程 3 2 ( ) 3

数值实验指导书 来自淘豆网www.taodocs.com转载请标明出处.

相关文档 更多>>
非法内容举报中心
文档信息
  • 页数12
  • 收藏数0 收藏
  • 顶次数0
  • 上传人ffy51856fy
  • 文件大小0 KB
  • 时间2016-03-05