3         OptionsMatlab Tutorial

3.1        Create a input structure

Use the function createBeamStruct to create an OptionsMatlab input structure. At the command line enter:


>> input = createBeamStruct


input =


      DNULL: -777

     OLEVEL: 2

    MAXJOBS: 10

       NVRS: 2

       VNAM: {'BREADTH'  'HEIGHT'}

      LVARS: [5 2]

      UVARS: [50 25]

       VARS: [30 20]

      NCONS: 5

       CNAM: {'SIGMA-B'  'TAU'  'DEFLN'  'H-ON-B'  'F-CRIT'}

      LCONS: [-777 -777 -777 -777 5000]

      UCONS: [200 100 5 10 -777]

    NPARAMS: 7

       PNAM: {'LENGTH'  'FORCE'  'FACTOR'  'EE'  'GG'  'NU'  'SIGMAY'}

     PARAMS: [1500 5000 2 216620 86650 0.2700 200]

       ONAM: 'AREA'

     OMETHD: 2.8000

     DIRCTN: -1

     NITERS: 500

     OPTFUN: 'beamobjfun'

     OPTCON: 'beamobjcon'

     OPTJOB: 'optjob'


The OptionsMatlab input structure describes the problem to be searched, including the design variables, constraints and parameters. The input structure will also include details of the optimisation or design search to be run over the problem. The function createBeamStruct is a utility function which creates an input structure specific to the Beam problem.


The fields of the structure input are described in detail by the documentation for OptionsMatlab. Of particular interest are the fields OPTFUN and OPTCON that specify the Matlab functions that describe the objective and constraint functions respectively. The objective and constraint functions used, beamobjfun.m and beamobjcon.m, is a Matlab implementation of the Beam problem described in the Options manual [1].


The field OMETHD is a scalar which specifies the search method to be used (see FAQ section 5.2 for further details). This example uses a Design of Experiments study, OMETHD = 2.8.


3.2        Run the search

OptionsMatlab can now be invoked with the input structure returned by createBeamStruct. At the command line enter:


>> results = OptionsMatlab(input)


results =


       VARS: [2x1 double]

     OBJFUN: 2.9455e+003

       CONS: [5x1 double]

     OBJTRC: [1x1 struct]

    CONSTRC: [1x1 struct]


OptionsMatlab will quickly perform a Design of Experiments study, evaluating the objective and constraint functions NITERS times. The results are returned in the structure results. The fields OBJFUN and VARS contain the minimum objective function found and the corresponding design variables. The field CONS contains the values of the constraints at the design variables VARS.


Other fields OBJTRC and CONSTRC contain the search histories over the objective and constraint functions. This information is valuable to examine the history of the optimisation and build Response Surface Models.


3.3        View the search histories

A simple tool is provided to view the search histories of problems with two design variables. At the command line enter:


>> plotOptionsSurfaces(results, input)


This will produce plots for the objective function and each of the constraints against the two design variables at each of the design variables evaluated. The final plot shows the objective function plotted against the two design variables, in which each point is coloured depending whether it exceeds the constraints (red), or not (blue) (Figure 3).


Figure 3 The results of a 500 point DoE plotted with plotOptionsSurfaces


3.4        Build and search a Response Surface Model

The results returned by the Design of Experiments can be used to build a Response Surface Model (RSM) that can be searched very rapidly. This approach may be suitable when either the objective or constraint functions are expensive to evaluate. To do this we must create another input structure, with the same problem definition. We will modify this input structure to specify that a RSM is used to evaluate the objective and constraint functions. At the command line enter:


>> inputRSM = createBeamStruct;

>> inputRSM.OBJMOD = 3.5;

>> inputRSM.CONMOD = 3.5;


By specifying OBJMOD and CONMOD equal to 3.5 OptionsMatlab will produce a RSM using a second order polynomial regression model. For a list of the alternative RSM approximation methods available within OptionsMatlab see the FAQ section 5.4.


>> inputRSM.OMETHD = 4;

>> inputRSM.NITERS = 1000;


OMETHD equal to 4 specifies a Genetic Algorithm with 1,000 function evaluations. OptionsMatlab will perform the function evaluations required for the Genetic Algorithm against the RSM (rather than evaluating the user's objective or constraint functions directly).


The input structure inputRSM must be passed into OptionsMatlab together with the results of the Design of Experiments contained in the variable results.


>> resultsRSM = OptionsMatlab(inputRSM, results)


resultsRSM =


      VARS: [2x1 double]

    OBJFUN: 2.4824e+003

      CONS: [5x1 double]


The results structure returned, resultsRSM, does not contain search histories. This is because the model used to evaluate the design variables is an approximation of the user’s model and should not be considered to be equivalent to direct evaluation. It is good practice to verify the results of a search over a RSM by direct evaluation of the objective and constraint functions at the returned optimum design.


4         Function Reference




Banana problem

Copyright © 2007, The Geodise Project, University of Southampton