SubModel Example: Manipulation of Monte Carlo Statistics

A common use of SubModels is to manipulate Monte Carlo statistics. That is, after carrying out a Monte Carlo simulation A method for propagating (translating) uncertainties in model inputs into uncertainties in model results., you may want to carry out further calculations using the statistical outputs of the simulation. For example, you may want to carry out a calculation that is some function of the mean and the 95th percentile of a particular output in a Monte Carlo simulation.

Without the use of SubModels, the only way to accomplish this is by exporting results from a Monte Carlo simulation manually to another application (e.g., a spreadsheet or a separate GoldSim model). With SubModels, this is easily accomplished within a single GoldSim model by inserting 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. (that is a Monte Carlo simulation) into an outer model (that is static and simply manipulates the statistical outputs of the inner model).

Example model MonteCarloStatistics.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 SubModel contains a single Stochastic. The SubModel carries out a Monte Carlo simulation. The outer model is a static deterministic simulation A simulation in which the input parameters are represented using single values (i.e., they are "determined" or assumed to be known with certainty). that contains a single Expression element. The Expression is a function of statistics (the mean and 95th percentile) of the Stochastic within the SubModel.