数值分析2.Solutions of Equations in One Variable

1.Bisection(二分法)

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 Nmax.

Output: approximate solution p or message of failure.

Step 1  Set  i = 1;FA = f (a) ;

Step 2  While ( i <= Nmax)  do  steps 3-6

Step 3  Set  p = a + ( b – a ) / 2 ; /* compute pi */FP = f (p) ;     

Step 4  If  ( FP == 0 ) or ( b - a ) / 2 < TOL  

     then  Output (p);

     STOP; /* successful */

 

Step 5  Set  i ++;

Step 6  If  sign(FA) · sign(FP) > 0

            then set a = p ; FA = FP ;                            

            Else set b = p ; /* update ai, bi */  

Step 7  Output (Method failed after Nmax iterations); /* unsuccessful */

            STOP.

2.Fixed-Point Iteration

Fixed-Point Theorem:

如果g(x)在[a,b]上的导数为g'(x),若|g'(x)|<k,0<k<1,对于x都成立,

则存在p_n=g(p_{n-1})收敛于p,p在[a,b]区间中。

实际上k是等比数列的公比。公比小于1时可以收敛。

推论:收敛精度:;收敛速度:

 Algorithm: Fixed-Point Iteration

Find a solution to p = g(p) given an initial approximation p0.

Input: initial approximation p0; tolerance TOL; maximum number of iterations Nmax.

Output: approximate solution p or message of failure.

Step 1  Set  i = 1;

Step 2  While ( i < Nmax)  do  steps 3-6

Step 3  Set  p = g(p0);  /* compute pi */     

Step 4  If  | p - p0 | < TOL  then  Output (p);  /* successful */

            STOP;

Step 5  Set  i ++;

Step 6  Set  p0 = p ;   /* update p0 */

Step 7 Output (The method failed after Nmax iterations);  /* unsuccessful */

           STOP.

3.Newton’s Method (Newton-Raphson Method)

收敛定理

如果p属于[a,b],f(p)等于0,f'(p)不等于0

那么p收敛到p0

牛顿法:使用下式做逐次迭代。

1阶收敛。

优化牛顿法:将f/f'代入上式

p_n=p_{n-1}-\frac{f(p)f'(p)}{f'(p)^2-f''(p)f(p)}

1.可以保证重根的时候也有解

2.二阶收敛

4.Error Analysis for Iterative Methods

定义asymptotic error constant 为

如果 a =1, the sequence is linearly convergent.

如果 a =2, the sequence is quadratically convergent.

计算的时候,考虑

当几次导数不为0时,就是几次收敛。

5.Accelerating Convergence

 \Delta p_n = p_{n+1} -p_n

Aitken’s Method:

Steffensen’s Method:

对于p=g(p),如果p_n<p<p_{n+1},以下的序列收敛到p,且g'(p)不为0,则二阶收敛

  Algorithm: Steffensen’s Acceleration

Find a solution to x = g(x) given an initial approximation p0.

Input: initial approximation p0; tolerance TOL; maximum number of  iterations Nmax.

Output: approximate solution x or message of failure.

Step 1  Set  i = 1;

Step 2  While ( i <= Nmax)  do  steps 3-6

Step 3  Set  p1 = g(p0) ;                                  

             p2 = g(p1) ;

             p = p0 - ( p1 - p0 )^2 / ( p2 - 2p1 + p0 ) ;     

Step 4  If  | p - p0 | < TOL  

            then  Output (p);  /* successful */         

             STOP;

Step 5  Set  i ++;     

Step 6  Set  p0 = p ;   /* update p0 */

Step 7  Output (The method failed after Nmax iterations);  /* unsuccessful */     

            STOP.

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值