Defining the Inflow Rate
Lesson 4, page 7 of 14
Recall that a stream flows into the pond.The inflow rate varies from day to day, and this variation can be described statistically. We are going to assume that the daily variability in the inflow rate can be described using a Normal (Gaussian) distribution with a mean of 20 m3/day and a standard deviation of 5 m3/day.
To define the inflow rate in this way, we will use a Stochastic An Input element that allows you to quantitatively represent the uncertainty in a model input by defining it as a probability distribution. element.
Add a Stochastic Element to Represent the Inflow Rate:
- In the Graphics pane The primary portion of the GoldSim interface, where the graphical depiction of the model is shown., right-click, choose Insert
Element, Inputs, and then select Stochastic:
Once you've inserted the element, its Properties dialog will immediately open: - In the Element ID field, type "Inflow".
- In the Description field, type "Stream flow rate into pond".
- In the Display Units field, type "m3/day".
- To define the
distribution, press the Edit... button. The following dialog will be
displayed:
- From the drop list at the
top of the dialog, select "Normal". Then enter "20 m3/day" for the
Mean and "5 m3/day" for the Standard Deviation.Finally,
press the Apply button.The dialog will now look like this:
- Since this represents an
inflow rate (and logically cannot be less than zero), let's ensure that cannot
happen.To do so, check the Truncated box, and enter "0 m3/day" for
the Minimum, and press the Apply button again.The dialog
will now look like this:
- Press OK to close the dialog to return to the main Stochastic dialog.
- By default, GoldSim only
samples a distribution once (at the beginning of each realization A single model run within a Monte Carlo simulation. It represents one possible path the system could follow through time.). We need to tell GoldSim to select
a different value from this distribution every day during each realization of
the simulation. To do so, select the Resampled radio button, and then
press Resample....The following dialog will be displayed:
This dialog is used to specify "triggering events" instructing GoldSim when to resample the distribution. - Press the Add button.
- From the Type drop-list, select "On Changed".
- In the Trigger
Definition, enter "EDay". The dialog will look like this:
EDay is an internal variable (referred to as a Run Property A fundamental internal variable that tracks the progress of the simulation (e.g., Time, Realization) and can be referenced like an output in expressions.) that represents the number of elapsed days in the simulation.So this "trigger" tells GoldSim to resample the distribution whenever the variable EDay changes (i.e., at the beginning of every day). - Press Close to close the triggering dialog, and then press Close again to close the Stochastic dialog.
In order to better understand what we have just done, let's run the model and look at the Inflow.
Run the Model:
- Click Run on the toolbar.
- When the model finishes running, a "Simulation Complete!" message is displayed. Press OK to continue. The model is now in Result Mode The state of a GoldSim model when it has been run and contains simulation results..
-
Recall
that in addition to viewing results using Result elements The basic building blocks with which a GoldSim model is constructed. Each element represents a feature, pararamer, process or event in the model., we can also do so by
right-clicking on elements and selecting a result to
display from the context menu.Right-click on "Inflow", and then
left-click on Time History Results... :
The following result will be displayed:
Note that your result will not look identical to this.This is because the behavior is a function of a random number seed A number (e.g., randomly created based on the computer’s internal clock) that is used in an algortihm that subsequently generates random numbers that are used to randomly sample Stochastic (and other elements) during a simulation. that was created when the element was inserted.Your random number seed will be different than the one that was used to generate this result, and this will result in different samples being selected from the Stochastic.However, the overall result will be similar: The value for the inflow changes every day, randomly fluctuating around the mean of 20 m3/day. - Close the result by pressing on the X.
- Press F4 to return to Edit Mode The state of a GoldSim model when it is being edited and does not contain simulation results..
- Press the Save button in
the toolbar (or press Ctrl+S):
Before moving on, let's recap what we have just done:
- We created a probability distribution A mathematical representation of the relative likelihood of a variable having certain specific values. to represent the daily variability in the inflow rate.
- Since the purpose of the distribution was to represent the daily variability in the inflow rate, we instructed GoldSim to resample the distribution every day.
- The resampling process is random, and depends on a random number seed that was generated when the element was created.
Due to the random nature of the sampling process, any given run represents one possible (random) future that the system A subunit of the world separated by a boundary from the rest of the world. The description of the system is comprised of the relations within the system as well as those characterizing the action of the outside world on the system. could follow (and hence your result will look different from the result shown above). As a result, to fully represent the uncertain behavior of this system, it is necessary to carry out a Monte Carlo simulation A method for propagating (translating) uncertainties in model inputs into uncertainties in model results. running multiple realizations. As the number of realizations increases, the statistical behavior of converges (regardless of the random number seed that is used). We will take this next step and run multiple realizations next.
Note: The manner in which the inflow has been represented here is not very realistic (e.g., if the inflow rate was high today, it is probably likely to be high tomorrow, and this is not represented in this model). However, you should not be concerned about this! The purpose of this Tutorial is not to teach you how to model this particular problem, but to introduce you to the basic features of GoldSim. At the end of the Tutorial, however, in order to illustrate some of GoldSim's advanced features, we will briefly discuss ways in which such a model could potentially be made more realistic.