Contents - Index



Min/Max is used to find the minimum or maximum of an undetermined variable in an equation set for which there is one or more (limited to 20 in the Commercial version, 80 in the Professional version) degrees of freedom.  EES will first check the syntax of the equations.  If no errors are found, a dialog window will appear presenting the undetermined variables in two lists.  



Click the Minimize or Maximize radio button above the left list.  The variable that is to be minimized/maximized is selected from the list on the left by clicking on its name or using the up/down arrow keys.  The independent variable(s) whose value(s) will be changed in searching for the optimum are selected from the list on the right.  It is necessary to select as many independent variables as there are degrees of freedom (i.e., the difference between the number of variables and the number of equations).  The number of independent that which must be selected is indicated above the right-hand list.  To select (or deselect) a variable using the mouse, click on its name in the list.  Using the keyboard, move the cursor to the variable name and press the space bar to toggle to the selection.   If a $DOLAST directive is used in the Equations window, only the variables within the $DOLAST - $ENDDOLAST clause will be available for the optimization process. 


If there is one degree of freedom, EES will minimize/maximize the selected variable using either a Golden Section search or a Quadratic Approximations method, depending on the settings of the radio buttons at the bottom of the dialog box.  The Quadratic Approximation method is usually faster, but the Golden Section method is more reliable.  Multidimensional optimization may be done in the Commercial version using the Conjugate directions method, or the Variable metric method.  The Variable Metric method, which uses numerical derivatives, seems to be the most efficient method (when it works). The Conjugate Directions is best for problems in which the optimum is constrained to be on a bound or when numerical derivatives are not reliable. 


The Professional version provides three additional optimization algorithms:  the Nelder-Mead Simplex method, the DIRECT algorithm and the Genetic method,.   The Genetic method is the most robust method in the sense that is able to find a global optimum even if there are local optima, but it is also the slowest.  The DIRECT algorithm is also designed to find a global optimum when local optima are present, and it can be much faster than the Genetic method.


EES requires finite lower and upper bounds to be set for each independent variable.  Careful selection of the bounds and the guess value(s) of the independent variables will improve the likelihood of finding an optimum.  You can view or change the bounds and guess value for each selected independent variable by clicking the Bounds button.  This will bring up an abbreviated version of the Variable Info dialog containing just the selected independent variables.  See the description of the Variable Info command for additional information on setting the bounds.


For all methods except the genetic method, the maximum number of times in which the equations are solved (i.e., the number of function calls) may be specified, along with the relative tolerance.  Calculations will stop if: 1) the relative change in the independent variable(s) between two successive steps is less than the specified relative tolerance; or 2) the number of steps exceeds the specified maximum.  EES will also stop the calculations if the equations cannot be solved with the specified value(s) of the independent variables within the tolerance and allowable number of iterations specified with the Stop Criteria command in the Options menu and the "Stop if error occurs" check box is checked.  In some cases, the error occurs because the choice of independent variable(s) is not valid and you do not wish the stop the optimization process.  In this case, uncheck the "Stop if error occurs" check box.


The Professional version provides an option to conduct a Sensitivity Analysis to determine the sensitivity of the optimum value to changes in the independent variables. The results of the sensitivity analyses are displayed in the Solution window.


The Professional version provides an option to log the optimization results to a specified file.  Clicking the check box in the Log Results group box will toggle through three options: no logging, logging of the best points as they are found or logging of all points.  The values of other variables in the problem may also be selected for logging by clicking in the check box preceding the variable name.  Each entry in the log file includes the value of the dependent variable (objective function), the value(s) of the independent variables, the value(s) of the additional selected variables and the number of function calls at this time.  The generation number is also logged for the genetic method.  The manner these variables are written to the disk file depends of the file name extension.  If the file name extension is .csv, the results are written with a comma (or semi-colon in the EU system) delimited file that can be directly opened by Excel.  If the file name extension is .dat, these results are written as a tab-delimited text file that can be read into Word, Excel or other similar programs.  If the file name extension is .txt, the results are written in a format that can be read directly into an EES Lookup table using the Open Lookup Table menu command. 



Note:  The Min/Max command can be used for other purposes, such as to find limits of integration.  


The optimization calculations will begin after the OK button is clicked.  A dialog, similar to that shown below, will indicate the progress of the optimization process.  The current optimum value of the dependent variable (Q_dot_refrigeration in the example below) is shown below the elapsed time.  The values of the independent variables (FEED[1] and FEED[2] in the example below) are also displayed.  Both the current values, i.e., the values that are being tested at this time, and the best values, i.e., the values the produced the optimum shown below the elapsed time, are displayed.  



Clicking the Abort button will terminate the calculations.  If the optimization calculation is successful, the values of the independent variable(s) will be set to the those values which resulted in the optimum value of the dependent variable.