2-1, nonlinear equations - Newton iterative method

Content from teacher Wang Xiaohua

This was sort of hard core, do first to understand, learn how to use the main iterative steps to solve the problem

 

In the field of numerical analysis, it is generally used iterative method, approximation method and the method of doing like FIG approximately solving complex problems, iterative method where an approximate solution is a class of algorithms using the recursion formulas or loop sequence configured by the problem to seek method, this method of iterative solution of the mathematical problem is directly reflected in the algorithm, iterative methods can be considered in the design field.

Low-order non-linear equation solving algebraic method
there is a method of monadic nonlinear equation algebraically solutions are many methods commonly used methods Open, distribution methods, factorization method, equation method, there is a method of mapping method Approximate Solution and various iterative method
algebraic method for solving equations, although high accuracy and precision, but not conducive to the preparation of a computer program, so in the field of numerical analysis, solving nonlinear equations with a variety of commonly used iterative method. Common methods for solving systems of nonlinear equations with approaching and has two points Newton iterative method,

Half approximation

 

Newton iteration method
Newton iterative method, also known as Newton - Raphson method (Newton-Raphson Method), it is a method in the complex field and the real number field approximation equation solving. Since it is an iterative method, then the algorithm Newton iteration method is certainly suitable for the realization of iterative method mode.

 

Solution and guide function approximation formula

 

Newton iteration method algorithm
according to the relationship between the iterative equation of Newton iteration method, Newton iteration method iteration variable is the desired result xx, the initial value of the iteration may choose a value close to an approximate solution for monotonic interval, this value may be any value, or even a section boundary value iteration recurrence relation iterative formula is the top part of the mathematical principles given iteration termination condition is to find a precision to meet the requirements of the approximate solution. The method of determining whether the iteration variable accuracy is consistent solution is to calculate the most recent iteration value of two, to see if the difference is less than the difference between iterations required accuracy. According to the iterative recurrence relation, with the recursive loop iterations to achieve the most simple. When designing algorithms, in order to prevent infinite loop iteration does not converge as a result of the general increase can also be an iterative exit conditions, which set a limit number of iterations.

double NewtonRaphson(FunctionPtr f, double x0) 
{
    double x = INVALID_VALUE;
    int count = 0;
    do
    {
        double x1 = x0 - f(x0) / CalcDerivative(f, x0); //应用迭代递推关系
        if (fabs(x1 - x0) < PRECISION)
        {
            x = x1;
            break;
        }
        x0 = x1;  //更新迭代变量
        count++;
    } while (count < MAX_RUN_LOOP);

    return x;
}

参数 x0 是迭代初始值。选择与上面相同的例子函数,并将迭代初始值设置为区间最大值 8.0,使用牛顿迭代法也只需要 7 次迭代,就可以得到和二分逼近法精度一样的近似解。选择初始值 -8.0 从另一个方向计算,还可以得到另一个解 x= -2.040967365,计算这个解也只需要 6 次迭代,可见牛顿迭代法的收敛速度是超线性的。

 

总结

使用迭代法,需要首先确定问题是否存在迭代关系,如果存在迭代关系,就尝试确定迭代算法需要的三个关键要素

它们分别是迭代变量、迭代递推关系公式和迭代终止条件。首先确定迭代变量,迭代变量是由迭代关系式确定的,一般情况下,迭代变量就是计算结果,接下来是确定迭代递推关系,最后是迭代退出条件

Guess you like

Origin www.cnblogs.com/orxx/p/10956851.html