二分法与Regula Falsi法的区别
二分法用于寻找形式为 f(x) = 0 的非线性方程的方程的根,它基于中间值属性的重复应用。设 f(x) 为闭区间 [x1,x2] 内的连续函数,若 f(x1), f(x2) 符号相反,则区间 (x1,x2) 内至少有一个根 α,使得 f(α) = 0。
公式
X2= (X0 + X1) / 2
例子
问题:求方程 f(x)=x3-x-1 的根
解决方案:
给定方程 f(x)=x3-x-1
让 x = 0, 1, 2
在第一次迭代中:
f(1)=-1<0 and f(2)=5>0
Root lies between these two points 1 and 2
x0=1+2/2 = 1.5
f(x0)=f(1.5)=0.875>0
在第二次迭代中:
f(1)=-1<0 and f(1.5)=0.875>0
Root lies between these two points 1 and 1.5
x1=1+1.5/2 =1.25
f(x1)=f(1.25)=-0.29688<0
在第三次迭代中:
f(1.25)=-0.29688<0 and f(1.5)=0.875>0
Root lies between these two points 1.25 and 1.5
x2=1.25+1.5/2 = 1.375
f(x2)=f(1.375)=0.22461>0
在第四次迭代中:
f(1.25)=-0.29688<0 and f(1.375)=0.22461>0
Root lies between these two points 1.25 and 1.375
x3=1.25+1.375/2=1.3125
f(x3)=f(1.3125)=-0.05151<0
在第 5 次迭代中:
f(1.3125)=-0.05151<0 and f(1.375)=0.22461>0
Root lies between these two points 1.3125 and 1.375
x4=1.3125+1.375/2=1.34375
f(x4)=f(1.34375)=0.08261>0
在第 6 次迭代中:
f(1.3125)=-0.05151<0 and f(1.34375)=0.08261>0
Root lies between these two points 1.3125 and 1.34375
x5=1.3125+1.34375/2=1.32812
f(x5)=f(1.32812)=0.01458>0
在第 7 次迭代中:
f(1.3125)=-0.05151<0 and f(1.32812)=0.01458>0
Root lies between these two points 1.3125 and 1.32812
x6=1.3125+1.32812/2 =1.32031
f(x6)=f(1.32031)=-0.01871<0
在第 8 次迭代中:
f(1.32031)=-0.01871<0 and f(1.32812)=0.01458>0
Root lies between these two points 1.32031 and 1.32812
x7=1.32031+1.32812/2=1.32422
f(x7)=f(1.32422)=-0.00213<0
在第 9 次迭代中:
f(1.32422)=-0.00213<0 and f(1.32812)=0.01458>0
Root lies between these two points 1.32422 and 1.32812
x8=1.32422+1.32812/2=1.32617
f(x8)=f(1.32617)=0.00621>0
在第 10 次迭代中:
f(1.32422)=-0.00213<0 and f(1.32617)=0.00621>0
Root lies between these two points 1.32422 and 1.32617
x9=1.32422+1.32617/2=1.3252
f(x9)=f(1.3252)=0.00204>0
在第 11 次迭代中:
f(1.32422)=-0.00213<0 and f(1.3252)=0.00204>0
Root lies between these two points 1.32422 and 1.3252
x10=1.32422+1.3252/2=1.32471
f(x10)=f(1.32471)=-0.00005<0
使用二分法的方程 x3-x-1=0 的近似根是 1.32471
Regula Falsi 方法:
Regula Falsi 是找到方程 f(x) = 0 的实根的最古老的方法之一,与二分法非常相似。它需要较少的计算量,因为我们每次迭代只需要评估一个函数。
公式
X3 = X1(fX2) - X2(fX1)/ f(X2) -f(X1)
例子
问题:求方程 f(x)=x3-x-1 的根
解决方案:
给定方程, x3-x-1=0
让 x = 0, 1, 2
在第一次迭代中:
f(1)=-1<0 and f(2)=5>0
Root lies between these two points x0=1 and x1=2
x2=x0-f(x0)
= x1-x0
f(x1)-f(x0)
x2=1-(-1)⋅
= 2-1
= 5-(-1)
x2=1.16667
f(x2)=f(1.16667)=-0.5787<0
在第二次迭代中:
f(1.16667)=-0.5787<0 and f(2)=5>0
Root lies between these two points x0=1.16667 and x1=2
x3=x0-f(x0)
x1-x0
f(x1)-f(x0)
x3=1.16667-(-0.5787)
2-1.16667
5-(-0.5787)
x3=1.25311
f(x3)=f(1.25311)=-0.28536<0
在第三次迭代中:
f(1.25311)=-0.28536<0 and f(2)=5>0
Root lies between these two points x0=1.25311 and x1=2
x4=x0-f(x0)⋅
x1-x0
f(x1)-f(x0)
x4=1.25311-(-0.28536)⋅
2-1.25311
5-(-0.28536)
x4=1.29344
f(x4)=f(1.29344)=-0.12954<0
在第四次迭代中:
f(1.29344)=-0.12954<0 and f(2)=5>0
Root lies between these two points x0=1.29344 and x1=2
x5=x0-f(x0)⋅
x1-x0
f(x1)-f(x0)
x5=1.29344-(-0.12954)⋅
2-1.29344
5-(-0.12954)
x5=1.31128
f(x5)=f(1.31128)=-0.05659<0
在第 5 次迭代中:
f(1.31128)=-0.05659<0 and f(2)=5>0
Root lies between these two points x0=1.31128 and x1=2
x6=x0-f(x0)⋅
x1-x0
f(x1)-f(x0)
x6=1.31128-(-0.05659)⋅
2-1.31128
5-(-0.05659)
x6=1.31899
f(x6)=f(1.31899)=-0.0243<0
在第 6 次迭代中:
f(1.31899)=-0.0243<0 and f(2)=5>0
Root lies between these two points x0=1.31899 and x1=2
x7=x0-f(x0)⋅
x1-x0
f(x1)-f(x0)
x7=1.31899-(-0.0243)⋅
2-1.31899
5-(-0.0243)
x7=1.32228
f(x7)=f(1.32228)=-0.01036<0
在第 7 次迭代中:
f(1.32228)=-0.01036<0 and f(2)=5>0
Root lies between these two points x0=1.32228 and x1=2
x8=x0-f(x0)⋅
x1-x0
f(x1)-f(x0)
x8=1.32228-(-0.01036)⋅
2-1.32228
5-(-0.01036)
x8=1.32368
使用 Regula Falsi 方法的方程 x3-x-1=0 的近似根为 1.32368
二分法与正则假法的区别
Basis | Bisection Method | Regula Falsi Method |
---|---|---|
Definition | In mathematics, the bisection method is a root-finding method that applies to continuous function for which knows two values with opposite signs. | In mathematics, the false position method is a very old method for solving equations with one unknown this method is modified form is still in use. |
Simplicity | it is simple to use and easy to implement. | Simple to use as compared to Bisection Method |
Computational Efforts | Less as compared to Regula Falsi Method | More as compared to Bisection Method |
Iteration required | In the bisection method, if one of the initial guesses is closer to the root, it will take a large number of iterations to reach the root. | Less as compared to Bisection Method. This method can be less precise than bisection – no strict precision is guaranteed. |
Convergence | The order of convergence of the bisection method is slow and linear. | This method faster order of convergence than the bisection method. |
General Iterative Formula | Formula is : X3 =( X1 + X2)/2 | Formula is : X3 = X1(fx2) – x2(fx1)/ f(x2) -f(x1) |
Other Names | It is also known as the Bolzano method, Binary chopping method, half Interval method. | It is also known as the False Position method. |