Optimization with Powersim Studio About Analysis Variables When you're working with analysis features in Studio, you must define analysis variables for the analysis you wish to perform. The analysis variables are based on a selection of the existing models variables in your simulation model. The analysis tasks and tools will use these analysis variables when performing the task at hand. Model variables in Studio can be divided into two groups: Changeable and Computed variables. Changeable variables are model variables that the analysis tools can alter during the execution of the task. Changeable variables can be used as decisions and assumptions when setting up a task. Constants and initial values of levels are changeable variables. There are some restrictions to this rule, however, Permanent variables are changeable, and may only be used as analysis variables at the start time of the simulation. Also, constants and levels that are initialized by other variables are called analytic variables, and they may not be used to create risk analysis variables. Computed variables are variables that Studio cannot alter during the execution of a task. Levels that accumulate flows and auxiliaries that depend on other variables belong to this category. Computed variables can be used as objectives in Optimization and Risk Management, and effects in Risk Assessment and Risk Management For Studio to be able to perform the analysis, you must select the variables that influence the performance of the model and categorize them as decisions, assumptions, objectives, and effects. These categories contribute to define the analysis variables and determine what further information you can attach to the variables. What categories are available depends upon the selected task. Decisions, assumptions and objectives are available for Scenario Control and Optimization. Decisions, assumptions, objectives, and effects are available Risk Assessment and Risk Management. Assumptions Assumptions are changeable variables beyond your control. External factors that influence the model are assumptions if they're modeled as constants rather than auxiliaries. It is quite common that there is uncertainty in estimating the value of assumptions. Inflation rate and interest rate are typical examples of assumptions. Assumptions can take place at any time in the simulation. You can use assumptions for any of the analyses available in Studio. Assumptions may only be defined as fixed values when working with Scenario Control and Optimization. For Risk Assessment and Risk Management, however, assumptions may be defined by probability distributions. Assumptions may be cloned, allowing you to create a series of assumptions for the analysis. Decisions Decisions are changeable variables that you can influence directly. You can, for example, decide upon the production volume of a new production line or the salary of a group of employees. At the policy level, decisions are parameters to policy procedures. Decisions can take place at the start or at a specified time of the simulation. Decision variables can be cloned. Decisions are useful when you are using Scenario Control, and required for Optimization, and Risk Management. Objectives Objectives are computed variables that represent targets for an optimization, for example market share or profits. Objectives can be applied at the end of the simulation, or at a specified time. Objectives can be cloned, in order to define different criteria at different times. If you have more than one objective in your analysis, you can normalize them and give them different weight, to assign different importance to them. Objectives must be specified for Optimization and Risk Management. Effects Effects are computed variables for which you want to study the uncertainty distribution in the risk assessment. Effects in Risk Assessment analyses will often be objectives in Optimization or Risk Management tasks. Effects cannot be cloned, since the resulting data for effects are complete time series over the entire simulation run. You can easily create good effect presentations in the time graph. Effects may be specified for Risk Assessment and Risk Management. Summary The table below summarizes how the various analysis variables are used in the different analyses. *) Assumptions are not required for any analyses in Studio. However, risk is introduced through defining probability distributions for assumptions, and running these analyses without using assumptions may not provide very useful. Powersim Tutorial Model for Optimization: Notes Decisions for Optimizing Profit For the Optimize task, you must select decisions and objective variables, and you can also select assumptions. In the Inventory model, the InventoryCoverage variable is the one that you can alter most easily to optimize the profit. Other variables that affect the objective are of course the cost factor of having products in inventory, the delay time for receiving ordered supplies, and the price. What you do: 1. Open the Analysis Variables window by double-clicking it in the Project Explorer 2. Right-click the Decisions heading in the window, and select Add Decision on the shortcut menu. 3. Select the Inventory Coverage variable, and click OK. The Inventory Coverage variable represents the desired number of days' sales that should be covered in inventory. Assumptions for Optimizing Profit The assumptions are given the values that apply to your model at the time when you want to optimize it. By varying the assumptions, you can find different values for the decision to get closer to the objective. What you do: 1. Right-click the Assumptions node in the window, and select Add Assumption on the shortcut menu. 2. Select the Delivery Delay variable, and click OK. 3. Repeat steps 1 and 2 and add the Information Delay variable as another assumption for your analysis. Delivery Delay represents the number of days from the supplies are ordered until they arrive at the inventory, while Information Delay represents the number of days for information about demand to reach the inventory management. Objectives for Optimizing Profit The objective for an optimization task is the goal you want Solver to reach. By varying the different decision values and applying the different assumptions, it tries to find the scenario that best fulfills the objective as you have defined it. The objective in this particular optimization task is to maximize the profit. What you do: 1. Right-click the Objectives node in the window, and select Add Objective on the shortcut menu. 2. Select the Total Profit variable, and click OK. Total Profit represents the total profit created by the company. Define Decisions for Optimizing Profit The decision you have selected, Inventory Coverage, indicates the desired number of days' sales that should be available in inventory to all times. When Studio tries to optimize the model, it will select different values for the decision variable. The values are picked from an interval specified by you. In this example, you might allow the InventoryCoverage to vary between one day, being the minimum coverage you will allow, and ten days, being the maximum coverage you will allow. What you do: 1. Double-click the Inventory Coverage variable, and define it as specified below: Define Objectives for Optimizing Profit When optimizing, Solver must have an objective to compare the simulated results against. If the objective is reached, the optimization will stop. If not, Solver will find a new set of values for the decisions, and simulate again. By using different operators and values when defining these objectives, you can optimize for a profit in (or not in) a specified interval, for a profit greater or less than a specified value, or simply for its minimum or maximum value. You can also enter a time at which the objective should be fulfilled. In this case, the natural thing is to optimize for a maximum value at the end of the simulation. What you do: 1. Double-click the Total Profit variable, and define it as specified below: Since there is only one objective, there is no need to change the Weight and Normalizing Factor, so you can leave its value at 1. Note! If you click the spin button in the Apply time box, you can also select a date. To set the apply time to the stop time of the simulation again, simply select the box, and type "Stop." Define and Start the Optimization Studio uses an evolutionary search method to generate new values for the decision sets. On the basis of the value intervals and constraints that you have defined for your decisions, new parameters are generated and used in the simulation. Those that produce the best results are used as parent values to generate new offspring values. This process is repeated until the goal is reached, the maximum number of generations is reached, or the convergence rate is too low. When you click the Optimize button in Studio, you can select which decisions that should be active during the optimization. Note! When you click Optimize, you will not be able to scroll this window. Please scroll to the end of the window so the procedure below is visible when you open the wizard. 1. Click Optimize on the toolbar. The Optimize Wizard will appear. 2. In the first step, General, you define the method used to run the optimization. Leave the default settings as they are. 3. Click Next to go to the next step of the wizard. 4. In the second step, Assumptions, you can select you can change the value of your assumptions if you like. 5. Click Next to go to the next step of the wizard. 6. In the third step, Decisions, you can select which decisions should be used to optimize the simulation in this run. You can also change the minimum and maximum values of the decision. 7. Note, however, that you can not specify a minimum that is lower (or maximum that is higher) than the minimum (and maximum) defined in the Analysis Variables window. You can, in other words, narrow the value span. Click Next to go to the next step of the wizard. 8. In the final step, Objectives, you can change the settings for the objective. You may change the operator as well as the parameters for the objective (if the objective's operator is not locked on the Property page). 9. When you click Finish, the Optimize dialog box will appear and the optimization runs will start automatically. You can view how the analysis develops in the various pages of the dialog box. The Status field shows the status of the analysis at any time, and will also let you know when the analysis is finished. 10. When the optimization is finished, you can inspect the results in the various pages of the dialog box. When you click OK to close the dialog box, a new simulation using the best decisions will automatically be executed, allowing you to see the results of the best simulation run in the presentation objects. Displaying the Optimization Results When you clicked OK to close the Optimization Wizard, a new simulation was automatically run, using the best decision found. When you go back to the Shared Diagrams (by clicking Shared Diagrams in the toolbar or in the Project Explorer), you will see the results produced by this simulation. As you can see in the table, the best value for Inventory Coverage of 2.62. You can change this value and run new simulations with other inputs. If you wish to retrieve the optimal value again, you can click Optimize and browse to the third steps, Decisions. The last optimized value is listed under Last Actual. Note! Since a decision is created for the Inventory Coverage variable, and the apply time for this decision is Start, you are only allowed to provide input to the variable at the start of the simulation. To allow input at other times, you can either create more decisions for the variable with different apply times, which will allow you to provide input at any of those apply times during the simulation (but not outside them). Alternatively, you can delete the decision and provide input at any time during the simulation (as normal). Tips for Further Experiments If you want to experiment further with optimization, you can try out the following experiments. What you do: 1. Vary the values of the different assumptions to see their effect on the decision and objective values. You can do this inside the Optimize Wizard. 2. Vary the definition of the objective to try the different operators. You can do this inside the Optimize Wizard. 3. Create other decisions to optimize. The decisions must be created in the Analysis Variables window, but you can change the decisions' parameters in the Optimize Wizard. Decisions are useful when you are using Scenario Control, and required for Optimization, and Risk Management.