darwin
解方程8sin(30x)-10e^x+80=0,用迭代法解,首先得构造个phi(x)=x,使的phi(x)在某个区间内收敛(满足李普西斯条件或导数的绝对值有界)。对于这个方程我实在想不出这样的Phi(x),请大侠们帮个忙看看~另外,想问个更为普遍的问题,就是对于这些超越的方程,构造phi(x)是否有什么固定的方法?
谢谢!~
darwin
[quote]引用第1楼谢益辉于2008-11-04 13:11发表的“”:
8sin(30x)-10e^x+80=0
8sin(30x)+80=10e^x
log(0.8sin(30x)+8)=x不行么?[/quote]
呃...可能怪我没说明清楚哦,要求的是方程在[2.05,2.15]上的解。那个变形当然是第一个想到的啦,不过也就当然不行了...
fixedpoint.solve=function(x0,N,epsilon)
{i=1;p=NULL
while(i<N) ## set the maxium times of iteration
{
p=log(0.8*sin(30*x0)+8) ## iteration function x=p(x)
if(abs(p-x0)<epsilon){return(p)} ## when x and p(x) are almost the same
## under the given epsilon,stop the iteration
else{i=i+1;x0=p}
}
return(p)
}
fixedpoint.solve(2.10,100,10^(-8)) ##2.1 is the first x
result:
[1] 2.174543
虽然有个值,但是呢,没有收敛到正确的解...
是不是我什么地方错了还是这个迭代函数不能用的?