Page 373 - Applied Numerical Methods Using MATLAB
P. 373

362    OPTIMIZATION
            7.5 Constrained Optimization and Penalty Method
                Consider the problem of minimizing a nonlinear objective function

                            Min x f(x) =−3x 1 − 2x 2 + M(3x 1 − 2x 2 + 2) 2  (P7.5.1a)
                                        (M : a large positive number)

                subject to the constraints


                     3    4   x 1 ≤    7            0         x 1     10
                                          and l =      ≤ x =      ≤       = u
                   −2 −1      x 2 ≥−3               0         x 2     10
                                                                       (P7.5.1b)
                (a) With the two values of the weighting factor M = 20 and 10,000 in
                    the objective function (P7.5.1a), apply the MATLAB built-in routine
                    “fmincon()” to find the solutions to the above constrained minimiza-
                    tion problem. In order to do this job, you might have to make the vari-
                    able parameter M passed to the objective function (defined in an M-file)
                    either through “fmincon()” or directly by declaring the parameter as
                    global both in the main program and in the M-file defining (P7.5.1a). In
                    case you are going to have the parameter passed through “fmincon()”
                    to the objective function, you should have the parameter included in
                    the input argument list of the objective function as


                     function f=f7p05M(x,M)
                     f = -3*x(1)-2*x(2)+M*(3*x(1)-2*x(2)+2).^2;


                    Additionally, you should give empty matrices ([]) as the ninth input
                    argument (for a nonlinear inequality/equality constraint function ‘nonl-
                    con’) as well as the 10th one (for ‘options’) and the value of M as
                    the 11th one of the routine “fmincon()”.

                    xo = fmincon(’f7p05M’,x0,A,b,[],[],l,u,[],[],M)
                    For reference, type ‘help fmincon’ into the MATLAB command
                    window.
                (b) Noting that the third (squared) term of the objective function (P7.5.1a)
                    has its minimum value of zero for 3x 1 − 2x 2 + 2 = 0 and, thus, it actu-
                    ally represents the penalty (Section 7.2.2) imposed for not satisfying the
                    equality constraint
                                         3x 1 − 2x 2 + 2 = 0            (P7.5.2)

                    tell which of the solutions obtained in (a) is more likely to satisfy this
                    constraint and support your answer by comparing the values of the
                    left-hand side of this equality for the two solutions.
   368   369   370   371   372   373   374   375   376   377   378