Page 202 - Applied Numerical Methods Using MATLAB
P. 202

NEWTON METHOD FOR A SYSTEM OF NONLINEAR EQUATIONS  191
            4.6  NEWTON METHOD FOR A SYSTEM OF NONLINEAR EQUATIONS

            Note that the methods and the corresponding MATLAB routines mentioned so
            far can handle only one scalar equation with respect to one scalar variable. In
            order to see how a system of equations can be solved numerically, we rewrite
            the two equations
                                       f 1 (x 1 ,x 2 ) = 0
                                                                         (4.6.1)
                                       f 2 (x 1 ,x 2 ) = 0

            by taking the Taylor series expansion up to first-order about some estimate point
            (x 1k ,x 2k ) as

                                    ∂f 1                 ∂f 1
                     ∼
            f 1 (x 1 ,x 2 ) = f 1 (x 1k ,x 2k ) +     (x 1 − x 1k ) +     (x 2 − x 2k ) = 0

                                    ∂x 1 (x 1k ,x 2k )   ∂x 2 (x 1k ,x 2k )

                                    ∂f 2                 ∂f 2
                     ∼
            f 2 (x 1 ,x 2 ) = f 2 (x 1k ,x 2k ) +     (x 1 − x 1k ) +     (x 2 − x 2k ) = 0

                                    ∂x 1 (x 1k ,x 2k )   ∂x 2 (x 1k ,x 2k )
                                                                         (4.6.2)
            This can be arranged into a matrix–vector form as


               f 1 (x 1 ,x 2 )  f 1 (x 1k ,x 2k )
                         ∼              +   ∂f 1 /∂x 1  ∂f 1 /∂x 2    x 1 − x 1k
                         =
               f 2 (x 1 ,x 2 )  f 2 (x 1k ,x 2k )  ∂f 2 /∂x 1  ∂f 2 /∂x 2     x 2 − x 2k
                                                             (x 1k ,x 2k )

                             0
                         =                                               (4.6.3)
                             0
            which we solve for (x 1 ,x 2 ) to get the updated vector estimate
                                                     −1

                 x 1,k+1   x 1k     ∂f 1 /∂x 1              f 1 (x 1k ,x 2k )
                        =       −           ∂f 1 /∂x 2
                 x 2,k+1   x 2k     ∂f 2 /∂x 1  ∂f 2 /∂x 2     f 2 (x 1k ,x 2k )
                                                     (x 1k ,x 2k )
                                                                         (4.6.4)
                   x k+1 = x k − J  −1
                               k  f(x k ) with the Jacobian J k (m, n) = [∂f m /∂x n ]| x k
            This is not much different from the Newton iterative formula (4.4.2) and is cast
            into the MATLAB routine “newtons()”. See Eq. (C.9) in Appendix C for the
            definition of the Jacobian.
              Now, let’s use this routine to solve the following system of nonlinear equations
                                           2
                                                 2
                                          x + 4x = 5
                                           1     2
                                                                         (4.6.5)
                                      2
                                    2x − 2x 1 − 3x 2 = 2.5
                                      1
            In order to do so, we should first rewrite these equations into a form like
            Eq. (4.6.1) as
                                         2
                                              2
                             f 1 (x 1 ,x 2 ) = x + 4x − 5 = 0
                                        1     2
                                                                         (4.6.6)
                                          2
                             f 2 (x 1 ,x 2 ) = 2x − 2x 1 − 3x 2 − 2.5 = 0
                                         1
   197   198   199   200   201   202   203   204   205   206   207