Page 368 - Applied Numerical Methods Using MATLAB
P. 368

PROBLEMS   357
            Table 7.3 The Names of MATLAB Built-In Minimization Routines in MATLAB 5.x/6.x
                        Unconstrained Minimization    Constrained Minimization
            Minimization     Non-Gradient- Gradient-        Linear Nonlinear
            Methods   Bracketing  Based  Based  Linear Nonlinear  LS  LS  Minimax
            MATLAB 5.x  fmin    fmins    fminu  lp   constr  leastsq  conls  minimax
            MATLAB 6.x fminbnd  fminsearch  fminunc linprog fmincon lsqnonlin  lsqlin  fminimax



            The program also applies the general constrained minimization routine “fmin-
            con()” to solve the same problem for cross-check. Readers are welcome to run
            the program and see the results.

            >> nm733
                xo_lp = [0.3333  1.5000], fo_lp = -4.0000
                cons_satisfied = -0.0000 % <= 0(inequality)
                                -0.8333 % <= 0(inequality)
                                -0.0000 % = 0(equality)
                xo_con = [0.3333  1.5000], fo_con = -4.0000
            In this result, the solutions obtained by using the two routines “linprog()”and
            “fmincon()” agree with each other, satisfying the inequality/equality constraints
            and it can be assured by Fig. 7.15.
              In Table 7.3, the names of MATLAB built-in minimization routines in MAT-
            LAB version 5.x and 6.x are listed.



            PROBLEMS


             7.1 Modification of Golden Search Method
                In fact, the golden search method explained in Section 7.1 requires only
                one function evaluation per iteration, since one point of a new interval
                coincides with a point of the previous interval so that only one trial point
                is updated. In spite of this fact, the MATLAB routine “opt_gs()”imple-
                menting the method performs the function evaluations twice per iteration.
                An improvement may be initiated by modifying the declaration type as

                 [xo,fo] = opt_gs1(f,a,e,fe,r1,b,r,TolX,TolFun,k)

                so that anyone could use the new routine as in the following program,
                where its input argument list contains another point (e)aswellasthe new
                end point (b) of the next interval, its function value (fe), and a parameter
                (r1) specifying if the point is the left one or the right one. Based on this
                idea, how do you revise the routine “opt_gs()” to cut down the number
                of function evaluations?
   363   364   365   366   367   368   369   370   371   372   373