牛顿迭代法

用牛顿迭代法求f(x)=0在x0附近的一个实根的方法是:(1) 选一个接近于x的真实根的近似根x1;(2) 通过x1求出f(x1)。在几何上就是作x=x1,交f(x)于f(x1);(3) 过f(x1)作f(x)的切线,交x轴于x2。可以用公式求出x2。由于f'(x1)=f(x1)/(x2-x1),故x2=x1-f(x1)/f'(x1)(4) 通过x2求出f(x2);(5) 再过f(x2)作f(x)的切线交x轴于x2;(6) 再通过x3求出f(x3),…一直求下去,直到接近真正的根。当两次求出的根之差xn+1-xn≤ε就认为 xn+1足够接近于真实根。牛顿迭代公式是:xn+1=xn-f(xn)/f'(xn)牛顿迭代法的关键就是计算这个迭代公式,并在程序中进行迭代运算即可。该问题程序相对简单,就不列举了,控制一下迭代精度,直到达到需要目标即可。有一个问题需要注意的是,该方法能够有效的基本条件是:迭代公式必须是收敛的( 也就是通过迭代运算,每一次的结果必须是更接近真实值的)。

Advertisements

About yhtian

I am an academic researcher working on Offshore Geotechnical Engineering. My blog aims to write down some work related trivial things and tricks about software, programming. It is basically a memo for me to back up some thoughts and small details. But I am more than happy if someone would visit and discuss.
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s