声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 16453|回复: 9

[其他相关] 谁能详细介绍一下Newton-Raphson方法?

[复制链接]
发表于 2007-3-28 12:57 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
先谢过了啊,呵呵
回复
分享到:

使用道具 举报

发表于 2007-3-28 16:21 | 显示全部楼层
牛顿迭代法(Newton's method)又称为牛顿-拉夫逊方法(Newton-Raphson method),它是牛顿在17世纪提出的一种在实数域和复数域上近似求解方程的方法。多数方程不存在求根公式,因此求精确根非常困难,甚至不可能,从而寻找方程的近似根就显得特别重要。方法使用函数f(x)的泰勒级数的前面几项来寻找方程f(x) = 0的根。牛顿迭代法是求方程根的重要方法之一,其最大优点是在方程f(x) = 0的单根附近具有平方收敛,而且该法还可以用来求方程的重根、复根。

      设r是f(x) = 0的根,选取x0作为r初始近似值,过点(x0,f(x0))做曲线y = f(x)的切线L,L的方程为y = f(x0) f'(x0)(x-x0),求出L与x轴交点的横坐标 x1 = x0-f(x0)/f'(x0),称x1为r的一次近似值。过点(x1,f(x1))做曲线y = f(x)的切线,并求该切线与x轴的横坐标 x2 = x1-f(x1)/f'(x1),称x2为r的二次近似值。重复以上过程,得r的近似值序列,其中x(n+1)=x(n)-f(x(n))/f'(x(n)),称为r的n+1次近似值,上式称为牛顿迭代公式。

       解非线性方程f(x)=0的牛顿法是把非线性方程线性化的一种近似方法。把f(x)在x0点附近展开成泰勒级数 f(x) = f(x0)+(x-x0)f'(x0)+(x-x0)^2*f''(x0)/2! +… 取其线性部分,作为非线性方程f(x) = 0的近似方程,即泰勒展开的前两项,则有f(x0)+f'(x0)(x-x0)=f(x)=0 设f'(x0)≠0则其解为x1=x0-f(x0)/f'(x0) 这样,得到牛顿法的一个迭代序列:x(n+1)=x(n)-f(x(n))/f'(x(n))。

评分

1

查看全部评分

发表于 2007-4-5 07:37 | 显示全部楼层
If you've ever tried to find a root of a complicated function algebraically, you may have had some difficulty. Using some basic concepts of calculus, we have ways of numerically evaluating roots of complicated functions. Commonly, we use the Newton-Raphson method. This iterative process follows a set guideline to approximate one root, considering the function, its derivative, and an initial x-value.

You may remember from algebra that a root of a function is a zero of the function. This means that at the "root" the function equals zero. We can find these roots of a simple function such as: f(x) = x2-4 simply by setting the function to zero, and solving:

f(x) = x2-4 = 0
(x+2)(x-2) = 0
x = 2 or x = -2


The Newton-Raphson method uses an iterative process to approach one root of a function. The specific root that the process locates depends on the initial, arbitrarily chosen x-value.
1.gif


Here, xn is the current known x-value, f(xn) represents the value of the function at xn, and f'(xn) is the derivative (slope) at xn. xn+1 represents the next x-value that you are trying to find. Essentially, f'(x), the derivative represents f(x)/dx (dx = delta-x). Therefore, the term f(x)/f'(x) represents a value of dx.
2.gif


The more iterations that are run, the closer dx will be to zero (0). To see how this works, we will perform the Newton-Raphson method on the function that we investigated earlier, f(x) = x2-4. Below are listed the values that we need to know in order to complete the process.
3.gif


Theoretically, we could execute an infinite number of iterations to find a perfect representation for the root of our function. However, this is a numerical method that we use to lessen the burden of finding the root, so we do not want to do this. Therefore we will assume that the process has worked accurately when our delta-x becomes less than 0.1. This value of precision should be specific to each situation. A much more, or a much less, precise value may be appropriate when using the Newton-Raphson method in class. The table below shows the execution of the process.
1111.JPG


Thus, using an initial x-value of six (6) we find one root of the equation f(x) = x2-4 is x=2. If we were to pick a different inital x-value, we may find the same root, or we may find the other one, x=-2.

A graphical representation can also be very helpful. Below, you see the same function f(x) = x2-4 (shown in blue). The process here is the same as above. In the first iteration, the red line is tangent to the curve at x0. The slope of the tangent is the derivative at the point of tangency, and for the first iteration is equal to 12. Dividing the value of the function at the initial x (f(6)=32) by the slope of the tangent (12), we find that the delta-x is equal to 2.67. Subtracting this from six (6) we find that the new x-value is equal to 3.33. Another way of considering this is to find the root of this tangent line. The new x-value (xn+1) will be equal to the root of the tangent to the function at the current x-value (xn).
4.gif


The Newton-Raphson method does not always work, however. It runs into problems in several places. First, consider the above example. What would happen if we chose an initial x-value of x=0? We would have a "division by zero" error, and would not be able to proceed. You may also consider operating the process on the function f(x) = x1/3, using an inital x-value of x=1. Do the x-values converge? Does the delta-x decrease toward zero (0)?

So, how does this relate to chemistry? Consider the van der Waals equation found in the Gas Laws section of this text. Assuming that we have a set number of moles of a set gas, not under ideal conditions, we can use the Newton-Raphson method to solve for one of the three variables (temperature, pressure, or volume), based on the other two. To do this, we need to use the van der Waals equation, and the derivative of this equation, both seen below.
5.gif

6.gif


As you can see, the Van der Waals equation is quite complex. It is not possible to solve it algebraically, so a numerical method must be used. The Newton-Raphson Method is the easiest and most dependable way to solve equations like this, even though the equation and its derivative seem quite intimidating.

Depending on the conditions under which you are attempting to solve this equation, several of the variables may be changing. So, it may be necessary to use partial derivatives. For the purposes of this example, we are assuming that pressure, temperature, and volume are the only things changing, and that these values are all functions of time. This avoids the use of a partial derivative; we simply differentiate all variables with respect to time, as shown above. Some algebraic manipulation of the equation and/or its derivative may be needed depending on the specific problem to be solved. It is assumed that all of the variables but one are specified; that variable is used in the expression for "xn+1" that Newton's method uses. Performing Newton's method on this equation successfully would give a value of that variable which gives a solution when the other variables are held constant at the values you specified.

[ 本帖最后由 tammy 于 2007-4-5 07:39 编辑 ]

评分

1

查看全部评分

发表于 2008-11-11 13:21 | 显示全部楼层
楼上两位的介绍非常好!我正整理相关的一个程序包,就在网上搜索,结果就搜到这里来了,非常感谢!

[ 本帖最后由 无水1324 于 2008-11-12 21:09 编辑 ]
发表于 2011-10-7 13:38 | 显示全部楼层
谢过了啊,呵呵
发表于 2011-10-20 09:04 | 显示全部楼层
学习了,顶一个···
发表于 2011-10-20 09:05 | 显示全部楼层
学习了,顶一个···
发表于 2012-5-21 20:52 | 显示全部楼层
我也真在学习一些算法,谢过了
发表于 2013-5-11 10:17 | 显示全部楼层
学习了~~好东西~~
发表于 2013-9-3 09:37 | 显示全部楼层
三楼能用更简洁的汉语就好了。
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-11-15 12:56 , Processed in 0.076178 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表