Running an Optimization Within a
SubModel
One of the applications for a SubModel A specialized element that allows you embed one complete GoldSim model within another GoldSim model. This facilitates, among other things, probabilistic optimization, explicit separation of uncertainty from variability, and manipulation of Monte Carlo statistics. is to carry out a dynamic optimization (i.e., at specified times) during a simulation. For example, imagine a situation where you were simulating the operation of a facility over a period of one year. Every month, the operators make a decision based on the current state of the system. This decision is based on a simple optimization analysis using currently available data (i.e., at every simulated month during the simulation). The optimization chooses the optimum values of a few control variables that they will use for the next month.
To represent this in GoldSim, you would need to specify the Solution Type for the SubModel as "Optimization", and the SubModel itself would represent the optimization calculations carried out by the simulated operator.
Note: If a SubModel is set to carry out an optimization, it cannot contain any Spreadsheet elements.
When you select "Optimization" for the Solution Type, GoldSim enables optimization for the SubModel and immediately switches to the Optimization tab for the SubModel:
This is the standard optimization dialog that is also used for stand-alone models, and is described elsewhere in detail.
Several points regarding use of this dialog for SubModel optimization, however, are worth noting:
- Optimization Variables can be defined in terms of variables that are outside of the SubModel. That is, initial values, upper bounds and lower bounds for Optimization Variables can be defined in terms of a variable that is placed on the input interface to the SubModel.
- In most cases, all of the Optimization Variables themselves (and perhaps the Objective Function) should be placed on the output interface to the SubModel (since the purpose of the SubModel is typically to determine these variables). When running an Optimization in a SubModel, the only applicable result type is Final Value. At the end of the optimization, the SubModel outputs the final (optimized) values of the Optimization Variables.
- Optimizations can sometimes fail or may be unable to converge. GoldSim provides different types of error messages when carrying out optimizations. If an optimization of a SubModel fails, a fatal warning message will be displayed (and the simulation is halted). If the optimization completes, but cannot fully converge, a message will be written to the run log Text that is stored with a GoldSim model once it has been run. It contains basic information regarding the simulation, and any warning or error messages that were generated. (but the simulation will not be halted).
- Building the Contents of the SubModel
- Carrying Out Nested Monte Carlo Simulation Using a SubModel
- Controlling How Run Messages are Logged for a SubModel
- Controlling the Appearance of the Graphics Pane for a SubModel
- Controlling When a SubModel is to be Run
- Creating the Input Interface to a SubModel
- Creating the Output Interface to a SubModel
- Exporting SubModels
- Importing SubModels
- Interrupting and Pausing a Simulation Within a SubModel
- Protecting the Contents of a SubModel
- Running an Optimization Within a SubModel
- Saving and Viewing Results Inside a SubModel
- Specifying the Modules and Module Options for a SubModel
- Specifying the Simulation Settings for a SubModel
- Specifying the Solution Type for a SubModel
- Using Resources Inside a SubModel
- Viewing and Editing SubModel Summary Information
- Viewing Element Dependencies Within a SubModel