Page 155 -
P. 155

Minimum of a Function of Two Variables
                             To find the local minimum of a multivariable function, we use the MATLAB
                             fmins function. Finding the maximum can be handled by the same tech-
                             nique as outlined for the one variable case.

                             Example 5.4
                                                                                   2
                                                                                2
                             Find the position of the minimum of the surface f(x, y) = x  + y .
                             Solution:
                                1. First, make a function file and save it as fname.m.
                                   function f=fname(array)

                                   x=array(1); % x is stored in first element of array
                                   y=array(2); % y is stored in second element of
                                   %array
                                   f=x.^2+y.^2; % function stored in f

                                2. Graph the contour plot for the surface; and from it, estimate the
                                   coordinates of the minimum:

                                   arrayguess=[.1 .1];
                                   The arrayguess holds the initial guess for both coordinates at
                                   the minimum. That is,
                                   arrayguess=[xguess yguess];

                                3. The coordinates of the minimum are then obtained by entering the
                                   following commands in the command window:

                                   arraymin=fmins('fname',arrayguess)
                                   fmin=feval('fname',arraymin)




                             Homework Problem

                             Pb. 5.24 In this problem we propose to apply the above optimization tech-
                             niques to the important problem of the optical narrow band transmission fil-
                             ter. This filter, in very wide use in optics, consists of two parallel semi-
                             reflective surfaces (i.e., mirrors) with reflection coatings R  and R  and sepa-
                                                                                      2
                                                                                1
                             rated by a distance L. Assuming that the material between the mirrors has an
                             index of refraction n and that the incoming beam of light has frequency ω and
                             is making an angle θ  with the normal to the semi-reflective surfaces, then the
                                               i
                             ratio of the transmitted light intensity to the incident intensity is

                             © 2001 by CRC Press LLC
   150   151   152   153   154   155   156   157   158   159   160