SubModel Example: Dynamic Optimization During a Simulation

Another common use of SubModels is to do a dynamic optimization during a simulation.  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 month during the simulation). The optimization chooses the optimum values of a few control variables that the operators will use for the next month. 

With SubModels, you could simulate this by inserting a SubModel (e.g., a static optimization) within an outer model (e.g., a dynamic simulation).

Example model DynamicOptimization.gsm in the General Examples/SubModel folder in your GoldSim directory (accessed by selecting File | Open Example... from the main menu) provides a simple illustration of such an application. In this model, the outer model is a dynamic deterministic simulation, and the SubModel is a static deterministic optimization.  The objective function in the SubModel is a function of a parameter that is passed in from the outer model (and changes every timestep).  Hence, every timestep, the SubModel carries out a new optimization and the results are used in the parent model for the next timestep. 

Related Topics…