数值实验指导书.docVIP

  • 14
  • 0
  • 约7.38千字
  • 约 12页
  • 2017-02-01 发布于重庆
  • 举报
数值实验指导书

数值实验指导书 数值实验一 实验名称:非线性方程求根 (Solution of Non-linear Equation) 实验目的:掌握二分法、不动点迭代、牛顿迭代法等常用的非线性方程迭代算法;加深对不同算法收敛速度、对初值的依赖性等的认识。 基本要求:应用C语言或Fortran语言及Matlab编程,并上机调试通过;2学时。 算法描述: 计算的二分法(bisection Method): PURPOSE: 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: TOL0.0, 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 do Steps3-6 Step 3 Set P=A+(B-A)/2; FP=F(P). Step 4 IF FP=0 or (B-A)/2TOL THEN OUTPUT (P) (Procedure completed successfully) STOP END IF Step 5 Set I=I+1 Step 6 IF THEN Set A=P; FA=FP ELSE Set B=P; FB=FP END IF Step 7 OUTPUT (Method failed after N iteration) STOP 2. 计算的不动点迭代(Fixed-Point Iteration): PURPOSE: To find a solution to given an initial approximation p0 INPUT: initial approximation p0; tolerance TOL; maximum number of iterations N OUTPUT: approximation solution p or message of fails Step 1 Set I=1 Step 2 While do Steps 3-6 Step 3 Set (compute ) Step 4 IF THEN OUTPOT (P) (the procedure was successful.) STOP END IF Step 5 Set I=I+1 Step 6 Set (Update ) Step 7 OUTPUT (Method failed after N iteration) STOP 3. 计算的牛顿法(Mewton Method): PURPOSE: To find a solution to given an initial approximation : INPUT: initial approximation ; tolerance TOL; maximum number of iteration N. OUTPUT: approximate solution or message of failure. Step 1 Set Step 2 While do Steps 3-6 Step 3 Set (*Compute *) Step 4 If then Output(p) Stop Step 5 Set Step 6 Set Step 7 Output (The method failed after N itera

文档评论(0)

1亿VIP精品文档

相关文档