Page 94 - Numerical Methods for Chemical Engineering
P. 94

Solving nonlinear algebraic systems in MATLAB                         83












                      2

                    2

                     2








                                        2            2
                                               1
                  Figure 2.15 Trajectory of reduced-step Newton method with the guess (2,−1).

                    The full Newton step at x [k]  satisfies the linear system

                                              B [k] (n)  =− f x [k]                  (2.85)
                                                 p
                  Therefore, it is also a global minimum of the quadratic cost function
                               [k]     &  [k]          & 2
                             m (p) =  1 & B  p + f x  [k] &                          (2.86)
                                      2                2
                                               2                         T
                                       &      &        [k]    [k]  1  T    [k]    [k]
                                    =  1 &  f x  [k] &  + f x  · B  p + p B  B  p
                                      2        2                 2
                                                         [k]
                  If we were to apply a minimization algorithm to m (p), we would find the full Newton step
                   (n)
                  p . We note, however, that p (n)  becomes erratic when we are far from the solution. We
                  therefore expect there to be some trust radius   [k]  (that we modify at each iteration) such
                                                [k]
                  that we expect the quadratic model m (p) to be a valid measure of locating the solution
                                [k]
                  only if 	p	 2 <  . We obtain the update vector by solving the constrained problem
                                             [k]
                                        min m (p)  subject to |p| <  [k]             (2.87)
                  This technique is the basis of the MATLAB routine fsolve, whose use is demonstrated
                  below. A further discussion of the trust-region method, and the efficient dogleg method of
                  implementing it, is provided in Chapter 5.


                  Solving nonlinear algebraic systems in MATLAB

                  Although MATLAB contains a built-in routine, fsolve, for solving systems of multiple
                  nonlinear algebraic equations (using the trust-region Newton method discussed above), it
                  is part of the Optimization Toolkit and so is not available in every installation of MATLAB.
                  reduced Newton.m implements the reduced-step Newton algorithm, and can be used if
   89   90   91   92   93   94   95   96   97   98   99