Page 703 - ExtendSim User Guide

P. 703

```
Variables table
When a dialog’s variable is dragged using the Clone Layer tool onto a closed Optimizer block, the Optimizer block places that variable into its Variables table. This table holds the variables needed in the Optimizer’s cost or profit equation. These variables can be of two types:
• Decisionvariablestobeoptimized.Theseneedtheirlowerandupperlimitsentered. • Outputvariablesfromthemodel.Theseshouldhavenolimitsentered.
Both lower and upper limits for a decision variable need to be entered directly in the Variables table. Variables that are outputs from the model, such as Exited from an Exit block (Item library), should not have any limits entered or the Optimizer will attempt to incorrectly change them.
☞ If the variable is an integer type, such as a number of machines, do not enter a decimal point in the limits. Conversely, variables that need to have real values, such as a delay time that could vary from 1.0 to 2.2, need both limits entered with decimal points.
Specifying data table cells in the Variables table
If a cloned data table is dragged to the closed Optimizer block, the Row,Col indexes need to be entered, separated by a comma. Since data tables are zero-based and start at row 0 and column 0, the first cell would start at 0,0.
For example, to use the first row and second column cell of a data table, enter the Row,Col value 0,1 where 0 is the first row and 1 is the second column.
☞ The Variables table’s Row,Col column is only used to access a cell within a data table.
Objective functions
Optimizations can maximize profit, minimize a cost, or approach a constant, depending on the form of the equation. Just like the equation field of the Equation block (Value library), optimi- zation equations can be multi-lined, define variables, have control constructs (i.e. IF-ELSE, FOR...), and call ModL functions. To see more information on equations, see “Equation-based blocks” on page 695.
Maximizing profit or minimizing cost
For example, you may want to optimize the number of machines used to maximize the profit. In that case, you can set up an equation:
MaxProfit = thruput*dollarsPerUnit - numMachines*dollarsPerMa-
chine;
Or, you might want to write the equation as a cost, and minimize that cost:
MinCost = numMachines*dollarsPerMachine - thruput*dollarsPerUnit;
The variable names used in the MaxProfit or MinCost equations come from the Equation Vari- able column of the Optimizer’s Variables table. Depending on how you write the equation, the Optimizer will either maximize or minimize the equation value by changing the values of the decision variables until the correct condition converges.
Approaching a constant
A special case for an objective function would be that the result needs to approach a constant K as close as possible. In this case, you can write a profit equation.
For the case where the equation should approach a nonzero constant K, the form would be:
Analysis 677
Optimization
How To
```