GoldSim Volume2
GoldSim Volume2
GoldSim Volume2
GoldSim
Probabilistic Simulation Environment
Volume 2 of 2
Copyright GoldSim Technology Group LLC, 1998-2006. All rights reserved.
GoldSim is a registered trademark of GoldSim Technology Group LLC.
The GoldSim User's Guide is divided into two volumes. Chapters 1 through 7 are
included in Volume 1. Chapters 8 through 10, along with the appendices, are
included in Volume 2. The full Table of Contents, Index and Glossary are
provided in both volumes.
Index 767
E d w a r d Tu f t e , T h e V i s u a l D i s p l a y o f
Qua nt itat i ve I nfor mati on
Chapter Overview
GoldSim has powerful charting and display functions that allow you to view
your simulation results in a variety of ways. You can plot time histories of your
data, view probability distributions, create scatter plots and bar charts, and view
tables of results. You can also combine multiple results on a single plot, and
view multiple plots simultaneously. To facilitate the creation of report quality
graphics, you can modify and save chart styles, which allow you to customize
(and reuse) the style (i.e., appearance) for each type of chart.
This chapter describes how you can create and view the results of your
simulations.
In this Chapter The following topics are discussed in this chapter:
• Displaying Results: An Overview
• Viewing Time History Results
• Viewing Distribution Results
• Viewing Multi-Variate Results
• Viewing Final Values for Arrays
• Editing the Appearance of a Chart
• Creating and Using Chart Styles
• Creating and Using Result Elements
• Exporting Results
• Copying, Exporting and Printing Charts and Tables
• Setting Defaults for Result Display
Viewing "Last Value" Although GoldSim provides a variety of powerful ways in which you can
Results in Tool-Tips display simulation results in the form or charts and tables, the simplest and
perhaps most common way to view basic results is via tool-tips.
In Result Mode, an output's Last Value (the value at the end of the last
realization) will be displayed in a tool-tip when the cursor is held over it in a
browser (or output interface).
If the output is the primary output of an element, the Last Value will also be
shown in the tool-tip displayed when the cursor is held over the element itself.
Tool-tips are only displayed for scalar outputs. If you hold the cursor over a
vector or a matrix , the Last Value will not be displayed (since the output
actually consists of multiple values). Note, however, that if you expand the array
in a browser or output interface and hold the cursor over a single item, the Last
Value for that item will be displayed.
Read more: Using Vectors and Matrices (page 522).
Note: If the simulation was run using the Distributed Processing Module, Last
Values are not available in the tool-tips.
Viewing the Four GoldSim provides four ways in which you can display results in graphical and
Basic Result Types tabular form:
Time Histories: Values at selected times for a particular output.
Distributions: Probability distributions of the final value (i.e., the value at
the end of each realization) of an uncertain output.
Multi-Variate Results: Comparisons between the final values of variables
(outputs), such as scatter plots, correlation tables, and sensitivity analyses;
and
Array Results: Final values for vector and matrix outputs.
Right-clicking on an element with a primary output (in the graphics pane or
browser) or on a specific output (in an output interface or a browser) which has
been saved will provide a context menu for displaying these four types of
results.
The first two items are used to display specific types of results.
Note: Time Histories are only available if you have selected Save Time
Histories for the output. Distributions and Multi-Variate Results are only
available if multiple realizations have been run and you have selected Save
Final Values for the output. Array Results are only available if the output is a
vector or a matrix.
The same information can also be viewed in table form, in which the time is
shown in one column, and the output's value is shown in the other:
Distribution Results In many systems, you may be uncertain about some of the input parameters. In
such a case, GoldSim allows you to define these parameters as probability
distributions. If at least one of the inputs to a model is a probability distribution,
by definition, the outputs are probability distributions. (Basic concepts of
probabilistic simulation are provided in Appendix A.) Distribution results
provide a way to view the final values of uncertain (probabilistic) outputs. As
such, they are only available if multiple Monte Carlo realizations have been run.
The summary display for a distribution result combines graphical and tabular
information, and looks like this:
The chart display for a distribution expands the small chart provided in the
upper right-hand corner of the summary display shown above.
Multi-Variate Results When evaluating the results of your simulations, you will sometimes want to
view multi-variate results, in which multiple outputs are analyzed in graphical or
tabular form.
To view multi-variate results, you select a specific output that you are interested
in, along with the input variables (which are typically Stochastics) that may have
affected that result.
One example of this is the 2-D scatter plot, in which the final value of one
output is plotted against the final value of another:
GoldSim also allows you to create a 3-D scatter plot, in which one output is
plotted against two others.
GoldSim provides two very useful tabular multi-variate result outputs to support
sensitivity and uncertainty analysis. One table provides a variety of statistical
sensitivity analysis outputs (coefficient of determination, correlation
coefficients, standardized regression coefficients, partial correlation coefficients,
and importance measures):
You can also view the raw data display of multiple variables, showing the final
values for each realization for each of a number of selected outputs:
Multi-variate results are only available if multiple realizations have been run.
Array Results Most complex models will utilize vectors and matrices, collectively referred to
as arrays. GoldSim allows you to view array results in both graphical and tabular
form.
Read more: Using Vectors and Matrices (page 522).
A chart display of a vector looks like this:
Using Result Display Although GoldSim allows you to view four different types of results (time
Windows histories, distributions, multi-variate results, and array results), the result display
windows for these results types share a number of common characteristics:
• All four results can be viewed either as a chart or a table. You can
determine which type of view is initially shown by default when you
select a particular result type to be displayed. Once a result is
displayed, you can subsequently switch back and forth between a chart
view and a table view.
Read more: Setting Defaults for Result Displays (page 487).
• Although you can resize and maximize an interactive chart or table
result display window, it is always modal. That is, it cannot be
minimized, and it retains the focus while it is displayed. As a result,
you must close the display window before you can edit any other part
of your GoldSim model. GoldSim does, however, provide a mechanism
(Result elements) by which you can display one or more modeless
result display windows (which allow you to navigate and edit other
parts of the GoldSim model while keeping the windows open).
Read more: Creating and Using Result Elements (page 466).
• Chart and table result display windows for all four types of results have
a common set of buttons which provide access to specialized dialogs
and/or allow you to carry out specific actions.
Read more: Using Buttons in Chart Display Windows (page 404);
Using Buttons in Table Display Windows (page 404).
• Charts for all four result types provide a number of common functions,
such as context-sensitive menus, data tips and the ability to zoom in on
a section of the chart.
Read more: Using Context Menus in Charts (page 405); Viewing Data
Tips in Charts (page 405); Zooming in on a Chart (page 406).
Using Buttons in Chart At the top of all chart display windows are several buttons which provide access
Display Windows to specialized dialogs and/or allow you to carry out specific actions:
Viewing Data Tips in GoldSim allows you to view a "data tip" by holding the cursor over a data point
Charts in a chart. The example below shows a data tip for a point in a time history
chart:
In this particular case, the data tip displays the realization number for the curve,
and X and Y values of the data point. (For a time history chart, the X axis is
always time). Note that the plot point number is also indicated (in parentheses).
Read more: Defining Plot Points (page 348).
In this case, the first column is the sort key, and the header is shown in red.
You can choose a new sort key by simply clicking on a different column. The
first time you click one of the columns, that column is sorted in ascending order.
A second click sorts the column in descending order (and the header column
resembles a depressed button).
To turn sorting off, right-click anywhere in the table, and select Reset Sorting.
Controlling the You can control the number of significant figures displayed in a result table by
Significant Figures in selecting Ctrl+Shft+S when viewing the table. The following menu will be
Result Tables displayed:
Note: Whenever you set the number of significant figures in a table, the change
is global. That is, it is subsequently applied to all tables that you view.
Although internal calculations are carried out using double precision numbers,
Size of Values results are only stored as single precision numbers (in order to reduce storage
Displayed requirements). This means that when results are viewed in tables or charts, the
range of values that can be displayed is between -1.2E-38 and 3.4E38. Values
outside this range are indicated using a > or < sign:
Viewing Final Values Distributions, Multi-Variate results, and Array results all operate on Final
for Phases Values. That is, they allow you to view the value at the end of each realization.
GoldSim also allows you to view Distributions, Multi-Variate results and Array
results at the end of each phase in your simulation (in addition to those at the
end of each realization). This is useful, for example, if you wish to examine a
result distribution for an output at various times during a simulation.
Read more: Defining Time Phases (page 346).
If you have saved final values at the end of phases, an additional drop-list is
added to the result display windows for Distribution, Multi-Variate, and Array
results:
To view the Final Values for a particular phase, you simply select that phase
from the drop-list.
Creating Chart Styles GoldSim has powerful charting capabilities that allow you to customize the
appearance of each chart (e.g., by adding headers and footers, changing axes
scales and labels, etc.).
Read more: Editing the Appearance of a Chart (page 450).
In some cases, after modifying the appearance of a chart, you may want to save
the particular set of properties you have created (e.g., label fonts, header, footer)
so that you can apply them to another chart. To facilitate this, GoldSim allows
you to save the set of properties as a named chart style. The named chart style is
saved as part of the model file, and can subsequently be applied to other results
in your model. You can also export and import chart styles between models.
In order to facilitate the use of a single chart style for multiple results, GoldSim
allows you to use keywords (delimited by the % symbol) when you create and
use chart styles. For example, you could define a chart style in which the header
was %on%. This particular keyword inserts the output name into the location
that it is used. Similarly, the keyword %curdate% inserts the current date.
When you view a result, it will initially take on a set of characteristics defined
by the default chart style for that particular type of chart (e.g., time history,
distribution, etc.). GoldSim automatically provides a set of default chart styles
for all chart types. If desired, however, for any type of chart, you can specify
one of your own custom chart styles as the default chart.
Read more: Creating and Using Chart Styles (page 459).
Screening When carrying out probabilistic simulations, you may often run hundreds or
Realizations thousands of realizations. In order to analyze the results, it is often quite useful
to define and display subsets of the data by screening out some realizations.
For example, you could choose to examine only those realizations in which a
particular output was within a certain range or above some threshold value (e.g.,
only display those realizations in which the uncertain discount rate was above
3.5%; only display those realizations in which the negative cash flow exceeded
$1,000,000).
You specify such screening conditions within GoldSim via a dialog accessible
from the main menu under Run|Screen Realizations…:
Note: This dialog is only accessible when the model is in Result Mode.
In the example shown above, only those realizations in which the output named
Discount_Rate is greater than 0.035 and the output named CashFlow is less than
-$1,000,000/yr will be displayed in result charts and tables.
Once you define a screening condition, you must press the Update List button
to carry out the screening operation. The number of realizations which meet the
screening condition (and hence will be displayed) is then indicated in the dialog.
The bottom part of the dialog allows you to select specific screened realizations
when displaying time histories.
In this particular example, 228 out of the 1000 realizations met the screening
condition. Time histories were saved for the first 100 (out of 1000) realizations .
Of these 100 realizations, 28 met the screening condition, and 10 of these have
been selected for plotting.
Note: You can modify the default so that a table (rather than a chart) is
displayed when you select Time Histories… from the context menu.
Plotting Condition Time Condition outputs are either True or False and are typically used as state
Histories variables or flags in a simulation. As a result, in some situations, you may want
to save and plot time histories of conditions. To facilitate this, when plotting a
time history of a condition, GoldSim plots True as 1 and False as 0.
Read more: Output Attributes (page 83).
Viewing a Time You can view a time history table by pressing the Table View button from the
History Table chart display window. A time history table looks like this:
Note: You can modify the default so that a table (rather than a chart) is
automatically displayed when you select Time Histories… from the context
menu for an output.
Note: If you a running a date-time simulation, you can control the format in
which dates/times are displayed in result tables on the Results tab of the Options
dialog (accessed via Model |Options… from the main menu).
Note: You can copy the contents of a time history table to the clipboard (by
pressing the Copy button in the display or pressing Ctrl+V). You must first
select the cells you wish to copy. You can do so by placing your cursor in one
cell and dragging to another location. You can select the entire table by pressing
Ctrl+A. Selected items will be highlighted in black. You can subsequently
paste the table into another application (such as a spreadsheet).
Viewing Time When you wish to view time history results for an array output, you must first
Histories for Array choose whether you wish to view results for a single item of the array, for
selected items, or for all items.
Outputs
If you wish to view results for only a single item, you should expand the array in
the browser or output interface, right-click on the specific item which you wish
to view, and select Time Histories… from the context menu.
If, however, you wish to view selected items (or all items) of the array, you
should right-click on the entire array, and select Time Histories… from the
context menu. The resulting display differs depending on whether the array is a
vector or a matrix.
Viewing Time Histories If you choose to display a time history chart of an entire vector, the chart will
of Vectors look something like this.
GoldSim will display each item of the vector, and add a legend. You can change
the line style and color for each item, as well as the legend style.
Read more: Editing the Appearance of a Chart (page 450).
The table view of this chart would look like this:
Pressing the Select Array Items… button in this dialog displays a dialog for
selecting the items of the array that you wish to display.
After selecting the desired items (you can select multiple items by Ctrl-clicking
on them), close the dialog by pressing OK, and then press the Display Chart or
Display Table button in the Result Properties dialog.
If you choose to display a time history chart of an entire matrix, the chart will
Viewing Time Histories look something like this:
of Matrices
If you choose to display a time history chart of an entire matrix, GoldSim will
display each item for the first row of the matrix, and add a legend. As will be
discussed below, you can plot every item of any row or every item of every
column, but you cannot plot all items of the matrix simultaneously. In effect,
you can plot one vector from the matrix (a column vector or a row vector) at a
time.
You can change the line style and color for each item in the chart, as well as the
legend style.
Read more: Editing the Appearance of a Chart (page 450).
The table view of this chart would look like this:
Each item of the matrix row is displayed in a different column of the table.
You can display a different row or column of the matrix (and/or a subset of the
items of the selected vector) by selecting the Result Properties button from
either the Chart view or the Table view. The following dialog will be displayed:
Pressing the Select Array Items… button in this dialog displays a dialog for
selecting the items of array that you wish to display.
After selecting the desired items (you can select multiple items by Ctrl-clicking
on them), close the dialog by pressing OK, and then press the Display Chart or
Display Table button in the Result Properties dialog.
Viewing Time If you choose to display a time history of an output with multiple realizations,
Histories of Multiple GoldSim will display the first available (unscreened) realization.
Realizations
You can select a specific realization to view using the Realization control at the top of the
window.
A Realization control is added to the chart display window. You can type in a
specific realization (and press Enter), move upward or downward through the
available realizations using the spin control, or use the F2 and F3 keys to view
the previous or next realization, respectively.
Note: You can only view those realizations which are available (i.e., those
which have been saved and have not been screened out).
You can select which realizations are to be viewed (which are available) by
pressing the Result Properties button from either Chart view or Table view.
From within this dialog, the Select Realization(s)… button provides access to
the screening conditions dialogs.
In this case, all of the time histories are shown in the same color (black).
If the number of realizations is less than or equal to 100, they will be assigned
different colors and labeled in the legend.
You can switch back to a regular time history chart view by clicking on the
Probability Histories button.
By default, the areas between the percentile curves are filled. You can show just
the lines by right-clicking on the chart and clicking on (clearing) Show as Areas
from the context menu:
Note: When displaying areas, an additional context menu option (Show Outline)
is available. When this is selected, lines are drawn between the areas. The line
color is the Data Area Foreground color.
Selecting Percentiles By default, GoldSim plots the following pairs of percentiles when displaying
and Options for probability histories:
Probability Histories • Lower Bound/Upper Bound (0%/100%)
• 5%/95% (requires at least 100 realizations)
• 25%/75% (requires at least 20 realizations)
It also plots the median (50th percentile) and the mean.
Note: When plotting a probability histories for a Condition, only the Mean (the
probability of being True) is plotted and the other percentiles are ignored.
You can customize which of these lines you would like to plot, as well as add
some of your own, using the Probability Histories dialog, accessed by right-
clicking on the chart and selecting Edit Percentiles… or by pressing the
Display settings for probability histories… button on the Results tab of the
Options dialog (accessed via Model|Options…):
You can activate or deactivate a particular line (or pair of lines) by clicking in
the checkbox to the left of the item. You can add new percentile pairs by
pressing the Add… button. The following dialog is displayed.
You need to only type in one item of a pair (as a percentage, not a fraction), and
the complementary item will also be added. For example, if you enter 10, both
the 10th and 90th percentiles will be added. User-defined percentile pairs appear
in the list in a red font.
You can subsequently remove any user-defined percentile pairs using the
Remove… button.
Note: A minimum number of time histories must have been run in order to plot
the percentile curves. In particular, in order to be able to plot the Xth percentile
(where X is the lower number of the pair, expressed as a fraction), at least 5/X
time histories must be available. For example, in order to plot the 10th (and
90th) percentile, at least 5/0.1 = 50 time histories must be available. At least 5
time histories must have been run to plot any probability history curves at all.
Regardless of what percentiles have been activated, GoldSim will only plot
those percentiles for which this condition is met. Percentile pairs which do not
meet this requirement (based on the specified number of realizations) are grayed
out in the dialog.
Note: All of the information specified in the Probability Histories dialog (i.e.,
the percentiles to save, whether to show the probability history as the default,
etc.) is saved to the Windows registry (rather than being saved with the file
itself). As a result, it is applied to all GoldSim files that you open on your
machine.
Viewing a Probability By pressing the View Table button when viewing a Probability Histories Chart,
Histories Table or by pressing the Probability Histories button when viewing a regular time
history table, you can view a Probability Histories table.
You can select a specific realization to view using the Realization control.
The spin control is also added to the Table view for the array.
You can type in a specific realization (and press Enter), move upward or
downward through the available realizations using the spin control, or use the
F2 and F3 keys to view the previous or next available realization, respectively.
Note: You can only view those realizations which are available (i.e., those
which have been saved and have not been screened out).
When you are viewing multiple realizations of an array time history, you can
choose to view the mean time history (or a specific percentile) for each item by
pressing the Probability Histories button (on the right-hand side of the menu):
If you press the Probability Histories button when viewing multiple realizations for an array,
the mean time histories (or a specific percentile) are displayed (either as a chart or a table)
as indicated in the window’s title bar.
Note: You can specify what statistic is displayed when viewing probability
histories of multiple output in the Probability Histories dialog, accessed by right-
clicking on the chart and selecting Edit Percentiles… or by pressing the
Display settings for probability histories… button on the Results tab of the
Options dialog (accessed via Model|Options…)
In order to view all the percentiles for a given item (in addition to the mean time
history), you must choose to display the result only for that item (in which case
the Probability Histories button shows the percentiles for the time histories).
Read more: Displaying a Probability History (page 417).
Viewing Time It is often useful to plot the time histories of multiple outputs on a single plot.
Histories of Multiple This allows you to compare and contrast different results, or to better understand
how various parameters in your model affect each other. Therefore, GoldSim
Outputs allows you to display multiple outputs on a single time history plot. Once you
are viewing a time history chart or table, you can add an additional output to the
chart or table as follows:
1. Press the Result Properties button at the top of the result display
window. A dialog will be shown listing all the outputs currently being
Result Properties button displayed.
2. Within this dialog, press the Add Output button. A dialog for selecting
an output is displayed. The dialog shows all outputs, organized by
containment.
3. Select the output the you wish to add to the chart or table display, and
press OK. The selected outputs will then be shown in the Result
Properties dialog for the result.
In the Data-Axis Definition group, you can specify the display units for the two Y
axes. GoldSim defaults these to that of the first output linked to each axis.
GoldSim also automatically determines what the axis is plotting (value, condition,
or unused). The selected outputs are listed in the Outputs grid. You can show the
full path for each output (showing the containment hierarchy) by selecting Show
Full Path.
This will be indicated in the Result Properties dialog for the result by
the Y2 checkbox next to each output (the box will be checked to those
outputs that are assigned to the secondary y-axis). The display units for
both the primary and secondary Y axes can also be modified from the
Result Properties dialog.
• If the output you select to add to the chart has the same dimensions as
the original output, it will automatically be placed on the primary (Y1)
axis. You can move it to the Y2 axis (e.g., if its magnitude is very
different from the result on the Y1 axis) by activating the Y2 axis
(changing Right Y-Axis (Y2) from “Unused” to “Value”) and clicking
the Y2 checkbox for that output.
• You can add as many outputs as desired to the chart or table. Note,
however, that all outputs must either have the dimensions of the
original output, or the dimensions of the secondary Y axis (determined
by the first output added with different dimensions from the original
output). You can subsequently change the dimensions of both axes (via
the Left Y-Axis Display Unit and Right Y-Axis Display Unit fields).
However, GoldSim will not allow you to view the chart if the list
contains an output which does not match one of these two dimensions.
• When you are viewing time histories of multiple realizations of
multiple outputs, you can choose to view the mean time history (or a
Note: You can modify the default so that a chart or a table (rather than the
distribution summary) is displayed when you select Final Value| Distribution
Result… from the context menu.
Viewing a If you have saved Final Values for an output, and you have run multiple
Distribution Summary realizations, you can display a distribution result by right-clicking on the output
(in a browser or the output interface), or the element (if the output is the
element's primary output) and selecting Final Value| Distribution Result…
from the context menu. By default, a Distribution Summary will be displayed.
The Distribution Summary view of a distribution result is very similar to the
Distribution dialog used for defining a Stochastic element.
Read more: Specifying the Distribution for a Stochastic Element (page 142).
A Distribution Summary looks like this:
The preview pane (in the upper right-hand corner of the screen) shows a preview
of the chart view of the distribution. You can copy the preview pane to the
clipboard using Ctrl+C.
The statistics for the distribution (Mean, Standard Deviation, Skewness, and
Kurtosis) are shown directly below the distribution's percentiles. The
significance of these four statistics is described in Appendix A. The number of
realizations (Num. Reals) is also indicated.
The Calculator section of the window allows you to compute the value
associated with a particular percentile or the percentile associated with a
particular value:
Enter the percentile in the Cum. Prob. field and the corresponding value will be displayed in
Value OR Enter the value in the Value field and the corresponding percentile will be
displayed in Cum. Prob.
The Calculator also displays the Probability Density and the Conditional Tail
Expectation for the specified Cumulative Probability/Value pair. The
Conditional Tail Expectation is the expected value of the output given that it lies
above a specified Cumulative Probability. That is, it represents the mean of the
worst 100(1 - α)% of outcomes, where α is the specified Cumulative Probability.
The Distribution Summary has a variety of buttons at the top of the window,
some of which are common to all result windows, and some of which are
specific to this window:
Note: The PDF view histogram is created by placing all of the realizations into a
discrete number of "bins" (represented by each bar in the histogram). The
number of bins used to create the PDF view histograms is controlled via the
Results tab of the Options dialog (accessed from the main menu via Model |
Options…) in the field marked “Number of bins drawn in PDF view”. This is
discussed in detail in Appendix B.
Note that for a CDF, if Show Marker is checked below the preview, the
particular value/percentile entered in the Calculator section is indicated on
the plot.
CCDF View: This displays the preview pane as a complementary
cumulative distribution function (CCDF):
Note: You can also toggle between the three types of distribution views (PDF,
CDF, CCDF) using the PgUp and PgDn keys.
Chart/Summary: This switches to a Chart view of the result. You can also
toggle between the Distribution Summary View and the Chart View by
pressing Ctrl+Shft+T. or by double-clicking in the preview pane.
Read more: Viewing a Distribution Chart (page 429).
Result Properties: This provides access to a dialog for modifying the result
display in a variety of ways (e.g., adding additional outputs to the chart,
converting the chart to a Result element).
Table View: This switches to a Table view of the result.
Read more: Viewing a Distribution Table (page 432).
If you check Confidence Bounds below the preview pane (or press
Ctrl+Shft+B), GoldSim will display confidence bounds on the CDFs and PDFs,
as well as the confidence bounds on the mean. These bounds reflect uncertainty
in the probability distribution due to the finite number of Monte Carlo
realizations (as the number of realizations is increased, the uncertainty in the
distribution decreases). For CDFs and CCDFs, the confidence bounds represent
the 5% and 95% confidence limits on the distribution. The calculation of
confidence bounds is discussed in detail in Appendix B.
Editing the Distribution You can control the appearance of the preview pane of a Distribution Summary
Preview Chart by pressing the Edit Preview Style… button at the top of the Distribution
Summary window.
The following dialog is displayed:
You can control the scale and type (logarithmic or linear) of the X and Y-axes.
If Auto is checked, GoldSim automatically sets the scale.
Viewing a You can view a distribution chart by pressing the Chart/Summary button or
Distribution Chart double-clicking on the preview pane in the Distribution Summary window, or by
pressing the Chart View button in the Table View window.
Note: You can modify the default so that a chart or a table (rather than the
distribution summary) is displayed when you select Final Value | Result
Distribution… from the context menu.
PDF View: This displays the chart as a probability density function (PDF).
CDF View: This displays the chart as a cumulative distribution function
(CDF).
CCDF View: This displays the chart as a complementary cumulative
distribution function (CCDF).
Note: You can also toggle between the three types of distribution views (PDF,
CDF, CCDF) using the PgUp and PgDn keys.
Note: The PDF view histogram is created by placing all of the realizations into a
discrete number of "bins" (represented by each bar in the histogram). The
number of bins used to create the PDF view histograms is controlled via the
Results tab of the Options dialog (accessed from the main menu via Model |
Options…). In this dialog, you can select the “Number of bins drawn in PDF
view”. The details of how GoldSim constructs a PDF histogram is discussed in
detail in Appendix B.
Two context menu items for the distribution chart are of particular note:
• If Show Marker is checked, the particular value/percentile entered in
the Calculator section of the Distribution Summary window is
indicated on the CDF views.
• If Confidence Bounds is checked, GoldSim will display confidence
bounds on the probability curves. You can also toggle the confidence
bounds on and off by pressing Ctrl+Shft+B. These bounds reflect
uncertainty in the probability distribution due to the finite number of
Monte Carlo realizations (as the number of realizations is increased, the
uncertainty in the distribution decreases). For CDFs and CCDFs, the
confidence bounds represent the 5% and 95% confidence limits on the
distribution. The calculation of confidence bounds is discussed in detail
in Appendix B.
Plotting Condition Condition outputs are either True or False and are typically used as state
Distributions variables or flags in a simulation. As a result, in some situations, you may want
to save and plot distributions of conditions. To facilitate this, when plotting a
distribution of a condition, GoldSim plots True as 1 and False as 0.
When viewing a distribution of conditions in the Distribution Summary dialog,
within the Percentile portion of the window, GoldSim does not display
percentiles; rather it displays the probability of True and False:
The displayed Mean is actually computed as the probability of being True. The
other statistics are not computed. GoldSim also displays the 5% and 95%
confidence bounds on the Mean.
Read more: Output Attributes (page 83); Viewing a Distribution Summary
(page 425).
Plotting Discrete Discrete distributions only take on a finite number of discrete values (i.e., they
Distributions are not continuous). GoldSim’s Monte Carlo engine includes algorithms that
attempt to identify discrete (as opposed to continuous) results, and plot them as
such.
When viewing a discrete distribution in the Distribution Summary dialog, within
the Percentile portion of the window GoldSim does not display percentiles;
rather, it displays the actual probability of each result:
You can view a distribution table by pressing the Table View button from the
Viewing a Distribution Summary or Chart View window.
Distribution Table
A distribution table looks like this:
Each row of the table is a separate realization. The header row for a table shows
the name (ID) of the result. You can increase or decrease the width of a column
by dragging the line separating columns to the right or to the left, respectively. If
the column is too narrow to display the contents of a cell, holding the cursor
over the cell displays a tool-tip with the contents.
Note: You can modify the default so that a table (rather than a Distribution
Summary) is automatically displayed when you select Final Value|Result
Distribution… from the context menu for an output.
The result array represents a sorted table of all of the results, and is used to
produce the charts and statistics for the distribution. The table shows the value,
the weight, the number of occurrences of the value, the cumulative probability
of the value, and, if confidence bounds are selected, the 5% and 95% confidence
bounds for the value at that cumulative probability.
You can increase or decrease the width of a column by dragging the line
separating columns to the right or to the left, respectively. If the column is too
narrow to display the contents of a cell, holding the cursor over the cell displays
a tool-tip with the contents.
Two of the buttons available at the top of the table are unique to this table and
are worth noting:
Sort Ascending: This sorts the rows in ascending order (by the first
column).
Sort Descending: This sorts the rows in ascending order (by the first
column).
The manner in which the results array is created and used is discussed in detail
in Appendix B.
Note: You can copy the contents of a distribution result array table to the
clipboard (by pressing the Copy button in the display or pressing Ctrl+C). You
must first select the cells you wish to copy. You can do so by placing your
cursor in one cell and dragging to another location. You can select the entire
table by pressing Ctrl+A. Selected items will be highlighted in black. You can
subsequently paste the table into another application (such as a spreadsheet).
Viewing Distributions It is often useful to plot the distributions of multiple outputs on a single plot.
of Multiple Outputs Plotting multiple distributions on a single chart allows you to more directly
compare and contrast the results.
1. Once you are viewing a distribution chart or table, you can add an
additional output to the chart or table by accessing the Result Properties
The selected outputs are listed in the Output grid. You can show the full path for
each output (showing the containment hierarchy) by checking the Show Full Path
box. You can also specify the display units for the results.
GoldSim will automatically display the results and add the output IDs
to a legend. For tables, the outputs are listed in separate columns.
A browser will then appear allowing you to select a variable (i.e., another output
in the model). After doing so, the following dialog is displayed:
If you check the Show full path option, the full paths of the outputs are shown here and in
headers for Multi-Variate result tables.
From this dialog, you can add additional variables (or delete variables using the
Add… and Delete buttons.
You use the dialog to select which of the five types of multi-variate results you
wish to view:
• 2D Scatter Plot Chart;
• 3D Scatter Plot Chart;
• Sensitivity Analysis Table;
• Correlation Matrix Table; or
• Raw Data Table.
Note: Depending on how many variables you have selected, some of the buttons
may be disabled (grayed out). For example, in order to display a 3D Scatter Plot,
you must have at least two variables selected. Furthermore, none of the buttons
are available if you have no variables selected.
You can add as many variables as desired. For 2D and 3D scatter plots, only the
first one or two variables, respectively, will be used. For a Correlation Matrix,
Sensitivity Analysis, or a Raw Data Display, however, all of the variables are
used.
The Add All Stochastics button adds all Stochastic elements in the model to the
list of variables.
The Analyze based on ranks and Analyze based on values radio buttons
control whether correlation analysis, sensitivity analysis and scatter plots are
based on ranks or values (these radio buttons do not affect the raw data display).
When viewing an interactive result, pressing Create Result Element creates a
Result element and prompts you for a Container to place it in.
For the purpose of creating scatter plots, the variables must be assigned to
specific axes. The result (the output from which you selected Final
Value|Multi-Variate Analysis…) is assigned to the Y-axis (i.e., the vertical
axis). The first variable that you select is assigned to the X-axis, and the second
variable you select is assigned to the Z-axis. Additional variables are not
assigned to any axis. You can subsequently reassign different variables to the X
and Z axes.
Reassigning Variables For the purpose of creating scatter plots, the variables must be assigned to
to Axes for Scatter specific axes. The result (the output from which you selected Final
Plots Value|Multi-Variate Analysis…) is assigned to the Y-axis (i.e., the vertical
axis). The first variable that you select is assigned to the X-axis, and the second
variable you select is assigned to the Z-axis. Additional variables are not
assigned to any axis.
After adding input variables within the Multi-Variate Result properties dialog,
however, you can reassign axes as follows:
1. Select a variable that you wish to move by left-clicking in the variable
number column to the left of the output.
2. Release the left mouse button to complete the selection. The selected
variable will be highlighted.
3. Left-click in the variable number column of the selected variable, and
Move Item cursor keep the button depressed. The Move Item cursor appears.
4. Keeping the button depressed, move the cursor to the location in the list
where you wish to move the variable (recall that the first item in the list
is always the X axis, and the second is always the Z axis). A red line
will indicate where the variable will be moved to.
5. Release the left mouse button to complete the move.
Viewing a 2D Scatter A 2D Scatter Plot can provide a powerful visual image of the relationship
Plot between two variables (outputs).
If you press the 2D Plot… button from the Multi-Variate Result dialog, a chart
such as this is displayed:
The buttons at the top of the 2D scatter plot chart display window provide access
to specialized dialogs and/or allow you to carry out specific actions relative to
the chart.
Note: You can control whether the scatter plot displays the values or the ranks
of the variable and the result by selecting the appropriate choice from the
Analyze based on ranks and Analyze based on values radio buttons in the
main Multi-Variate Result dialog.
Viewing a 3D Scatter A 3D Scatter Plot (or a Cloud Plot) allows you to visualize the relationship
Plot between three variables (i.e., two input variables and an output variable).
If you press the 3D Plot… button from the Multi-Variate Result dialog, a chart
such as this is displayed:
The buttons at the top of the 3D scatter plot chart display window provide access
to specialized dialogs and/or allow you to carry out specific actions relative to
the chart.
Read more: Using Buttons in Chart Display Windows (page 404).
You can rotate the three dimensional image using the Up, Down, Left and
Right arrow keys, or by holding down the left mouse button and dragging
within the chart.
Note: You can control whether the scatter plot displays the values or the ranks
of the variables and the result by selecting the appropriate choice from the
Analyze based on ranks and Analyze based on values radio buttons in the
main Multi-Variate Result dialog.
Manipulating 3D Scatter 3D scatter plots have several hot-keys which can be used to modify the plot:
Plots
Keys Action
Ctrl+D Toggles the drop lines (the lines drawn from each point to the base of
the axis) on and off.
Ctrl+S Toggles between a 3D scatter plot and a 2D scatter plot.
Ctrl+P Affects the way in which the 3D chart is rotated. If it is toggled on, all
of the data is shown as you rotate the image (which can be very slow
on less powerful machines). If it is toggled off (the default), only the
cube surrounding the data is shown as you rotate the image.
These three options are also available on the context menu for the chart (as
Drop Lines, Rotate Full and 2D/3D, respectively.
Viewing a Sensitivity One of the most powerful options for analyzing multi-variate results is to carry
Analysis Table out a sensitivity analysis. GoldSim provides a number of statistical sensitivity
analyses through the multi-variate result display option.
If you press the Sensitivity Analysis… button from the Multi-Variate Result
dialog, a table such as this is displayed:
This table displays measures of the sensitivity of the selected result (the output
from which you selected Final Value|Multi-Variate Analysis…) to the
selected input variables.
Note: You can control whether the sensitivity analyses are based on the values
or the ranks of the variables and the result by selecting the appropriate choice
from the Analyze based on ranks and Analyze based on values radio buttons
in the main Multi-Variate Result dialog. The selection is indicated at the top of
the Sensitivity Analysis dialog (“Analysis is based on”).
Note: You can copy the contents of a sensitivity analysis table to the clipboard.
To do so, you must first select the entire table (by double-clicking on the empty
cell in the upper left-hand corner of the table, or by pressing Ctrl+A). After you
do so, you can copy the table to the clipboard by Ctrl+C). You can subsequently
paste the table into another application (such as a spreadsheet).
Like all result tables in GoldSim, this table can be sorted in ascending or
descending order by clicking on a column header. That column then becomes
the sort key for the table (all columns are sorted based on that column).
Whenever the data is sorted, the header of the sort key is shown in red:
If you have saved final values at the end of phases, an additional drop-list is
added to the display window to allow you to select the set of data (i.e., the time
point defined by the phase end time) that you would like to analyze.
Read more: Defining Time Phases (page 346).
Note: The sensitivity analyses presented here are statistical measures computed
by analyzing multiple realizations of the model in which all of the Stochastic
variables are simultaneously sampled each realization. GoldSim also provides a
second type of sensitivity analysis in which you can vary one variable at a time,
while holding all other variables constant.
Note: If you need to carry out more advanced sensitivity analyses, you can do so
by exporting all results and using a third party analysis tool.
Read more: Running Sensitivity Analyses (page 384); Exporting Results (page
471).
Viewing a Correlation A Correlation Matrix tabulates the statistical correlation between two or more
Matrix Table variables.
If you press the Variable Correlations…button from the Multi-Variate result
properties dialog, a correlation matrix table is displayed.
The correlation matrix consists of a table whose column and row headers are
identical, and consist of all of the selected variables (as well as the selected
result variable). The table entry for a particular row/column pair is the
correlation coefficient for that pair of variables. The correlation coefficient takes
on a value between –1 and 1, 1 being a perfect positive correlation, -1 being a
perfect negative correlation.
Note: You can control whether the correlation coefficients are based on the
values or the ranks of the variables and the result by selecting the appropriate
choice from the Analyze based on ranks and Analyze based on values radio
buttons in the main Multi-Variate Result dialog. The selection is indicated in
the header of the dialog (in this example, “Value Correlation” is displayed).
Note: This is the same analysis presented in the Sensitivity Analysis table (in the
Correlation Coefficient column), but is presented in terms of a matrix here,
showing how all variables are correlated to each of the others. The Sensitivity
Analysis table simply shows how a single result variable is correlated to the
others (i.e., it shows one column of the matrix).
Note: If you check the Show full path box in the Properties dialog for a Multi-
Variate Result, the full path of the outputs will be shown in the header row and
column for the Correlation Table.
The buttons at the top of the correlation matrix table window provide access to
specialized dialogs and/or allow you to carry out specific actions relative to the
table.
Read more: Using Buttons in Table Display Windows (page 404).
Viewing a Raw Multi- If you press the Raw Data… button from the Multi-Variate result properties
Variate Data Table dialog, a table such as this is displayed.
Each row of the table is a different realization, while the columns show the
values of the selected outputs. The selected result is shown in the first column,
and the selected variables are shown in the other columns.
You can increase or decrease the width of a column by dragging the line
separating columns to the right or to the left, respectively. If the column is too
narrow to display the contents of a cell, holding the cursor over the cell displays
a tool-tip with the contents.
Note: If you wish to change the number of significant figures displayed in the
figure, You can do so by selecting Ctrl+Shft+S when viewing the table.
Note: If you check the Show full path box in the Properties dialog for a Multi-
Variate Result, the full paths of the outputs will be shown in the header row for
the Raw Data Table.
Like all result tables in GoldSim, this table can be sorted in ascending or
descending order by clicking on a column header. That column then becomes
the sort key for the table (all columns are sorted based on that column).
Whenever the data is sorted, the header of the sort key is shown in red:
The buttons at the top of the raw data table window provide access to
specialized dialogs and/or allow you to carry out specific actions relative to the
table.
Note: You can copy the contents of a raw data table to the clipboard (by
pressing the Copy button in the display or pressing Ctrl+C). You must first
select the cells you wish to copy. You can do so by placing your cursor in one
cell and dragging to another location. You can select the entire table by pressing
Ctrl+A. Selected items will be highlighted in black. You can subsequently
paste the table into another application (such as a spreadsheet).
Note: You can modify the default so that a table (rather than a chart) is
displayed when you select View Array Final Values… from the context menu.
Manipulating Vector Vector charts have several hot-keys which can be used to modify the plot:
Charts
Keys Action
Ctrl+S Switches between a bar chart and line chart. This is also available on
the chart context menu as Show Line Chart.
Ctrl+T Adds an additional entry showing the total of all the items in the vector.
This is also available on the chart context menu as Show Totals.
Ctrl+W Increases the width of the bars in a bar chart.
Ctrl-Shft+W Decreases the width of the bars in a bar chart.
Note: The default display for a vector chart is a bar chart. You can modify the
default so that a line chart is displayed by default instead.
Key Action
F6 Increases the depth (into the page) of the bars.
Shft+F6 Decreases the depth (into the page)of the bars.
Key Action
F7 Increases the vertical inclination from which the chart is viewed.
Shft+F7 Decreases the vertical inclination from which the chart is viewed.
F8 Rotates the chart to the left.
Shft+F8 Rotates the chart to the right.
Note: The properties set by the hot-keys are saved to the Windows registry, so
that the next time you view an array chart, the properties you set the previous
time you displayed such a chart are used (e.g., inclination, rotation, depth) are
In addition to these hot-keys, the context menu for the chart (accessed by right-
clicking anywhere in the chart) provides several options, including the ability to
view the chart as a line chart (rather than a bar chart), to toggle the outlines of
the bars off and on, and to show a separate data point that sums the items in the
vector.
Viewing a Matrix If you have saved Final Values for a matrix output, you can display the final
Chart values of the matrix by right-clicking on the output (in a browser or the output
interface), or the element (if the output is the element's primary output) and
selecting View Array Final Values… from the context menu.
Read more: Saving Outputs as Results (page 365).
By default, a bar chart is displayed.
The row items are plotted along the X axis, with multiple bars for each column
item (which are identified in a legend).
Note: You can modify the default so that a table (rather than a chart) is
displayed when you select View Array Final Values… from the context menu.
The buttons at the top of the array chart display window provide access to
specialized dialogs and/or allow you to carry out specific actions relative to the
chart.
Read more: Using Buttons in Chart Display Windows (page 404).
Manipulating Matrix Matrix charts have several hot-keys which can be used to modify the plot:
Charts
Keys Action
Ctrl+S toggles between a bar chart and line chart. This is also available on the
chart context menu as Line Chart:
Ctrl+T adds additional entries showing the totals of all the rows and columns
for the matrix (as well as the total of all the items in the matrix). This
is also available on the chart context menu as Show Totals.
Ctrl+W increases the width of the bars in a bar chart.
Ctrl-Shft+W decreases the width of the bars in a bar chart.
Note: The default display for a matrix chart is a bar chart. You can modify the
default so that a line chart is displayed by default instead.
Keys Action
F6 increases the depth of the bars.
Shft+F6 decreases the depth of the bars.
F7 increases the vertical inclination from which the chart is viewed.
Shft+F7 decreases the vertical inclination from which the chart is viewed.
F8 rotates the chart to the left.
Shft+F8 rotates the chart to the right.
GoldSim also allows you to view the matrix chart as a stacked bar chart, in
which the columns are plotted as another dimension (rather than parallel bars).
In a stacked bar chart for a matrix, the values of the matrix items are plotted
along the (vertical) Y-axis, the row items are plotted along the X-axis, the
column items are plotted along the Z-axis.
Ctrl+M switches between a normal bar chart and a stacked bar chart. This also
is available by toggling Show 3D from the context menu for the chart.
You can rotate the three dimensional image using the Up, Down, Left and Right
arrows keys, or by holding down the left mouse button and dragging within the
chart. You can force this rotation to be along the X, Y or Z axes by holding one
of these keys down as you rotate.
The following hot-keys can be used to manipulate the stacked (3D)bar chart:
Keys Actions
Ctrl+P (or Show Full in the context menu) affects the way in which the 3D chart
is rotated. If it is toggled on, all of the data is shown as you rotate the
image (which can be very slow on less powerful machines). If it is
toggled off (the default), only the cube surrounding the data is shown as
you rotate the image.
F6 increases the depth (into the page) of the bars.
Shft+F6 decreases the depth (into the page) of the bars.
Note: The properties set by the hot-keys are saved to the Windows registry, so
that the next time you view an array chart, the properties you set the previous
time you displayed such a chart are used (e.g., inclination, rotation, depth) are
In addition to these hot-keys, the context menu for the chart (accessed by right-
clicking anywhere in the chart) provides several options, including the ability to
view the chart as a line chart (rather than a bar chart), to toggle the outlines of
the bars off and on, and to show a separate data point that sums the items in the
matrix.
Plotting Condition Condition outputs are either True or False and are typically used as state
Arrays variables or flags in a simulation. You can create arrays of conditions, and, in
some situations, you may want to save and plot these arrays. To facilitate this,
when plotting an array of a condition, GoldSim plots True as 1 and False as 0.
Viewing an Array You can view an array table by pressing the Table View button from the chart
Table display window.
An array table for a vector looks like this:
The column header is the name of the output. The first column shows the item
names for the vector. The Ctrl+T hot-key totals all items of the vector (and
displays it as a separate row).
An array table for a matrix looks like this:
The first row shows the item names for the columns. The first column shows the
item names for the rows. The Ctrl+T hit-key displays the totals for each row
and column of the array.
Note: You can modify the default so that a table (rather than a chart) is
automatically displayed when you select View Array Final Values… from the
context menu for an output.
Viewing Multiple If you have run (and saved) multiple realizations, a realization control is added
Realizations of Array to the top of the chart display window for an array chart.
Final Values
The control is also added to the Table view for the array.
You can type in a specific realization (and press Enter), move upward or
downward through the available realizations using the spin control, or use the
F2 and F3 keys to view the previous or next available realization, respectively.
Note: You can only view those realizations which are available (i.e., those
which have been saved and have not been screened out).
Viewing the If you click on the Result Properties button when viewing an Array Result chart
Properties of an or table, the properties dialog for the result will be displayed.
Array Result
Selecting the Chart Style… button in any chart (or right-clicking on any chart and
selecting Edit Chart Style from the context menu) displays the Chart Style dialog
Chart Style… button for editing the appearance of the chart.
This dialog allows you to edit the appearance of the chart (e.g., by modifying
headers, footers, axis labels and scales, legends, etc.). To make it easier to
modify and customize your charts, the same tabbed dialog is used for all chart
types in GoldSim; some of the tabs and/or options, however, are hidden for
those charts for which they are not applicable.
Note: When this dialog is displayed, a scaled down "preview" chart is placed to
the immediate right of the dialog. If you modify some part of the chart's
appearance using the dialog and press the Apply button, the change is applied to
this preview chart. This allows you to view changes without closing the dialog.
The dialog has a number of tabs, which are described in the following sections.
The Chart Style The General tab is shown by default when you first open the Chart Style dialog.
General Tab
By default, the Chart Area defaults to the same colors as the Window Area and
the Data Area defaults to the same colors as the Chart Area. You can specify the
colors of the Chart Area directly by clearing the Same as Window Area box.
You can specify the background color of the Data Area directly by clearing the
Same as Chart Area box.
The Foreground Color controls the text or lines that appear in the chart. The
Window Area Foreground Color controls the header, the footer and the legend.
The Chart Area Foreground Color controls the axes, the axis labels and the grid.
(The colors of the actual data lines and points are specified in the Data tab).
You can place a border around the Window Area and/or the Chart Area of a
specified style and width. You can also choose to display a bounding box around
the Data Area by checking Show axis bounding box.
The Chart Style The Header and Footer tabs are used to specify a header and footer for the chart,
Header and Footer and are identical in appearance.
Tabs
If Hide Header (or Hide Footer) is checked, the header or footer is hidden.
You can also hide or show the header or footer via the chart context menu
(under View) or via the header/footer context menu.
You enter Text for the header or footer, and determine the Justification (if it
consists of multiple lines), and Font.
You can place a border around the header or footer, and specify its Style and
Width (in terms of pixels). You can also specify the Foreground and
Background color for the header or footer (or default the colors so they use that
of the Window Area, as specified in the General tab).
Note: You can access the Header or Footer tab of the chart style dialog directly
by selecting Edit Header… or Edit Footer… from the header/footer context
menu.
Note: If you right-click within the Text edit field, a context menu providing a
list of keywords will be provided. Keywords allow you to automatically insert
text that is determined automatically by the context of the result (e.g., the
keyword %en% inserts the element name). This allows you to use a single chart
style for multiple results.
The Chart Style Axis Depending on the type of chart and the number of outputs being plotted, up to
Tabs three axis tabs may be present in the Chart Style dialog (there are always at least
two):
At the top of the dialog, GoldSim indicates what the particular axis represents,
along with its units (if applicable).
The various fields in this tab are described below:
Title: This is the axis title. If you right-click within the Title edit field, a
context menu providing a list of keywords will be provided. Keywords
allow you to automatically insert text that is determined automatically by
the context of the result (e.g., the keyword %x_unit% inserts the display
units for the output associate with the x axis). This allows you to use a
single chart style for multiple results.
Read more: Using Keywords in Styles (page 464).
Title Rotation: This is only available for the Y and Y2 axes. There are
three options: 90 (the default), in which the title is rotated and read from
bottom to top; 270, in which the title is rotated and read from top to bottom;
and None, in which the title is not rotated (i.e., is horizontal), and is placed
at the top of the axis.
Axis Font: This provides access to a dialog for specifying the font for the
axis. Note that this font is applied to all axes (i.e., all axes must use the
same font).
Hide Axis: If this box is checked the entire axis (and all annotation) is
hidden.
Logarithmic: If this box is checked, the axis is plotted logarithmically
(rather than linearly). Note that if the data set you are plotting contains
numbers which are less than or equal to zero, these points cannot be plotted
on a logarithmic axis. Therefore, if you make the axis logarithmic in such a
situation, GoldSim will omit these points from the plot (i.e., they will
appear as "holes" or "gaps" in the plot).
Note: Bar charts cannot be plotted on a logarithmic axis. For example, when
plotting a distribution chart as a PDF, the X-axis cannot be logarithmic. If you
check the Logarithmic box, it will be ignored.
Reversed: If this box is checked, the axis numbering is reversed (e.g., going
from high values to low values rather than from low values to high values).
Label Placement: This is only available for the X, Y and Y2 axes, and
determines where the axis labels are placed relative to the other
(orthogonal) axis. There are three options: On Axis (the default), in which
the labels are placed alongside the axis, Minimum (in which they are placed
at the minimum value of the other axis), or Maximum ( (in which they are
placed at the maximum value of the other axis).
Label Rotation: This determines the angle that the axis numbers are rotated.
The default is 0.
Origin Placement: This is only available for the X, Y and Y2 axes, and
determines where the axis intersects the orthogonal axis (e.g., where the X-
axis intersects Y-axis). There are three options: Minimum (the default), in
which it intersects at the minimum value of the other axis; Maximum, in
which it intersects at the maximum value of the other axis; or At Value, in
which it intersects at the Value on the other axis indicated directly to the
right.
Note: You cannot select label or origin placement for the Y axes for a time
history chart with two vertical (Y and Y2) axes.
Scale Minimum: This is the minimum value (lower bound) on the axis. If
Default is checked, GoldSim will select the value for you (based on the
range).
Scale Maximum: This is the maximum value (upper bound) on the axis. If
Default is checked, GoldSim will select the value for you (based on the
range).
Color: This is the color of the axis and all of the annotation. If Auto is
checked, the foreground color specified for the Chart Area (in the General
tab) will be used.
Axis Width: This is the width of the axis lines, in pixels
Tick Length: This is the tick length, in pixels.
Note: You can control how GoldSim numbers axes for large values using
scientific notation. By default, GoldSim indicates the power of 10 as "e±NN"
(e.g., 1.7e+05). You can, however, choose to display such numbers as a
superscript on 10 (e.g., 1.7x105) by checking Use x10 instead of e when
scientific notation is active in the Results tab of the Options dialog (accessed
from the main menu via Model|Options…).
Note: When viewing a 3D scatter plot, some of the axis options are fixed by
GoldSim and will automatically be grayed out in the X-Axis and Y-Axis tabs.
Specifying the Axis The Z-axis tab of the Chart Style dialog box is only available when viewing 3D
Appearance for 3D scatter plots and contains a subset of the options available on the other axes.
Charts
This is because the nature of a 3D plot is such that other than the title, the scale,
the font and the font size, the appearance of the axis labels in a 3D plot are fixed
by GoldSim and cannot be edited.
The various fields in this tab are described below:
Title: This is the axis title. If you right-click within the Title edit field, a
context menu providing a list of keywords will be provided. Keywords
allow you to automatically insert text that is determined automatically by
the context of the result (e.g., the keyword %x_unit% inserts the display
units for the output associate with the x axis). This allows you to use a
single chart style for multiple results.
Read more: Using Keywords in Styles (page 464).
Axis Font: This provides access to a dialog for specifying the font for the
axis. Note that this font is applied to all axes (i.e., all axes must use the
same font).
Hide Axis: If this box is checked the entire axis (and all annotation) is
hidden.
Scale Minimum: This is the minimum value (lower bound) on the axis. If
Default is checked, GoldSim will select the value for you (based on the
range).
Scale Maximum: This is the maximum value (upper bound) on the axis. If
Default is checked, GoldSim will select the value for you (based on the
range).
Grids (XY-Plane, XZ-Plane, YZ-Plane): This determines if grids are
shown for the specified planes. If checked, the grids are shown.
Show Drop Lines: If his box is checked, GoldSim will draw a line from the
data point to the XY-plane.
The Chart Style The Legend tab of the Chart Style dialog is used to specify the legend for the
Legend Tab chart, and is only available for those charts for which a legend is applicable.
If Hide Legend is checked, the legend is hidden. You can also hide or show the
legend via the chart context menu (under View) or via the legend context menu.
You enter the Title for the legend, and determine its Font. If the Reverse Order
box is checked, the items of the legend are listed in reverse order.
The Position field allows you to place the legend at various locations around the
chart (Top, Bottom, Right, Left, etc.). The Orientation of the items in the
legend can be specified as being vertical or horizontal.
You can place a border around the legend, and specify its Style and Width (in
terms of pixels). You can also specify the Foreground and Background color
for the legend (or default the colors by selecting Auto so they use that of the
Window Area, as specified in the General tab).
Note: You can access the Legend tab of the chart style dialog directly by right-
clicking in the legend in the chart and selecting Edit Legend… from the context
menu.
The Chart Style Grid The Grid tab of the Chart Style dialog is used to specify the grid for the chart.
Tab
Note that the grid lines are specified for each axis (and are perpendicular to the
axis).
You can specify the Line Style and Line Width (in terms of pixels). You can
also specify the Color for the grid lines.
You specify the Spacing of the grid lines in terms of the actual units for the data
assigned to the axis.
If Auto is checked, GoldSim automatically computes an appropriate spacing
based on the data range, defaults the color so it uses the Chart Area foreground
color (as specified in the General tab), and resets the Line Style and Line
Width to default settings.
The Chart Style Data The Data tab of the Chart Style dialog is used to specify how the data itself is
Tab shown in the chart.
Note: The Data tab is not available when viewing a single output with more than
100 realizations. In this case, the Data style is fixed.
On the left side of the dialog, you select the data set whose appearance you wish
to modify. There will be multiple data sets if, for example, you are plotting a
vector (one for each item of the vector), multiple outputs (one for each output),
and in some cases (i.e., if the number of realizations is less than 20 and one
output is selected), multiple realizations (one for each realization).
Note: For some types of charts, some of the data sets must be accessed by first
selecting the Secondary Style from the drop list in the upper left-hand corner of
the dialog. In particular, when plotting multiple time histories (using two Y
axes), the Y2 axis items are accessed via the Secondary Style. Also, when
viewing probability histories, the mean and the median data styles are accessed
via the Secondary Style
For each data set, you can select the Line Style (e.g., solid, dashed, etc.), the
Line Width (in pixels) and the Line Color. You can also choose to plot a
symbol at the data points (the default is no symbol is shown), and select a
Symbol Style (e.g., square, solid circle, etc.), Symbol Size (in pixels), and
Symbol Color.
For array charts, you can also choose the Fill Style. The selected line color is
used as the fill color.
Note: Although PDF histograms appear as bar charts, you cannot use the Data
tab to modify the fill style.
The Reset… button provides access to a dialog that allows you to reset all of the
data sets in the chart to a single specified style, or back to their default styles:
Pressing the OK button resets all Data styles to the single identical style
identified on the right side of the page. Pressing Set Default Styles resets all
data styles back to their default styles (overriding any changes that were
previously made). Pressing Cancel closes the dialog without making any
changes.
2. To save a style, press the Save Style… button. The following dialog is
displayed:
3. Type in a style name (to create a new style) or select an existing style
from the drop list (to overwrite an existing style).
4. Press OK to save the style.
Note: Styles store all the information required for all types of charts. Hence, any
style can be applied to any kind of chart. In practice, however, you will typically
create and apply different styles for different types of charts in order to better
customize their appearance.
Using the Style The GoldSim Style Manager is used to manage all of your styles. You can use
Manager the Style Manager to edit and create styles, import and export styles, and define
default styles.
The Style Manager is accessed from the main menu via View|Style Manager…,
by pressing F8, or by pressing the Style Manager button in the Standard toolbar.
Style Manager button
The Style Manager consists of two tabs: Edit Style and Style Options. The Edit
Style tab lists all of the styles in your model (including the "built-in" styles
provided by GoldSim). When you select a style, a preview (using a simple
default data set), showing its primary attributes is shown in the Preview window.
You can also enter a Description for any user-defined style (in order to remind
yourself of the purpose or contents of the style).
You can delete a style by selecting it and pressing the Remove button. Note,
however, that this button is grayed out if a "built-in" style is selected ("built-in"
styles cannot be deleted).
If you right-click on one of the listed styles, a list of the Result elements which
use that style is displayed.
Read more: Creating and Using Result Elements (page 466).
Creating and Editing Although you will usually create and edit styles while you are viewing actual
Styles from the Style charts, you can also create and edit a new style (or edit an existing style) directly
Manager from the Style Manager.
You can create a new style as follows:
1. Open the Style Manager (via View|Style Manager…, by pressing
F8, or by pressing the Style Manager button in the Standard toolbar).
2. Press the New… button from the Edit Style tab of the Style Manager.
The following dialog is displayed:
3. Enter a Style Name and select the style that the new style is to be based
on (the new style will be created as a copy of the specified style).
4. Press OK. The new style will be added to the style list and selected.
You may want to edit the Description for the new file to indicate how
it should be used.
After creating a new style in this manner, you will want to edit it (since initially
it will only be a copy of an existing style). You can edit a style directly from the
Style Manager as follows:
5. Press the Edit… button from the Edit Style tab of the Style Manager.
The Edit Chart Style editing dialog is displayed.
Note: In this case, the preview shown alongside the Chart Style dialog is based
on a simple default data set.
6. After editing the style using the dialog, press the Save Style… button
in the General tab of the Edit Chart dialog displays the Save Style
dialog box. The style which you originally chose to edit is shown.
Note: The default location in which the style file will be saved is specified in the
Style Options tab of the Style Manager. If desired, of course, you can also save
the style file to a different folder.
5. Enter a Style Name for the style into which you wish to import the
information contained in the style file.
6. Expand the Based on drop list to display all of the available styles
upon which you can base the new style.
7. In addition to including all of the styles, the list also includes all the
style files located in the default style file directory. (Style files are
indicated in the list in red, and include the date they were created.)
8. Select the style file that you wish to import and press OK.
The new style will be created by copying all of the information from the selected
style file. The new style will be added to the style list and selected. You may
want to edit the Description for the new file to indicate how it should be used.
Defining the Default Whenever you view a result, it will initially take on a set of characteristics
Chart Styles defined by the default chart style for that particular type of chart (e.g., time
history, distribution, etc.).
GoldSim provides four "built-in" chart styles:
• Basic Time History Style
• Basic Distribution Result Style
• Basic Multi-Variate Style
• Basic Array View Style
Initially, these four "built-in" styles are defined as the default chart styles for
each type of plot. For any type of chart, however, you can specify one of your
own custom chart styles as the default chart style for all subsequent results that
are displayed.
This is done from the Style Options tab of the Style Manager. The default styles
for each of the four types of result charts are specified at the top of this tab of the
dialog.
Note: Styles store all the information required for all types of charts. Hence, any
style can be applied to any kind of chart. In practice, however, you will typically
create and apply different styles for different types of charts in order to better
customize their appearance. Hence, it is likely that you will want to assign a
different default chart style for each type of chart.
Using Keywords in In order to facilitate the use of a single chart style for multiple results, GoldSim
Styles allows you to use keywords (delimited by the % symbol) when you create and
use chart styles. Keywords can be used in fields where titles or text is required
(e.g., headers and footers, axis labels, legend titles). For example, the keyword
%#real% inserts the number of realizations, which you could insert in a header,
as shown below:
The keyword %#real% has been specified as part of the header text.
You can access the full list of keywords which are available by right-clicking in
any Title or Text field in the chart style dialog.
A complete list of available keywords is provided below:
Keyword Description
1
%en% Element name
%on% Output name only1
%one% Element name and output name (ElementID.OutputID)1
%onf% Element name and output name with full containment path1
%ed% Element description1
%tdu% Time display unit (as specified in the Simulation Settings dialog)
%(tdu)% Time display unit within parentheses
%[tdu]% Time display unit within brackets
%x_unit% Display units for X-axis value2
%(x_unit)% Display units for X-axis value within parentheses2
%[x_unit]% Display units for X-axis value within brackets2
%y_unit% Display units for Y-axis value2
%(y_unit)% Display units for Y-axis value within parentheses2
%[y_unit]% Display units for Y-axis value within brackets2
%y2_unit% Display units for Y2-axis value2
%(y2_unit)% Display units for Y2-axis value within parentheses2
%[y2_unit]% Display units for Y2-axis value within brackets2
%z_unit% Display units for Z-axis value2
%(z_unit)% Display units for Z-axis value within parentheses2
%[z_unit]% Display units for Z-axis value within brackets2
%alr% Name of array label set for vector (name of row array label set for
matrix)
%alc% Name of column array label set for matrix
%#real% Number of realizations
Keyword Description
3
%#cr% Current realization
%#creal% Number of completed realizations
%runtime% Time simulation was started
%rundate% Date simulation was started
%runduration% Duration of simulation
%curdate% Current date
%curdatetime% Current date and time
%type% Result type4
%author% Model Author (as specified in the Information tab of the
Simulation Settings dialog)
%an_desc% Analysis Description (as specified in the Information tab of the
Simulation Settings dialog)
%filename% model filename (without extension)
%filename_ex% model filename (with extension)
%copyright% GoldSim copyright notice
%version% GoldSim version number
1
If your chart has multiple outputs, and you append an integer to the keyword (e.g.,
%on%2 ), GoldSim will insert that specific output's element name and/or output name. If
the specified output number does not exist, it will use the first output.
2
If the axis data is dimensionless, the keyword is ignored.
3
If single realization shown, displays realization; if all realizations shown, displays number
of realizations, if all realizations shown and some screened, displays number shown out of
total; if probability histories shown, displays empty string; all other results, displays empty
string.
4
Time History, Distribution, Multi-Variate, or Array View.
If you press the Create Result Element button, you will be prompted for the
Container in which you want the Result element to be placed. Select a Container
and press OK.
You can also insert a result element into your model directly just as you would
insert any other kind of element, via the main menu or context menus:
Changing the Order of In some cases, when a Result element is being used to display multiple outputs,
Outputs in a Result you may wish to change the order in which the outputs are listed (since the
Element manner in which multiple outputs are displayed is a function of their order in the
output list):
Like an interactive result, you can also editing the appearance of the chart (e.g.,
headers, footers, etc.) and apply and save chart styles. Note, however, that
whenever you change the appearance of the chart for a result element, these
changes are automatically saved with the element. In contrast, for an interactive
result, in order to save the appearance, you need to save the properties to a chart
style, and then apply the style (manually or by default) to the result.
Viewing Result One of the key features of result elements is that they can be opened prior to the
Elements During a start of a simulation, and then viewed while they are updated dynamically as the
Simulation simulation progresses.
Note: Only charts can be viewed during a simulation. Table results cannot be
viewed in this way.
This can be particularly useful in helping you to debug a model (by examining
one or more outputs dynamically and pausing the simulation when a particular
set of conditions is reached).
It can also be instructive to dynamically display the evolution of the system
when presenting your model to others.
The dynamic display of result elements is facilitated by GoldSim’s ability to
slow down the speed of the simulation, step through a simulation one realization
or timestep at a time, and pause a resume a simulation.
Read more: Pausing and Stepping through a Simulation (page 371).
Note that you cannot open a result element while a model is running. If you
want to view a result element being dynamically updated, you must open it prior
to starting the simulation, or while the simulation is paused. If you open a result
element prior to starting the simulation and try to view a chart, the resizable
result display window will open with a message that there is no data available.
Disabling a Time If an output is linked to a Time History Result element, GoldSim automatically
History Result saves the results for the element (even if you have manually specified in the
element's property dialog or the property dialog for a parent Container that time
Element histories are not to be saved).
Read more: Saving Outputs as Results (page 365); Controlling Result Flags for
Elements in the Container (page 131).
Under some circumstances, you may want to temporarily disable saving the
results for an element that is linked to a Time History Result element (e.g., if
you wish to run a large number of realizations).
You can do this by checking the Disable Element checkbox at the bottom of the
Time History Result element:
Note that you can enable or disable all of the Time History Result elements
within a Container directly from the Container's property dialog.
Controlling Result Flags for Elements in the Container
Exporting Results
In some cases, rather than using the result plotting and post-processing
capabilities provided by GoldSim, you may wish to plot, analyze, or store the
results using a separate program, such as a spreadsheet, a database, or statistical
analysis package.
To facilitate this, GoldSim provides three flexible methods for exporting results
in the form of an ASCII or binary file, an MS-Excel file, or an Access database
file. The three methods are as follows:
Exporting Results to a Text File, Binary File or Database. You can use
a Results Export Wizard to export all results (i.e., all timesteps, all
realizations, all elements) or a subset of them (i.e., selected timesteps,
realizations and elements) to one of three defined formats (an ASCII file, a
binary file, or an Access database file. This export is triggered manually
while in Result Mode.
Exporting Time Histories from a Time History Result Element. You
can export outputs that are specified within a Time History Result to an
MS-Excel spreadsheet file or an ASCII text file. Both time history data and
probability histories (statistics) can be exported. This export can be set to
occur automatically at the end of a simulation, or can be triggered manually
while in Result Mode.
Exporting Results Using a Spreadsheet Element. You can export
specified GoldSim outputs to an MS-Excel spreadsheet file using a
Spreadsheet element. Any GoldSim output can be exported in this way. By
using the built-in capabilities of Spreadsheet elements (in particular, the
ability to specify dynamic offsets), time histories and/or multiple
realizations can be output. This export occurs automatically during the
simulation.
3. The second page of the wizard allows you to select which elements you
would like to export. If you select a Container, all of the elements
within the Container will be exported. If you deselect a Container, only
those elements that you specifically select within the Container will be
exported.
If only some (but not all) of the elements in a Container have been
selected, the checkbox for the Container will be checked and grayed
out.
Note: When exporting to a text file, this page will also include an option to
select the number of significant figures exported.
4. The third page of the wizard displays all of the timesteps for which
results have been saved. You can choose to export all or a subset of the
timesteps. (Note that if you have saved final values for phases,
timesteps associated with the end of each phase will be identified.)
After selecting the timesteps you wish to export, press the Next button.
5. The fourth page of the wizard displays all of the available realizations.
You can choose to export all or a subset of the available realizations.
After selecting the realizations you wish to export, press the Next
button.
Note: If you have applied a screening condition to the results, the Apply
screening conditions checkbox will be available in the fourth page of the
wizard (otherwise it will be grayed out). Checking this box applies the screening
conditions, and only the realizations that meet the conditions will be displayed
in the list. You can view and/or edit the screening conditions by pressing the
View/Edit Screening Conditions… button.
7. You specify the filename to which the results will be exported on the
final page of the wizard. By default, the filename will be “Results”, and
will be placed in the same directory as the model file. The default
extension is “txt” for the ASCII file, “dat” for the binary file, and
“mdb” for the Access database file. You can specify a different
filename (and path) by pressing the Browse… button. Pressing Finish
completes the result export process.
The formats for the three types of result export files are described in detail in
Appendix E.
You can export outputs that are specified within a Time History Result to an
Exporting Time MS-Excel spreadsheet file or an ASCII text file. Both time history data and
Histories from a Time probability histories (statistics) can be exported. This export can be set to occur
History Result automatically at the end of a simulation, or can be triggered manually while in
Element Result Mode.
To enable this capability for a Time History Result element, select either “MS-
Excel” or “ASCII Text File” from the Export Result To drop-list at the bottom
of the Time History Result element dialog:
By default, this is set to “None”. When you select one of the other three
options, a new tab for specifying the details of the export is added to the dialog.
These tabs are described in the sections below.
Exporting Time Once you have enabled spreadsheet result export for a Time History Result
Histories from a Time element by selecting “MS-Excel” from the Export Result To drop-list at the
History Result Element bottom of the Time History Result element dialog, an “Export to MS-Excel” tab
to a Spreadsheet is added to the dialog:
You first select whether you wish to export Data Histories, Statistics Histories,
or both. If Data Histories are selected, all outputs associated with the Time
History Result element will be exported for each realization and each time (plot)
point. If Statistic Histories are selected, the probability histories for each output
will be saved each time (plot) point.
Read more: Defining Plot Points (page 348).
The statistics that are saved can be viewed and edited by pressing the Select
Statistics… button (this information is also available via the Display settings
for probability histories button on the Results tab of the Options dialog):
Read more: Selecting Percentiles and Options for Probability Histories (page
418).
These settings are global, so that any changes you make here will affect the
percentiles exported by all Time History Result elements.
Note: You must run at least 5 realizations in order for Probability Histories
(Statistics Histories) to be computed. If you run less than 5 realizations, they
will not be computed (or exported).
Note: Within the Probability Histories dialog shown above, you can specify how
many plot points are used to generate plots. This is only used when generating
plots and tables, and does not affect how many plot points are exported for
Statistics Histories.
After specifying the type of results that you wish to export, you must specify the
Excel filename to which you wish to export. You can enter the name of a
Microsoft Excel spreadsheet file to which you wish to link by pressing the
Options >> button. This will provide options for either selecting an existing
file, or creating (and then selecting) a new file. You can also type in the name
of a file directly. In this case, you must provide a full or relative path (relative
to the model file).
The Excel file does not need to exist prior to the export. If you type in a file that
does not exist, GoldSim will create it at the time of export. The filename that
you enter can contain one or more of the following keywords which will be
replaced with the appropriate text at the time of export:
Keyword Description
%en% The name of the Result element
%filename% The name of the GoldSim file (without the extension)
%curdate% The simulation start date
Keyword Description
%curedatetime% The simulation start date and time
If the file exists at the time of export, it will be overwritten by the new data. If
Confirm before overwriting contents of an existing file is checked, GoldSim
will confirm before doing so.
In addition to specifying the Excel filename, you must also specify the Starting
Location (the sheet and starting cell) where the data is to be exported. If the
Excel file already exists, you can use the Location… button, which opens the
spreadsheet and provides a dialog allowing you to directly select the desired cell
using your mouse. If the Excel file does not exist, you must manually enter the
sheet name and starting cell.
Data can be exported either in Columns (like it is within an actual GoldSim
table) or in Rows.
Note: Excel is limited to 65,536 rows and 256 columns. Therefore, data will
usually be exported in columns. Exporting in columns allows a maximum of
65,534 plot points to be exported (one row is reserved for a header, and one row
is reserved for a spacer at the bottom). Exporting in rows allows 254 plot points
to be exported (one column is reserved for a header, and one column is reserved
for a spacer at the bottom). If the data will not fit in the spreadsheet due to one
of these limitations, a warning message will be written to the screen (if
Exporting manually) or the Run Log (if exporting automatically).
There are two ways to export data: manually and automatically. This is
determined by the Export automatically when simulation completes
checkbox. If this box is cleared, GoldSim only exports the data if and when you
press the Export Now button on the Result element dialog. If this box is
checked, however, GoldSim automatically exports that data at the end of the
simulation. When it exports the data in this way, any errors it encounters (e.g.,
running out of space in the spreadsheet) are written to the Run Log.
The options in the drop-list affect all Time History Result elements which are
set to export automatically when the simulation completes. The default is
“Export results after simulation”. If “Prompt before exporting results” is
selected, at the end of the simulation, you will be prompted to determine
whether or not to carry out an automatic export. If “Do not export result” is
selected, no automatic export is carried out (i.e., this overrides the selection for
each individual Result element). Pressing the Export Now button manually
exports results from all Time History Result elements which are set to export
automatically when the simulation completes.
Warning: You should never try to open a spreadsheet that is linked to GoldSim
while a simulation is running. In addition, prior to running a GoldSim model
that is linked to a spreadsheet, all referenced spreadsheets should be closed.
Exporting Time Once you have enabled text file result export for a Time History Result element
Histories from a Time by selecting “ASCII Text File” from the Export Result To drop-list at the
History Result Element bottom of the Time History Result element dialog, an “Export to Text File” tab
to a Text File is added to the dialog:
You first select whether you wish to export Data Histories, Statistics Histories,
or both. If Data Histories are selected, all outputs associated with the Time
History Result element will be exported for each realization and each time (plot)
point. If Statistic Histories are selected, the probability histories for each output
will be saved each time (plot) point.
Read more: Defining Plot Points (page 348).
The statistics that are saved can be viewed and edited by pressing the Select
Statistics… button (this information is also available via the Display settings
for probability histories button on the Results tab of the Options dialog):
Read more: Selecting Percentiles and Options for Probability Histories (page
418).
These settings are global, so that any changes you make here will affect the
percentiles exported by all Time History Result elements.
Note: You must run at least 5 realizations in order for Probability Histories
(Statistics Histories) to be computed. If you run less than 5 realizations, they
will not be computed (or exported).
Note: Within the Probability Histories dialog shown above, you can specify how
many plot points are used to generate plots. This is only used when generating
plots and tables, and does not affect how many plot points are exported for
Statistics Histories.
After specifying the type of results that you wish to export, you must specify the
filename to which you wish to export. You can enter the name of an existing
file, to which you wish to link by pressing the Options >> button. This will
provide options for either selecting an existing text file (with the extension .txt),
or creating (and then selecting) a new file. You can also type in the name of a
file directly. In this case, you must provide a full or relative path (relative to the
model file).
The file does not need to exist prior to the export. If you type in a file that does
not exist, GoldSim will create it at the time of export. The filename that you
enter can contain one or more of the following keywords which will be replaced
with the appropriate text at the time of export:
Keyword Description
%en% The name of the Result element
%filename% The name of the GoldSim file (without the extension)
%curdate% The current date
%curedatetime% The current date and time
If the file exists at the time of export, it will be overwritten by the new data. If
Confirm before overwriting contents of an existing file is checked, GoldSim
will confirm before doing so.
There are two ways to export data: manually and automatically. This is
determined by the Export automatically when simulation completes
checkbox. If this box is cleared, GoldSim only exports the data if and when you
press the Export Now button on the Result element dialog. If this box is
checked, however, GoldSim automatically exports that data at the end of the
simulation.
The options in the drop-list affect all Time History Result elements which are
set to export automatically when the simulation completes. The default is
“Export results after simulation”. If “Prompt before exporting results” is
selected, at the end of the simulation, you will be prompted to determine
whether or not to carry out an automatic export. If “Do not export result” is
selected, no automatic export is carried out (i.e., this overrides the selection for
each individual Result element). Pressing the Export Now button manually
exports results from all Time History Result elements which are set to export
automatically when the simulation completes.
Exporting Time Once you have enabled text file result export for a Time History Result element
Histories from a Time by selecting “ASCII Text File (Table Format)” from the Export Result To
History Result Element drop-list at the bottom of the Time History Result element dialog, an “Export to
to a Table File Text File (Table Format)” tab is added to the dialog:
This text file mimics what is displayed if you were to display a Table View of
the result in GoldSim. Each row (plot point) in the table is exported as a single
row in the text file (with values separated by tabs).
Read more: Defining Plot Points (page 348).
If only a single realization has been run, the results at each plot point for all
outputs are exported.
If multiple realizations have been run, the nature of the result that is exported is
a function of the number of outputs, and setting specified in the Probability
Histories dialog:
This dialog is accessed via the Display settings for probability histories button on the
Results tab of the Options dialog
Read more: Selecting Percentiles and Options for Probability Histories (page
418).
If multiple realizations have been run and the Time History Result contains
multiple outputs, a single statistic for each output is exported at each plot point.
By default, this statistic is the mean, but it can be specified in the Probability
Histories Options dialog to be a particular percentile (Display this statistical
value if multiple results).
If multiple realizations have been run and the Time History Result contains only
a single output, the information that is output is determined by whether or not
the Show percentiles instead of History for multiple realizations view is
checked. If the box is checked, GoldSim exports a column for each statistic
(selected at the top of the dialog). If the box is cleared, GoldSim exports a
column for each realization.
The Probability History settings are global, so that any changes you make here
will affect the percentiles exported by all Time History Result elements.
Note: You must run at least 5 realizations in order for Probability Histories to
be computed. If you run less than 5 realizations, they will not be computed (or
exported).
Note: Within the Probability Histories dialog shown above, you can specify how
many plot points are used to generate plots. This is only used when generating
plots and tables, and does not affect how many plot points are exported.
Having determined exactly what will be exported, you must specify the filename
to which you wish to export. You can enter the name of an existing file, to
which you wish to link by pressing the Options >> button. This will provide
options for either selecting an existing text file (with the extension .txt), or
creating (and then selecting) a new file. You can also type in the name of a file
directly. In this case, you must provide a full or relative path (relative to the
model file).
The file does not need to exist prior to the export. If you type in a file that does
not exist, GoldSim will create it at the time of export. The filename that you
enter can contain one or more of the following keywords which will be replaced
with the appropriate text at the time of export:
Keyword Description
%en% The name of the Result element
%filename% The name of the GoldSim file (without the extension)
%curdate% The current date
%curedatetime% The current date and time
If the file exists at the time of export, it will be overwritten by the new data. If
Confirm before overwriting contents of an existing file is checked, GoldSim
will confirm before doing so.
The options in the drop-list affect all Time History Result elements which are
set to export automatically when the simulation completes. The default is
“Export results after simulation”. If “Prompt before exporting results” is
selected, at the end of the simulation, you will be prompted to determine
whether or not to carry out an automatic export. If “Do not export result” is
selected, no automatic export is carried out (i.e., this overrides the selection for
each individual Result element). Pressing the Export Now button manually
exports results from all Time History Result elements which are set to export
automatically when the simulation completes.
Exporting Results An additional method that can be used to export results from GoldSim is to use a
Using a Spreadsheet Spreadsheet element. A spreadsheet element can be used to export any output to
a spreadsheet. By using the built-in capabilities of Spreadsheet elements (in
Element particular, the ability to specify dynamic offsets), time histories and/or multiple
realizations can be output.
Before copying a table, you must select the items of the table that you wish to
copy. If your cursor is simply placed in a cell of the table, only that cell will be
copied to the clipboard. You can select multiple cells in the table by placing
your cursor in one cell and dragging to another location in the table. Selected
items will be indicated in black. Double-clicking on the item in the upper left-
hand corner of the table or pressing Ctrl+A selects the entire table.
Once you have copied multiple items from a table, you can readily paste them
into a spreadsheet. The table retains its rows and columns in the clipboard, and
therefore will be correctly pasted into separate rows and columns in the
spreadsheet.
Note: The number of significant figures which is cut to the clipboard is the same
as that displayed in the table. You can control the number of significant figures
shown in the table by pressing Ctrl+Shft+S.
Note: If you press the Copy button (or Ctrl+C) from the Summary View of a
Distribution result, the percentile table is copied to the clipboard.
Exporting a Chart or You can export a chart or table to a file of a specified format. You can then
Table subsequently open and edit the file in a separate application (e.g., a graphics
package or a text editor).
To export the chart or table, simply press the Export button in the display
window.
Export button
If you are exporting a chart, you will be prompted for the graphics format. The
following choices are available:
• Windows Bitmap (BMP)
• Enhanced Windows Metafile (EMF)
• JPEG Image (JPEG)
• Portable network Graphics (PNG)
• Tagged Image File (TIF)
• Windows Metafile (WMF)
• Encapsulated PostScript (EPS)
• FlashPix format (FPX)
• Adobe PhotoShop (PSD)
Table files are saved as space-delimited ASCII files.
Printing a Chart or Pressing the Print button in the display window prints the chart or table. A Print
Table dialog is displayed. The Properties button within the Print dialog provides
access to a dialog for controlling the orientation (portrait or landscape), page
size, and other printer-specific options.
Pressing the Edit… button for interactive results displays the Result Display
type dialog.
For a Time History, Array View and Multi-Variate chart, you can choose Chart
View or Table View as the default. For a Distribution, you can choose Chart
View, Table View, or Summary View.
The Results tab of the Options dialog also allows you to specify whether Array
View charts are plotted as bar charts or line charts by default, and the number of
bins used for PDF charts
Note: The PDF view histogram is created by placing all of the realizations into a
discrete number of "bins" (represented by each bar in the histogram). In this
dialog, you can select the “Number of bins drawn in PDF view”. The details of
how GoldSim constructs a PDF histogram is discussed in detail in Appendix B.
David Hilbert
Chapter Overview
A model which cannot be easily explained is a model that will not be used or
believed. As a result, GoldSim was specifically designed to allow you to
effectively document, explain and present your model. You can add graphics,
explanatory text, notes and hyperlinks to your model, and organize it in a
hierarchical manner such that it can be presented at an appropriate level of detail
to multiple target audiences. This chapter describes how to use these important
features.
In this Chapter The following topics are discussed in this chapter:
• Step One: Organize Your Model!
• Displaying Your Model in a Presentation Using Full Screen View
• Adding Graphics and Text
• Modifying the Appearance of Elements
• Creating, Editing and Viewing Notes
• Adding Hyperlinks to the Graphics Pane
• Manipulating Graphical Objects
• Creating Printed Documentation
• Creating a GoldSim Player
GoldSim User's Guide Chapter 9: Documenting and Presenting Your Model • 489
Step One: Organize Your Model!
490 • Chapter 9: Documenting and Presenting Your Model GoldSim User's Guide
Step One: Organize Your Model!
This high-level container shows the "big picture" of how the company's future
income is predicted by the model, and would be of interest to all audiences. The
three Containers (Revenue, Labor_Costs, and Other_Direct_Costs) contain the
details of these three model components. The details within the Revenue
Container may be of particular interest to one individual (e.g., the sales
manager), while the contents of the other Containers may be of particular
interest to others (e.g., cost accountants). Others (e.g., financial analysts, the
CFO) may be interested in the details of all three.
Note: Even if your model was not originally organized in a top-down manner,
you can use GoldSim's Move function to add Containers and move elements into
them after your model has been built.
GoldSim User's Guide Chapter 9: Documenting and Presenting Your Model • 491
Displaying Your Model in a Presentation Using Full Screen View
492 • Chapter 9: Documenting and Presenting Your Model GoldSim User's Guide
Adding Graphics and Text
The same functions can also be accessed under Graphics|Insert in the main
menu.
Adding and editing graphic objects, text and images is discussed in the sections
below.
Adding Graphic Graphic objects can be added to the graphics pane by using the Drawing Tools
Objects toolbar (originally docked to the right of the graphics pane), or by selecting
Graphics|Insert from the main menu.
All of the graphic object buttons (or menu options) operate in the same way: when
you select a button or a menu option, the cursor changes its appearance (to a
Drawing cursor drawing cursor). Clicking in the graphics pane with the cursor allows you to insert
the object at that point.
GoldSim User's Guide Chapter 9: Documenting and Presenting Your Model • 493
Adding Graphics and Text
You can delete a graphic object by selecting it and pressing the Delete button, or
by right-clicking on it and selecting Delete from the context menu.
Adding a Line To add a Line to the graphics pane:
1. Select Line from the Drawing Toolbar or the main menu under
Graphics|Insert.
2. Place the cursor at the location in the graphics pane where you want the
line to start.
3. Left-click and drag the line to the location where you want it to end.
You can move a line by selecting it and dragging it around the graphics pane.
You can move one end of the line by selecting the line and dragging one of the
end points (vertices).
You can rotate a line by selecting the line and choosing Graphics|Rotate from
the main menu.
Read more: Rotating Objects (page 516); Changing the Appearance of
Graphic Objects (page 496).
Adding a Polyline A Polyline is a segmented line. To add a Polyline to the graphics pane:
1. Select Polyline from the Drawing Toolbar or the main menu under
Graphics|Insert.
2. Place the cursor at the location in the graphics pane where you want the
polyline to start, and click.
3. Move the cursor to the next vertex of the polyline and click.
4. After adding as many vertices as desired, move the cursor to the
location where you want the polyline to end and double-click.
You can move a polyline by selecting it and dragging it around the graphics
pane. You can move a vertex of the polyline by selecting the line and dragging
one of the vertices.
You can rotate a polyline by selecting the object and choosing
Graphics|Rotate from the main menu
Read more: Rotating Objects (page 516); Changing the Appearance of
Graphic Objects (page 496).
Adding a Polygon To add a Polygon to the graphics pane:
1. Select Polygon from the Drawing Toolbar or the main menu under
Graphics|Insert.
2. Place the cursor at the location in the graphics pane where you want
one of the corners of the polygon to be and click.
3. Move the cursor to the next vertex of the polygon and click.
4. After adding as many vertices as desired, move the cursor to the
location where you want the last vertex of the polygon to be and
double-click.
You can move a polygon by selecting it and dragging it around the graphics
pane. You can "stretch" a polygon the polygon by selecting the object and
dragging one of the "handles" (there are eight handles - one on each corner and
one on each side). Pressing the Shft key while resizing the object keeps the
same aspect ratio; pressing the Ctrl key while resizing keeps the center of the
object at the same location.
494 • Chapter 9: Documenting and Presenting Your Model GoldSim User's Guide
Adding Graphics and Text
GoldSim User's Guide Chapter 9: Documenting and Presenting Your Model • 495
Adding Graphics and Text
The Fill tab is not present when editing lines, polylines, and curves.
If the Allow Move and Allow Rotation boxes are checked (the default), you can
move and rotate the object.
If Allow Scaling is checked (the default), you can resize the object (this option
is not available for lines, polylines and curves). For objects that can be scaled, if
Lock Aspect Ratio is checked, the object keeps its aspect ratio when it is
resized.
If Lock Appearance is checked, all of these options are disabled (you cannot
move, rotate or scale the object).
The Line tab allows you to edit the appearance of the line itself (for lines,
polylines and curves) or the outline for the object (for polygons, rectangles,
closed curves, and ellipses). You can select the Color, the Style and the Width
(and for Lines and Polylines, the Line Head).
496 • Chapter 9: Documenting and Presenting Your Model GoldSim User's Guide
Adding Graphics and Text
You can change the line's color, style and width. However, the style can only be
applied to 0 point lines.
Note: The default Line Head for new Lines and Polylines can be defined in the
Graphic tab of the Options dialog (accessed via Model|Options from the main
menu).
The Fill tab (which is not available for lines, polylines and curves) allows you to
change the appearance of the fill for the object.
Note: GoldSim provides two ways to add text to the graphics pane: a Text
object and a Text Box. Text objects are movable objects that can utilize a single
font. Text Boxes are scrollable boxes of text that can simultaneously utilize
multiple fonts and can be “pinned” to a specific location in the graphics pane.
GoldSim User's Guide Chapter 9: Documenting and Presenting Your Model • 497
Adding Graphics and Text
Editing Text Objects Double-clicking on a text object in the graphics pane selects the text (it will be
highlighted in blue). If you start typing while the entire text is highlighted in
blue, the text will be overwritten. Once the text is selected, clicking anywhere
within the text places the cursor at that location.
You can also use the Home, End, Backspace and arrow keys to move the
cursor in the selected text.
A single click on a text object selects the object, but does not select the text
itself. Eight "handles" will be visible, defining the limits of the textbox (one at
each corner, and one on each side).
By default, word-wrap is on, so the text will wrap around given a specified
width. As you type, the textbox will automatically expand downward.
Changing the To edit the properties of a text object (e.g., font, fill), right-click on it (to access
Appearance of Text it's context menu), and select Appearance…. The following dialog will be
Objects displayed:
If Allow Move and Allow Rotation boxes are checked (the default), you can
move and rotate the text. If Allow Scaling is checked (the default), you can
resize the textbox.
498 • Chapter 9: Documenting and Presenting Your Model GoldSim User's Guide
Adding Graphics and Text
If Lock Aspect Ratio is checked, the textbox keeps its aspect ratio when it is
resized. If Lock Appearance is checked, all of these options are disabled (you
cannot move, rotate or scale the text).
The Text tab allows you to edit the text and adjust its alignment.
You can edit the Text directly in this tab. If Multiple Lines is checked (the
default), the text object can continue onto multiple lines (either by pressing
Enter while editing it or by turning on Word-wrap). The Word Wrap checkbox
activates word wrap.
Warning: Word Wrap is ignored if Multiple Lines is turned off (cleared). That
is, your text will only wrap if you allow for multiple lines.
You can center the text horizontally in the textbox by choosing a Horizontal
Alignment option. You can center the text vertically in the textbox by choosing
a Vertical Alignment option. However, only single line text can be vertically
aligned (the option is not available if Multiple Lines is checked).
The Line tab allows you to edit the appearance of the outline for the textbox.
You can change the outline's Color, Style and Width. Note, however, that the
style can only be applied to 0 point lines.
The Fill tab allows you to change the appearance of the fill for the textbox.
GoldSim User's Guide Chapter 9: Documenting and Presenting Your Model • 499
Adding Graphics and Text
Adding and Editing Text boxes can be added to the graphics pane by using the Drawing Tools
Text Boxes toolbar (originally docked to the right of the graphics pane), or by selecting
Graphics|Insert|Text Box from the main menu.
When you select the Text Box button or menu option, the cursor changes to the
text box cursor. Clicking in the graphics pane with the cursor allows you to insert
the text object at that point.
Text box cursor
Note: GoldSim provides two ways to add text to the graphics pane: a text object
and a text box. Text objects are movable objects that can utilize a single font.
Text boxes are scrollable boxes of text that can simultaneously utilize multiple
fonts and can be “pinned” to a specific location in the graphics pane.
500 • Chapter 9: Documenting and Presenting Your Model GoldSim User's Guide
Adding Graphics and Text
At this point the text box will be inserted into the graphics pane and the dialog
for editing the text box will be displayed:
After adding text, pressing the Close button closes the dialog.
You can double-click on the dialog to edit it again. You can move a text box by
selecting it and dragging it around the graphics pane. You can resize the text
box by grabbing and dragging one of the handles of the box. You can delete a
text box in the graphics pane by selecting it and pressing the Delete button, or
by right-clicking on it and selecting Delete from the context menu.
Note: All of these operations (editing, moving, resizing, deleting) can only occur
if the size and position are not locked (i.e., the Lock size & position checkbox
is cleared).
Controlling the You can control the format of the text in a text box by using the buttons and
Behavior of Text Boxes controls at the top of the dialog. These buttons and controls are self-explanatory
(and all have tool-tips), and allow you to control the font, size, color, and
justification of the text. Note that the text can have multiple fonts, formats and
colors. You can also control these options by right-clicking on the text and
selecting options from a context menu.
Note: The default font used within the text box can be selected from the
Graphic tab of the Options dialog (accessed via Model|Options in the main
menu).
GoldSim User's Guide Chapter 9: Documenting and Presenting Your Model • 501
Adding Graphics and Text
If the Lock size & position checkbox is cleared, the text box can be edited by
double-clicking on it, can be moved by selecting and dragging, can be resized by
dragging the handles, and can be deleted by selecting and pressing the Delete
key. A text box which is not locked appears in the graphics pane like this:
You can unlock a text box in the graphics pane by right-clicking on it and
clearing the Lock size & position menu item. Likewise, you can lock a text box
in the graphics pane by right-clicking on it and checking the Lock size &
position menu item.
Adding Images In addition to adding text and graphics, you can also add images (as bitmaps and
other graphic formats) to the graphics pane.
To add an image to the graphics pane:
1. Select Image from the Drawing Toolbar or the main menu under
Graphics|Insert. A dialog is displayed for selecting the image file to
be inserted.
2. Select a file and file type to insert and press OK.
3. Place the cursor at the location in the graphics pane where you want the
center of the image to be inserted and click.
The image will be inserted into the graphics pane. You can move an image by
selecting it and dragging it around the graphics pane.
You can "stretch" (resize) an image by selecting it and dragging one of the
"handles" (there are eight handles - one on each corner and one on each side).
Pressing the Shft key while resizing the image keeps the same aspect ratio;
pressing the Ctrl key while resizing keeps the center of the object at the same
location.
Changing the GoldSim provides some capabilities for you to edit the properties and
Appearance of an appearance of an image that you have inserted into the graphics pane.
Image To edit the properties of an image in the graphics pane, right-click on it (to
access it's context menu), and select Appearance…. The following dialog will
be displayed:
502 • Chapter 9: Documenting and Presenting Your Model GoldSim User's Guide
Modifying the Appearance of Elements
If the Allow Move box is checked (the default), you can move the image.
If Allow Scaling is checked (the default), you can resize the image. If Lock
Aspect Ratio is checked, the image keeps its aspect ratio when it is resized
(scaled). If Lock Appearance is checked, both of these options are disabled
(you cannot move or scale the image).
The Image tab allows you to make one color in the image transparent. If you
check the Transparent box, and choose a Transparency Color, that color will
become transparent in the image.
Note: The Image tab is only available for bitmap and icon files. If your image is
an enhanced metafile, the image tab is replaced with a Line and a Fill tab. The
Line tab allows you control the appearance of the outline of the image. The Fill
tab allows you to control the appearance of the background of the image
(including allowing you to make it transparent).
GoldSim User's Guide Chapter 9: Documenting and Presenting Your Model • 503
Creating, Editing and Viewing Notes
One of the most powerful ways to document and visually augment your model is
to replace the default symbols with customized symbols. This is particularly
useful for Containers. For example, you may want to replace the image of a
particular Container with a schematic or diagram of the subsystem that it
represents.
Read more: Editing the Appearance of Elements (page 333).
The topics below describe how to create, edit and display notes.
Opening the Note To display, create and edit notes, you must activate the Note pane. By default,
Pane the Note Pane is turned off (hidden). The Note pane can be toggled on and off in
order to edit and view notes for your elements.
You do this by pressing the Note Pane button in the Standard toolbar, by
Note Pane button selecting View|Note|Show Note from the main menu, or selecting Note from
the toolbar context menu (accessed by right-clicking anywhere outside of the
graphics pane and browsers).
The Note pane is originally docked at the bottom of the screen. You can undock
the pane and dock it at another location on the screen (e.g., the bottom, or to the
right of the graphics pane) by grabbing the docking grab bar on the left side of
the pane (a vertical bar) and dragging the pane to the desired location. If you
press the Ctrl key while you drag the Note pane, it will become a floating
window. You can also undock the pane (and turn it into a floating window) by
double-clicking on the docking grab bar.
Whenever you select an element, the Note for that particular element is
displayed in the Note pane. The element whose Note is being displayed is
indicated in the title bar for the Note pane. If nothing is selected in the graphics
pane, the Note for the entire Container is displayed.
504 • Chapter 9: Documenting and Presenting Your Model GoldSim User's Guide
Creating, Editing and Viewing Notes
Note: The basic settings for the Note pane (its location, size and whether or not
the Editing Menus are visible) is saved to the Windows Registry, and are
therefore applied to all GoldSim files on your machine. Formatting for specific
Notes (e.g., font, format, tabs), however, is saved only with the file.
You can only enter a Note if an element is selected (or nothing is selected). If
nothing is selected, the Note is attached to the Container being viewed. If a
graphical object is selected, you will not be able to type in the Note pane (since
Notes can only be associated with elements).
In addition to typing in the Note pane, you can paste text from another Note or
another application (such as a word processor).
Once a Note has been created for an element, the element’s ID will be
underlined in the Graphics Pane and a single click on the element ID in the
Graphics Pane will open the Note pane and display the Note for that element:
By default, the ID of an element with a Note associated with it is underlined and
shown in blue (so that it looks like a hyperlink). You can modify this so that the
ID is shown in the defined text color (black by default) via an options on the
General tab of the Options dialog (accessed by selecting Model|Options from
the main GoldSim menu).
Once an element has a note associated with it, the words “Note attached” are
displayed in the tool-tip for the element in the Graphics Pane and the Browsers.
To delete a note attached to an element, simply delete all of the text in the note.
Editing and The Note Pane does not act like a text editor. Rather, it behaves like a simple
Formatting Notes word processor. That is, you can specify indents, set tabs, and format paragraphs
as you would for a word processing document.
The topics below describe how you can edit and format your Notes.
Changing the Font for You can change the font and the font size in a Note by selecting the text and
Notes choosing a font and font size from the Editing Menu.
You can also use the Bold, Italic and Underline buttons in the Editing menu to
modify text.
Additional font options can be accessed by selecting Format|Font… in the
context menu for the Note Pane (accessed by right-clicking in the text portion of
the pane) or by selecting View|Note|Format|Font… from the main menu.
GoldSim User's Guide Chapter 9: Documenting and Presenting Your Model • 505
Creating, Editing and Viewing Notes
Formatting Paragraphs You can change the alignment of a paragraph by placing your cursor in the
in Notes paragraph and selecting Left, Right, Center or Full Justification from the
Editing Menu.
You can change the indentation of the paragraph by placing your cursor in the
paragraph and dragging the First Line Indent and Left Indent tools to the left
or the right.
To view the current indents for a paragraph, simply place your cursor in the
paragraph. Note that when you drag the Left Indent tool, the First Line Indent
tool moves with it. You can, however, move the First Line Indent tool
independently (without moving the Left Indent tool).
Additional paragraph formatting options can be accessed by selecting
Format|Paragraph… in the context menu for the Note Pane (accessed by
right-clicking in the text portion of the pane) or by selecting
View|Note|Format|Paragraph… from the main menu. A dialog will be
displayed.
506 • Chapter 9: Documenting and Presenting Your Model GoldSim User's Guide
Creating, Editing and Viewing Notes
This dialog allows you to specify the justification (alignment) of the paragraph
(which can also be specified using buttons in the Note Pane Editing Menu). You
can also adjust the line spacing, specify the indents, and define the distances
from the top and bottom of the Note Pane.
Controlling the Right Because the Note pane behaves like a word processing program, each
Indent for a Note “document” (Note) has a fixed width. The text wraps to the next line when it
reaches the edge of the "page".
You control the location of the "edge" of the Note (and hence its width) by
adjusting the Right Indent tool:
Setting Tabs for a Note There are four types of tab stops you can place in your notes:
Left align tab. When you tab to this, text is left aligned to the tab stop.
Right align tab. When you tab to this, text is right aligned to the tab stop.
Decimal align tab. When you tab to this, numbers are decimal aligned to
the tab stop.
Center align tab. When you tab to this, text is center aligned to the tab
stop.
Examples of the use of these four type of tabs are shown below:
By default, Notes have Left align tabs every two ruler units. You can insert new
tabs by clicking once on the desired tab button, and then on the location in the
Indent bar (directly above the ruler) where you wish the tab to be placed.
You can move the tabs by dragging them left and right in the Indent bar. To
delete a tab, drag it from the Indent bar into the note page.
GoldSim User's Guide Chapter 9: Documenting and Presenting Your Model • 507
Adding Hyperlinks to the Graphics Pane
You can access a menu for manipulating the text by right-clicking in the Note
Copying and Pasting pane and selecting Edit from the context menu.
Text in a Note
You can use this menu to select, cut, copy, paste, delete and find text. You can
also undo and redo editing actions.
Inserting Hyperlinks One of the most powerful features of Notes is that you can insert hyperlinks to
into Notes other documents:
• To insert a link to a URL which starts with "www", you need only type
in the address (e.g., www.goldsim.com).
• To insert a link to a URL which does not start with "www", you must
specify the transfer protocol (e.g., http://website.com/).
• To insert a link to an ftp site, you need only type in the address (e.g.,
ftp.asite.com).
• To insert a link to some other document (e.g., a Word document or a
PowerPoint presentation), you must type "file://" before the document
name and one of the following:
o The full path (e.g., file://C:\Projects\Docs\report.doc).
o A relative path (e.g., file://..\Docs\report.doc), in which case
GoldSim searches relative to the current directory (the directory
from which the model file was loaded). If the model file was in
C:\Projects\Models, GoldSim would look for the document in
C:\Projects\Docs.
o No path (e.g., file://report.doc), in which case GoldSim looks only
in the current directory (the directory from which the model file
was loaded).
When you are entering a hyperlink, you must enter the link and then hit a space
for it to be recognized as a link (it will become underlined and the text will
become blue).
When you are first entering the text, do not place any spaces in the link. If the
link does contain spaces (e.g. , a filename), enter the link first without spaces, hit
a space in order for GoldSim to recognize it as a link, and then backspace to the
appropriate location to add a space.
When you click on a hyperlink in a note, GoldSim will immediately open the
application associated with the link (e.g., Internet Explorer, Word).
508 • Chapter 9: Documenting and Presenting Your Model GoldSim User's Guide
Adding Hyperlinks to the Graphics Pane
The Label appears below the Hyperlink object in the graphics pane. Note that
unlike element IDs, the label can have spaces (but it cannot be completely
empty).
The Type field contains the type of hyperlink you wish to make in the Address
field. GoldSim provides the following options:
• Web or local document: Opens a website or a document (e.g., a Word
or PowerPoint document);
• Email to…: Opens your default browser and inserts the specified email
address in the “To” field. ;
• FTP: Opens an FTP site;
• Execute Command: Opens a specific program;
• Go to Element: Jumps to a specific element and selects it. This is
useful for navigating a model.
• Open Container: Jumps to a specific Container. This is useful for
navigating a model.
• Open Dashboard: Jumps to a specific Dashboard. This is useful for
navigating a model.
You can also enter a Tooltip. This is displayed when you place your cursor
over the Hyperlink object in the graphics pane.
If the Editable check box is checked (the default), you will be able to move the
Hyperlink object around the graphics pane (and resize it). If this checkbox is
cleared, the object will be “pinned” to the location where you placed it. You can
make the object editable by right-clicking on it in the graphics pane and
checking the Editable menu item. Likewise, you can lock (make uneditable) an
editable hyperlink by right-clicking on it in the graphics pane and clearing the
Editable menu item.
After entering the Hyperlink’s properties in the dialog and pressing OK, you
will be presented with a "placement cursor". When you click with the cursor, the
Hyperlink object is inserted at that location.
GoldSim User's Guide Chapter 9: Documenting and Presenting Your Model • 509
Adding Hyperlinks to the Graphics Pane
You can access the dialog for editing the Hyperlink’s properties by selecting
Properties… from the context menu for the object.
When you double-click on a Hyperlink object, GoldSim will immediately open
the application associated with the link (e.g., Internet Explorer, Word).
You can move a Hyperlink object by selecting it and dragging it around the
graphics pane. You can resize a hyperlink by selecting the object and dragging
one of the "handles" (there are eight handles - one on each corner and one on
each side). Note, however, that these operations are only available if you have
checked the Hyperlink as being Editable.
Specifying Addresses The details regarding how the various Hyperlink types are specified are
for the Various provided below:
Hyperlink Types Web or local document: To insert a link to a URL which starts with www,
you need only type in the address (e.g., www.goldsim.com). To insert a link
to a URL which does not start with www, you must specify the transfer
protocol (e.g., http://website.com).
To insert a link to some other document (e.g., a Word document or a
PowerPoint presentation), you can provide the full path (e.g.,
C:\Docs\Projects\report.doc), or if the document is in the same directory as
the model file, you can provide just the file name. That is, if you only
provide a file name, GoldSim will look for the document in the active
directory (the directory containing the current model file). You can also use
the Browse… button to find a particular file to which you wish to create a
hyperlink.
Email to…: When you click on an email link, it opens your default email
program with the specified address in the “To” field. You should enter an
email address (e.g., support@goldsim.com).
FTP: To insert a link to an ftp site, simply type in the address (e.g.,
ftp.asite.com).
Execute Command: This allows you to run a specific application. This can
be useful, for example, if you wish to open a document with an application
which is not the default application with which the file extension is
associated:
C:\graphics\paint.exe c:\images\bitmap.doc
Note that when using this type of Hyperlink, if the filename has spaces in it,
it must be enclosed in quotation marks:
C:\graphics\paint.exe "c:\images\my bitmap.doc"
Go to Element. This causes GoldSim to immediately jump to (but not
open) the specified element. You can also specify a full path when using the
element command. When you do so, the path name must start with a
backslash:
\Container1\Container2\XYZ
Open Container. This causes GoldSim to immediately display the contents
of the specified Container. GoldSim searches upward through the
containment hierarchy from the current location and jumps to the first
Container with the specified name. If you need to be more explicit (i.e., you
have multiple Containers with the same name), you can also specify a full
path when using the Container command. When you do so, the path name
must start with a backslash:
510 • Chapter 9: Documenting and Presenting Your Model GoldSim User's Guide
Adding Hyperlinks to the Graphics Pane
\Container1\Container2\Container3
Open Dashboard. This causes GoldSim to immediately jump to the
specified Dashboard. You can also specify a full path when using the
Dashboard command. When you do so, the path name must start with a
backslash:
\Container1\Container2\InputScreen
Changing the You can edit the appearance of a hyperlink by right-clicking on the object and
Appearance of a selecting Appearance… from the context menu. The following dialog will be
displayed.
Hyperlink Object
The dialog is tabbed. The first tab (General) controls the types of changes that
can be made to the appearance of the object:
Lock Appearance: If you check this box and then close the dialog, you can
no longer move or scale the object in any way. To unlock appearance
editing, you must select Unlock Appearance from the context menu for the
object.
Allow Move: If this box is checked (the default), you can move the object
around within the graphics pane. Otherwise, its position remains fixed.
Allow Label Move: If this box is checked you can select and move the
object's label (separately from the object itself). If the box is cleared (the
default), the label can only be moved with the object itself.
Allow Scaling: If this box is checked (the default), you can change the size
of the object by selecting it and dragging one of the control handles (small
boxes on the edges of the image). Otherwise, the size is fixed.
Lock Aspect Ratio: If this box is checked (the default), the aspect ratio of
the image is locked when it is scaled. Otherwise, you can stretch the image
and change the aspect ratio.
GoldSim User's Guide Chapter 9: Documenting and Presenting Your Model • 511
Adding Hyperlinks to the Graphics Pane
The Image tab of the Hyperlink Appearance dialog allows you to change the
Changing the Hyperlink image used for the Hyperlink object in the graphics pane.
Object's Symbol
If you select the User-defined symbol radio button within this tab, you will be
prompted for the name of a file to be used for the symbol. The file must be an
enhanced Windows metafile (.emf)
Note: GoldSim utilizes enhanced metafiles for symbols because they are vector
graphics (and therefore scale without losing image quality). Most advanced
graphics programs can create enhanced metafiles (or convert other formats to an
enhanced metafile). Note, however, that unless you create the original image as
an enhanced metafile, it will not be a true vector graphic and will lose image
quality when scaling.
You can use GoldSim's graphic capabilities to convert other graphics formats to
an enhanced metafile as follows:
1. Insert a graphic image (e.g., a bitmap) into the graphics pane;
2. Select the image and click File|Export|Graphic Selection… from the
main menu;
3. Specify that you wish to save the file as an enhanced metafile.
Read more: Adding Images (page 502).
Once the symbol is defined using a user-defined symbol, you can change the
symbol by pressing Select new Image…, or you can switch back to the default
image provided by GoldSim by selecting the Default symbol button.
You can access the dialog for selecting a new image directly (without using the
Appearance dialog) by selecting Change Symbol… from the context menu for
the element.
Two additional buttons are also on the Image tab:
Reset Size: This resets the size of a scaled image back to its original size.
Reset Ratio: This resets the aspect ratio of a scaled image back to its
original ratio (by changing the symbols height).
Changing the Hyperlink Two tabs within the Hyperlink Appearance dialog control the appearance of the
Object's Label object's label. The Font tab controls the label's font.
512 • Chapter 9: Documenting and Presenting Your Model GoldSim User's Guide
Adding Hyperlinks to the Graphics Pane
You can choose one of nine positions for the label. If one of these nine positions
is not sufficient, you can manually move the label by selecting just the label and
dragging it. However, in order to manually move the label in this way, the
Allow Label Move box must be checked in the General Tab.
Changing the Hyperlink Two tabs within the Hyperlink Appearance dialog control the appearance of the
Object's Background object's background and outline. The Line tab allows you to draw a line (a box)
and Outline around the symbol and label.
GoldSim User's Guide Chapter 9: Documenting and Presenting Your Model • 513
Manipulating Graphical Objects
By default, the line is transparent. If you clear this box, you can change the line's
color, style and width. Note, however, that the style can only be applied to 0
point lines.
The Fill tab allows you to change the appearance of the fill for the symbol and
label.
The options in this menu (which are self-explanatory) can be used to align the
selected objects.
When you add an object to the graphics pane, it is assigned a particular order.
The order determines how objects are "stacked" (i.e., whether an object is in
front or behind another object) when they overlap. Higher order objects are
always placed in front of lower order objects:
With regard to order, GoldSim groups objects into three classes: 1) elements; 2)
influences; and 3) everything else (graphical objects like images and text).
Elements always have a higher order than influences and influences always have
a higher order than graphical objects. Hence, influences will always appear
behind elements, and images and text will always appear behind influences.
Within a given class of objects (i.e., elements, influences or graphical objects),
the latest object added to the graphics pane always has the highest order. Hence,
514 • Chapter 9: Documenting and Presenting Your Model GoldSim User's Guide
Manipulating Graphical Objects
if you add three circles, the first one added will have the lowest order and the
last one added will have the highest order.
Once an object is placed in the graphics pane, you can manually change its order
(within its class of objects) by selecting the object and choosing Order from the
context menu to display a submenu.
Bring to Front brings the object all the way to the front (gives it the highest
order).
Send to Back sends the object all the way to the back (gives it the lowest
order).
Bring Forward increases the object's order by one.
Send Backward decreases the object's order by one.
The order and align options are also available in the Graphical Tools toolbar:
Spacing and Sizing If multiple objects are selected, you can also choose to space them evenly
Objects (horizontally or vertically), or set their widths, heights or sizes to be identical.
These options are provided under Graphics|Layout in the main menu:
The layout options are also available from the Layout toolbar:
Precisely Moving Although you can move objects around the graphics pane by simply dragging
Objects them from one location to another, in some cases you may want to move them in
a more precise manner. To facilitate this, GoldSim allows you to move objects
vertically and horizontally using the arrow keys.
There are two modes of movement using the arrow keys:
• Using the arrow keys alone moves the object a short distance in a
horizontal or vertical direction.
• Holding the Shift key down while using the arrows increases the
distance moved by a factor of five.
Note also that when moving objects in the graphics pane, you can force their
upper left hand corner to snap to a grid.
Read more: The Graphics Pane Grid and Background (page 324).
Grouping Objects If you have selected multiple objects in the graphics pane, you can choose
Grouping|Group from the context menu of one of the objects or
Graphics|Group|Group from the main menu to group the objects. When
GoldSim User's Guide Chapter 9: Documenting and Presenting Your Model • 515
Manipulating Graphical Objects
objects are grouped, they behave as a single object. Hence, when you select one
object, all objects in the group are selected. When you edit the graphical
property (e.g., font, background color) of one object, the corresponding property
of all objects in the group is modified.
Rotating Objects You can rotate a graphic object or text object in the graphics pane by selecting
the object and choosing Graphics|Rotate from the main menu to access a
submenu.
Copying, Pasting, You can copy and paste objects within the graphics pane using Ctrl+C and
Moving and Deleting Ctrl+V, respectively.
Graphical Objects You can delete an object by selecting it and pressing the Delete key.
You can also use the context menu for the object to Cut, Copy, Paste or Delete.
You can paste graphical objects and text from one GoldSim model to another
and/or from other applications into GoldSim. For example, you could paste a
bitmap from a graphics program directly into the GoldSim graphics pane, or you
could paste text from a word processing application or text editor directly into
the graphics pane.
516 • Chapter 9: Documenting and Presenting Your Model GoldSim User's Guide
Creating Printed Documentation
When you paste text from another application into the GoldSim graphics pane,
you must tell GoldSim how it is to treat any tabs that are present in the pasted
text, and the font for the text. This is specified in the Graphic tab of the Options
dialog (accessed via Model|Options… from the main menu).
You can also move graphical objects from one container to another in the same
manner that you can move elements.
Read more: Moving Elements Between Containers (page 95).
Using the Graphical GoldSim provides an automated "undo" and "redo" capability for actions
Undo and Redo involving the manipulation of graphics. These are accessible from the main
menu (Edit|Undo and Edit|Redo). Alternatively, you can use Ctrl+Z and
Functions Ctrl+Y for Undo and Redo, respectively.
The Undo function only operates on actions involving the manipulation of
graphic objects, such as adding, moving or modifying graphics and text. It
cannot Undo actions that affect the model itself (such as editing inputs to an
element).
The "stack" of actions that can be undone is terminated as soon as you carry out
an action which cannot be undone. For example, if you add a text object, then
add a rectangle, and then edit its graphical properties, you can step backward
and undo these actions. If you subsequently added a new element, however, the
"stack" of graphical actions would be deleted (and could not be undone using the
Undo function).
The Redo function is only available after you Undo and action. That is, its
function is to reverse an Undo.
GoldSim User's Guide Chapter 9: Documenting and Presenting Your Model • 517
Creating Printed Documentation
Read more: Adjusting the Size of the Graphics Pane (page 326).
In order to print the document, you must specify the manner in which the
document is to be represented on paper. In particular, you must specify the paper
size and orientation, along with the margins. You do this from a dialog accessed
File|Page Setup… on the main menu:
When you make a change to the Page Setup (and press OK), GoldSim will ask if
you want to apply these settings to all Containers, or just the current Container.
You can view the Page Bounds within the graphics pane by toggling on Show
Page Bounds from the context menu for the graphics pane.
You can preview the printed document by selecting File|Print Preview from
the main menu or pressing the Print Preview button in the Standard toolbar.
Print Preview button
You can print the graphics pane directly from the Print Preview window, by
selecting File|Print from the main menu or pressing the Print button in the
Print button Standard toolbar.
Exporting the You can export the graphics pane and save it to a graphics format.
Graphics Pane The simplest way to do this is to using Alt+PrtSc to cut the entire window to the
clipboard (as a bitmap).
You can also use GoldSim's Export utility to save just the graphics pane (or
selected items in the graphics pane) to a particular graphics format.
To do so:
1. Select an object (or objects) in the graphics pane, and choose
File|Export… from the main menu. A dialog for specifying a file type
and a location for the file is displayed.
2. Select a file type and a location, and then press Save.
If no object is selected in the graphics pane when you choose File|Export…
from the main menu, the entire graphics pane will be exported.
518 • Chapter 9: Documenting and Presenting Your Model GoldSim User's Guide
Creating a GoldSim Player File
GoldSim User's Guide Chapter 9: Documenting and Presenting Your Model • 519
Creating a GoldSim Player File
A Player file cannot be read by GoldSim; it can only be read by the GoldSim
Player. You can view and navigate a Player file using the GoldSim Player just as
you would view and navigate a GoldSim model file in GoldSim. This includes
the ability to open most GoldSim dialogs (e.g., in order to examine how an
element has been defined).
Unless the Player file was created using the Dashboard Authoring Module (see
below), a Player file cannot be edited (or run) by the GoldSim Player.
As pointed out above, the user interface for the GoldSim Player is identical to
that of the full GoldSim version, with a number of menu options and controls for
editing the model removed. Instructions for using the GoldSim Player are
described within the program’s online help system, as well as the GoldSim
Player User’s Guide.
Creating a Player File The GoldSim Dashboard Authoring Module provides tools that allow a GoldSim
Using the Dashboard modeler to design and construct a "dashboard" interface for models.
Authoring Module The interfaces can be designed to look like "dashboards" or "control panels",
with buttons, gauges, sliders and display panels, and the author can embed
instructions, tool-tips and graphics to provide instructions on the use of the
model.
Such an interface allows a model to be easily used by someone without
requiring them to be familiar with either the GoldSim modeling environment or
the details of the specific model.
When such “dashboarded” models are saved as Player files, Player users can not
only view and navigate the model, but they can also modify the model (through
the dashboards), save the changes, and run the model.
The Dashboard Authoring Module is described in detail in the GoldSim
Dashboard Authoring Module Users Guide.
520 • Chapter 9: Documenting and Presenting Your Model GoldSim User's Guide
Chapter 10: Advanced Modeling
Concepts
These are much deeper waters than I had
thought.
Chapter Overview
This chapter describes a number of advanced and powerful GoldSim features.
They have been saved for last since in order to use them, you must have a good
understanding of the basic GoldSim features. Although you can build many
kinds of models without using these features, once you become comfortable
with GoldSim, many of these advanced features will seem indispensable, and
you will want to take advantage of some of them in all of your models.
In this Chapter The following topics are discussed in this chapter:
• Using Vectors and Matrices
• Understanding Locally Available Properties
• Solving Convolution Integrals
• Generating Stochastic Time Histories
• Using Conditional Containers
• Using External Application Elements
• Localizing Containers
• Cloning Elements
• Referencing an Output’s Previous Value
• Using Looping Containers
• Understanding the Causality Sequence
• Using SubModels to Embed Models Within Models
• Tracking Model Changes
• Linking Elements to a Database
You could also create a matrix element that represented the salmon population
in each of 20 streams over a period of three years:
In addition to adding data in the form of vectors and matrices, you can
manipulate these arrays in equations. For example, you could create an
Expression element, and define it as:
2 * Salmon_Population
The output of the Expression would be an array, identical to the
Salmon_Population array, except each item of the array would be two times
greater.
If you did not use arrays to carry out this calculation, rather than creating 2
elements, you would need to create 40 elements (20 Data elements and 20
Expression elements) to accomplish the same thing!
Vectors and matrices are applicable to almost any kind of system, and you will
likely want to take advantage of this feature in most of your models.
An example model which uses vectors and matrices within different elements
(Arrays.gsm) can be found in the Examples folder in your GoldSim directory. In
addition, MaterialTimeSeries.gsm and InfoTimeSeries.gsm include examples of
how Time Series elements can be used to generate arrays.
The following sections describe how you can create and use vectors and
matrices in your models.
Understanding Array When you define a vector or a matrix, it must be defined relative to a particular
Labels set of array labels. A set of array labels is simply a collection of labels for the
items of the array. The labels can be numbers (1, 2, …, 10) or words (apples,
oranges, peaches, pears). When you define an element which has an array as an
output, you must specify the sets of array labels upon which the array is based.
You define and reference a particular item of an array by using these labels.
Vectors require a single set of array labels, and matrices require two sets of
array labels (one for the rows, one for the columns).
As an example, consider a matrix that represents the salmon population in each
of 20 streams over a period of 3 years:
The matrix is defined relative to two sets of array labels: the rows are labeled
using a "stream" set, and the columns are labeled using a "year" set. The labels
or members for the "stream" set are BearCreek, IssaquahCreek, BlackRiver, and
so on. The labels for the "year" set are the numbers 1998, 1999, and 2000.
You would reference the (scalar) item in the third row and second column of the
matrix as Salmon_Population[BlackRiver, 1999].
Creating and Editing You can create (and edit) sets of array labels by selecting Model|Array
Array Labels Labels… from the main menu.
You can also create and edit array labels directly from the dialog for defining the
Output Attributes for an element.
Read more: Defining Vectors and Matrices Using Data Elements (page 527).
In either case, the following dialog for defining the array labels is displayed:
You must select whether you wish to define a Named set or an Indexed
(numbered) set. If you choose to create a Named set of array labels and press
OK (or select an existing Named set to be edited), a dialog for editing the set
will be displayed:
You can assign a name to the new set of array labels (by default it will be named
Setn). You add and remove entries using the Add Entry and Remove Entry
buttons. Clear All deletes all entries. The Sort button sorts the entries into
alphabetical order.
If you choose to create an Indexed set of array labels (or select an existing
Indexed set to be edited) a dialog for editing the set will be displayed.
You can assign a name to the new set of array labels (by default it will be named
Setn). You must enter a Start index (e.g., 1) and an End index (e.g., 100).
GoldSim will then display the number of entries in the set.
If you are editing an existing indexed set which is already referenced by some
elements for which data has been defined, and change the Start or End indices,
GoldSim will use the following rules:
• If Map all items is selected (the default), all existing entries defined
using the old set definition will be mapped to the new definition. If the
new set is shorter, for any elements that referenced the set, entries
associated with the end of the original set will be lost. If the new set is
longer, zero entries will be added at the end of existing elements
referencing the set.
• If Map matching items is selected, GoldSim will only map entries for
items in the old set which match items in the new set. For example, if
the original set was 1 through 20, and the new (edited) set was 15
through 34, for any elements that referenced the set, only entries 15
through 20 would be mapped to the new set (as the first five entries),
and entries associated with items 1 through 14 in the original set would
be lost. The remaining entries associated with the new set (16 through
34) would all be set to zero.
Note: Array label sets are saved with your model. If you wish to use the same
set of array labels in different models, you must recreate it in each model.
Alternatively, you can copy a set of array labels from one model file to another
by copying an element that uses the set. Note, however, that GoldSim will only
allow you to do so if a set of the same name does not exist in the model file into
which the element is being copied.
Deleting a Set of Array You can delete a set of array labels by selecting the set in the Array Labels
Labels dialog and pressing Delete Set….
Note, however, that this button will be grayed out if the set is being referenced
somewhere in the model (you can not delete a set if it is referenced by an
element). If a set is used in the model, the Show References… button will be
available. Pressing this button displays a dialog that provides a list of all of the
elements which reference the set, and allows you to edit or delete each element.
In addition to sorting items of a set of array labels in alphabetical order using the
Moving Items in a Set of Sort button, individual items can be moved up and down within the list shown
Array Labels in the dialog as follows:
1. Select an item that you wish to move by left-clicking on the number to
the left of the item.
2. You can select multiple adjacent items by moving the cursor up (or
down) while holding the left-mouse button down.
3. Release the left mouse button to complete the selection. The selected
items will be highlighted.
4. Left-click on the number of the selected item (or if multiple items are
selected, the number of any of the selected items), and keep the button
Move Item cursor depressed. The "Move Item" cursor will appear.
5. Keeping the button depressed, move the cursor to the location in the list
where you wish to move the item(s). A red line will indicate where the
item(s) will be moved.
6. Release the left mouse button to complete the move.
Note: If you reorder the items, any existing elements using the set will
automatically be re-sorted to the new sequence.
Defining Vectors and Once you have defined the sets of array labels that you wish to use, you can
Matrices Using Data create vectors and matrices. The primary way to create vectors and matrices is to
define them using Data elements. Once these exist, other vectors and matrices
Elements can be created by other kinds of elements based on these (e.g., by using these as
inputs).
You specify that a Data element is to be a vector or a matrix when you define its
output attributes (by pressing the Type… button in the element’s properties
dialog). The dialog for specifying output attributes for an element looks like
this:
The Order drop-list provides three choices: “Scalar” (the default), “Vector (1D-
Array)”, and Matrix (2D-Array)”.
If you wish to create a vector, select “Vector (1D-Array)”. If you wish to create
a matrix, select “Matrix (2D-Array)”. If you select “Vector (1D-Array)”, the
Row Labels field becomes available. If you select “Matrix (2D-Array)”, both
the Row Labels and Column Labels fields become available. These two fields
contain lists of all of the sets of array labels defined in your model:
If you have defined the Order as a vector or a matrix (i.e., if the Row Labels or
Column Labels fields are active), you must select a set of array labels (or
GoldSim will display a warning message when you try to close the Output
Attributes dialog).
Note that within the drop-list for the Row and Column labels is the choice to
“Create new Array Labels”. If you click this option, the dialog for defining new
array labels will be displayed. After leaving the Array Labels dialog, you will be
returned to the dialog for defining output attributes.
Read more: Creating and Editing Array Labels (page 524).
To illustrate how you would create a vector or a matrix Data element, consider
the following example. Suppose that you defined the Order as “Vector (1D-
Array)”, and defined the Row Labels as “Days”. The properties dialog for the
Data element would look like this.
Note that this dialog is different from the standard Data element dialog for a
scalar.
Read more: Data Elements (page 139).
In particular, because it is an array, you cannot directly edit the Data input field.
To edit the vector, you must press Edit Vector…, which will display the
following dialog.
This dialog displays all items of the vector (in this case, seven). Each field is a
standard edit field (you can enter a number, an expression or a link), although
typically you would enter just a number (with units).
Note that the equivalent dialog for a matrix looks like this (in this example using
a set of array labels for the Column Labels named Fruit with members Apples,
Oranges, Peaches and Pears):
Although you would typically enter constants (numbers) into the input fields
defining a vector or a matrix, the fields accept links and expressions. For
example, you could create a vector of Stochastics by entering a link to a
Stochastic for each item in a vector.
Note: You can paste data from a spreadsheet, a Word table, or a tab-delimited
text file directly into a vector or matrix grid. To do so, copy the data to the
clipboard, select the cell in the vector or matrix representing the upper left-hand
corner of the range into which you wish to paste (by single-clicking in it), and
press Ctrl+V.
Note: You can resize the columns of the editing dialog by dragging the lines
separating columns right or left. You can also resize the entire dialog by
dragging a side (or a corner).
Viewing an Array in a When you view a vector or a matrix in a browser or an interface, the inputs and
Browser or Interface outputs can be expanded to show the individual items.
If you double-click On the Minus sign (-) next to a group label with the link cursor, the entire
vector is used. If you double-click an individual item with the link cursor, only that (scalar)
item of the vector is used.
Note: Element inputs and outputs are only shown in the browser if you choose
to Show element subitems (accessed via the browser context menu by right-
clicking in the browser).
Note that placing the cursor over an item of the array displays the Current Value
(if in Edit Mode) or the Last Value (if in Result Mode). The Current Value is
computed as the expected value of the item. The Last Value is the final value
(i.e., the value at the end) of the last realization.
Read more: Understanding Result Mode (page 396).
Referencing an Item of If required, you can access a particular item of the array in an expression. You
an Array do this by using brackets [ ].
For example,
Data1[Monday]
references a single (scalar) value representing the second item of the vector
Data1 (defined by the set “Days”).
Similarly,
Data1[Monday, Peaches]
references a single (scalar) value representing the item in the second row and
third column of the matrix Data1 (with the rows defined by the set “Days”, and
the columns defined by the set “Fruit”).
Defining Vectors In addition to using Data elements to create vectors, you can also create vectors
Using Stochastic using Stochastic elements. If you define a Stochastic element as a vector, rather
than inputting a single probability distribution, you specify a set of probability
Elements distributions (one for each item of the vector).
If you specify the Stochastic as a vector (by specifying a set of array labels via
the Type… button), the dialog for defining the distribution (accessed via the
Edit Distribution… button) will look similar to this:
Defining Arrays in an One of the quickest ways to create an array is to use array constructor functions.
Input Field Using These are functions that can be entered into an input field that generate an array
(a vector or a matrix) by specifying the array label set(s) and values as
Array Constructor arguments.
Functions
For example, the following expression generates a vector based on the Days
array label set, in which all the items have a value of 1m:
Vector(days, 1m)
The following expression generates a matrix based on the Days array label set
(for rows) and the Months array label set (for columns), in which all the items
have a value of 0 g:
Matrix(days, months, 0g )
In addition to creating an array in which all the values for the items are identical
(and hence specified by a single argument), you can also specify each item
separately:
Vector(days, 1m, 3m, 0m, 5m, 6m, 2m, 7m)
In this example, since the Days array label set was specified, seven items are
defined.
Note: When defining a matrix using an array constructor, the first argument
represents the row array label set (having n items), the second argument is the
column label set (having m items), and if all of the values are specified
separately, they are defined as follows: r1c1, r1c2,…r1cm, r2c1,…rncm. That is, the
items are listed left-to-right-then-down through the matrix.
The units for the values of a constructor do not need to be identical. The
following expression is valid:
Vector(days, 1m, 3ft, 0km, 5mm, 6m, 2ft, 7m)
If any of the values listed do not have units, they take on the units of the first
item in the array:
Note: The values for the items of an array cannot be specified as links (i.e., they
cannot reference the name of another element). They must be specified as
numbers.
Manipulating Vectors Although you often will use Data elements to create arrays in your models, the
and Matrices with real power of arrays is that they can be manipulated using other elements. In
general, when you manipulate arrays in other elements, GoldSim carries out the
Other Elements calculations in parallel for each item of the array. GoldSim also provides some
special functions which convert matrices to vectors, vectors to scalars, whose
argument is a vector and output is a scalar, and whose argument is a matrix and
output is a vector.
In this section, the various operators and functions that can be used to build
expressions involving arrays are discussed. The manner in which various
elements can manipulate array inputs is also described.
Manipulating Arrays in The manner in which the standard operators in GoldSim can be used with arrays
Expressions Using is summarized below:
Mathematical Operators Addition and Subtraction of Arrays. The addition (+) and subtraction (-)
operators can be used between arrays if and only if the two arrays have the
same dimensions and order, and are defined using the same set of array
labels. GoldSim carries out the operation term-by-term and produces an
array of the same order. For example, if A was a vector based on the set
“Days”, and B was a vector based on the set “Days”, C=A + B would also
produce a vector based on the set “Days”. The first item of C would be the
sum of the first item of A and the first item of B; the second item of C
would be the sum of the second item of A and the second item of B, and so
on. You cannot add or subtract an array to/from a scalar.
Multiplication or Division of an Array by a Scalar. The multiplication
(*) and division (/) operators can be used between arrays and a scalar. Each
item of the array is multiplied or divided by the scalar. For example, you
could create the expression 2 * A, where A was a vector. The output of the
Expression would be a vector, identical to the A vector (and its output
attributes would need to be defined accordingly), except each item of the
vector would be two times as great. Note that not only can you divide an
array by a scalar, but you can also divide a scalar by an array. In both cases,
the result is an array.
Multiplication and Division of Arrays. The multiplication (*) and division
(/) operators can be used between arrays if and only if the two arrays have
the same dimensions and order, and are defined using the same set of array
labels. GoldSim carries out the operation term-by-term and produces an
array of the same order. For example, if A was a vector based on the set
“Days”, and B was a vector based on the set “Days”, C=A * B would also
produce a vector based on the set “Days”. The first item of C would be the
product of the first item of A and the first item of B, etc.
Raising an Array to a Power. You can use the exponentiation operator (**
or ^) to raise the items of an array to a power. GoldSim carries out the
Array Functions Most of the built-in functions in GoldSim can also operate on arrays. In most
cases, these functions carry out the operation term-by-term and produce an array
of the same order as the input argument. For example, if A was a vector based
on the set “Days”, C=sin(A) would also produce a vector based on the set
“Days”. The first item of C would be the sine of the first item of A, the second
item of C would be the sine of the second item of A, and so on.
Several functions (max, min, mod, tdist, tprob, bess, beta) accept multiple array
arguments. For these functions, the arguments must all be scalars, or must be
arrays of the same order that are defined using the same set of array labels.
GoldSim carries out the operation term-by-term and produces an array of the
same order. For example, if A was a vector based on the set “Days”, and B was
a vector based on the set “Days”, C=min(A, B) would also produce a vector
based on the set “Days”. The first item of C would be the minimum of the first
item of A and the first item of B; the second item of C would be the minimum of
the second item of A and the second item of B, and so on.
Two specialized functions (occurs and changed) cannot accept arrays as
arguments.
If X and Y are arrays (of the same order and using the same set of array labels),
the If(C,X,Y) function can manipulate the arrays in two different ways:
• If C is a scalar condition, the output of the If function is either the
array X (if C is true) or the array Y (if C is false).
• If C is an array (with (of the same order and using the same set of array
labels as X and Y), GoldSim will carry out a term-by-term if,then
computation to produce the output array. That is, if the first item of C
is true, the first item of the output would be equal to the first item of X,
otherwise it would be equal to the first item of Y, and so on.
Read more: Built-in Functions (page 116).
In addition to the standard functions mentioned above, GoldSim also provides a
wide variety of special array functions which allow you to manipulate arrays
(accessible from the context menu for an input field).
These special array functions are listed below:
Elements That Can Many of the GoldSim elements can manipulate and produce vectors and
Manipulate Arrays matrices. For example, you can sum a number of matrices using the Sum
element, or compute the peak value of each item of a vector using the Extrema
element.
In general, if the outputs for an element are an array, its inputs must be arrays
(defined by the same sets of array labels ), and GoldSim carries out the element's
calculations in parallel for each item of the array.
Element Comment
Data Can create vectors and matrices.
Stochastic Can create stochastic vectors (but not matrices)
Information Time Series Can create time series vectors (but not matrices).
Material Time Series Can create time series vectors (but not matrices)
Integrator Outputs arrays if inputs are all arrays.
Reservoir Outputs arrays if inputs are all arrays.
Convolution Outputs arrays if inputs are all arrays.
Expression Can manipulate and create arrays using operators and
functions.
Element Comment
Extrema Outputs array if input is an array.
Selector Outputs arrays if inputs are all arrays.
Sum Outputs arrays if inputs are all arrays.
Discrete Change Outputs a vector if input is a vector (cannot manipulate
matrices).
External Can exchange vectors and matrices with external DLL.
Spreadsheet Can exchange vectors and matrices with external
spreadsheet.
Information Delay Outputs array if input is an array.
Material Delay Outputs arrays if inputs are all arrays.
Discrete Change Delay Outputs a vector if input is a vector (cannot manipulate
matrices).
Note: If an input field of an element requires a vector, and the vector only has a
single item, GoldSim allows you to enter a scalar as the input. Of course, if you
then add items to the set of array labels (such that it consists of more than one
item), the scalar input will no longer be valid.
In order for one of these elements to output an array, you must specify that it is
to be a vector or a matrix when you define its output attributes (by pressing the
Type… button in the element’s properties dialog). The dialog for specifying
output attributes for an element looks like this:
The Order drop-list provides three choices: “Scalar” (the default), “Vector (1D-
Array)”, and Matrix (2D-Array)”:
If you wish to create a vector, select “Vector (1D-Array)”. If you wish to create
a matrix, select “Matrix (2D-Array)”. If you select “Vector (1D-Array)”, the
Row Labels field becomes available. If you select “Matrix (2D-Array)”, both
the Row Labels and Column Labels fields becomes available.
These two fields contain lists of all of the sets of array labels defined in your
model:
If you have defined the Order as a vector or a matrix (i.e., if the Row Labels or
Column Labels fields are active), you must select a set of array labels (or
GoldSim will display a warning message when you try to close the Output
Attributes dialog):
Within the drop-list for the Row and Column labels is the choice to “Create new
Array Labels”. If you click this option, the dialog for defining new array labels
will be displayed. After leaving the Array Labels dialog, you will be returned to
the dialog for defining output attributes.
Read more: Creating and Editing Array Labels (page 524).
Viewing Array If an element has an output which is an array, you can view the values of
Results specific items of the array by holding your cursor over the item in a browser or
the output interface.
Note: Element inputs and outputs are only shown in the browser if you choose
to Show element subitems (accessed via the browser context menu by right-
clicking in the browser).
You can also view array output results in table form or chart form (as bar
charts).
Read more: Viewing Final Values for Arrays (page 444).
Copying Array When you copy an element defined using a set of array labels (i.e., an element
Elements Between with vector or matrix outputs) to another model, you must ensure that the set(s)
of array labels referenced by the element in the two models are consistent. In
Models particular, GoldSim imposes the following rules:
• If the set(s) of array labels referenced by the element already exist in
the model into which it is being pasted, the number of items in the
set(s) must be identical in both models. Note that it is not necessary that
the set labels be identical, as long as the number of items is identical.
• If the set(s) of array labels referenced by the element do not exist in the
model into which it is being pasted, GoldSim will automatically create
them in the new model.
Read more: Copying Elements Between Model Files (page 96).
Note: Locally available properties are only shown in the main browser if you
choose to Show element subitems (accessed via the browser context menu by
right-clicking in the browser).
Locally available properties derive their name from the fact that they may only
be available, or they may take on different values (i.e., be over-ridden), in
“locally available” parts of your model (e.g., within particular Containers).
Containers are often providers of locally available properties. In fact, the Run
Properties are actually locally available properties belonging to the Model
Container:
If you define an internal clock for a Container, and then within that Container,
reference Etime, GoldSim will automatically connect to the “locally available”
Etime (the Etime in the Container), rather than the global Etime (the Etime
associated with the “root” or Model Container). Hence, the actual locally
available property that it linked to is a function of where it is referenced from.
Read more: Specifying Containers with Internal Clocks (page 354).
Some locally available properties are only available in specific locations. A
good example of this is the loop count for a Looping Container.
Read more: Using Looping Containers (page 611).
Within the looping Container itself (or in its property dialog), it is often
necessary to reference the loop count. However, this variable has no meaning
whatsoever outside of the looping Container. As a result, it can only be
referenced inside the Container (including in its property dialog). If you right-
click in an input field within the looping Container and select Insert Link to
view the Insert Link browser, the loop count will appear in an Available
Properties folder:
If you invoke the Insert Link browser from outside of the Container, however,
the loop count is not visible and cannot be referenced.
Locally available properties are referenced in expression by adding the ~ prefix.
For example, when you insert the loop count for a looping Container into a field,
it appears as follows:
t
y(t) = S[x(0 to t)] = ∫ x(τ ) hτ (t - τ ) δτ
0
In this equation h τ (t - τ) is the transfer function (also referred to as the impulse
response function). t - τ is referred to as the lag, as it represents the time lag
between the input and the output time. The transfer function is given a subscript
τ to indicate that the function itself may take on different forms at different
points in time. That is, the response to an input impulse at t = τ1 could have a
different form than the response to an impulse at t = τ 2 .
Convolution elements require that you supply the input signal, x(t), and the
transfer function, h(t - τ) . The element then computes the output signal, y(t).
Note that the convolution integral is a linear operation. That is, for any two
functions x1(t) and x2(t), and any constant a, the following holds:
S[x1(t) + x2(t)] = S[x1(t)] + S[x2(t)]
S[ax1(t)] = a S[x1(t)]
Having defined mathematically what a convolution integral does, let us now try
to understand what it represents conceptually. Perhaps the simplest way to think
about the convolution integral is that it is simply a linear superposition of
Convolution elements have a single output. You can specify these attributes by
pressing the Type… button. By default, a new Convolution element is a scalar,
dimensionless value. You can also use Convolution elements to operate on
and/or create vectors and matrices.
Read more: Using Vectors and Matrices (page 522); Convolution Elements
Defined as Arrays (page 544).
The Display Units field refers to the display units of the output signal (which
may have different dimensions than the input signal).
You can save the results for a Convolution element by clicking Final Values
and/or Time Histories.
Under Signal Definition, you first specify the Input signal. You must also
specify the dimensions of the input signal (by defining Units). This facilitates
error checking. The Input signal will be a direct or indirect function of time.
You then define the Transfer Function. In some cases, it may be easier to
define the integral of the transfer function, rather than the transfer function itself,
and the two radio buttons on the dialog allow you to choose between these two
options.
The transfer function essentially “spreads out” or “disperses” a unit impulse
over time. In many cases, the transfer function may be a continuous function
with a long “tail”. That is, 99% of output produced by an impulse may be
generated within 10 days of the impulse, with the remainder being spread out
over the remaining 1000 days. Such a transfer function can have a significant
computational impact on your model. Hence, GoldSim provides a way to “cut
off” a transfer function after a certain lag time. If you check the Truncate the
Function at checkbox, you can then enter a time after which the transfer
function will be truncated. In the above example, you might, for example,
specify this as 10 days. This input can be a function of time (e.g., if the transfer
function changes with time, you may need to adjust the truncation time
accordingly).
Note that in the definition of a convolution integral, the transfer function is
mathematically defined not as a function of time, but as a function of a time
difference, (t - τ) , or lag time. In order to write such an equation in GoldSim,
you reference the time difference t - τ using a special locally available property
of the Convolution element called “Lag”. It must be referenced as “~Lag”.
The transfer function does not have to be time-invariant. That is, the function
can be defined to change as a function of time. Referring to the example above,
the if the response was different at later times in the simulation (e.g., after 1 yr),
the transfer function could be written as follows:
GoldSim checks to ensure that the dimensions of the various inputs and outputs
are related as follows:
Output = Transfer Function * Input Signal * time
If the integral of the transfer function is specified, GoldSim checks to ensure that
the dimensions of the various inputs and outputs are related as follows:
Output = Integral of Transfer Function * Input Signal
For example, if the element display units were specified as $ and the input signal
display units were specified as g/yr, then GoldSim would require that the
transfer function had dimensions of currency/mass (e.g., $/g).
Several points should be noted regarding the numerical implementation of the
Convolution element within GoldSim:
• During the numerical integration, GoldSim does not actually start the
integration from 0. Instead, it starts the integration from a very small
number. This allows the transfer function to be a function of the
inverse of the lag without causing numerical problems (i.e., divide by
zero errors)
• The numerical integration approach used by GoldSim assumes that the
input function varies linearly between time steps; and
• To have acceptable accuracy, the simulation timestep should be short
relative to the rate of change of the transfer function. Note, however,
that your model may run much slower if the timestep is too small, as
the computational effort for solving a Convolution element goes up as
the square of the number of timesteps.
Convolution Elements A convolution element can be defined to output an array. In this case, the dialog
Defined as Arrays appear like this:
In this case, the Input Signal must be specified as an array. Pressing the Edit
Vector… button (or Edit Matrix…button if it is a matrix) provides access to a
dialog for defining the scalar transfer function for each separate item of the
array:
Examples of the Use In order to fully understand how to use Convolution elements, it is helpful to
of the Convolution explore several examples. The first example discussed here can be found in the
Examples folder of your GoldSim directory, in a file named Convolution.gsm.
Element The latter two examples can be found in the GRC Model Library.
We examine three simple examples below:
• A simple filter;
• Computing costs associated with warranties; and
• Computing response of a structure due to an earthquake.
This examples shows how a simple input signal can be filtered to alter its shape.
Convolution Example: In this example, the input signal is a square “boxcar” function:
A Simple Filter
Note that the output signal in this case has dimensions of time (since the input
signal and the transfer function were defined as being dimensionless).
Convolution Example: This example shows how warranty costs for a product (e.g., a vehicle) can be
Warranty Costs computed based on a product sales rate and the expected warranty cost time
history for a product using a Convolution element.
In this example, the input signal is the sales rate of the vehicle:
Sales will start one year in the future, and ramp slowly up for three years. The
vehicle is only assumed to be produced for three years.
This can be entered into GoldSim as an Information Time Series.
The Transfer function represents, on average, how warranty costs are expected
to be incurred in the future (per vehicle):
This curve indicates that warranty costs start to be incurred about 1.5 years after
the sale, reach a peak at 3 years after the sale, and no more costs can be expected
to occur after about 4.5 years after the sale. Note that the units on the transfer
function are $/car/yr (the curve integrates to 2000 $/car).
The output signal will then have dimensions of $/yr:
Output = Transfer Function * Input Signal * time
Output = $/car/yr * cars/yr * yr = $/yr
That is, the output represents the rate at which we can expect to incur warranty
costs for all of the vehicles sold:
If we integrate the warranty cost rate (using an Integrator), we can compute the
cumulative warranty costs:
This example can be found in the Model Library within the GoldSim Resource
Center (GRC).
Convolution Example: This example shows how a Convolution element can be used to simulate how a
Earthquake Response structure responds to an earthquake. The input signal is an accelerogram (a time
history of ground accelerations). The output signal is the displacement of a
building (illustrating how the building oscillates from side to side in response to
the earthquake).
The input signal (the accelerogram) is taken from an actual earthquake in
Southern California in 1940 (the El Centro earthquake):
- e[-n (t -τ )]
sin[Wd ( t - τ )]
Wd
where n is the coefficient of decay (in radians/sec), and Wd is the damped
frequency (in radians/sec). A plot of this transfer function looks like this:
This example can be found in the Model Library within the GoldSim Resource
Center (GRC).
Like all GoldSim elements, you first specify an Element ID and a Description.
Below the Description field, you specify the Display Units you wish to use.
To the right of the Display Units, you can specify the Type. By default, a
History Generator provides a scalar output (and requires scalar inputs).
However, via this button, you can also specify it to have vector (1-D array)
output (and require vector inputs).
The "History Definition" portion of the History Generator dialog is used to
specify the characteristics of the stochastic history. The History Type field is
used to select the general type of stochastic history. GoldSim currently provides
two options: "Geometric Growth" and "Random Walk". The details of how the
History Definition fields are specified are provided below.
An example file which illustrates the use of History Generator elements
(HistoryGen.gsm) can be found in the Examples folder in your GoldSim
directory.
Types of Stochastic Before creating stochastic time histories using the History Generator element, it
Time Histories is instructive to briefly summarize the different kinds of time histories that can
be generated.
Consider the stochastic time histories below:
These are random histories that follow no particular trend. They simply
randomly walk through time. Clearly one of the curves has larger random
fluctuations than the other. For certain types of variables (e.g., stock prices), the
variability of the time history as a function of time is described in terms of a
volatility. The history with greater fluctuations is said to be more "volatile".
Note that the volatility is often a function of the unit of time on which it is
based. In the examples shown above, the volatility increases with time (i.e., the
annual volatility is greater than the daily volatility). For other types of stochastic
variables, however, the volatility may stay constant with time. In the example
below, the dashed line variable is target-reverting. That is, the value reverts
strongly to some underlying target (in this case, a constant value of 1). As a
result, the volatility is constant in time.
The histories in the two examples above either move randomly through time, or
move randomly around some constant target. Other stochastic histories may
follow a trend.
The histories below grow geometrically at a rate of 5% per year:
The dark solid line is growth with no volatility. The other two lines both are
volatile. In one, the volatility grows with time. In the other, the volatility stays
constant.
If we were to run multiple realizations of the time history whose volatility grows
with time, the growth in the volatility as a function of time would be more
noticeable:
Compare this to multiple realizations of the time history whose volatility stays
constant with time:
Again, the dark solid line is growth with no volatility. The other two lines are
both volatile. In one, history lags the underlying trend. In the other, there is no
lag.
The History Generator element can be used to generate all of these types of
stochastic time histories.
Generating Selecting "Geometric Growth" for the History Type field of a History
Geometric Growth Generator element allows you to define a history that grows geometrically with
time. This means that the rate of growth and the amount of volatility are
Histories proportional to the current value. Among other things, this type of history is
appropriate for variables such as security prices.
In its simplest form, this type of history requires three inputs (Mean Annual
Growth Rate, Mean Annual Volatility, and Initial Value). The other two
inputs (Annual Reversion Rate and Initial Value of Median are only required
if you wish the history to revert toward its median (and this is discussed in the
next section).
Mean Annual Growth Rate. This is the mean annual logarithmic growth
rate (μ'), where Vi is the value at time i:
t Vi +1
∑ ln( )
i =t − n Vi
μ' =
n
Although this is a rate (i.e., time-based), because it is "hard-wired" to be an
annual value, this input is dimensionless. That is, it represents the
logarithmic growth rate over a year. It can be positive, negative, or zero.
If the logarithmic growth rate is measured over a different time period (e.g.,
monthly), this can be scaled by direct multiplication. For example a mean
monthly logarithmic growth rate can be converted to a mean annual
logarithmic growth rate by multiplying it by 12.
Annual Volatility. This is the standard deviation of the annual logarithmic
growth rate (σ'):
t ⎡ ⎛V ⎞ ⎤
∑ ⎢ln⎜⎜ i +1 ⎟⎟ − μ ' t )⎥
⎢ ⎝ Vi ⎠
i =t − n ⎣ ⎦⎥
σ'=
n −1
This is a dimensionless value that must be non-negative.
If the logarithmic volatility is measured over a different time period (e.g.,
monthly), and the rate of reversion to the median is zero, this can be scaled
by the square root of the time period. For example, a mean monthly
logarithmic volatility can be converted to a mean annual logarithmic
volatility by multiplying it by √12.
Initial Value. This is the initial value of the time history (the value at time
zero). It has the same dimensions as the output. It must be a positive
number.
If the Annual Reversion Rate is set to zero (the default), GoldSim generates
successive values as follows:
' '
V new = Vold e μ Δt +εσ Δt
where Vnew is the new value, Vold is the previous value, Δt is the time between
the two values, ε is a random standard normal value (sampled from a
distribution with mean 0 and standard deviation 1), and μ' and σ' are as defined
above.
For constant values of the Mean Annual Growth Rate and Mean Annual
Volatility, this results in a history that (on average) grows exponentially, and
whose standard deviation of the logs increases as the square root of time:
t ⎡⎛ Vi +1 − Vi ⎞ ⎤ t ⎛V − Vi ⎞
∑ ⎢⎜⎜ ⎟ − μ a )⎥
⎟ ∑ ⎜ i +1
⎜
⎟
⎟
⎢⎝ V i
i =t − n ⎣ ⎠ ⎦⎥ i =t − n ⎝ Vi ⎠
σ= , where μ a =
n −1 n
then this can be used (in conjunction with the geometric mean of the
returns) to compute the volatility using GoldSim's geo2vol function.
Read more: Financial Functions (page 118).
Converting from Arithmetic Mean Returns. In some cases, you may
have return rate statistics reported in terms of the arithmetic mean of the
annual return over a period (μa, defined above).
You can use GoldSim's built in ari2cm function to convert an arithmetic
mean annual return (and a standard deviation) to an arithmetic mean log
annual return, and the ari2vol function to convert a standard deviation (and
an arithmetic mean) of the annual return to the standard deviation of the log
annual return (the volatility).
Generating Geometric By default, the standard deviation of a geometric growth type history increases
Growth Histories with with the square root of time. In some cases, when simulating a stochastic
Median Reversion history that increases geometrically, you may not want the standard deviation to
grow in this way. Rather, you may want it to stabilize at a constant value.
You can accomplish this by forcing the stochastic history to revert towards its
median value at a specified rate. To do so, you must use the Annual Reversion
Rate and Initial Value of Median input fields.
Annual Reversion Rate. This is the annual fractional rate at which the
history reverts towards its median. Although this is a rate, because it is
"hard-wired" to an annual value, this input is dimensionless. That is, it
represents the fractional rate per year. It must be non-negative.
Initial Value of Median. In most cases, the initial value of the time history
is unlikely to be at the median. Hence, this is the initial value of the median
of the time history (the value at time zero). It has the same dimensions as
the output. It must be a positive number.
If the Annual Reversion Rate is non-zero, GoldSim generates successive
values as follows:
1− e −2κΔt
( )
μ ' Δt + 1− e − κΔt (ln Told − ln Vold )+ εσ '
1− e − 2 κ (1 yr )
V new = Vold e
where Vnew is the new value, Vold is the previous value, Δt is the time (in years)
between the two values, ε is a random standard normal value (sampled from a
distribution with mean 0 and standard deviation 1), κ is the reversion rate, and μ'
and σ' are the logarithmic growth rate and volatility, respectively. T is median
(a function that grows geometrically from the specified Initial Value of Median
using the mean annual growth rate).
In practical terms, specifying a non-zero Annual Reversion Rate has two effects:
• The history tracks the median, and if the Initial Value differs from the
Initial Value of Median, the history approaches the median history with
a half-life of ln(2)/Annual Reversion Rate.
• The standard deviation of the logs initially grows, approaching a
constant value with a similar half-life. The "steady-state" standard
deviation of the log of the values stabilizes at a value of:
1
σ'
1−e −2κ
Generating Random Selecting "Random Walk" for the History Type field of a History Generator
Walk Histories element allows you to define a history that randomly walks through time.
In its simplest form, this type of history requires two inputs (Annual Volatility,
and Initial Value). The other two inputs (Target and Annual Reversion Rate
are only required if you wish the history to track an underlying target or trend
(and this is discussed in the next section).
Annual Volatility. This is the standard deviation of the annual values (σ):
t
∑ [Vi − μ )]
i =t − n
σ=
n −1
where μ is the mean of the annual values:
t
∑ Vi
i =t − n
μ=
n
If the volatility is measured over a different time period (e.g., monthly), this
can be scaled by direct multiplication. For example a mean monthly
volatility can be converted to a mean annual volatility by multiplying it by
√12.
It has the same dimensions as the output, and must be non-negative
Initial Value. This is the initial value of the time history (the value at time
zero). It has the same dimensions as the output and can be positive,
negative or zero.
You can control whether your history can take on negative values using the
Allow Negative Values checkbox (which defaults on). If this box is checked,
negative values are "truncated". Note that this has the effect of artificially
reducing the standard deviation of the values.
If the Annual Reversion Rate is set to zero (the default), GoldSim generates
successive values as follows:
V new = Vold + εσ Δt
where Vnew is the new value, Vold is the previous value, Δt is the time (in years)
between the two values, ε is a random standard normal value (sampled from a
distribution with mean 0 and standard deviation 1), and σ is the volatility.
For constant values of the Annual Volatility, this results in a history whose
standard deviation increases as the square root of time.
Generating Random By default, the standard deviation of a random walk type history increases with
Walk Histories with the square root of time. In some cases, when simulating such a history, you may
Target Reversion not want the standard deviation to grow with time. Rather, you may want it to
stabilize to a constant value around an underlying target.
You can accomplish this by forcing the stochastic history to revert towards a
target value at a specified rate. To do so, you must use the Annual Reversion
Rate and Target input fields.
Target. This is the underlying target that the history will revert to (i.e.,
track). It can be a constant value or a function of time. It has the same
dimensions as the output. It can take on any value.
Annual Reversion Rate. This is the annual fractional rate at which the
history reverts to its target. Although this is a rate, because it is "hard-
wired" to an annual value, this input is dimensionless. That is, it represents
the fractional rate per year. It must be non-negative.
If the Annual Reversion Rate is non-zero, GoldSim generates successive
values as follows:
1 − e −2κΔt
( )
V new = Vold + 1 − e −κΔt (Tnew − Vold ) + εσ
1 − e − 2κ (1 yr )
where Vnew is the new value, Vold is the previous value, Δt is the time (in years)
between the two values, ε is a random standard normal value (sampled from a
distribution with mean 0 and standard deviation 1), κ is the reversion rate, and σ
is the volatility. Tnew is the current (new) value of the underlying target (which
may change with time).
In practical terms, specifying a non-zero Annual Reversion Rate has two effects:
• The history tracks the target, and if the Initial Value differs from the
initial value of the Target, the history approaches the target history with
a half-life of ln(2)/Annual Reversion Rate.
• The standard deviation initially grows, but eventually stabilizes to a
constant value with a similar half-life. The "steady-state" standard
deviation stabilizes at a value of:
1
σ
1−e − 2κ
1 − e −2κΔt
( )
V new = Vold + 1 − e −κΔt (Told − Vold ) + εσ + (Tnew − Told )
1 − e − 2κ (1 yr )
As can be seen below, this has the impact of eliminating the lag (and the
dispersion):
In this example, the volatile movements of Beta and Gamma are strongly
correlated, and are both uncorrelated to Alpha.
The correlations between the members of an array are specified via a correlation
matrix. A correlation matrix specifies the correlations between variables, and
generally has the following form:
If this box is checked, the Edit Matrix… button becomes available. This button
provides access to a dialog for specifying the correlation matrix:
Correlation Algorithms GoldSim provides several different algorithms for correlating stochastic
for Stochastic Histories histories within the Correlation Matrix dialog. These are selected from the
Correlation Algorithm drop-list at the top of the dialog.
The two primary choices are Gaussian copula and t-distribution copula. The t-
distribution copula requires an additional input (the Degrees of Freedom).
The plot below shows the value at the first timestep of two variables correlated
(with a correlation coefficient of 0.9) using a t-distribution copula (and a value
for the Degrees of Freedom of 1):
The middle portion of the Conditionality tab controls when the Container is
activated. The bottom portion controls when the Container is deactivated.
You can turn off conditionality by selecting the Conditionality feature in the
Container dialog to clear the box. When you do so, the Conditionality tab is
removed.
Conditional Containers are represented in the graphics pane as follows:
Outputs of a When you enable conditionality for a Container, three outputs are added to the
Conditional Container Container. While a regular Container (i.e., one which is not conditional) has no
outputs of it own, the three outputs of a conditional Container are properties of
the Container itself.
These outputs are as follows:
Activity_Status: This is a condition which is True when the Container is
active.
Num_Activations: This is the cumulative number of times that the
Container has been activated.
Duration: This represents the duration that the Container has been in its
current Activity Status. Hence, whenever the Activity Status changes, the
Duration is reset to zero.
If you wish to reference any of these three outputs outside of the Container, you
must do so by referencing the Container name as a prefix (e.g.,
Container1.Duration).
In some cases, you may want to reference these inputs inside the Container. If
you wish to reference the Duration and Num_Activations within elements
inside the Container or when defining Deactivation triggers for the Container,
you cannot do so by using the Container name (i.e., Container1.Duration).
Instead, you must reference them using the prefix “~” (e.g., ~Duration and
~Num_Activations). As indicated by the way they are referenced, these two
outputs are examples of locally available properties.
Read more: Understanding Locally Available Properties (page 539).
If you access the Insert Link dialog inside a conditional Container (by right-
clicking inside an input field of an element within the Container or within the
Deactivate trigger dialog for the Container), these two outputs appear in a
Available Properties folder (displaying all of the locally available properties that
can be accessed from that location):
None of the outputs of a conditional Container are saved by default. If you wish
to save these outputs, you can choose to Save Results for the Container (Final
Values and/or Time Histories) from the General tab of the Container’s property
dialog.
Activating a You control when a conditional Container activates via the Activation… button
Container on the Conditionality tab, which provides access to a standard Trigger dialog.
Read more: Understanding Event Triggering (page 275).
By default, the Activation is set to “Never”. This means that the Container will
never activate.
Note: You can tell if an activation trigger has been defined from the appearance
of the Trigger… button. If a trigger is defined, the rectangle next to the
lightning bolt is bright green; otherwise it is dark green. And like all Trigger…
buttons, it displays a tool-tip. If there is no trigger defined, the tool-tip will
display “Never activates”.
Note: You can tell if a deactivation trigger has been defined from the
appearance of the Trigger… button. If a trigger is defined, the rectangle next to
the lightning bolt is bright green; otherwise it is dark green. And like all
Trigger… buttons, it displays a tool-tip. If there is no trigger defined, the tool-
tip will display “Automatically deactivates when parent deactivates”, where
parent is the name of the parent Container.
Using Auto Triggers Most elements with triggers can be assigned an Auto Trigger. An Auto Trigger
in Conditional requires no user-defined Trigger Definition and its behavior is defined by it
context (i.e., the type of element). Auto Triggers react to the activation or
Containers deactivation of their parent Container.
Read more: Understanding Event Triggering (page 275).
In most cases, an Auto Trigger is used in association with the activation of a
conditional Container. In particular, if an element inside a conditional Container
is given an Auto Trigger, it will be triggered when its parent Container activates.
In one instance, an Auto Trigger is associated with the deactivation of a
Container. In particular, conditional Containers all have Auto Deactivate
triggers (that cannot be deleted). This means that the Container will deactivate
when its parent Container deactivates. Note that if a conditional Container is not
within a conditional Container, it deactivates when the Model (root) Container
deactivates (i.e., at the end of the realization).
Viewing a Conditional The browser view of a conditional Container is shown below:
Container in the
Browser
Note: Element inputs and outputs are only shown in the browser if you choose
to Show element subitems (accessed via the browser context menu by right-
clicking in the browser).
Note: If you wish to import lookup tables or time history data from a
spreadsheet into GoldSim, or export time history data from GoldSim to a
spreadsheet, GoldSim provides specialized ways to do this using the Lookup
Table, Time Series and Time History Result elements that do not require a
Spreadsheet element.
You must first enter the name of a Microsoft Excel spreadsheet file to which you
wish to link by pressing the Options >> button. This will provide options for
either selecting an existing file, or creating (and then selecting) a new file.
Note: If you select a file in the same directory as (or a subdirectory below) your
GoldSim .gsm file, GoldSim will subsequently display just a local path. If you
select a file in a directory above your .gsm file, it will display the full path.
Once you have selected a file, you can subsequently use the Options >> button
to select a different file. You can also use the Options>> button to open the
selected file in Excel. (Note that multiple Spreadsheet elements can link to the
same spreadsheet file.)
Spreadsheet elements can be used in one of three ways:
1. You can use the spreadsheet as a database and import data from the
spreadsheet into GoldSim at the beginning of the simulation.
2. You can use the spreadsheet as a repository for results and export data
from GoldSim to the spreadsheet throughout a simulation.
3. You can use the spreadsheet as a function by exporting data into
specified cells in the spreadsheet from GoldSim, having the spreadsheet
recalculate, and then import data from "result" cells in the spreadsheet
back into your GoldSim model.
In all cases, you need to define either at least one input to the spreadsheet
element (data that you are exporting from GoldSim to the spreadsheet), or one
output from the spreadsheet (data that you are importing from the spreadsheet
into GoldSim).
The dialog lists all of the inputs and outputs that you have specified (inputs are
listed in the table first).
You add inputs and outputs by pressing the Add… button (which only becomes
available after you have specified a spreadsheet file). After pressing the Add…
button, the following dialog is displayed:
You must select whether you want to Import data from the spreadsheet (creating
an output to the element) or Export data to the spreadsheet (creating an input for
the element). If Use Wizard to define spreadsheet inputs and outputs is
checked, a wizard will pop up to guide you through the process of creating an
input or output. Otherwise, a dialog will appear. It is recommended that you
use the wizard until you are familiar with the use of the Spreadsheet element.
Read more: Using the Spreadsheet Wizard to Define Spreadsheet Inputs (page
575); Using the Spreadsheet Wizard to Define Spreadsheet Outputs (page 577).
Once you have defined or edited an input or output, the main Spreadsheet
element dialog is displayed again, listing all of the inputs and outputs that you
have specified (inputs are listed in the table first):
An input or output can be edited by either selecting the row and pressing
Edit…, or by double-clicking on the row. You can edit the spreadsheet location
of any entry by selecting the row and pressing Location…. An input or output
can be deleted by pressing the Remove button.
The up and down arrow buttons move the entries up and down the list (although
inputs will always be listed before outputs). Note that the relative positions of
the rows have no effect on how the element functions, and such repositioning is
purely cosmetic.
The Shift… button provides access to a dialog that allows you to quickly edit
the spreadsheet location of one or more inputs or outputs by shifting them by
one or more sheets, rows or columns.
Read more: Shifting Ranges for Inputs and Outputs to a Spreadsheet Element
(page 580).
Spreadsheet Element If you press the Export… button from the Import or Export Selection dialog
Inputs: Exporting Data (and the checkbox for using the wizard is cleared), or if you select an existing
to the Spreadsheet input in the main Spreadsheet dialog and press the Edit… button, the following
dialog is displayed:
Note: The size of the range must be consistent with the dimensions of the input
which you are sending to the spreadsheet. Hence, a scalar input must map to a
single cell; a vector input must map to a single column or row range with the
number of rows or columns matching the number of items in the vector; and a
matrix input must map to a rectangular range with the number of rows and
columns matching the dimensions of the matrix (e.g., a matrix with 3 rows and 6
columns would have to map to a range in the spreadsheet 3 rows long and 6
columns wide).
If required, you can control the sheet and cell range into which GoldSim exports
data dynamically. For example, you could instruct GoldSim to change the
location to which it exports data based on the simulation time or the realization.
Read more: Defining Offsets for Inputs and Outputs to a Spreadsheet Element
(page 579).
If you would like to edit the location of several inputs (or outputs)
simultaneously by shifting them by sheet, row or column, you can do this from
the main Spreadsheet element dialog using the Shift… button.
Read more: Shifting Ranges for Inputs and Outputs to a Spreadsheet Element
(page 580).
Using the Spreadsheet If you press the Export… button from the Import or Export Selection dialog,
Wizard to Define and the checkbox for using the wizard is checked, the Spreadsheet Wizard will
Spreadsheet Inputs be displayed:
change the units accordingly. Note that this page is skipped if the
output is dimensionless or a Condition.
4. On the last page of the wizard, you select the location in the
spreadsheet to which you wish to export the GoldSim data. You can do
this specifying the Sheet Name and Cell Range directly. Alternatively,
you can press the Location… button, which opens the spreadsheet and
provides a dialog allowing you to directly select the desired cell range
using your mouse.
Note: The size of the range must be consistent with the dimensions of the input
which you are sending to the spreadsheet. Hence, a scalar input must map to a
single cell; a vector input must map to a single column or row range with the
number of rows or columns matching the number of items in the vector; and a
matrix input must map to a rectangular range with the number of rows and
columns matching the dimensions of the matrix (e.g., a matrix with 3 rows and 6
columns would have to map to a range in the spreadsheet 3 rows long and 6
columns wide).
If required, you can control the sheet and cell range into which GoldSim exports
data dynamically. For example, you could instruct GoldSim to change the
location to which it exports data based on the simulation time or the realization.
Read more: Defining Offsets for Inputs and Outputs to a Spreadsheet Element
(page 579).
Spreadsheet Element If you press the Import… button from the Import or Export Selection dialog
Outputs: Importing (and the checkbox for using the wizard is cleared), or if you select an existing
Data from the output in the main Spreadsheet dialog and press the Edit… button, the following
Spreadsheet dialog is displayed:
This dialog allows you to define the order (scalar, vector, matrix) of the
output. Note that data from a spreadsheet can only be imported as
values (conditions are not supported and cannot be selected here).
3. The Units in Spreadsheet represents the units of the data in the
spreadsheet. This will also become the display units for the output after
it is imported into GoldSim.
4. You must then select the location in the spreadsheet from which you
wish to import the data. You can do this specifying the Sheet Name and
Cell Range directly. Alternatively, you can press the Location…
button, which opens the spreadsheet and provides a dialog allowing you
to directly select the desired cell range using your mouse.
Note: The size of the range specified in the spreadsheet must be consistent with
Type (scalar, vector , matrix) that you defined for the output. Hence, a scalar
output must map to a single cell; a vector output must map to a single column or
row range with the number of rows or columns matching the number of items in
the vector; and a matrix output must map to a rectangular range with the number
of rows and columns matching the dimensions of the matrix (e.g., a matrix with
3 rows and 6 columns would have to map to a range in the spreadsheet 3 rows
long and 6 columns wide).
If required, you can control the sheet and cell range from which GoldSim
imports data dynamically. For example, you could instruct GoldSim to change
the location from which it imports data based on the simulation time or the
realization.
Read more: Defining Offsets for Inputs and Outputs to a Spreadsheet Element
(page 579).
If you would like to edit the location of several inputs (or outputs)
simultaneously by shifting them by sheet, row or column, you can do this from
the main Spreadsheet element dialog using the Shift… button.
Read more: Shifting Ranges for Inputs and Outputs to a Spreadsheet Element
(page 580).
Using the Spreadsheet If you press the Import… button from the Import or Export Selection dialog,
Wizard to Define and the checkbox for using the wizard is checked, the Spreadsheet Wizard will
Spreadsheet Outputs be displayed:
Note: If you specify a spreadsheet range that is more than one cell, the size of
the range specified in Step 1 must be consistent with the size of the Array Label
set(s) specified in Step 2. Hence, a vector output must map to a single column or
row range with the number of rows or columns matching the number of items in
the vector; and a matrix output must map to a rectangular range with the number
of rows and columns matching the dimensions of the matrix (e.g., a matrix with
3 rows and 6 columns would have to map to a range in the spreadsheet 3 rows
long and 6 columns wide).
If required, you can control the sheet and cell range into which GoldSim exports
data dynamically. For example, you could instruct GoldSim to change the
location to which it exports data based on the simulation time or the realization.
Read more: Defining Offsets for Inputs and Outputs to a Spreadsheet Element
(page 579).
Defining Offsets for In some cases, you may want to specify the location in the spreadsheet file to
Inputs and Outputs to a which you are linking in terms of an offset from a defined location, in which the
Spreadsheet Element offset is defined by model variables (such as Time or Realization).
For example, you could instruct GoldSim to change the location to which it
exports data based on the realization number, with results from each realization
being exported to a different column in the spreadsheet file.
You do this by selecting the Offset… button when you are selecting a
spreadsheet location while defining inputs or outputs to a Spreadsheet file:
You select whether you want to offset by Sheet, Column, and/or Row by
clicking the appropriate checkboxes. For example, if you were exporting a
scalar GoldSim output to the spreadsheet file, and wanted to export the value to
Sheet1!A1 for realization 1, Sheet1!B1 for realization 2, and so on, you would
simply do the following:
1. Specify Sheet1!A1 for the Location in Spreadsheet
2. Define the Column offset as follows:
In this case, the offset would be 0 for Realization 1 (and hence the value would
be exported to Sheet1!A1), it would be 1 for Realization 2 (and hence the value
would be exported to Sheet1!B1), and so on.
Note: The offsets can be any expression with links to other GoldSim outputs,
but should be specified as dimensionless, integer values. GoldSim will not
accept expressions in these fields that have dimensions. Offsets defined as real
numbers are truncated.
Note: If as a result of an offset, you try to access a cell that is invalid (e.g., if
you specify a negative offset from the first column), GoldSim will display a fatal
error message at runtime.
If you wish to use a particular unit of time to define an offset, you must cast the
output to a dimensionless number. For example, Time|day| will represent the
number of days (which could be fractional, and hence will be truncated). Note
that Run Properties like Day and Year are, by definition, dimensionless.
Read more: Unit Casting (page 87); Understanding and Referencing Run
Properties (page 362).
When you close the Offset dialog and have a defined offset, this is indicated in
the Spreadsheet Location (Offset… is checked) and in the list of inputs and
outputs (any offset ranges are indicated as such).
Warning: In order to properly use offsets, you must have a good understanding
of the conditions and settings that control when GoldSim exchanges data with
the spreadsheet file.
Read more: Controlling When GoldSim Exchanges Data with the Spreadsheet
File (page 582).
An example model which includes an illustration of the use of offsets for a
Spreadsheet element (Spreadsheet.gsm) can be found in the Examples folder in
your GoldSim directory.
Shifting Ranges for In some cases, you may want to edit the location of several inputs (or outputs)
Inputs and Outputs to a simultaneously by shifting them by sheet, row or column.
Spreadsheet Element This could happen, for example, if you have multiple Spreadsheet elements
linked to a single spreadsheet with multiple sheets. You may want each
Spreadsheet element to link to a different sheet of the file, but otherwise, you
would like all of the row and columns in the links to be identical.
GoldSim provides a very convenient way to shift multiple inputs or outputs by
sheet, row, and/or column.
You do this by selecting the items that you want to shift, and pressing the
Shift… button from the main Spreadsheet element dialog:
Multiple contiguous rows in this dialog can be selected by holding down the
Shft key while selecting with the mouse. Multiple rows that are not contiguous
can be selected by holding down the Ctrl key while selecting with the mouse.
All rows can be selected by placing cursor in any row and pressing Ctrl-A.
When you select items and press the Shift… button, the Spreadsheet element
dialog expands to show the following section:
The Up and Down keys shift the selected items by row. The Left and Right
buttons shift the selected items by column.
Note: If you try to shift beyond the valid range for any of the selected items
(e.g., if you try to shift left and one of the items is defined as being in column A)
GoldSim will not shift any of the items.
The Change Sheet… button displays a dialog for selecting a new sheet to apply
to all selected items:
The drop-list includes all worksheets present in the Excel file. By default, no
new sheet is selected. If you press OK without selecting a sheet, no changes are
made. If you select a sheet and press OK, all selected items will be updated
(they will point to that sheet).
Locking onto a GoldSim allows you to “lock onto” the spreadsheet file that is being referenced.
Spreadsheet File When you lock onto a file (by selecting the Lock onto selected file item in the
menu displayed via the Options>> button), the following additional information
regarding the referenced file is saved with the element:
• File and path name;
• Date the file was created;
• Date the file was last modified;
• File size; and
• CRC signature.
Once you have locked onto a file, the CRC signature is displayed in a tool-tip
when you hold your cursor over the filename in the dialog.
The CRC signature is an alphanumeric code that can be used to uniquely
identify whether the file contents have changed. When you run a model that has
locked onto a file, GoldSim compares the CRC signature of the file with the
original signature that was stored. If these are not identical (indicating that the
file has been changed), GoldSim displays an error message and will not run the
model.
You can unlock a file by clearing the Lock onto selected file item. Note that if
versioning is enabled, whenever a file is locked onto or unlocked, this
information is logged with the version.
Read more: Tracking Model Changes (page 638).
Note: Saving changes to a spreadsheet file and file locking are mutually
exclusive. If the Save MS-Excel file after simulation item is selected in the
Options>> menu when you try to lock onto a file, GoldSim will warn you that
locking onto the file will automatically disable saving changes to the MS-Excel
file. When you lock onto a file, the Save MS-Excel file after simulation item
is no longer available in the Options>> menu.
Note: The act of opening a workbook in Excel automatically modifies the file,
even if no changes are made. In order to allow spreadsheet files to be viewed
without changing the CRC signature, GoldSim automatically makes the file
read-only when it is locked onto. Note that if it is subsequently unlocked, it
remains read only, and you will need to change this manually if you wish to edit
the file.
Read more: How Spreadsheet Files are Affected by GoldSim (page 585).
Controlling When Whenever a Spreadsheet element is used in a model, GoldSim uses the
GoldSim Exchanges following information to determine when during the simulation it should import
Data with the data from or export data to the spreadsheet file:
Spreadsheet File
Note: The Recalculate in Excel during simulation setting is only available via
the Options>> button if you are both exporting data to and importing data from
the spreadsheet. That is, it only makes sense to recalculate during a simulation
if you are using the spreadsheet like a function (i.e., sending it data, asking it to
recalculate, and then retrieving results).
The following table summarizes how this information is used to determine when
to exchange data with the spreadsheet file:
Note: When you use a Spreadsheet element, there may be a delay of several
seconds at the start of a simulation as Excel is loaded into memory. Once it is
loaded, however, the simulation should progress rapidly.
Warning: You should never try to open a spreadsheet that is linked to GoldSim
while a simulation is running. In addition, prior to running a GoldSim model
that is linked to a spreadsheet, all referenced spreadsheets should be closed.
If you are importing data from a spreadsheet, you can tell GoldSim to import the
data while in Edit Mode by selecting Update Spreadsheet Outputs via the
Options>> menu button. When you do this, GoldSim will import the data
currently existing in the spreadsheet. If the information being imported is
impacted by data that is being exported to the spreadsheet (and that data can be
computed in Edit Mode), GoldSim will export the data to the spreadsheet,
trigger a recalculation, and import the data from the spreadsheet to GoldSim,
where it can be viewed as an output of the spreadsheet element.
By default, GoldSim’s interactions with the Excel spreadsheet only affect a copy
How Spreadsheet Files of the spreadsheet temporarily stored in memory, and do not affect the data
are Affected By permanently stored in your spreadsheet file. That is, following your simulation,
GoldSim the spreadsheet file will be unchanged (even if during the simulation GoldSim
has sent data to cells in the spreadsheet).
In some cases, however, you may want to save the changes you make to a
spreadsheet (i.e., when GoldSim exports data to the spreadsheet). To do so,
select the Save MS-Excel file after simulation item in the Options>> menu
(which by default is cleared).
Note: Unless you use offsets that vary with time or realization, if you access the
spreadsheet multiple times (at multiple timesteps or for multiple realizations),
only the changes made to the spreadsheet the final time you access it will be
saved (all the previous modifications will be overwritten each time that you
access it).
Read more: Defining Offsets for Inputs and Outputs to a Spreadsheet Element
(page 579).
Note: Saving changes to a spreadsheet file and file locking are mutually
exclusive. If the Save MS-Excel file after simulation item is selected in the
Options>> menu when you try to lock onto a file, GoldSim will warn you that
locking onto the file will automatically disable saving changes to the MS-Excel
file. When you lock onto a file, the Save MS-Excel file after simulation item
is no longer available in the Options>> menu.
Warning: You should always close any spreadsheets that are referenced by
GoldSim prior to running your GoldSim model. In fact, in most cases, GoldSim
will warn you if it tries to interact (in particular, write to) a spreadsheet that is
already open.
Exchanging Date In some cases, you may wish to exchange date or time information with a
Information with a spreadsheet. For example, you may wish to send the current date in the GoldSim
Spreadsheet simulation to a cell formatted as a date in a spreadsheet, or retrieve a date from a
spreadsheet into GoldSim. In order to do so, you must understand how
Microsoft Excel (and GoldSim) deal with dates.
Within Excel, a date is stored internally as the number of days (which can be
fractional) since December 31, 1899 00:00:00. Hence, if you were to export the
number 4.25 into a spreadsheet cell formatted as a date, it would be interpreted
as January 4, 1900 at 6:00:00 AM. However, Excel mistakenly adds an extra
day into its calendar that did not actually exist (February 29, 1900). As a result,
the effective Julian date reference for all times after March 1, 1900 in Excel is
actually December 30, 1899 00:00:00.
Within GoldSim, the Run Property Time represents the elapsed time since the
reference date December 30, 1899 00:00:00. Hence, for all dates after March 1,
1900, Excel and GoldSim have the same effective Julian date reference.
Given this information, the following rules should be followed for exchanging
date information between GoldSim and a spreadsheet:
• When exporting a date/time from GoldSim to a spreadsheet cell, you
should select Days for the Units in Spreadsheet. If the spreadsheet
cell is formatted as a date, it will display as a date; otherwise, it will
display the number of days from December 30, 1899 00:00:00 to the
specified date that was exported.
• When importing a date or time from a spreadsheet cell, you should
select Days for the Units in Spreadsheet. In this case, the associated
output from the Spreadsheet element would represent the number of
days from December 30, 1899 00:00:00 to the particular date that was
imported from the spreadsheet.
Read more: Referencing Dates in Expressions (page 121); Setting the Basic
Time Options (page 344).
Saving Spreadsheet You can save results for a Spreadsheet element by clicking Final Values and/or
Element Outputs Time Histories. Checking one of these causes all output arguments to be saved.
If the element has multiple outputs, and you wish to save only one or two of
these as results, you can use the context menu of the output in the browser
(accessed via a right-click on an output) to turn on or off a particular output. In
this case, the checkbox in the dialog would then become a box instead of a
check (indicating that only some of the results will be saved). Note that in order
to see outputs in the browser you must first ensure that Show element subitems
is selected for the by right-clicking anywhere in the browser.
As can be seen, the browser view shows an item for each specified input to the
spreadsheet, and an item for each specified output.
Note: Element inputs and outputs are only shown in the browser if you choose
to Show element subitems (accessed via the browser context menu by right-
clicking in the browser).
External (DLL) In some situations, you may wish to define a complex function which can not be
Elements readily implemented using the expression editing features supplied by GoldSim.
For example, calculation of an output may require a very complex set of logic
Defining the External The editing dialog for an External element is shown below:
Element
In order to use an External element, you must first specify the DLL and
Function within the DLL that the element will utilize:
DLL: This is the name of the dynamic link library containing the external
function. You can press the Browse button (the folder to the right of the
DLL field) to search for the file. In general, you should specify the full path
to the DLL. (If you specify just the filename, it will look for the DLL only
in the working directory containing the GoldSim model file). Note that a
single DLL can contain multiple external functions.
Function: This is the specific name of the external function in the DLL.
This name is case-sensitive and must exactly match the name of the
function in the source code for the external function.
Note: If you append “;OneTime” (without the quotes) after the DLL’s name,
GoldSim will unload the DLL (and continue the simulation). This is useful when
running very large model files (in which the DLL only needs to be called
infrequently). If the DLL is subsequently called again, GoldSim will
automatically reload it.
Note: You can use GoldSim's File element to automatically copy the DLL file
from some location (typically on a network) to your machine. Because GoldSim
records this action in the Run Log, it can provide an "audit trail" to ensure that
the proper version of an external file (such as a DLL) was used in a particular
simulation.
When you press Add Input, a new row is added. The first column (Input) is a
normal edit field in which you can add a constant, an expression or a link. Right-
clicking in this field displays a context menu for inserting a link, units, functions
and other editing features. The second column (Type) displays the data type and
dimension (in the form of its display units) of the Link and cannot be edited. The
third column (Outgoing Units) represents the units that the input is to be
converted to before it is sent to the External function. The dimensions of these
units must be consistent with those displayed in the Type column.
Note: The input arguments are sent to the external function in exactly the order
in which the inputs are listed.
When you press Add Output, a new row is added, and a dialog for defining the
data type and order of the output is displayed.
This dialog allows you to define the data type (e.g., Value, Condition), and order
(scalar, vector, matrix) of the output. You can subsequently edit this information
by selecting the output in the list and pressing the Edit Type… button.
After closing this dialog, you can press the Edit Unit… button to specify the
Display Units for the output and the Incoming Units. The dialog looks like this:
The Incoming units represent the units in which the External function returns
the value. Obviously, the Display Units and the Incoming Units must have the
same dimensions.
Note that within the Add/Remove Outputs dialog, only the Output ID can be
edited directly. The remaining columns display the data type, order and
dimensions of the output and can only be edited by selecting the row (by
clicking in it) and pressing the Edit Type… button.
Note: It is assumed that the output arguments will be sent from the external
function in exactly the order in which the outputs are listed.
Running the DLL in a By default, GoldSim loads DLLs used by External elements into the GoldSim
Separate Process process space. GoldSim and the all external DLLs therefore share the
application’s address space, which is usually limited to 2 GB on Windows
operating systems. In some case, a single DLL itself may have large memory
requirements (e.g., if it loaded large sets of data from files or databases), or it
could statically or dynamically allocate large blocks of memory. If the combined
memory requirements of GoldSim (the executable), the GoldSim model
(including all model properties, buffers and result values) and all DLLs exceeds
2 GB, GoldSim will be unable to carry out the simulation. The user will be
forced to preserve memory by saving fewer histories or time steps, or by turning
off saving of results for certain elements.
To circumvent this limitation, GoldSim provides a feature that allows external
DLLs to be executed outside of the GoldSim process space. If Run in separate
process is checked, GoldSim does not load the DLL into its process space.
Instead, it launches a separate small DLL server with its own private process
space. The DLL server works like a middleman who dispatches information
between GoldSim and the external DLL. Each DLL that runs in a separate
process has its own DLL server. Therefore each DLL has access to a private 2
GB process space, which is not shared with any other DLL or application.
Using an External In some cases, you may wish an external program to directly generate a look-up
Element to Define table that you can use to dynamically define a Lookup Table element.
Lookup Tables Read more: Lookup Table Elements (page 227).
To facilitate this, GoldSim allows you to define the table using an External
element. The entire table then becomes an output of the External element, which
can subsequently be linked to a Lookup Table element.
In order to specify that an output of the External element is a table, you must
indicate that the Data Type of the output is a 1D, 2D, or 3D Table Definition
(when you press Add Output or Edit Type… in the Add/Remove Outputs
dialog for the External element):
When you do so, a new tab (External DLL) is added to the dialog. You use this
tab to specify the name of the External element output that defines the table.
Note: In order to link a 1D, 2D, or 3D Table Definition output from an External
element to a Table element, the dimensions specified in the Incoming Units
dialog for the output must be consistent with the Result Units and the
Independent Variable units specified when defining the Lookup Table element.
Note: After you have defined a Lookup Table element externally and run the
model (so that the DLL has loaded the table into the Lookup Table element),
you can view the table definition created by the external function by pressing
View Data…. In addition, if you have run the model and you subsequently
"uncouple" the External element from the Lookup Table element (by selecting
“None” from the Data Source drop-list in the Lookup Table dialog), the data in
the table will become accessible (by pressing Edit Table…).
Saving External You can save results for an External element by clicking Final Values and/or
Element Outputs Time Histories. Checking one of these causes all output arguments to be saved.
If the element has multiple outputs, and you wish to save only one or two of
these as results, you can use the context menu of the output (accessed via a
right-click) in the browser to turn a particular output on or off. In this case, the
checkbox in the dialog would become gray (indicating that some of the results
will be saved). The display units for these outputs are defined when the output is
created.
Note: Element inputs and outputs are only shown in the browser if you choose
to Show element subitems (accessed via the browser context menu by right-
clicking in the browser).
The browser view shows an item for each specified input argument, and an item
for each specified output argument.
File Elements The File element is a support element in GoldSim. It has no inputs or outputs
and carries out no calculations. Its purpose is to simply control copies of
auxiliary files that may be required by External elements and Spreadsheet
elements.
File elements have two uses:
• To ensure that all necessary support files are passed to Slaves when
using the GoldSim Distributed Processing Module; and
• To ensure that support files which are stored on a network are accessed
for use in a simulation, and to provide an “audit trail” of the file
transfer.
In the latter case, the File Element utilizes a specifically formatted database to
identify a "source" file, typically on a network, and then copy the target file onto
the local computer. This file is then available for access by GoldSim elements.
The dialog for a File element looks like this:
Using File Elements to The most common use of a File element is to ensure all necessary support files
Support Distributed are passed to Slaves when using the GoldSim Distributed Processing Module.
Processing The Distributed Processing Module allows you to use multiple computers
connected over a network to share the computational burden of a Monte Carlo
simulation. This is accomplished by having a Master (server) GoldSim
executable connect to multiple Slave (client) GoldSim executables.
The first step in such a simulation is for the Master to transfer the necessary files
(the model files and any support files) to the Slaves.
If the model uses any External or Spreadsheet elements, the Master
automatically transfers the DLLs and spreadsheet file, respectively, to the
Slaves. If, however, these elements reference any other files (e.g., if the DLL
reads in a separate data file the first time it is called), GoldSim has no way of
knowing this, and could not send the required files to the Slaves.
The File element can be used to overcome this problem. Any file referenced by
a File element is automatically sent to Slaves in a distributed processing
simulation.
Hence, when using the Distributed Processing Module with external function
elements that reference other files, a File element should be created for each file.
The file name should be entered in the Local file name field of the File element,
and the Database checkbox should be cleared. If no path is provided, the file
should be placed in the same directory as the model file, and if the file cannot be
found locally, the Status area displays “Local file missing”, and the simulation is
not allowed to proceed.
Using File Elements to A File element can be used to ensure that support files which are stored on a
Access a File on a network are accessed for use in a simulation, and to provide an “audit trail” of
Network the file transfer.
When used in this way, the Element ID for the File element is used as a key to
access a record in a specifically formatted database referred to as a Yucca
Mountain database. This record provides a network path-name for the source
file, and also provides an integrity-checking code for the file (to ensure that the
file was copied with no errors).
Read more: Downloading from a Yucca Mountain Database (page 651).
To use a File element in this way, the Database box must be checked, and you
must enter the data source name associated with a Yucca Mountain database.
Before using GoldSim’s database features you must first define all available
databases on your computer using Control Panel’s 32-bit ODBC Data Sources
option. This allows you to define a name for each data source, and link it to a
specific database file.
Read more: Adding Data Sources to Your Computer (page 647).
When the Download Now button is pressed, or when a global database
download is carried out, GoldSim locates the source file and makes a copy of it.
The Local file name input field defines the local destination for the copy of the
source file. If the local already exists, it is automatically overwritten.
After copying, the CRC signature of the downloaded file is compared to that of
the file entered in the database to ensure the integrity of the data transfer. (The
CRC signature is an alphanumeric code that can be used to uniquely identify
whether the file’s contents have changed.) If the codes are different, the
download is treated as having failed.
As is the case for other Yucca Mountain database records, you can optionally
Select most recent value no later than, in which case GoldSim will interrogate
the database for the most current version of the source file dated on or prior to
that date. If this field is left blank, GoldSim will use the default effective date, as
specified in the GS_Parameter table. Details in the format of the Yucca
Mountain database are provided in Appendix F.
Locking onto a File GoldSim allows you to “lock onto” the file that is being referenced by a file
element. When you lock onto a file (by checking the Lock onto this file option
in the File element dialog), the following additional information regarding the
referenced file is saved with the element:
• File and path name;
• Date the file was created;
• Date the file was last modified;
• File size; and
• CRC signature.
Once you have locked onto a file, this information is displayed in a tool-tip
when you hold your cursor over the filename in the dialog.
The CRC signature is an alphanumeric code that can be used to uniquely
identify whether the file contents have changed. When you run a model that has
locked onto a file, GoldSim compares the CRC signature of the file with the
original signature that was stored. If these are not identical (indicating that the
file has been changed), GoldSim displays an error message and will not run the
model.
You can unlock a file by clearing the Lock onto this file checkbox. Note that if
versioning is enabled , whenever a file is locked onto or unlocked, this
information is logged with the version.
Read more: Tracking Model Changes (page 638).
Localizing Containers
In most models, element names are forced to be unique. In some cases, however,
you may want to have more than one element with the same name. This
requirement usually arises when you have a number of similar subsystems in
your model.
For example, suppose that you have developed a subsystem (within a Container)
that calculates the balance in a bank account as a function of the previous
balance, interest rate, deposits and withdrawals. Each of these items would be
represented by its own element in the Container. After creating these elements,
you decide you would like to track ten other accounts.
In such a case, it would be convenient to create ten copies of the Container (one
for each of the other ten accounts). If GoldSim allowed you to just make copies
of the bank account Container, however, there would be confusion when you
referred to an element by name (e.g., in an expression), since GoldSim would
have no way of knowing which copy of the element you were referring to.
GoldSim’s solution to this problem is to allow you to localize portions of your
model, such that any element names in the local region are hidden from
elements outside of that region. A local region is referred to as a scope in
GoldSim. Elements with the same name cannot exist within the same scope.
Elements can, however, have the same name if they are located in different
scopes. You change the scope of an element by localizing the Container in
The dialog lists all localized Containers containing the element (i.e., if
the element is contained within nested localized Containers, all of the
localized Containers are shown). The output can be exposed on any (or
all) of the localized Containers in which it resides by clicking on the
Container name. If the output is already exposed on a particular
Container, a check will appear next to the Container name.
Once an output is exposed, it remains exposed even if the element to which it
was originally linked is deleted. The only way to unexpose an output is to access
the context menu for the output, and under the Expose Output option, clear the
check mark (by clicking on it) for the Container.
Nesting Localized Localized Containers can be nested, so that a localized Container (referred to
Containers here as the parent) can itself contain a localized Container (referred to here as
the child). In such a case, the scope of the parent localized Container does not
extend into the child localized Container.
To illustrate this, consider the following example. Suppose you had a localized
Container L1, containing a second localized Container L2. A Reservoir element
named R1, with an output (among others) called Overflow_Rate, exists in L2.
Because this Reservoir is within a localized Container, a second Reservoir
element with the same name could exist in L1.
If the Overflow_Rate for the Reservoir in L2 was exposed on L2, and the
Overflow_Rate for the Reservoir in L1 was exposed on L1, these outputs would
be referenced as shown schematically below:
Hence, if you were to reference R1.Overflow rate from an expression within L1,
it would link to a different element than if you were to do the same from an
expression within L2.
Read more: Search Logic for Linking to an Output Present in Multiple Scopes
(page 600).
Defining an Alias for There are some situations where referencing an exposed output of a localized
an Exposed Output container might be ambiguous. In particular, suppose you exposed the
Overflow_Rate from the Reservoir in L2 on Container L1. How would you then
reference this output from outside of L1? L1.Overflow_Rate is already used (it
refers to the output from the Reservoir in L1). The same problem would occur if
you added another Reservoir element with a different name (e.g., R2) to L1 and
exposed the Overflow_Rate on L1. Again, L1.Overflow_Rate is already used
and is not available.
GoldSim solves this potential conflict by defining an alias for each exposed
output. Whenever at least one output is exposed on a Container, an Exposed
Outputs tab is added to the Container's property dialog:
If you hold the cursor over the Output field, a tool-tip showing the full path to the output is
displayed.
The first column on this tab lists the full path of the output (which uniquely
identifies it). The second column contains an alias. By default, the alias is the
output name. When you reference an exposed output outside of a localized
Container, it is not actually referenced as ContainerID.OutputID. Rather, it is
referenced as ContainerID.Alias.
If you expose an additional output which has the same output name, GoldSim
automatically appends a number to the alias.
Note: The aliases automatically created by GoldSim for outputs with the same
name depend on the order in which the outputs are exposed. The alias of the first
output with a particular name that is exposed is always the output name.
GoldSim then adds numbers (beginning with 2) to each additional output with
the same name that is exposed on the Container.
Although GoldSim automatically creates aliases, you can manually edit an alias
if you wish (by clicking on it in the dialog). The same rules that apply for
element names apply for aliases: Aliases can only include letters, numbers, and
the underscore ("_") character. They cannot include spaces and must begin with
a letter. Furthermore, for a given Container, no two exposed output aliases can
be the same.
Search Logic for Although the outputs of an element in a localized Container can be referenced
Linking to an Output outside of the Container only if the output is exposed on that Container, the
inputs to the element can come from any location in the model. That is, a
Present in Multiple localized Container is analogous to a two-way mirrored glass: you cannot look
Scopes into the Container, but you can look out of it.
In cases where multiple outputs with the same name exist in a model, however,
it is important to clearly identify the search logic used by GoldSim to link to
outputs.
Consider the following example. Localized container L2 is contained within
localized Container L1. Both L1 and L2 contain an element (with a primary
output) named A1. A third element named A1 also exists outside of L1. Within
L2, you create an Expression element (named B1), and specify its definition as
2*A1. Which of the three A1 elements does GoldSim create a link to?
The schematic above illustrates the search logic GoldSim would use to create
the link. It would first look within its own scope (the local scope of B1). If it
finds A1 there, it creates the link. If it does not find A1 in its local scope, it
moves one level up in the scope hierarchy (in this case within L1) and looks for
it there. If it finds A1 there, it creates the link. If it does not find A1 at that level,
it continues to search upward through the various scopes that it has access to
until it finds an A1, or exhausts the search (and fails to complete the link).
Globalizing a You can convert a localized Container to a normal (global) Container in two
Container ways:
• By selecting Globalize from the context menu for the element in the
graphics pane or a browser (accessed via a right-click); or
• By clearing the Localization checkbox on the Container’s property
dialog.
When you do this, GoldSim first checks to ensure that none of the elements in
the Container will conflict with (i.e., have the same name as) other elements in
the scope into which the Container's contents will be placed when it was
globalized. If it finds a conflict, it will not globalize the Container, and will issue
a warning message. You will not be able to globalize the Container until all of
the conflicts are eliminated (i.e., until all conflicting elements are renamed).
Cloning Elements
In some situations, you may wish to have elements in your model that always
have identical definitions. You could accomplish this by copying an element to
various locations in your model, but if you ever needed to change the definition
of the element, you would need to make the change to all the copies, and this
could be time-consuming and error-prone.
GoldSim addresses this issue by allowing you to create multiple clones of an
element. When you create clones of an element, all of the clones behave
identically: if you change one of the inputs to a clone, the same input is
automatically changed for all of the other clones.
Clones are often used in conjunction with localized Containers. For example,
suppose that you wished to model the salmon populations in each of ten streams.
To do this, you might create ten parallel (adjacent) localized Containers, each of
which represented a different stream. Although the inputs differ, let's assume
that the basic algorithm used to compute the salmon population as a function of
time was the same for each of the ten streams.
One way to build this model would be to create the elements representing the
algorithm and copy them to each of the ten Containers. If, however, you were
expecting to frequently change and modify the algorithm (e.g., as more data
became available), it would become cumbersome (and error-prone) to edit the
elements in all ten Containers whenever you wanted to make a change.
Clones provide an easier way to build and maintain such a model: You would
simply create ten sets of clones (rather than copies) of the elements defining the
algorithm and place them in each of the ten localized Containers. Then if you
wanted to modify the algorithm, you would need only to change the elements in
one of the Containers and the corresponding clones of those elements would
automatically be changed in all of the others.
Note that use of clones does not imply that all clones produce the same output
result; it only implies that they have the same definition. For example, a cloned
Expression element might have the definition 2*A. All clones of the element
would indeed have the same definition, but if the clones were each located in a
different localized Container, then A in one Container could have a different
value than A in another Container (i.e., each localized Container could have its
own element A). As a result, the output of the Expression would be different in
each Container.
Creating Clones You create clones of an element by right-clicking on the element you wish to
clone in the graphics pane or a browser to access its context menu, and selecting
Clone Element.
When you do so, you will then be presented with a dialog containing all of the
Containers in your model. Using this dialog, you must then select the Container
into which you wish to place the clone.
If you select a Container in the same scope as the element you are cloning (or an
existing clone of the element), GoldSim will ensure that the names of none of
the clones conflict by adding a number to the end of the new clone. If you select
a Container in a different scope, the cloned element will have the same name as
the element being cloned.
All clones are "equal". That is, the original element is no different than the
clone which was created from it. Both are clones, and if you change an input to
one, the same input in the other is automatically changed accordingly.
You can always recognize a clone by looking at the properties dialog: all clones
have an additional tab, labeled Clones.
The Clones tab lists all of the clones of the element. There is no limit on the
number of clones of an element that can be created.
Pressing the Go button in this dialog jumps directly to the selected clone.
Element Properties that If you change an input for one clone, it is automatically changed for the other
are Not Cloned clones. This is the case for standard inputs, as well as other properties, such as
checkboxes.
There are, however, several exceptions to this rule:
• Names (element IDs) are never cloned. Each clone can have a unique
name.
• Descriptions are never cloned. Each clone can have a unique
description.
• Save flags (i.e., Save Final Values and Save Time Histories) are never
cloned. You must separately select whether you wish to save results for
each clone.
• The graphical properties of an element (e.g., size, color, and symbol
used in graphics pane) are not cloned. Each clone can have a different
appearance.
• The random seed of Stochastic elements is not cloned. Therefore,
cloned Stochastic elements have different seeds (and hence will have
different sampled values).
Elements that Cannot Three element types cannot currently be cloned:
be Cloned • Result elements;
• File Elements; and
• Dashboards.
No option is provided to clone these elements. Moreover, if they are present in a
Container that you want to clone, you will not be able to clone the Container.
Read more: Cloning Containers (page 604).
Freeing a Clone In some situations, you may want to "declone" or "free a clone" (i.e., change it
(Decloning) to a "normal" element). You can do this by right-clicking on the clone you wish
to declone in the graphics pane or a browser to access its context menu, and
selecting Free Clone.
In either case, the element will be changed into a "normal" element: it will no
longer be a clone (and the Clone tab will no longer appear in the properties
dialog for the element).
Note that if the element was one of only two clones before it was freed, the other
remaining clone would also be automatically freed (since it would have no other
clones).
Similarly, if you delete a clone which was one of only two clones before it was
deleted, the remaining clone is automatically freed.
Cloning Containers In addition to cloning individual elements, you can also clone an entire
Container. Before cloning a Container, it must first be localized. Once a
Container is cloned, it cannot be globalized.
When you clone a Container, all of its contents are also automatically cloned.
Any change you make to any element within one cloned Container is made to all
of the clones. In particular,
• When you create, paste or delete an element in one cloned Container, it
is automatically created, pasted or deleted in all of the cloned
Containers.
• When you move an element between Containers inside of a cloned
Container, it is automatically moved within all of the cloned
Containers.
• When you move an element into a cloned Container, the element is
replicated and moved into all of the cloned Containers.
• When you move an element out of a cloned Container, that copy is
moved and all of the clones of the element in the other cloned
Containers are deleted.
Several other points regarding cloned Containers should also be noted:
• The names of all elements within a cloned Container are also cloned.
(Recall that cloned elements which are not inside a cloned Container
can have different names).
• You cannot declone an element which is inside a cloned Container.
• When you declone a Container, the elements inside the formerly cloned
Containers remain clones. Once the Container is decloned, however,
you can individually declone elements within the Container.
• Some elements cannot be cloned (Dashboards, Files, Results). If these
elements are present in a Container, the Container cannot be cloned. If
one is added to an existing cloned Container, it is also added to the
other clones, but the properties of the element are not cloned.
• If graphic images are present inside a Container when it is cloned, these
are copied to the cloned Containers. If they are subsequently edited,
however, the changes are not propagated to the other cloned
Containers.
• When you change the positions of elements within a cloned Container
(e.g., by dragging an element from one part of the screen to another),
the new position is not propagated to the other cloned Containers.
The key to using cloned Containers is to provide unique inputs to them from
elements that are outside of them (otherwise, all of the cloned Containers would
behave identically and produce exactly the same results). This can be done by
placing the cloned Containers within separate localized Containers:
In the example shown above, the two cloned Containers (Clone1 and Clone2)
are within two separate localized Containers (L1 and L2). Within the cloned
Containers, all the equations and elements are, by definition, identical. In this
example, it is assumed that within each cloned Container, an element references
Data1. Since the clones are in different localized Containers, however, they each
link to a different Data1 element.
Copying Containers In general, you cannot copy a cloned element to create another cloned element.
with Clones If you simply copy a clone and paste it elsewhere, the pasted element will not be
a clone. The only way to clone an element is to right-click on it and select
Clone Element.
Under one circumstance, however, you can create a clone by copying and
pasting an element. In particular, you can create clones if you copy and paste a
Container that contains clones.
When you copy and paste a Container that contains clones, GoldSim uses the
following rules when the Container is pasted:
• If the Container contains at least two elements that are clones of each
other (cloned sisters), the pasted Container will also treat those
elements as clones. Note, however, that they will not be clones of the
elements in the original Container. For example, if Container1 contains
elements A and B that are sister clones, and Container1 is copied and
pasted (and the pasted Container is named Container2), A and B inside
Container2 will be clones of each other, but they will not be clones of
the original A and B in Container 1. The rule here is simple: when you
copy and paste a Container with clones, under no circumstances can
you increase the size of a set of existing clones. You can only make a
copy of a set (forming a new set of clones).
• If the Container contains only one clone (with the other clones being
outside of the copied Container), the element will not be a clone in the
pasted Container.
The property dialog for a Previous Value element looks like this:
Inputs and Outputs to
a Previous Value
Element
When defining a Previous Value element, your first step should be to specify the
type of output for which you want to compute a previous value. You do this by
pressing the Type… button, which will display the following dialog:
Note: The Initial Value must be a number or a link from a static variable (e.g., a
constant Data element, a Stochastic, or an Expression that is a function of
constant elements).
Obviously, the Reference and the Initial Value inputs to the Previous Value
element must have the same attributes (type, order and dimensions) as specified
in the attributes dialogs (accessed via the Type… button).
Note: If you specify the output type as a Discrete Event Signal, the Reference
field will also accept Discrete Change Signals. However, the information in the
signal (Instruction and Value) will be lost when it is output by the Previous
Value element.
If you place a Previous Value element inside a looping Container (and the
Reference is a Value of a Condition), the element has an additional property
(Reinitialize when looping starts) that controls how the Initial Value is treated
between loops:
Note: The rate of change output is only available if the Reference is a Value.
Viewing a Previous The browser view of a Previous Value element is shown below:
Value Element in the
Browser
As can be seen, the browser view shows the two inputs (Reference and Initial
Value) and the two outputs (the previous value itself, which has the same name
as the element, and the RateOfChange).
Note: Element inputs and outputs are only shown in the browser if you choose
to Show element subitems (accessed via the browser context menu by right-
clicking in the browser).
Timestep B at previous A B
timestep
0 2 1.333 2.667
1 2.667 1.111 2.889
2 2.889 1.037 2.963
3 2.963 1.012 2.988
4 2.988 1.004 2.996
5 2.996 1.001 2.999
6 2.999 1.001 3.000
7 3.000 1.000 3.000
Note: An even more effective way to solve this particular problem would be to
embed the system of equations in a looping Container. In such a case, the
iteration would not require any timestepping (the iteration would occur within a
single timestep). In fact, looping Containers are one of the most important uses
for Previous Value elements. This is illustrated in the file
LoopingContainers.gsm, which can be found in the Examples folder in your
GoldSim directory.
elements. In order to do so, however, the loop must meet one requirement: it
must contain at least one state variable.
Read more: Understanding State Variables and How GoldSim Evaluates Loops
(page 266).
Recursive loops, on the other hand, represent dynamic processes in which the
variables in the loop respond instantaneously to each other. That is, they are
coupled. Simulating systems like these in GoldSim requires approximating the
solution by using Previous Value elements.
Finding Recursive When using the Function Of or Affects View on an element that is within a
Loops feedback or recursive loop, GoldSim will stop building a branch of the
dependency tree as soon as an item is repeated (and it will mark this as a
“loop”).
Read more: Viewing Element Dependencies (page 104).
For example, if A is a function of B, B is a function of the previous value of C,
and C is a function of A, the Function Of View for A would look like this:
When using the Find function (Ctrl+F) in a Function Of or Affects view, one of
the options is to search in Labels. If this is selected, and you enter “loop”,
GoldSim will find the next loop in the list (since it will find the word “loop” in
the label for the element). When using this search method, GoldSim will find all
the loops (both feedback loops and recursive loops) in the model.
Read more: Finding Elements (page 103).
Note: When you specify a Container as having Looping Capability, you cannot
also define an Internal Clock for the Container (these two options are mutually
exclusive).
Loop UNTIL condition is true. In this case, the loop is carried out as
follows:
1. At the beginning of the calculation, the loop counter is set to 1.
2. The contents of the Container are updated.
3. GoldSim tests the Condition.
4. If the Condition is True, the looping calculation is assumed to be
complete.
5. If the Condition is False, the loop counter is incremented.
6. Go to Step 2.
This is illustrated schematically below:
Note: “Loop Until” Containers always update at least once. “Loop While”
Containers may not update at all (if the loop condition is not met).
Read more: Understanding State Variables and How GoldSim Evaluates Loops
(page 266).
The loop counter itself can be referenced by any element inside the Container
(and within the Condition field) as “~LoopCount”. For example, if the
Condition was defined as follows:
The Condition must reference at least one output from within the looping
Container (the loop counter is considered to be within the Container). If it does
not, GoldSim will display an error message (since otherwise, the Condition
could not change from loop to loop, and hence has no meaning).
Warning: GoldSim will not exit a loop until the Condition has been met, and
there is no upper limit on the number of loops that can be carried out. As a
result, you should be careful when defining your Condition to ensure that you
do not define an infinite loop. You can always do so by directly referencing the
loop counter (e.g., adding something to the Condition such as “OR ~LoopCount
> 1000”) If it seems that you are in an infinite loop, you should pause the
simulation (using the Pause button on the Run Controller) and evaluate the loop
counter and the condition. You can subsequently stop a simulation using the
Abort button on the Run Controller.
Understanding How The elements inside the Container are updated as follows during the loops:
Elements Inside a 1. On the first loop, the elements are moved forward in time to the next
Looping Container scheduled timestep;
are Updated
The looping system shown here would be updated every loop (changing X , and
hence the previous value of X). Typically, you would specify that the looping
continue until the difference between X and the previous value of X was within
some specified tolerance.
When a Previous Value element is included inside a looping Container, it takes
on a special property. In particular, an additional input option is added to the
dialog that specifies how the Initial Value is to be treated:
If Reinitialize when looping starts is cleared (the default), the Initial Value
specified in the field is only used at the beginning of the realization (when the
Container is updated for the first time), and never again.
If Reinitialize when looping starts is checked, the value specified in the Initial
Value field is used for the first loop every time the looping Container begins its
calculations (i.e., it does not “remember” the value from the previous timestep).
Read more: Inputs and Outputs to a Previous Value Element (page 607).
The dialog indicated the order within the sequence (Pos), the element type (T),
the type of calculation being carried out (Update), the element ID (Name), and
the full element path (Path).
The Update can be of several types (e.g., Static, Dynamic, Function). This
information can be useful for debugging complex models. Note that some
element types are necessarily updated twice every timestep, and therefore appear
twice in the sequence.
You can sort the rows according to any column (ascending or descending) by
double-clicking on the column header.
When you insert a SubModel, you are presented with a dialog asking if you
want to create a new (empty) SubModel, or create the SubModel by importing
an existing standalone model:
If you choose to import a standalone model, you will be prompted for the file
name and a SubModel with the contents of that model will be inserted into
GoldSim. Otherwise, a new (empty) SubModel will be created.
Read more: Importing SubModels (page 634).
The default icon for the SubModel element looks like this:
Like all GoldSim elements, you first specify an Element ID and a Description.
After inserting the SubModel element, the steps for building a SubModel are
generally as follows (although they will typically be done iteratively, rather than
in this exact order):
1. Specify the Solution Type (Simulation or Optimization).
2. Specify (or if an existing model was imported, edit) the GoldSim
modules required by the SubModel.
3. Build (or if an existing model was imported, edit) the contents of the
SubModel.
4. Specify (or if an existing model was imported, edit) the simulation
settings for the SubModel.
5. Create an interface between the SubModel and the parent (outer)
model.
6. Specify when the SubModel is to be run.
These steps are described in detail in the sections below.
Specifying the Solution The first step in creating a SubModel (after inserting the element) is to specify
Type for a SubModel the Solution Type. There are two options: "Simulation" and "Optimization".
This option determines how the SubModel is being used. For most applications,
you should choose "Simulation", which is the default.
"Optimization" will normally only be used when a SubModel is being used 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 specify the Solution Type for the
SubModel as "Optimization", and the SubModel itself would represent the
optimization calculations carried out by the simulated operator.
If you do chose the Simulation Type as "Optimization", you will also need to
specify the optimization settings in the Optimization tab for the SubModel.
Read more: Running an Optimization Within a SubModel (page 631).
Specifying the Modules Because a SubModel is effectively a separate model (as opposed to a Container),
and Module Options for you may choose to use different extension modules in a SubModel than in the
a SubModel outer model. For example, your SubModel may require the Contaminant
Transport Module, while the outer model may not.
When you create a SubModel, the modules that are activated by default are the
same as those that would be activated by default if you created a new model.
(These defaults are set by the user by pressing the Set as Default button when
activating modules in the Modules tab of the Options dialog).
Read more: Activating and Deactivating Extension Modules (page 20).
To specify the modules that will be activated for a SubModel, press the
Modules… button on the SubModel dialog. The following dialog will be
displayed:
All extension modules appear in the dialog. If your license does not allow you to
use a particular module, it will be grayed out (and the Active column will be
blank). You can activate and deactivate modules that you have permission to use
by clicking the Active checkbox.
If you deactivate a module, the specialized elements associated with that
module will be deleted from your SubModel (if any are present) and any menu
options will be removed in the current file. If you make a module active, the
various options associated with that module are made available again. If you
press the Set as Default button, the selected modules will be activated for all
new models or SubModels that are created.
Note: If a module that is active in a SubModel has special options (that are
normally accessed via a tab in the Options dialog for standalone model), these
options will appear in a tab on the Modules dialog for the SubModel.
Building the Contents Once you have selected the Solution Type and modules to be used by a
of the SubModel SubModel, building the contents of a SubModel is, for the most part, identical to
building the contents of a Container.
Like a Container, you enter a SubModel by clicking on the plus sign in the upper
left hand corner of the element. SubModels (and their contents) are also
displayed in the browser in the same manner as Containers.
You can add elements, Containers, and even other SubModels to a SubModel,
just as you would to a Container. Of course, you can also copy element that are
outside of a SubModel and paste them into the SubModel.
There are several important points to note when building and navigating a
SubModel:
• When you are inside a SubModel, the navigation bar at the top of the
graphics pane only shows the location with respect to the SubModel. It
does not show the path relative to the parent model:
Note also that the background in the field where the path is displayed is
a different color. This is intended to provide a visual indication that
you are inside a SubModel.
• You cannot reference outputs that exist outside of the SubModel in the
same way you would do so from inside a Container. That is, by
default, the SubModel is a self-contained system (i.e., a separate
model) that cannot "see" anything on the outside. In fact, within a
SubModel, the Insert Link dialog accessed via the context menu for
input fields does not list any elements outside of the SubModel. In
order to access outputs from outside the SubModel, you need to take
some specific actions (i.e., add the output to the SubModel's input
interface).
Read more: Creating the Input Interface to a SubModel (page 623).
• After running a model, you cannot browse into a SubModel and view
results. Because a SubModel is a separate simulation (that will
typically be carried out multiple times during a simulation of the outer
model), intermediate results of a SubModel are typically overwritten
during a simulation of the outer model. Hence, the outputs of a
SubModel take on a special form (as defined by the user in the
SubModel's output interface).
Read more: Creating the Output Interface to a SubModel (page 626).
Note: In addition to creating a model manually inside a SubModel, you can also
choose to import an existing (standalone) model into a SubModel.
Specifying the Because a SubModel is a separate model, it requires its own simulation settings
Simulation Settings for (i.e., timestepping and Monte Carlo options). That is, a SubModel does not use
a SubModel the simulation settings specified by the outer model.
The simulation settings for a SubModel are accessed via tabs at the top of the
SubModel dialog.
The Time tab is used to specify the time options for the simulation:
The inputs to be entered here are identical to those provided in the Time tab of
the Simulation Settings dialog for a model.
Read more: Setting the Basic Time Options (page 344).
The Monte Carlo tab is used to specify the Monte Carlo options for a
simulation:
The inputs to be entered here are identical to those provided in the Monte Carlo
tab of the Simulation Settings dialog for a model.
Read more: Setting the Monte Carlo Options (page 357).
Note: You can choose to specify some of the simulation settings for a SubModel
via the Input Interface for the SubModel. If you do this, some of the input fields
in the Time and Monte Carlo tabs will become locked.
Creating the Input Because a SubModel is a self-contained system (i.e., a separate model),
Interface to a SubModel elements inside a SubModel cannot "see" anything on the outside (i.e., in the
outer model). As a result, you cannot reference outputs that exist outside of the
SubModel in the same way you would do so from inside a Container. (In fact,
within a SubModel, the Insert Link dialog accessed via the context menu for
input fields does not list any elements outside of the SubModel).
Of course, in order to be of any value, a SubModel must have some way to
communicate with (e.g., access outputs of) the outer model. This is done by
creating an interface between the SubModel and the outer model.
The interface is accessed via the Interface tab on the SubModel dialog:
The top part of this dialog is used to define the input interface. The bottom
portion is used to define the output interface.
In order to access an output outside of the SubModel, you must add the output to
the input interface. This is done by pressing the Add button in the Input
Add button Interface portion of the dialog. When you do this, GoldSim displays the Insert
Link dialog, allowing you to select an output outside of the SubModel to add to
the interface):
After selecting a link and pressing OK (or selecting Cancel), the following
dialog is displayed:
The Name (ID) is the name by which the output variable can be referenced
inside the SubModel. This Name has the same restrictions as an element ID.
The Description is an optional description of the variable.
You must then specify the Display Units and Type information (e.g.,
value/condition, scalar/vector/matrix) for the variable. Finally, you specify the
Definition for the input. Typically, this will be a link to an output in the outer
model. However, it can also be an equation (with links), or a constant value.
Note: If you selected a link (rather than pressing Cancel) when adding the
interface input, the Definition, Display Units and Type will automatically be
entered.
Once you have added an output from the outer model to the Input Interface of a
SubModel, you can subsequently reference the output within the SubModel by
using the specified Name that you defined previously, preceded by a ~. For
example, if you create an interface input called X, you could reference it in input
fields within the SubModel as ~X.
Note: In this case, the ~ indicates that this output has some special
characteristics (in particular, it is coming from outside of the SubModel). This
is an instance of what is referred to as a locally available property in GoldSim.
Locally available properties are accessed by using a ~.
The Run Property field provides a drop-list of options for the SubModel
simulation setting that you wish to control. The options are:
• Simulation Duration;
• Number of Timesteps;
• Minimum Steplength;
• Maximum Steplength;
• Number of Realizations; and
• Realization to Run
The Definition field determines the value that will be used for the selected
simulation setting input. Typically, this will be a link to an output in the outer
model (the Definition field's context menu can be used to access an Insert Link
dialog that lists all elements in the outer model). However, it can also be an
equation (with links), or a constant value.
Note that when you select one of these options, the appropriate input fields are
automatically locked (and cannot be edited) in the Time and Monte Carlo tabs
for the SubModel:
Note: Buttons for deleting, editing and moving the inputs on the interface are
available directly below the Add and Add Run Property buttons.
Creating the Output Because a SubModel is a self-contained system (i.e., a separate model), by
Interface to a SubModel default, elements outside a SubModel cannot "see" anything on the inside.
Moreover, because a SubModel is a separate simulation (that will typically be
carried out multiple times during a simulation of the outer model), intermediate
results of a SubModel are typically overwritten during a simulation of the outer
model and are not available in the outer model.
Of course, in order to be of any value, a SubModel must have some way to
communicate with (e.g., provide outputs to) the outer model. This is done by
creating an output interface between the SubModel and the outer model.
The output interface is accessed via the Interface tab on the SubModel dialog:
The top part of this dialog is used to define the input interface. The bottom
portion is used to define the output interface.
The output interface allows you to specify the form of output that you want the
SubModel to provide to the outer model. In order to allow the outer model to
Add button access an output of the SubModel, you must select the output and add it to the
output interface. This is done by pressing the Add button in the Output Interface
portion of the dialog.
When you press this button, you will be presented with a browser displaying the
outputs inside the SubModel. You must select the output that you are interested
in. After you do so, the following dialog will be displayed:
The Output (ID) is the name by which the output variable can be referenced in
the outer model. This ID has the same restrictions as an element ID.
Note that the outputs defined in the output interface are added to the output port
interface of the SubModel and can be accessed there (in exactly the same
manner the outputs from other kinds of elements are accessed). The Output ID
is what is shown in the interface:
Warning: The Probability of Equal Value result is only meaningful if the output
is in the form of a discrete distribution. If the output is not a discrete
distribution, it will return zero.
Conditional Tail Expectation. The expected value of the output given that
it lies above a specified quantile (requires multiple realizations). This result
represents the mean of the worst 100(1 - α)% of outcomes, where α is the
quantile. You must enter a probability value that is greater than or equal to
zero and less than or equal to one.
Note that depending on the output, the Solution Type and the Simulation
Settings, not all of these choices may be available for a particular SubModel.
If the selected output is a condition, only a single result type will be available. If
the Simulation Type is a Monte Carlo Simulation with multiple realizations, the
only available result will be Probability of True; otherwise, the only available
result will be Final Value (true or false).
If the selected output is a value, multiple result types will be available in the
drop-list. Note, however, that even if a choice is available, it may not be
applicable under some circumstances. The table below lists all results that are
available in the drop-list for value outputs, and indicates under what
circumstances they are applicable:
Note: Result types that are not applicable are still available choices in order to
allow you to change simulation settings and Simulation Type for a SubModel
without having to redefine the interface.
Note: Buttons for deleting, editing and moving the outputs on the interface are
available directly below the Add button.
Controlling When a By default, a SubModel is treated like any other element in GoldSim and is
SubModel is to be Run updated (i.e., run) whenever required to do so by the parent model (e.g., when
inputs change, or if it contains dynamic elements that must be updated every
timestep).
In some cases, however, you may want to manually control when a SubModel is
updated (such that it is not updated whenever the parent model is updated). You
can do so by checking the Run (update) SubModel only when triggered
checkbox. When you do this, access is provided to a standard trigger dialog:
You can explicitly control when a SubModel is run by defining one or more
triggers (e.g., “Run when X > Y”).
Read more: Understanding Event Triggering (page 275).
By default, when this box is checked, no triggers are defined. This means that
the SubModel will never run.
Note: You can tell if a trigger has been defined from the appearance of the
Trigger… button. If a trigger is defined, the rectangle next to the lightning bolt
is bright green; otherwise it is dark green. And like all Trigger… buttons, it
displays a tool-tip. If there is no trigger defined, the tool-tip will display “Never
updates SubModel”.
If you wish the SubModel to run when its parent Container activates, set the
update trigger to Auto Trigger. Note that if a SubModel is set to Auto Trigger
and it is not within a conditional Container, it activates when the Model (root)
Container activates (i.e., at the start of the realization).
Prior to a SubModel being triggered, its outputs are all zero. The outputs are
updated when the SubModel is triggered, and outputs remain constant until the
SubModel is triggered again.
Other SubModel Several advanced options are available for SubModels.
Options These are discussed in thesections below.
Controlling the The Graphics tab of the SubModel dialog provides access to options for
Appearance of the controlling the appearance of elements inside the SubModel:
Graphics Pane for a
SubModel
The top portion of the dialog (the Graphics Pane section) is used to define the
size of the graphics pane, a background color for the graphics pane, and whether
or not the a grid is displayed.
Read more: Adjusting the Size of the Graphics Pane (page 326); The Graphics
Pane Grid and Background (page 324).
The bottom portion of the dialog (the Influences section) is used to specify the
default shapes for influences in the SubModel, and to define whether and in
what manner influences within the SubModel are filtered (hidden). The options
in this portion of the dialog are quite important, as they can be used to ensure
that your models are easy to view and understand.
Read more: Links and Influences (page 79); Editing the Appearance of
Influences (page 327); Filtering Influences (page 330).
Running an One of the applications for a SubModel is to carry out a dynamic optimization
Optimization Within a (i.e., at specified times) during a simulation. For example, imagine a situation
SubModel 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.
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.
Read more: Running an Optimization (page 374).
Several points regarding use of this dialog for SubModel optimization, however,
are worth noting:
• Optimization Variables cannot be defined in terms of variables that are
outside of the SubModel. That is, initial values, upper bounds and
lower bounds for Optimization Variables cannot be defined in terms of
a variable on the input interface to the SubModel.
• In most cases, all of the Optimization Variables (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 (but the simulation will not be halted).
Read more: Understanding Optimization Warning Messages (page
382).
Protecting the Contents In some cases, you may want to protect the contents of your SubModel by
of a SubModel sealing or locking it. SubModels can be sealed and locked in the same manner
as Containers.
Read more: Sealing and Locking Containers (page 132).
After you seal or lock the SubModel, the protected status of the SubModel is
displayed in the SubModel dialog:
Controlling How Run When using SubModels, you can control whether or not Run Log messages
Messages are Logged related to the SubModel are written to the parent model's Run Log.
for a SubModel Read more: The Run Log (page 391).
This can be controlled from within the SubModel dialog:
is accessible via the Globals tab in the stand-alone model's Simulation Settings
dialog:
There are several rules that must be met in order for the model to be successfully
inserted as a SubModel:
• The stand-alone model must have been saved using the same version of
GoldSim that is trying to import it.
• The stand-alone model must be in Edit Mode.
• The CT/RT Module can only be used in one model or SubModel in a
file. For example, if the parent model is using CT or RT Module and
the stand-alone model that is to be imported is also using it, the import
will not be permitted.
When importing a model, all of the information on the Globals tab of the
Simulation Settings dialog in the stand-alone model is imported into the input
interface for the SubModel.
Read more: Defining and Referencing Global Properties (page 360).
Note: If the model being imported was previously exported from a SubModel to
a stand-alone model, the original exported Definitions for the input and output
interface will be automatically recreated when the model is imported to recreate
it as a SubModel. Any changes to existing input Definitions will be ignored (the
Definitions that existed when the model was exported will be used). Any new
input Definitions that were added after the model were exported, however, will
be added to the interface.
Because the parent model and the imported model potentially could have
conflicting definitions (for units, array label sets and version stamps), the
following rules are followed during the import to ensure consistency.
Ensuring Consistency of Array Label Sets
When importing an existing model as SubModel, all of its array label sets are
imported into the parent model. Therefore, existing sets and imported sets must
be merged. The following rules apply when importing array label sets:
• Any set that exists in the imported model but not in the parent model is
automatically added to the parent model.
• If the imported model and the parent model have sets with identical
names (set names are not case-sensitive) that are not otherwise identical
(i.e., they must have the same number of items with the same index
names), an error is displayed and the import of the model will fail.
Read more: Understanding Array Labels (page 523).
Ensuring Consistency of Units
When importing an existing model as SubModel, all available user-defined units
in the existing model are imported into the parent model. Therefore, existing
units and imported units must be merged. The following rules apply when
importing units:
• If the imported unit name is unique, it is added to the parent's unit list.
• If the imported unit name is identical to an existing unit name, and the
units have the same dimensions, but are assigned to different
categories, then the unit is assigned to the category specified by the
parent model.
• If the imported unit name is identical to an existing unit name, and the
units have the same dimensions, but are assigned different conversion
factors, then the conversion factor is assigned the value specified by the
parent model.
• If the imported unit name is identical to an existing unit name, but the
units have different dimensions, an error is displayed and the import of
the model will fail.
Read more: Creating New Units (page 339).
Ensuring Consistency of Versioning
When importing a model file that includes versioning information, GoldSim
evaluates the version stamps and compares them against the version stamps in
the existing model (if it uses versioning).
If all version stamps are the identical (i.e., all properties must match: stamp
number, name, description, user name), then the imported model elements keep
their individual version logging information. Globally logged information from
the imported model, however, is lost.
If the version stamps are not identical, or if the existing (parent) model does not
use versioning, all version information is removed from the imported model and
its elements.
Read more: Tracking Model Changes (page 638).
Interrupting and When you pause a model using the Run Controller or via an Interrupt element
Pausing a Simulation message, if the model was in the middle of computing an element within a
Within a SubModel SubModel, GoldSim will pause the model at that point.
Read more: Pausing and Stepping through a Simulation (page 371);
Continuing, Pausing and Aborting a Simulation After an Interrupt (page 313).
When a model is paused, the Run Controller always displays the status of the
outermost parent model. However, if a model has been paused in the middle of
a SubModel, when you place your cursor over the Run Controller, it will display
the status of the SubModel(s) also:
SubModel Examples Several example models illustrating the use of SubModels are described below.
These examples can be found in the Examples folder in your GoldSim directory.
These examples cover the four most common applications for SubModels.
Read more: What Can I Do With a SubModel? (page 617).
SubModel Example: A common use of SubModels is to manipulate Monte Carlo statistics. That is,
Manipulation of Monte after carrying out a Monte Carlo simulation, you may want to carry out further
Carlo Statistics 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 (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 SubModel_1.gsm (in the Examples folder in your GoldSim
directory) 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 that
contains a single Expression element. The Expression is a function of statistics
(the mean and 95th percentile) of the Stochastic within the SubModel.
SubModel Example: Another common use of SubModels is to explicitly separate variability from
Explicit Separation of uncertainty. That is, many models have uncertain parameters as well as variable
Variability from parameters. An uncertain parameter represents ignorance that can theoretically
Uncertainty (but perhaps not practically) be reduced through investigation (e.g., the mean
failure time for a collection of light bulbs). Variability in inherent in the system
(e.g., the distribution of failure times for a collection of light bulbs ) and cannot
be reduced.
It often valuable to explicitly separate uncertainty from variability in a model.
With SubModels, this is accomplished by inserting a "variability" SubModel
(e.g., a dynamic Monte Carlo simulation) within an outer "uncertainty" model
(e.g., a static Monte Carlo simulation). This is referred to as double or two-
dimensional Monte Carlo simulation.
Example model SubModel_2.gsm (in the Examples folder in your GoldSim
directory) provides a simple illustration of such an application. In this model, a
two-dimensional Monte Carlo simulation is used to calculate confidence bounds
for a SubModel's performance measure. In particular, the outer model carries out
a Monte Carlo simulation and samples an uncertain parameter that represents the
mean value of a Weibull distribution. The SubModel carries out a Monte Carlo
simulation also. It contains a single Stochastic (a Weibull). This could represent
the statistics for an insurance policy or for some sort of risk analysis. The
SubModel outputs the 95th percentile value for the distribution. The outer model
computes the distribution of the 95th percentile. This represents the uncertainty
in the 95th percentile value.
SubModel Example: Another common use of SubModels is to optimize a probabilistic model. If you
Probabilistic wish to optimize a probabilistic (uncertain) system, the objective function to be
Optimization optimized cannot be a single deterministic output. Rather, it must be a statistic.
That is, if X was an output of a probabilistic model (and hence was output as a
probability distribution), optimizing X itself would be meaningless. Rather, you
would need to optimize a particular statistic (e.g., the mean or 50th percentile) of
the output X.
With SubModels, this is accomplished by inserting a SubModel (e.g., a dynamic
Monte Carlo simulation) within an outer model (e.g., a static optimization).
Example model SubModel_3.gsm (in the Examples folder in your GoldSim
directory) provides a simple illustration of such an application. In this model, the
SubModel is a Monte Carlo simulation containing a single Stochastic. The outer
model is an optimization. The variable being optimized is a function of another
element in the outer model and a statistic (the 95th percentile) of the Stochastic
in the SubModel.
SubModel Example: Another common use of SubModels is to do a dynamic optimization during a
Dynamic Optimization simulation. Imagine a situation where you were simulating the operation of a
During a Simulation 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 SubModel_4.gsm (in the Examples folder in your GoldSim
directory) 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.
Read more: Saving, Opening and Closing GoldSim Files (page 68).
For example, when GoldSim reports that element A was modified between
version X and the current version, you can open and compare the file that was
archived when version X was created to determine how the element was defined
at that point. When you archive a copy of your current model, GoldSim records
the name of the archived file (along with the version number) in your current
model.
Read more: Changes Tracked Between Versions (page 640).
Enabling Versioning In order to enable versioning in a file, select Model|Versioning… from the
main menu. The first time you do this, a message is displayed asking you to
confirm that you want to enable versioning.
After confirming your request, you will immediately be prompted to create a
version of the file (take a “snapshot” of the current model file and “stamp” it as
a version).
Once you create the first version, versioning will be enabled, and will remain
enabled until you choose to disable it.
Read more: Disabling Versioning (page 640).
Creating Versions When you first enable versioning, or whenever you choose to create additional
versions via the Version Manager , a dialog for creating versions is displayed.
You can edit the Description here, but cannot change any other details about the
version.
You can create new versions by pressing the Create Version… button, which
provides access to the Create Version dialog.
Read more: Creating Versions (page 639).
Deleting a Version You can delete an existing version by selecting it in the Version Manager and
pressing the Delete Version button. Note, however, that when you delete a
version, you also automatically delete all previous versions.
When you delete a version, the version number is never used again. For
example, if you had a single version (1.000), and you deleted this version and
then re-enabled versioning and created another major version, it would be
numbered as 2.000.
If you choose to delete the most recent version (and hence all versions in the
model), GoldSim will automatically disable versioning (until you enable it again
by creating a new version).
Specifying the Once you have created at least one version, you can then compare the current
Reference Version model (the model as it exists right now) to any previous model version you have
created. In order to do so, you must identify the Reference Version (the version
to which the current model is compared).
This is done by selecting the checkbox to the right of the version in the Version
Manager. Only one checkbox can be selected at a time (i.e., there can be only
one Reference Version).
You can readily change the Reference Version while you are viewing
differences.
Read more: Displaying Version Differences (page 642).
Disabling Versioning You disable (remove) versioning by pressing the Disable Versioning button in
the Version Manager dialog. When you disable versioning, all versioning
information is deleted (and cannot be recovered). Hence, before doing so,
GoldSim will ask you to confirm that you want to delete all versioning
information.
Changes Tracked When versioning is enabled, GoldSim can report the differences between the
Between Versions current model and any previous version. GoldSim does not actually tell you how
a model has changed; it only reports what has changed. For example, if you
modify an input field of an element, GoldSim does not store what field was
edited or what the previous value was. Rather, it simply reports that “one or
more of the element’s attributes have been changed”.
The changes that are logged by GoldSim can be divided into two categories:
global changes and element-specific changes. Global changes pertain to the
entire model. Element-specific changes pertain to a particular element.
The following global changes are recorded and stored within the model file
when versioning is enabled:
• A new version is created.
• A version is deleted.
• Versioning is disabled.
• The model filename has changed via a Saved As command (the
previous filename is recorded).
• The model filename has been changed outside of GoldSim since the file
was last opened (the previous filename is recorded).
• The model file has been archived (the archived filename is recorded).
• One or more of the Simulation Settings have changed.
• A user-defined unit has been created or modified.
• An array label set has been added, deleted or changed.
• A global database download has been carried out.
• A file has been locked onto or unlocked by a Spreadsheet, External or
File element.
• One or more options in the Options dialog associated with an extension
module have changed.
The following element-specific changes are recorded and stored within the
model file when versioning is enabled:
• An element is added, moved, deleted.
• An element is cloned or a cloned element is freed.
• The element’s ID has been changed (the previous ID is recorded).
• The element’s description has changed (the previous description is
recorded).
• Any of the element’s attributes or input definitions have changed.
• A database download to the element is carried out.
• Data is imported into a Lookup Table or a Time Series element.
• The checkbox in the Options dialog controlling whether or not Timed
Events are mapped to the next timestep has changed.
The following points regarding the changes tracked by GoldSim should be
noted:
• A Container is considered to be changed if an element is added to,
removed from, or deleted from it.
This dialog displays all of the changes that have been made to the element since
the specified Reference Version. The Reference Version (selected in the Version
Manager) is displayed at the bottom of the dialog . You can change the
Reference Version directly from this dialog by selecting a version from the
drop-list.
Clicking the Show History checkbox shows a history of all the changes between
the Reference Version and the current model.
If the Show History box is cleared, only a summary of the differences between
the Reference Version and the current model are shown. Hence, if the element
was changed several different times, the Show History display will indicate this,
while the summary display (with Show History cleared) will only indicate that
the element has changed since the Reference Version.
Clicking the Show Global Changes checkbox displays the Global changes to
the model (in addition to the changes to elements):
Manually Documenting After an element has been changed, you can add a Change Note to the element
Changes to an Element that will also be displayed in the Changes dialog.
If an element has been changed since the last (most recent) version stamp, the
Version Change Note… option is available in the context menu for the
element, and the Change Note… button is available on the Changes dialog for
the element. Selecting either of these buttons will display a dialog for adding a
change note to the element:
If you add a note , the note is saved with the next version that is created, and is
displayed in the element’s Changes dialog.
Generating a Version In some cases, rather than viewing changes to individual elements, you may
Report want to create a report of all of the changes made between the Reference
Version and the current model. You can do so by pressing the Generate
Report… button in the Version Manager dialog.
An ASCII text file summarizing all the changes will be generated and
immediately opened in the default application associated with .txt files (e.g.,
Notepad):
datum (e.g., associated with different dates). You can specify from within
GoldSim which version is to be used when linked to GoldSim.
The table below summarizes the key features of the three database formats:
Simple X X X X
GoldSim
Yucca X X X X X
Mountain
The specific formats for these three types of databases are described in
Appendix F.
Adding Data Sources Before using GoldSim’s database features you must first identify the database(s)
to Your Computer you need to access using the Windows Control Panel ODBC Data Sources
(32bit) option. This allows you to define a name for each data source, and
associate the data source with a specific database file.
For details in adding and configuring data sources, you should refer to your
Microsoft Windows documentation. A brief overview is presented below.
To add a data source to your computer, do the following (the instructions here
are for Windows XP; they may differ slightly for other Windows versions):
1. From the Windows Control Panel, double-click on Administrative
Tools, and select Data Sources (ODBC). A dialog similar to the one
shown below will be displayed:
3. Select a driver and press Finish. A dialog is displayed (the dialog will
differ for each driver). You will be prompted to assign a name to the
data source, and select the specific file (i.e., a database file)..
Once you have created the data source, you can reference it from within
GoldSim.
Downloading Element After defining the database and creating the data source, you must then link the
Definitions from a database to specific elements and download the data.
Database In order to link a specific element to the database, you first select a database
option from the Data Source field in the properties dialog for the element. This
is typically found toward the bottom of the dialog:
You can also right-click on the element in the graphics pane or browser, and
select Connect to DataSource…, which will display a menu for selecting the
Data Source.
By default, the Data Source is “None” (i.e., the element is not linked to a
database). To link to a database, you must select one of the database types from
the drop-down list.
Note: Not all three database options are available in the drop-down list for all
elements. For example, since a Stochastic cannot be linked to a Generic
database, this option is not available for Stochastics in the Database tab.
Note: If you open a file which has elements linked to a database which GoldSim
cannot find on your machine, it will prompt you to select from a list of databases
that are registered on your machine. If none of these databases is appropriate,
you must add a new data source to your computer. If you want GoldSim to
check to see if it can find all of the databases referenced by elements in your
model, press Model | Database | Validate Databases.
Downloading from a The following dialog is displayed when you specify a “Generic Database” for
Generic Database the Data Source for an element and click on the Database tab in the properties
dialog for a Data element (the only element for which this type of data source
can be specified):
2. Select the appropriate table from the database from the Table drop-
down list.
3. Press the Define Fields button in order to access a dialog for specifying
which field(s) in the table contain the data. For scalar data, you will
need to enter a single field (and this will be indicated at the top of the
dialog). Vector and matrix data require multiple fields to be specified.
4. Specify which record (or for matrix data, records) in the table contain
the data by specifying an appropriate condition in the Where input
field.
5. Specify the incoming units of the data in the Incoming Units input
field (using the appropriate GoldSim abbreviations for the units).
6. Press the Download Now button to download the data.
GoldSim notes whether the download was successful (and, if successful,
displays the date and time of the download).
If you wish to download a vector, you must specify one record for each item in
the vector. You identify the items of the vector using the Where input field. You
must sort the records in the appropriate order using the Order By input field.
If you wish to download a matrix, you must specify one data field for each
columns of the matrix (using the Define Fields dialog) and one record for each
row of the matrix using the Where input field. The order of the fields (i.e., the
columns of the matrix) is the order shown in the Define Fields dialog. You can
use the Move Up button to modify the order. You must sort the records (i.e., the
rows of the matrix) in the appropriate order using the Order By input field.
The file Generic_DB.gsm in the Examples folder of your GoldSim directory
includes examples of how to download a vector and a matrix from a Generic
database.
Downloading from a The following dialog is displayed when you specify a “Simple GoldSim
Simple GoldSim Database” for the Data Source for an element and click on the Database tab in
Database the properties dialog for a Data or Stochastic element (the two elements for
which this type of data source can be specified):
consistent with the specified dimensions for the element as defined on the
Definition tab).
Because a Yucca Mountain database is so highly structured, if the database is
properly defined, linking and downloading from it requires only two steps:
1. Select the appropriate data source from the Database drop-down list
(all defined data sources will be listed).
2. Press the Download Now button to download the data.
GoldSim notes whether the download was successful (and, if successful,
displays the date and time of the download).
The More info… button provides some additional information regarding a
successful download (the effective date and the Run Log strings associated with
the data).
As discussed in detail in Appendix F, for a Yucca Mountain database, you can
create multiple records for a particular item of data, each with a different
"effective date". This allows you to keep a record of how particular inputs to
your model have been modified. The Select most recent value no later than
field allows you to download data associated with a specific effective date.
If this box is cleared, GoldSim will use the default effective date, as specified in
the GS_Parameter table of the database (described in Appendix F).
Note: As pointed out above, when you link an element to a Yucca Mountain
database, GoldSim locates the data to download by using the element's ID alone
(no path is specified in the database). Hence, in order for GoldSim to download
the element's definition from the database, a record in the Element ID field of
the database must match the GoldSim element ID exactly (although the
comparison is not case-sensitive). This implies that you cannot have multiple
elements with identical names (e.g. , in two localized containers) which are both
being linked to a Yucca Mountain database.
If you do not select a date (the checkbox is cleared), GoldSim will use the
default effective date, as specified in the GS_Parameter table (see Appendix F
for details of the Yucca Mountain database structure).
If one or more of the downloads fails, a dialog will appear summarizing the
elements for which the download failed.
While an element is linked to a database, you cannot access or edit the data.
Modifying After you have downloaded data, however, you can choose to "uncouple" the
Downloaded Data element from the database by selecting the “No Database” option in the
Database tab. When you do this, you will be able to view and edit the values
downloaded from the database.
References
Embrechts, Paul., Lindskog, Filip and Alexander McNeil, 2001, "Modelling
Dependence with Copulas and Applications to Risk Management," Department
of Mathematics, Swiss Federal Institute of Technology, Zurich
(http://www.defaultrisk.com/pp_corr_19.htm).
Dorey, Martyn, 2006, "Why Aren't Copulas Far More Popular?", Professional
Investor, February 2006
(http://www.psolve.com/news/200602_Martyn%20Dorey%20article.pdf).
Ke n ne t h A r r ow, I K n o w a Ha w k fr om a
Handsaw
Appendix Overview
This appendix provides a very brief introduction to probabilistic simulation (the
quantification and propagation of uncertainty). Because detailed discussion of
this topic is well beyond the scope of this appendix, readers who are unfamiliar
with this field are strongly encouraged to consult additional literature. A good
introduction to the representation of uncertainty is provided by Finkel (1990)
and a more detailed treatment is provided by Morgan and Henrion (1990). The
basic elements of probability theory are discussed in Harr (1987) and more
detailed discussions can be found in Benjamin and Cornell (1970) and Ang and
Tang (1984).
In this Appendix This appendix discusses the following:
• Types of Uncertainty
• Quantifying Uncertainty
• Propagating Uncertainty
• A Comparison of Probabilistic and Deterministic Analyses
• References
Types of Uncertainty
Many of the features, events and processes which control the behavior of a
complex system will not be known or understood with certainty. Although there
are a variety of ways to categorize the sources of this uncertainty, for the
purpose of this discussion it is convenient to consider the following four types:
• Value (parameter) uncertainty: The uncertainty in the value of a
particular parameter (e.g., a geotechnical property, or the development
cost of a new product);
• Uncertainty regarding future events: The uncertainty in the ability to
predict future perturbations of the system (e.g., a strike, an accident, or
an earthquake).
• Conceptual model uncertainty: The uncertainty regarding the detailed
understanding and representation of the processes controlling a
particular system (e.g., the complex interactions controlling the flow
rate in a river); and
• Numerical model uncertainty: The uncertainty introduced by
approximations in the computational tool used to evaluate the system.
Incorporating these uncertainties into the predictions of system behavior is
called probabilistic analysis or in some applications, probabilistic performance
assessment. Probabilistic analysis consists of explicitly representing the
uncertainty in the parameters, processes and events controlling the system and
propagating this uncertainty through the system such that the uncertainty in the
results (i.e., predicted future performance) can be quantified.
Quantifying Uncertainty
Understanding When uncertainty is quantified, it is expressed in terms of probability
Probability distributions. A probability distribution is a mathematical representation of the
relative likelihood of an uncertain variable having certain specific values.
Distributions
There are many types of probability distributions. Common distributions include
the normal, uniform and triangular distributions, illustrated below:
All distribution types use a set of arguments to specify the relative likelihood for
each possible value. For example, the normal distribution uses a mean and a
standard deviation as its arguments. The mean defines the value around which
the bell curve will be centered, and the standard deviation defines the spread of
values around the mean. The arguments for a uniform distribution are a
minimum and a maximum value. The arguments for a triangular distribution are
a minimum value, a most likely value, and a maximum value.
The nature of an uncertain parameter, and hence the form of the associated
probability distribution, can be either discrete or continuous. Discrete
distributions have a limited (discrete) number of possible values (e.g., 0 or 1; yes
or no; 10, 20, or 30). Continuous distributions have an infinite number of
possible values (e.g., the normal, uniform and triangular distributions shown
above are continuous). Good overviews of commonly applied probability
distributions are provided by Morgan and Henrion (1990) and Stephens et al.
(1993).
There are a number of ways in which probability distributions can be graphically
displayed. The simplest way is to express the distribution in terms of a
probability density function (PDF), which is how the three distributions shown
above are displayed. In simple terms, this plots the relative likelihood of the
various possible values, and is illustrated schematically below:
Note that the “height” of the PDF for any given value is not a direct
measurement of the probability. Rather, it represents the probability density,
such that integrating under the PDF between any two points results in the
probability of the actual value being between those two points. Numerically
generated PDFs are typically presented not as continuous functions (as shown
above), but as histograms, in which the frequencies of the various possible
values are divided into a discrete number of bins. Histograms of the same three
PDFs shown above would look like this:
By definition, the total area under the PDF must integrate to 1.0, and the CDF
therefore ranges from 0.0 to 1.0.
A particular point, say [ri, P2], on the CCDF is interpreted as follows: P2 is the
probability that the actual value is greater than ri . Note that the CCDF is simply
the complement of the CDF; that is, P2 is equal to 1 - P1.
∫
μ = x f(x) dx
where f(x) is the probability density function (PDF) of the variable. For a
discrete distribution, it is computed as:
N
μ= ∑ x p(x )
i =1
i i
in which p(xi) is the probability of xi, and N is the total number of discrete
values in the distribution.
∫
μ n = (x - μ) n f(x) dx
The second moment is referred to as the variance, and is typically denoted as σ2.
The square root of the variance, σ, is referred to as the standard deviation. The
variance and the standard deviation reflect the amount of spread or dispersion in
the distribution. The ratio of the standard deviation to the mean provides a
dimensionless measure of the spread, and is referred to as the coefficient of
variation.
The skewness is a dimensionless number computed based on the third moment:
μ
skewness = 33
σ
overview, and includes a list of references. Morgan and Henrion (1990) also
provide a good discussion on the topic.
A key part of all of the various approaches for developing subjective probability
assessments is a methodology for developing (and justifying) an appropriate
probability distribution for a parameter in a manner that is logically and
mathematically consistent with the level of available information. Discussions
on the applicability of various distribution types are provided by Harr (1987,
Section 2.5), Stephens et al. (1993), and Seiler and Alvarez (1996). Note that
methodologies (Bayesian updating) also exist for updating an existing
probability distribution when new information becomes available (e.g., Dakins,
et al., 1996).
Correlated Frequently, parameters describing a system will be correlated (inter-dependent)
Distributions to some extent. For example, if one were to plot frequency distributions of the
height and the weight of the people in an office, there would likely be some
degree of positive correlation between the two: taller people would generally
also be heavier (although this correlation would not be perfect).
The degree of correlation can be measured using a correlation coefficient,
which varies between 1 and -1. A correlation coefficient of 1 or -1 indicates
perfect positive or negative correlation, respectively. A positive correlation
indicates that the parameters increase or decrease together. A negative
correlation indicates that increasing one parameter decreases the other. A
correlation coefficient of 0 indicates no correlation (the parameters are
apparently independent of each other). Correlation coefficients can be computed
based on the actual values of the parameters (which measures linear
relationships) or the rank-order of the values of the parameters (which can be
used to measure non-linear relationships).
One way to express correlations in a system is to directly specify the correlation
coefficients between various model parameters. In practice, however, assessing
and quantifying correlations in this manner is difficult. Oftentimes, a more
practical way of representing correlations is to explicitly model the cause of the
dependency. That is, the analyst adds detail to the model such that the
underlying functional relationship causing the correlation is directly represented.
For example, one might be uncertain regarding the solubility of two
contaminants in water, while knowing that the solubilities tend to be correlated.
If the main source of this uncertainty was actually uncertainty in pH conditions,
and the solubility of each contaminant was expressed as a function of pH, the
distributions of the two solubilities would then be explicitly correlated. If both
solubilities increased or decreased with increasing pH, the correlation would be
positive. If one decreased while one increased, the correlation would be
negative.
Ignoring correlations, particularly if they are very strong (i.e., the absolute value
of the correlation coefficient is close to 1) can lead to physically unrealistic
simulations. In the above example, if the solubilities of the two contaminants
were positively correlated (e.g., due to a pH dependence), it would be physically
inconsistent for one contaminant’s solubility to be selected from the high end of
its possible range while the other’s was selected from the low end of its possible
range. Hence, when defining probability distributions, it is critical that the
analyst determine whether correlations need to be represented.
Variability and When quantifying the uncertainty in a system, there are two fundamental causes
Ignorance of uncertainty which are important to distinguish: 1) that due to inherent
variability; and 2) that due to ignorance or lack of knowledge. IAEA (1989)
refers to the former as “Type A uncertainty” and the latter as “Type B
Propagating Uncertainty
If the inputs describing a system are uncertain, the prediction of the future
performance of the system is necessarily uncertain. That is, the result of any
xm ym zm
Result
Result
In this case the analyst explicitly represents the input parameters as probability
distributions, and propagates the uncertainty through to the result (e.g., using the
Monte Carlo method), such that the result itself is also a probability distribution.
One advantage to deterministic analyses is that they can typically incorporate
more detailed components than probabilistic analyses due to computational
considerations (since complex probabilistic analyses generally require time-
consuming simulation of multiple realizations of the system).
Deterministic analyses, however, have a number of disadvantages:
• “Worst case” deterministic simulations can be extremely misleading.
Worst case simulations of a system may be grossly conservative and
therefore completely unrealistic (i.e., they typically have an extremely
low probability of actually representing the future behavior of the
system). Moreover, it is not possible in a deterministic simulation to
quantify how conservative a “worst case” simulation actually is. Using
a highly improbable simulation to guide policy making (e.g., “is the
design safe?”) is likely to result in poor decisions.
• “Best estimate” deterministic simulations are often difficult to defend.
Because of the inherent uncertainty in most input parameters,
defending “best estimate” parameters is often very difficult. In a
confrontational environment, “best estimate” analyses will typically
evolve into “worst case” analyses.
• Deterministic analyses do not lend themselves directly to detailed
uncertainty and sensitivity studies. In order to carry out uncertainty and
sensitivity analysis of deterministic simulations, it is usually necessary
to carry out a series of separate simulations in which various
parameters are varied. This is time-consuming and typically results
only in a limited analysis of sensitivity and uncertainty.
These disadvantages do not exist for probabilistic analyses. Rather than facing
the difficulties of defining worst case or best estimate inputs, probabilistic
analyses attempt to explicitly represent the full range of possible values. The
probabilistic approach embodied within GoldSim acknowledges the fact that for
many complex systems, predictions are inherently uncertain and should always
be presented as such. Probabilistic analysis provides a means to present this
uncertainty in a quantitative manner.
Moreover, the output of probabilistic analyses can be used to directly determine
parameter sensitivity. Because the output of probabilistic simulations consists of
multiple sets of input parameters and corresponding results, the sensitivity of
results to various input parameters can be directly determined. The fact that
probabilistic analyses lend themselves directly to evaluation of parameter
sensitivity is one of the most powerful aspects of this approach, allowing such
tools to be used to aid decision-making.
There are, however, some potential disadvantages to probabilistic analyses that
should also be noted:
• Probabilistic analyses may be perceived as unnecessarily complex, or
unrealistic. Although this sentiment is gradually becoming less
prevalent as probabilistic analyses become more common, it cannot be
ignored. It is therefore important to develop and present probabilistic
analyses in a manner that is straightforward and transparent. In fact,
GoldSim was specifically intended to minimize this concern.
• The process of developing input for a probabilistic analysis can
sometimes degenerate into futile debates about the “true” probability
References
The references cited in this appendix are listed below.
Ang, A. H-S. and W.H. Tang, 1984, Probability Concepts in
Engineering Planning and Design, Volume II: Decision, Risk, and
Reliability, John Wiley & Sons, New York.
Bonano, E.J., S.C. Hora, R.L. Keaney and C. von Winterfeldt, 1989,
Elicitation and Use of Expert Judgment in Performance Assessment for
High-Level Radioactive Waste Repositories, Sandia Report SAND89-
1821, Sandia National Laboratories.
Benjamin, J.R. and C.A. Cornell, 1970, Probability, Statistics, and
Decision for Civil Engineers, McGraw-Hill, New York.
Dakins, M.E., J.E. Toll, M.J. Small and K.P. Brand, 1996, Risk-Based
Environmental Remediation: Bayesian Monte Carlo Analysis and the
Expected Value of Sample Information, Risk Analysis, Vol. 16, No. 1,
pp. 67-79.
Finkel, A., 1990, Confronting Uncertainty in Risk Management: A
Guide for Decision-Makers, Center for Risk Management, Resources
for the Future, Washington, D.C.
Harr, M.E., 1987, Reliability-Based Design in Civil Engineering,
McGraw-Hill, New York.
IAEA, 1989, Evaluating the Reliability of Predictions Made Using
Environmental Transfer Models, IAEA Safety Series No. 100,
International Atomic Energy Agency, Vienna.
Kotra, J.P., M.P. Lee, N.A. Eisenberg, and A.R. DeWispelare, 1996,
Branch Technical Position on the Use of Expert Elicitation in the High-
Level Radioactive Waste Program, Draft manuscript, February 1996,
U.S. Nuclear Regulatory Commission.
Morgan, M.G. and M. Henrion, 1990, Uncertainty, Cambridge
University Press, New York.
Anonymous
Appendix Overview
This appendix provides the mathematical details of how GoldSim represents and
propagates uncertainty, and the manner in which it constructs and displays
probability distributions of computed results. While someone who is not familiar
with the mathematics of probabilistic simulation should find this appendix
informative and occasionally useful, most users need not be concerned with
these details. Hence, this appendix is primarily intended for the serious analyst
who is quite familiar with the mathematics of probabilistic simulation and
wishes to understand the specific algorithms employed by GoldSim.
In this Appendix This appendix discusses the following:
• Mathematical Representation of Probability Distributions
• Random Numbers
• Correlating Distributions
• Sampling Techniques
• Representing Random (Poisson) Events
• Computing and Displaying Result Distributions
• Computing Sensitivity Analysis Measures
• References
Mathematical Representation of
Probability Distributions
Distributional Forms The arguments, probability density (or mass) function (pdf or pmf), cumulative
distribution function (cdf), and the mean and variance for each of the probability
distributions available within GoldSim are presented below.
Beta Distribution The beta distribution for a parameter is specified by a minimum value (a), a
maximum value (b), and two shape parameters denoted S and T. The beta
distribution represents the distribution of the underlying probability of success
for a binomial sample, where S represents the observed number of successes in a
1.5
binomial trial of T total draws.
1.0
Alternative formulations of the beta distribution use parameters α and β, or α1
0.5
and α2, where S = α = α1 and (T-S) = β = α2.
0.0
0.0 0.5 1.0 1.5 2.0
The usual approach to applying the beta distribution, however, is to know the
minimum, maximum, mean, and standard deviation. The shape parameters are
PDF
then computed from these statistics.
The beta distribution has many variations controlled by the shape parameters. It
is always limited to the interval (a,b). Within (a,b), however, a variety of
distribution forms are possible (e.g., the distribution can be configured to behave
exponentially, positively or negatively skewed, and symmetrically). The
distribution form obtained by different S and T values is predictable for a skilled
user.
1
pdf: f(x) = (x − a )S-1 (b − x )T-S-1
B(b − a )T −1
Γ(S)Γ(T − S)
where: B=
Γ (T )
∞
∫
Γ(k ) = e −u u k −1du
0
σ * <= 0.6 μ * (1 − μ * )
μ −a σ
where μ * = , σ* =
b-a b-a
This constraint ensures that the distribution has a single peak and that it does not
have a discrete probability mass at either end of its range.
Binomial Distribution The binomial distribution is a discrete distribution specified by a batch size (n)
and a probability of occurrence (p). This distribution can be used to model the
number of parts that failed from a given set of parts, where n is the number of
parts and p is the probability of the part failing.
0.6
⎛n⎞
0.4
pmf: P(x)= ⎜⎜ ⎟⎟ p x (1 − p) n − x x = 0, 1, 2, 3...
0.2
⎝ x⎠
0.0
⎛n⎞ n!
0 1 2 3 4 5
where: ⎜⎜ ⎟⎟ =
PDF
x
⎝ ⎠ x! (n − x)!
x
⎛ n⎞
cdf: F(x)= ∑ ⎜⎜⎝ i ⎟⎟⎠
i =0
p i (1 − p ) n −i
mean: np
variance: np(1-p)
Boolean Distribution The Boolean (or logical) distribution requires a single input: the probability of
being true, p. The distribution takes on one of two values: False (0) or True (1).
pmf: P(x) = 1-p x=0
0.6
p x=1
0.4
cdf: F(x)= 1-p x=0
0.2
1 x=1
0.0
-1 0 1 2
mean: μ=p
PDF
variance: σ2 = p(1 - p)
Cumulative Distribution The cumulative distribution enables the user to input a piece-wise linear
cumulative distribution function by simply specifying value (xi) and cumulative
probability (pi) pairs.
0.4 GoldSim allows input of an unlimited number of pairs, xi, pi. In order to
0.3 conform to a cumulative distribution function, it is a requirement that the first
0.2 probability equal 0 and the last equal 1. The associated values, denoted x0 and
0.1
xn, respectively, define the minimum value and maximum value of the
0.0
distribution.
0 1 2 3 4 5
pdf: f(x) = 0 x ≤ x0 or x ≥ xn
PDF
pi +1 − pi
xi ≤ x ≤ xi+1
xi +1 − xi
cdf: F(x) = 0 x ≤ x0
x − xi
pi + ( pi +1 − pi ) xi ≤ x ≤ xi+1
xi +1 − xi
1 x ≥ xn
n
mean: μ≅ ∑ x f (x )
i =1
i i
n
variance: σ2≅ ∑x
i =1
2
i f ( xi ) − μ 2
Discrete Distribution The discrete distribution enables the user to directly input a probability mass
function for a discrete parameter. Each discrete value, xi, that may be assigned to
the parameter, has an associated probability, pi, indicating its likelihood to
occur. To conform to the requirements of a probability mass function, the sum
0.6
of the probabilities, pi , must equal 1. The discrete distribution is commonly used
0.4 for situations with a small number of possible outcomes, such as “flag” variables
0.2
used to indicate the occurrence of certain conditions.
0.0
0 1 2 3 4 5
pmf: P(xi) = pi x = xi
i≥ j
cdf: F(xi) = ∑p
j=1
j
n
mean: μ≅ ∑x p
i =1
i i
n
variance: σ2≅ ∑x
i =1
2
i pi − μ2
⎧ −
x
⎪1 − e μ if x ≥ 0
pdf: P(x)= ⎨
⎪⎩ 0 otherwise
⎧ 1 − μx
⎪ e if x ≥ 0
cdf: F(x)= ⎨ μ
⎪ 0 otherwise
⎩
mean: μ
variance: μ2
Gamma Distribution The gamma distribution is most commonly used to model the time to the kth
event, when such an event is modeled by a Poisson process with rate parameter
λ. Whereas the Poisson distribution is typically used to model the number of
1.0
events in a period of given length, the gamma distribution models the time to the
kth event (or alternatively the time separating the kth and kth+1 events).
0.5 The gamma distribution is specified by the Poisson rate variable, λ , and the
event number, k. The random variable, denoted as x, is the time period to the kth
0.0
event. Within GoldSim, the gamma distribution is specified by the mean and the
0 1 2 3 4 5
standard deviation, which can be computed as a function of λ and k.
PDF
λ (λ x )k-1 e-λ x
pdf: f(x)=
Γ(k)
Γ(k, λ x)
cdf: F(x)=
Γ( k )
∞
where: ∫
Γ(k ) = e −u u k −1du
0
(gamma function)
∫
Γ(k , x) = e −u u k −1du
0
(incomplete gamma function)
μ2
k=
σ2
μ
λ=
σ2
mean: μ
variance: σ2
Log-Normal The log-normal distribution is used when the logarithm of the random variable
Distribution is described by a normal distribution. The log-normal distribution is often used
to describe environmental variables that must be positive and are positively
skewed.
0.4
0.3 In GoldSim, the log-normal distribution may be based on either the true mean
0.2 and standard deviation, or on the geometric mean (identical to the median) and
0.1
the geometric standard deviation. Thus, if the variable x is distributed log-
0.0
normally, the mean and standard deviation of log x may be used to characterize
0 1 2 3 4 5 6 7 8 9 10 the log-normal distribution. (Note that either base 10 or base e logarithms may
PDF be used).
2
1 1 ⎛ ln(x)- λ ⎞
e- 2 ⎜⎝
⎜ ⎟
pdf: f ( x) = ζ ⎟⎠
ζ x 2π
where:
⎡ ⎛ σ ⎞2 ⎤
ζ 2 = ln ⎢1 + ⎜⎜ ⎟⎟ ⎥ (variance of ln x);
⎢ ⎝μ⎠ ⎥
⎣ ⎦
ζ is referred to as the shape factor; and
1 2
λ = ln (μ ) - ζ (expected value of ln x)
2
cdf: No closed form solution
⎡ 1 ⎤
mean (arithmetic): μ = exp ⎢λ + ζ 2 ⎥
⎣ 2 ⎦
The mean computed by the above formula is the expected value of the log-
normally distributed variable x and is a function of the mean and standard
deviation of lnx. The mean value can be estimated by the arithmetic mean of a
sample data set.
variance (arithmetic): [ ( ) ]
σ 2 = μ 2 exp ζ 2 − 1
The variance computed by the above formula is the variance of the log-normally
distributed variable x. It is a function of the mean of x and the standard deviation
of lnx. The variance of x can be estimated by the sample variance computed
arithmetically.
Other useful formulas:
Geometric mean = eλ
Geometric standard deviation = eζ
⎛ x + n − 1⎞ n
pmf: P(x)= ⎜⎜ ⎟⎟ p (1 − p ) x x = 0, 1, 2, 3...
⎝ x ⎠
⎛ x + n − 1⎞ (x + n - 1)!
where: ⎜⎜ ⎟=
⎝ x ⎟⎠ x!(n - 1)!
x
⎛ i + n − 1⎞
cdf: F(x)= pn ∑ ⎜⎜
i =0 ⎝ i ⎠
⎟⎟ (1 − p)i
n(1 − p )
mean:
p
n(1 − p)
variance:
p2
Normal Distribution The normal distribution is specified by a mean (μ) and a standard deviation (σ).
The linear normal distribution is a bell shaped curve centered about the mean
value with a half-width of about four standard deviations. Error or uncertainty
0.8
that can be higher or lower than the mean with equal probability may be
satisfactorily represented with a normal distribution. The uncertainty of average
0.6
values, such as a mean value, is often well represented by a normal distribution,
0.4
and this relation is further supported by the Central Limit Theorem for large
0.2
sample sizes.
0.0
0 1 2 3 4
pdf: 1 1 ⎛ x- μ ⎞
2
f ( x) = e- 2 ⎜⎝ σ ⎠
⎟
2π σ 2
cdf: No closed form solution
mean: μ
2
variance:σ
⎧ ab a
⎪ if x ≥ b
pdf: P(x)= ⎨ x a +1
⎪⎩ 0 otherwise
⎧ ⎛ b ⎞a
⎪1 −
cdf: F(x)= ⎨ ⎜ x ⎟ if x≥b
⎝ ⎠
⎪ 0 otherwise
⎩
ab
mean:
a −1
ab 2
variance:
(a − 1)2 (a − 2)
Poisson Distribution The Poisson distribution is a discrete distribution specified by a mean value, μ.
The Poisson distribution is most often used to determine the probability for one
or more events occurring in a given period of time. In this type of application,
0.6
the mean is equal to the product of a rate parameter, λ, and a period of time, ω.
For example, the Poisson distribution could be used to estimate probabilities for
0.4 numbers of earthquakes occurring in a 100 year period. A rate parameter
0.2
characterizing the number of earthquakes per year would be needed for input to
the distribution. The time period would simply be equal to 100 years.
0.0
0 1 2 3 4 5
x
e- μ μ
pmf: P(x)= x = 0, 1, 2, 3...
x!
x
μi
cdf: F(x) = e- μ ∑ i!
i=0
mean: μ =λω
variance: σ2 =μ
where λ and ω are the “rate” and “time period” parameters, respectively. Note
that quotations are used because the terminology rate and time period applies to
only one application of the Poisson distribution.
Student’s t Distribution The Student’s t distribution requires a single input: the number of degrees of
freedom, which equals the number of samples minus one.
mean: 0
0.4
ν
0.3 variance:
ν −2
0.2
Triangular Distribution The triangular distribution is specified by a minimum value (a), a most likely
value (b), and a maximum value (c).
2(x − a)
pdf: f(x) = a≤x≤b
0.20 (b − a)(c − a)
0.15
2(c - x)
0.10
b≤x≤c
0.05
(c − b)(c − a)
0.00
0 1 2 3 4 5 6 7 8 9 10
0 x < a or x > c
PDF
(x- a )2
a≤x≤b
(b- a)(c- a)
( c - x )2
1- b<x<c
(c - b)(c - a)
1 x≥c
a +b+c
mean: μ=
3
a 2 + b2 + c2 - ab - ac - bc
variance: σ2 =
18
Log-Triangular Distribution The log-triangular distribution is used when the logarithm of the random
variable is described by a triangular distribution. The minimum (a), most likely
(b), and maximum (c) values are specified in linear space.
0.010
⎡ ⎛ x ⎞⎤⎛ 1 ⎞
2⎢ln⎜ ⎟⎥⎜ ⎟
⎝ a ⎠⎦⎝ x ⎠
0.005 pdf: f(x) = ⎣ a≤x≤b
⎛ ⎞ ⎛c⎞
b
ln⎜ ⎟ ln⎜ ⎟
0.000
⎝a⎠ ⎝a⎠
0 100 200 300 400 500
⎡ ⎛ c ⎞⎤ ⎛ 1 ⎞
2⎢ln⎜ ⎟⎥⎜ ⎟
PDF
⎣ ⎝ x ⎠⎦ ⎝ x ⎠
b≤x≤c
⎛c⎞ ⎛c⎞
ln⎜ ⎟ ln⎜ ⎟
⎝a⎠ ⎝b⎠
0 otherwise
cdf: F(x) = 0 x<a
2
⎡ ⎛ x ⎞⎤
⎢ln⎜ ⎟⎥
⎣ ⎝ a ⎠⎦ a≤x≤b
⎛b⎞ ⎛c⎞
ln⎜ ⎟ ln⎜ ⎟
⎝a⎠ ⎝a⎠
2
⎡ ⎛ c ⎞⎤
⎢ln⎜ ⎟⎥
⎣ ⎝ x ⎠⎦
1− b<x≤c
⎛c⎞ ⎛c⎞
ln⎜ ⎟ ln⎜ ⎟
⎝a⎠ ⎝b⎠
1 x>c
2 ⎧ ⎡ ⎛ b ⎞ ⎤⎫ 2 ⎧ ⎡ ⎛ b ⎞ ⎤⎫
mean: μ= ⎨a + b ⎢ln⎜ ⎟ - 1⎥ ⎬ + ⎨c + b ⎢ln⎜ ⎟ - 1⎥ ⎬
d1 ⎩ ⎣ ⎝ a ⎠ ⎦⎭ d2 ⎩ ⎣ ⎝ c ⎠ ⎦⎭
2 ⎧ a 2 b2 ⎡ ⎛ b ⎞ 1 ⎤ ⎫ 2 ⎧ c2 b2 ⎡ ⎛ b ⎞ 1 ⎤ ⎫ 2
variance: σ2 = ⎨ + ⎢ln⎜ ⎟ - ⎥ ⎬ + ⎨ + ⎢ln⎜ ⎟ - ⎥ ⎬ - μ
d1 ⎩ 4 2 ⎣ ⎝ a ⎠ 2 ⎦ ⎭ d2 ⎩ 4 2 ⎣ ⎝ c ⎠ 2 ⎦⎭
⎛c⎞ ⎛b⎞
where: d1 = ln⎜ ⎟ ln⎜ ⎟ and
⎝a⎠ ⎝a⎠
⎛c⎞ ⎛c⎞
d 2 = ln⎜ ⎟ ln⎜ ⎟
⎝a⎠ ⎝b⎠
Uniform Distribution The uniform distribution is specified by a minimum value (a) and a maximum
value (b). Each interval between the endpoints has equal probability of
occurrence. This distribution is used when a quantity varies uniformly between
two values, or when only the endpoints of a quantity are known.
1.0
a≤x≤b
b−a
1 x>b
mean: μ= b+a
2
( b − a )2
variance: σ2 =
12
Log-Uniform The log-uniform distribution is used when the logarithm of the random variable
Distribution is described by a uniform distribution. Log-uniform is the distribution of choice
for many environmental parameters that may range in value over two or more
log-cycles and for which only a minimum value and a maximum value can be
0.10
reasonably estimated. The log-uniform distribution has the effect of assigning
equal probability to the occurrence of intervals within each of the log-cycles. In
0.05
contrast, if a linear uniform distribution were used, only the intervals in the
upper log-cycle would be represented uniformly.
0.00
0 20 40 60 80 100 1
pdf: f(x) = a≤x≤b
PDF x(ln b − ln a )
0 x ≤ a or x ≥ b
cdf: F(x) = 0 x≤a
lnx - lna a≤x≤b
ln b − ln a
1 x>b
b−a
mean: μ=
(ln b − ln a )
2
b2 − a 2 ⎛ b−a ⎞
variance: σ2 = −⎜ ⎟
2(ln b − ln a ) ⎜⎝ (ln b − ln a ) ⎟⎠
Weibull Distribution The Weibull distribution is typically specified by a minimum value (ε), a scale
parameter (β), and a slope or shape parameter (α). The random variable must be
greater than 0 and also greater than the minimum value, ε. The Weibull
0.15
distribution is often used to characterize failure times in reliability models.
However, it can be used to model many other environmental parameters that
0.10
must be positive. There are a variety of distribution forms that can be developed
0.05 using different values of the distribution parameters.
0.00
0 2 4 6 8 10 12 14 16 18 20
α
α -1 ⎛ x −ε ⎞
α ⎛ x -ε ⎞ ⎜ ⎟⎟
pdf: f(x)= ⎜ ⎟ e − ⎜⎝ β −ε ⎠
β -ε ⎜ β -ε ⎟
⎝ ⎠
α
⎛ x −ε ⎞
cdf: F(x)= 1 - e-⎜⎜⎝ β −ε ⎟⎟⎠
⎛ 1⎞
mean: μ = ε + (β − ε )Γ⎜1 + ⎟
⎝ α⎠
⎡ ⎛ 2⎞ 2⎛ 1 ⎞⎤
variance: σ 2 = (β − ε )2 ⎢Γ⎜1 + ⎟ − Γ ⎜1 + ⎟ ⎥
⎣ ⎝ α⎠ ⎝ α ⎠⎦
The Weibull distribution is sometimes specified using a shape parameter, which
is simply β - ε. Within GoldSim, the Weibull is defined by ε, α, and the mean-ε.
As shown above, the mean can be readily computed as a function of ε, α, and β .
In practice, the Weibull distribution parameters are moderately difficult to
determine from sample data. The easiest approach utilizes the cdf, fitting a
regression through the sample data to estimate α (regression slope) and the
difference quantity, β - ε.
Representing Several distributions in GoldSim can be truncated at the ends (normal, log-
Truncated normal, Gamma, and Weibull). That is, by specifying a lower bound and/or an
upper bound, you can restrict the sampled values to lie within a portion of the
Distributions full distribution’s range.
The manner in which truncated distributions are sampled is straightforward.
Because each point in a full distribution corresponds to a specific cumulative
probability level between 0 and 1, it is possible to identify the cumulative
probability levels of the truncation points. These then define a scaling function
which allows sampled values to be mapped into the truncated range.
In particular, suppose the lower bound and upper bound were L and U,
respectively. Any sampled random number R (representing a cumulative
probability level between 0 and 1) would then be scaled as follows:
L + R(U-L)
The resulting "scaled" cumulative probability level would then be used to
compute the sampled value for the distribution. The scaling operation ensures
that it falls within the truncated range.
Correlating Distributions
GoldSim allows you to specify correlations between stochastic elements. This
section describes the manner in which this is implemented.
GoldSim uses a simple algorithm that generates dependent variables of specified
rank-correlation to a designated independent variable. In some circumstances,
the algorithm can cause minor deviations from the required distribution for the
dependent variable. These errors arise only for intermediate values of the
correlation coefficient, (between 0.6 and 0.9), and result in slightly altered
populations in the lower and upper deciles of the dependent variable. While this
is not normally a significant effect, GoldSim's algorithm should not be relied
upon where highly accurate representations of the tails of the distributions are
required, AND where the correlation coefficient has an intermediate value.
There is no error at all for the case where the correlation is perfect (i.e.,
coefficient equals 1 or –1).
If the correlation coefficient is greater than or equal to 0.999 (or <= -0.999),
GoldSim simply uses the same random number for both variables, resulting in
perfect positive (or negative) correlation.
Otherwise, it defines a conditional beta PDF for the dependent variable. The
expected value of this beta distribution is defined by:
μ = 0 .5 + C ( R − 0 .5 )
where:
C is the correlation coefficient; and
R is the independent variable’s random number.
The standard deviation of the beta distribution is defined by:
σ = σ max 1 − C 4
where:
Sampling Techniques
This section discusses the techniques used by GoldSim to sample Stochastic
elements (probability distributions). After first discussing how GoldSim
generates and assigns random numbers, two enhanced sampling techniques
provided by GoldSim (Latin Hypercube sampling and importance sampling) are
discussed.
Generating and Each stochastic element in GoldSim is automatically assigned a unique
Assigning Random permanent element seed when it is created. The seed consists of two long (32
bit) integers. If an element is copied and pasted into a different model, its seed
Number Seeds will be unchanged. However, if it is pasted into the same model, or into a model
where another element already has that seed value, it is given a new unique seed.
Element seeds can be displayed by selecting the element in the graphics pane
and pressing Ctrl-Alt-Shift-F12.
When a simulation is started, GoldSim generates a simulation seed which is the
basis for all random numbers used in the simulation. If you have chosen to
Repeat Sampling Sequences in the Monte Carlo tab of the Simulation Settings
dialog, the simulation seed is the user-specified Random Seed specified in the
dialog:
In this case, you can rerun a probabilistic simulation and get identical results. If
you have chosen not to repeat sequences, the simulation seed is based on the
system clock. In this case, each time you rerun the simulation, you will have a
different simulation seed (and hence will generate slightly different results).
For each realization, GoldSim generates a realization seed based on the
simulation seed. Each element in the model uses a combination of its permanent
seed and this realization seed to start its random sequence for the realization. At
the start of each Monte Carlo realization, the realization seed is incremented,
and forms the basis for the element seeds to be used for that realization.
If the user selects the option to run a specified realization, such as realization 16,
GoldSim simply iterates the realization seed the necessary number of times prior
to starting the specified realization.
At the start of each realization, each element generates a new seed by combining
its unique seed with the realization seed. This seed forms the basis for sampling
of the element during the realization. Many elements have no random properties
and hence are never sampled. Some elements, such as Stochastic elements, are
typically sampled once, at the beginning of the realization. Other elements, such
as Timed Events, Delay elements, and Stochastic elements that are specified to
be resampled, are sampled multiple times.
Latin Hypercube GoldSim provides an option to implement a Latin Hypercube sampling (LHS)
Sampling scheme (in fact, it is the default when a new GoldSim file is created). The LHS
option results in forced sampling from each “stratum” of each parameter. Each
Stochastic element’s probability distribution (0 to 1) is divided into up to 1000
equally likely strata or slices (actually, the lesser of the number of realizations
and 1000). The strata are then “shuffled” into a random sequence, and a random
value is then picked from each stratum in turn. This approach ensures that a
uniform spanning sampling is achieved.
Importance Sampling For risk analyses, it is frequently necessary to evaluate the low-probability,
high-consequence end of the distribution of the performance of the system.
Because the models for such systems are often complex (and hence need
significant computer time to simulate), and it can be difficult to use the
conventional Monte Carlo approach to evaluate these low-probability, high-
consequence outcomes, as this may require excessive numbers of realizations.
Warning: Importance sampling affects the basic Monte Carlo mechanism, and
it should be used with great care and only by expert users. In general, it is
recommended that only one or at most a very few parameters should use
importance sampling, and these should be selected based on sensitivity analyses
using normal Monte Carlo sampling. In addition, the magnification factors used
should be small, typically in the range between 2 and 10. Larger magnification
factors may result in inadequate sampling of the non-magnified portions of the
distribution, unless large numbers of realizations are used.
In some cases, importance sampling can result in distributions which are less
accurate that those obtained using random sampling. In particular, if a result is a
strong function of all of the importance sampled elements, importance sampling
will result in more accurate resolution (higher accuracy) of the high
consequence end of the result than if random sampling was used. If, however, a
result is a weak function of one or more of the importance sampled elements,
importance sampling will result in less accurate resolution (lower accuracy) of
the high consequence end of the result than if random sampling was used.
The biased variate s is then used to generate the random function. Since the
input random numbers are no longer uniformly distributed, the resulting sample
set is selectively enriched in high-consequence results:
In general, any continuous monotonic biasing function s which spans the range
0-1, and has s(0) = 0 and s(1) = 1 can be used to generate the set of input random
numbers. The weight associated with each sampled realization is ds/du, the
slope of the biasing function s at the sampled point.
When a number of independent random variables are involved in a model, then
the weight associated with a given realization is simply equal to the product of
the weights of all parameters.
GoldSim uses simple hyperbolic functions to selectively enhance either the
upper or the lower end of a stochastic element’s probability distribution.
Biasing (Enhancement)
Functions The biasing function for enhancing the upper end is:
au
s=
1 − u (1 − a)
where a is a user-specified "magnification factor" with a value between 1 and
100, which defines the ratio for selectively enhancing the sampling of the upper
end of the distribution.
The associated sample weight for this function is:
ds s s 2 (1 − a )
w= = +
du u au
The biasing function for enhancing the lower end is:
u
s=
a + u (1 − a)
The associated sample weight for the lower-end enhancing function is:
ds s s 2 (1 − a )
w= = −
du u u
The following figure shows the bias functions for a magnification factor of 10:
1
0.9
0.8
0.7
0.6
Upper
0.5
S
Lower
0.4
0.3
0.2
0.1
0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
U
Importance Sampling The figure below shows a PDF histogram for 1000 realizations of a simple
Illustrative Example uniform distribution which was importance-sampled with emphasis on the upper
end, using a magnification factor of 10. This particular figure shows the 5% and
95% confidence bounds for the distribution (the calculation and display of
confidence bounds is discussed below). Notice how the 5% / 95% confidence
bounds on the calculated densities tighten at the upper end of the distribution:
The top line in each vertical bar represents the 95% confidence bound. The middle line
represents the computed probability density; and the bottom line represents the 5%
confidence bound.
The top line in each vertical bar represents the 95% confidence bound. The middle line
represents the computed probability density; and the bottom line represents the 5%
confidence bound.
Specifying Importance GoldSim allows you to specify importance sampling for any Stochastic element
Sampling in GoldSim by pressing the Importance Sampling button in the dialog (which you may
need to access via the More button on the Stochastic dialog):
The Importance Sampling button provides access to a drop-list for activating importance
sampling for the Stochastic.
Pressing this button provides the following choices for selecting which end of
the distribution to amplify (High End or Low End):
Once you select either High End or Low End, you must also select a
Magnification factor ranging between 1 and 100.
You can turn importance sampling off by selecting “None” from the list (the
default).
In a Monte Carlo analysis, any Stochastic elements with importance sampling
specified automatically select their realized values using a biased random variate
as described above. The calculated weight for the element is then used to
multiply the weight of the realization (which has an initial value of 1). If there
are multiple importance-sampled elements, the realization weight is the product
of their weights.
Note that when GoldSim creates and displays probability distribution results, it
associates a realization weight with each result. Distribution plots, and
calculated probabilities and probability-densities, reflect these weights. You can
view the realization weights by pressing the Result Array button is the
Distribution Summary window.
Read more: Viewing the Distribution Result Array (page 433).
e -λT (λT ) N
P(N) =
N!
where:
P(N) is the probability of N occurrences of the event within the time
interval T;
T is the time interval of interest;
λ is the annual rate of occurrence; and
N is the number of occurrences of the event within the time interval T.
The expected (mean) number of occurrences during the time interval is equal to
λT.
The Poisson distribution also has the property that the intervals between events
are exponentially distributed (Benjamin and Cornell, 1970):
F(t) = 1 - e -λt
where F(t) is the probability that the time to the next event will be less than or
equal to t.
If you indicate that the event can only occur once, GoldSim simulates the first
occurrence according to the above equations, but does not allow the event to
occur again.
Note that the rate of occurrence can be specified to be a function of time (i.e.,
the event process can be non-stationary).
treats the result as a discrete value and does not ‘smear’ it. For
example, suppose the result is 0.0 50% of the time, and normal
(mean=10, s.d.=2) the rest of the time. The first result value would be
0.0, with a weight of about 0.5. The second value would be close to 8,
with a weight of 1/# realizations. We would not want to smear half of
the 0 result over the range from 0 to 8!
When the user selects the confidence bounds options (discussed below), a
different algorithm is used to display and plot CDF values. In particular, the
displayed value is simply the calculated median (50th percentile) in the
probability distribution for the “true” value of the desired quantile.
Displaying a PDF In order to create a PDF, GoldSim distributes the results into specific "bins"
Histogram (i.e., it creates a histogram). The range of results from r1 to rn is divided into a
user-definable number of equal-width bins. The probability-density computed
for each bin is calculated as the estimated fraction of all results which fall in the
bin divided by the bin-width.
GoldSim gives you limited control over the number of bins with which PDF
histograms are displayed. In particular, within the Results tab of the Options
dialog (accessed from the main menu via Model|Options…) you can select an
option from Number of bins drawn in PDF view:
You can use the Number Of Bins Drawn in PDF View field to control the number of bins
which are used in PDF plots.
There are five options to choose from in this field: Very Low, Low, Normal,
High (the default), and Very High.
Based on this selection, GoldSim automatically determines the number of bins
using the following equation:
Selection K
Very Low 0.4
Low 0.7
Normal 1
High 1.3
Very High 1.6
Hence, if your run 100 realizations and choose Normal, GoldSim will use 10
bins.
There are two limitations that should be noted regarding this algorithm:
• GoldSim requires at least 6 realizations in order to plot a PDF. If you
run less than six realizations, the PDF plot will be empty.
• After computing the number of bins as described above, GoldSim
applies the following constraints: it never uses more than 50 bins, and it
never uses less than 6 bins.
The accuracy of the estimated probability density decreases as the bins are made
smaller (i.e., the number of bins increases), because there are fewer results in
any particular bin. Thus, you have to choose between large bins which will give
a more precise estimate of their average probability density, but which may
obscure details of the distribution form, and small bins which will have a larger
amount of random error.
Computing and GoldSim is able to perform a statistical analysis of Monte Carlo results to
Displaying produce confidence bounds on the mean of a probabilistic result. These bounds
reflect uncertainty in the probability distribution due to the finite number of
Confidence Bounds Monte Carlo realizations - as the number of realizations is increased, the limits
on the Mean become narrower. The confidence bounds on the mean are displayed in the
Statistics section of the Distribution Summary dialog when viewing
Distribution Results if the Confidence Bounds checkbox is checked.
Read more: Viewing a Distribution Summary (page 425).
This approach to compute the confidence bounds uses the t distribution, which is
strictly valid only if the underlying distribution is normal. The 5% and 95%
confidence bounds on the population mean are calculated as defined below:
sx
P{X + t 0.05 } < μ = 0.05
n
sx
and P{X + t 0.95 } ≥ μ = 0.05
n
where:
X is the sample mean
t0.05 is the 5% value of the t distribution for n-1 degrees of
freedom
t0.95 is the 95% value, = -t0.05.
sx is the sample standard deviation
μ is the true mean of the population, and
n is the number of samples (realizations).
Each random result had a probability of q that its value would be less than or
equal to the actual qth quantile xq. The total number of results less than xq was
therefore random and binomially distributed, with the likelihood of exactly i
results <= xq being:
⎛n⎞ n!
P(i) = P(ri ≤ x q ≤ri +1 ) = ⎜⎜ ⎟⎟q' (1 − q) n −i = q' (1 − q) n −i
⎝i⎠ i! (n − i)!
Note that there may be a finite probability that the value of xq is less than the
first or greater than the largest result: for example, if 100 realizations ri were
sampled, there would be a probability of 0.366 that the 0.99 quantile exceeded
the largest result. The 100 realization probability distribution for x0.99 is as
follows:
GoldSim assumes that the probability defined by the equation presented above is
uniformly distributed over the range from ri to ri+1 , and interpolates into the
Monte Carlo results-list to find the 5% and 95% cumulative probability levels
for xq. For example, for 100 realizations, the 5% confidence bound on the 0.9
quantile is 0.31 of the distance from result 85 to result 86, and the 95%
confidence bound is 0.22 of the distance from result 95 to result 96.
When using this equation to estimate a very high or low quantile, a problem
arises when the probability level, q, is near to 0 or 1, as there can be a significant
probability that xq lies outside the range of results. In the first table presented
above, for example, there is a 0.366 chance of q0.99 exceeding the largest result.
In such cases, an estimate of the expected value of xq can be found by
extrapolating from the probabilities within the range of the results. Obviously,
however there are limits to extrapolation and without knowledge of the actual
distributional form no extrapolation would produce a reliable estimate of (say)
the 0.9999 quantile if only 100 realizations had been performed.
In evaluating the binomial distribution for large values of n, large numbers can
be generated which can cause numerical difficulties. To avoid these difficulties,
when the number of realizations (n) is greater than 100, GoldSim uses either the
normal or Poisson approximations to the binomial distribution. The Poisson
approximation is used when i or (n-i) is less than 20 and the normal distribution
is used otherwise. These approximations are described in any introductory
statistics text.
Theory: Bounds on For calculating bounds on the probability density, GoldSim evaluates the
Probability Density statistics of the number of results falling into specific "bins". The range of
results from r1 to rn is divided into a user-definable number of equal-width bins.
The probability-density computed for each bin is calculated as the estimated
fraction of all results which fall in the bin divided by the bin-width.
If, in a Monte Carlo simulation, i out of n realizations fell into bin j, what is the
probability distribution for the actual fraction Fj of the underlying distribution
that falls in the jth bin? The number of realizations in the jth bin is binomially
distributed:
⎛n⎞ n!
P(i results in bin j)=⎜⎜ ⎟⎟Fji (1 − Fj ) n −i = Fji (1 − Fj ) n −i
⎝i⎠ i! (n − i)!
Not knowing Fj in advance, and observing that i out of n realizations fell in bin j,
the probability density for Fj is proportional to the relative likelihood of
observing i out of the n realizations, as shown in the above equation, as a
function of Fj. This is simply the beta distribution, β(i-1,n-i-1), whose cumulant
is the incomplete beta function. For example, if 10 out of 100 realizations fell
into a particular bin, the distribution of Fj would be as shown below:
The accuracy of the estimated probability density decreases as the bins are made
smaller, because there are fewer results in any particular bin. Thus, the GoldSim
user has to choose between large bins which will give a more precise estimate of
their average probability density, but which may obscure details of the
distribution form, and small bins which will have a larger amount of random
error. The user can experiment with this effect by altering the desired number of
bins prior to plotting.
Computing the The Conditional Tail Expectation (CTE) is the expected value of the result given
Conditional Tail that it lies above a specified value or quantile (Hardy, 2006). The CTE is
displayed in the ‘Calculator’ portions of the Stochastic and Result Distribution
Expectation elements, and is an optional output type for a Monte Carlo SubModel element.
Read more: Specifying the Distribution for a Stochastic Element (page 142);
Viewing a Distribution Summary (page 425); Creating the Output Interface to a
SubModel (page 626).
For a tail starting at value k, the CTE is defined as:
∞
1
CTE k = ∫ x ⋅ f ( x) ⋅ dx
1 − F (k ) k
where:
F(k) is the cumulative probability of value k
f(x) is the probability density at value x
The CTE is related to another statistical measure of a distribution, the partial
expectation (PE). The PE is defined as:
∞
PE k = ∫ ( x − k ) ⋅ f ( x) ⋅ dx
k
PE k
CTE k = +k
(1 − F (k ))
This table displays measures of the sensitivity of the selected result (the output
from which you selected Final Value|Multi-Variate Analysis…) to the
selected input variables.
Note: You can control whether the sensitivity analyses are based on the values
or the ranks of the variables and the result by selecting the appropriate choice
from the Analyze based on ranks and Analyze based on values radio buttons
in the main Multi-Variate Result dialog. The selection is indicated at the top of
the Sensitivity Analysis dialog (“Analysis is based on”).
R 2 = ∑ Ci
i
where:
Crp= the value correlation coefficient;
n= the number of selected data points (realizations);
pi = value of output p for realization i;
ri = value of output r for realization i;
mp = mean value of output p; and
mr = mean value of output r.
Note that the value correlation coefficient as defined here provides a measure of
the linear relationship between two variables.
Furthermore, it may be affected by a few aberrant pairs (i.e., a good alignment
of a few extreme pairs can dramatically improve an otherwise poor correlation
coefficient; likewise, an otherwise good correlation could be ruined by the poor
alignment of a few extreme pairs).
To overcome these problems, the value correlation coefficient can be
supplemented by the rank correlation coefficient.
The rank correlation coefficient (also referred to as the Spearman rank
correlation coefficient) is computed using the same equation as that of the value
correlation coefficient with the ranks of the data values being used rather than
the actual values:
n
∑ (Rp i − m Rp )(Rri − m Rr )
i =1
C rp,rank =
n n
∑ (Rp i − m Rp ) 2 ∑ (Rri − m Rr ) 2
i =1 i =1
where:
Crp,rank = the rank correlation coefficient;
−ciy
Py ,i =
cii c yy
where:
Py,I = the partial correlation coefficient of the result (Y) to input variable Xi;
ciy = the off-diagonal term in the inverted correlation matrix for row i,
column y; and
cii, cyy = the diagonal terms in the inverted correlation matrix corresponding to
the input variable and the result, respectively.
Note that if any two or more of the input variables are linearly dependent, for
example if they are perfectly correlated, then the correlation matrix becomes
singular and cannot be inverted. GoldSim, which uses Choleski decomposition
to compute the inverse, will automatically adjust the correlation matrix if
necessary in order to compute the partial correlation coefficients. This
adjustment, which takes the form of ‘weakening’ of the off-diagonal terms, does
not affect the displayed correlation coefficients.
Computing Importance If there is a nonlinear, non-monotonic relationship between an input variable and
Measures the result, conventional correlation coefficients may not reveal the relationship.
The Importance Measure computed by GoldSim is a normalized version of the
measure V[R(Y|Xi)] discussed in Saltelli and Tarantola (2002). The Saltelli and
Tarantola measure represents the expected value of the variance if the input
variable Xi was not uncertain. Thus, the smaller this value, the more the input
variable controls the result.
The GoldSim version of this measure is normalized as follows:
Vy [E (Y | X i )]
M y ,i = 1 −
Vy
where:
My = the GoldSim importance measure for the sensitivity of the
result (Y) to input variable Xi;
Vy = the current variance in the result Y; and
Vy[E(Y|Xi)] = the expected value of Vy if the input variable Xi was perfectly
known.
Thus, GoldSim’s Importance Measure My,i represents the fraction of the result
variance that is explained by Xi. Note that, like the correlation coefficients and
scatter-plots, the importance measure can be calculated using either values or
ranks, as specified in the main property window for the multivariate element.
GoldSim calculates My,i numerically, using the following method. Construct a
2-d scatter plot of the results, with the Xi values on the horizontal axis and the
result on the vertical axis. If Xi is very important to the result, then this plot will
show a clustering around a central line or curve:
Scatter Plot of Y vs X2
100
90
80
70
60
50
40
Y
30
20
10
-10
-20
-10 -8 -6 -4 -2 0 2 4 6 8 10
X2
Subdivide the plot into Ns vertical segments based on the ranks of the Xi-values,
where Ns equals the square root of the number of model realizations. For each
of the segments, estimate the variance of V within that segment by using a
weighting function that assigns decreasing weights to the results as their
distance from the center of the segment increases. Then compute the average
value of the variance over all of the segments, i.e. Vy[E(Y|Xi)]. For the
weighting function, GoldSim uses the density of a beta distribution having a
mean equal to the X-value at the center of the segment, a standard deviation
equal to the segment width, and upper and lower bounds corresponding to the
range of X-values.
The example plot above is based on calculating:
2 3
Y = X1 + X 2 + X 3
where:
X1 = a random variable with a U(-10, 10) distribution;
X2 = a random variable with a U(-10,10) distribution; and
X3 = a random variable with a U( -5, 5) distribution.
The plot shown above, plotting Y vs X2, clearly reveals the importance of X2 in
this model. Conventional correlation analysis is completely unable to recognize
this sensitivity, as indicated by the correlation coefficient of 0.023 in the screen-
shot below. However, the importance measure is sensitive to it, and identifies
X2 as the most importance variable:
References
The references cited in this appendix are listed below.
Cox, D.R. and H.D. Miller, 1965, The Theory of Stochastic Processes,
Chapman and Hall, New York.
Benjamin, J.R. and C.A. Cornell, 1970, Probability, Statistics, and
Decision for Civil Engineers, McGraw-Hill, New York.
Hardy, Mary, 2006, Simulating VaR and CTE, Financial Engineering
News, http://www.fenews.com/fen47/topics_act_analysis/topics-act-
analysis.htm.
Iman, R.L. and W.J. Conover, 1982, A Distribution-Free Approach to
Inducing Rank Correlation Among Input Variables, Communications in
Statistics: Simulation and Computation, 11(3), pp 311-334,
Iman, R.L. et al., 1985. A FORTRAN Program and User’s Guide for
the Calculation of Partial Correlation and Standardized Regression
Coefficients, NUREG/CR-4122, SAND85-0044.
Mishra, Srikanta, 2004. Sensitivity Analysis with Correlated Inputs –
an Environmental Risk Assessment Example. Proceedings of the 2004
Crystal Ball User Conference,
http://www.decisioneering.com/cbuc/2004/papers/CBUC04-
Mishra.pdf.
Saltelli, A. and S. Tarantola, 2002, On the Relative Importance of Input
Factors in Mathematical Models: Safety Assessment for Nuclear Waste
Disposal, J. Am. Stat. Ass., Vol. 97, No. 459.
L e w i s C a r r o l l , A l i c e i n Wo n d e r l a n d
Appendix Overview
GoldSim allows you to develop separate program modules (written in C, C++,
Pascal, FORTRAN or other compatible programming languages) which can then
be directly coupled with the main GoldSim algorithms. These user-defined
modules are referred to as external functions, and are linked into GoldSim as
DLLs (Dynamic Link Libraries) at run time. GoldSim interfaces with the DLL
via an External element.
Read more: External (DLL) Elements (page 586).
Integrating your external program module into GoldSim requires that you
develop a "wrapper" or "shell" around the function and compile it into a DLL.
This appendix discusses the details of how external functions must be coded and
compiled.
In this Appendix This appendix discusses the following:
• Understanding External (DLL) Elements
• Implementing an External Function
• External Function Examples
• External Function Calling Sequence
• DLL Calling Details
Note: In the case of an error condition, the external function should always
return an error code to GoldSim, so that the user can be informed about the
problem and the simulation can be terminated cleanly with no memory leaks.
• All files required to run your specific DLL must be properly installed
on the machine GoldSim is running on. In particular, most development
environments allow you to bind required runtime libraries statically or
dynamically. If they are bound dynamically, then the dynamic runtime
files (e.g., msvcrt.dll for MS VC++ or Dforrt.dll for HP/Compaq Visual
Fortran) must be available on the machine which will use the DLL
External Function GoldSim’s internal definition for its external function class, written in C++
Format (Microsoft Visual C++) is:
XFmethod = XF_REP_ARGUMENTS
Argument Checking GoldSim calculates the total number of input and output arguments by summing
the number of specified inputs and outputs. These are then compared to the
external function’s reported number of input and output arguments. If the
number of arguments defined by GoldSim does not agree with the number
reported by the external function, GoldSim terminates with an error message.
However, note the following exception:
• If the external function will be returning definitions for one or more
Tables (see below), GoldSim will not know in advance how long the
Table definitions will be. In this case, the external function should
specify a value for outargs[1] greater than or equal to the actual total
number of arguments that may be returned. GoldSim will allocate this
amount of memory for outargs.
The Input and Output The input and output argument arrays (Inargs[ ] and Outargs[ ]) are defined by
Argument Arrays simply concatenating the data for each input and output defined in the External
element.
If an input or output represents a vector in GoldSim, it is simply added to the list
one item at a time. If the input or output represents a matrix in GoldSim, it is
added to the list one row at a time: row 1, followed by row 2, etc.
External functions can also return Table definition elements to GoldSim. A table
definition requires a specific sequence of values, depending whether it is a 1-D,
2-D, or 3-D table.
The sequence for a 1-D table is as follows:
• number of dimensions (in this case, 1)
• the number of rows
• row value1, row value 2, …, row value n
• dependent value 1, dependent value 2, …, dependent value n
The sequence for a 2-D table is as follows:
• number of dimensions (in this case, 2)
• the number of rows, the number of columns
• row value1, row value 2, …, row value n
• column value 1, column value 2, …, column value n
• dependent(row 1, column 1), …, dependent(row 1,column n)
Warning: This is different than the sequence used to read in an ASCII text file
for a 2-D table.
#include <stdio.h>
#include "version.h"
#define VERSN 1.04
#define XF_INITIALISE 0
#define XF_CALCULATION 1
#define XF_REP_VERSION 2
#define XF_REP_ARGUMENTS 3
#define XF_CLEANUP 99
#define XF_FATAL 1
extern “C” void __declspec(dllexport) XF001
(int XFmethod, int *XFState, const double inarg[],
double *outarg)
{
switch ( XFmethod ) {
case XF_INITIALISE :
break; // nothing required
case XF_REP_VERSION :
outarg[0] = VERSN;
break;
case XF_REP_ARGUMENTS :
outarg[0] = 2.0; // 2 in
outarg[1] = 1.0; // 1 out
break;
case XF_CALCULATION: // add the two input arguments,
return sum
outarg[0]=inarg[0]+inarg[1];
break;
case XF_CLEANUP : // No clean-up required
break;
}
} // end XF001 * * * * * * * * * * * * * * * * * * * * * *
* * * * * *
// If outputs using table definition type are defined we need to increase the
// number of counted (expected) arguments (m_nOutArgs).
if (m_nNumOutTableDef > 0)
{
int dllOutArgs = (int)outargs[1];
if (m_nOutArgs < dllOutArgs)
m_nOutArgs = dllOutArgs;
}
// Only without table definitions do we know the exact number of inputs/outputs
// and arguments
if ((m_nNumInTableDef==0) && (m_nNumOutTableDef==0))
{
if (m_nInArgs != (int)outargs[0])
{
CString errmsg;
CString tcstr;
char tstr[20];
tcstr = (_itoa((int)outargs[0],tstr,10));
AfxFormatString2(errmsg, IDS_EXTERNAL_INPUT_ARGS_DONT_MATCH,
GetFullPath(this),tcstr);
tcstr = (_itoa(m_nInArgs,tstr,10));
errmsg += ", " + tcstr + " " +
GetResourceString(IDS_EXTERNAL_NARGS_FOUND);
FreeLibrary(m_dllHandle);
throw MsgException(errmsg);
}
if (m_nOutArgs != (int)outargs[1])
{
CString errmsg;
CString tcstr;
char tstr[20];
tcstr = (_itoa((int)outargs[1],tstr,10));
AfxFormatString2(errmsg, IDS_EXTERNAL_OUTPUT_ARGS_DONT_MATCH,
GetFullPath(this),tcstr);
tcstr = (_itoa(m_nOutArgs,tstr,10));
errmsg += ", " + tcstr + " " +
GetResourceString(IDS_EXTERNAL_NARGS_FOUND);
FreeLibrary(m_dllHandle);
throw MsgException(errmsg);
}
}
Note: The return value 99 has a special definition which causes GoldSim to
unload the DLL (and continue the simulation). This is useful when running very
large model files (in which the DLL only needs to be called infrequently). If the
DLL is subsequently called again, GoldSim will automatically reload it.
Following are examples in C and Fortran showing how to return such an error
message.
C example:
extern void __declspec(dllexport) XFerr
(int XFmethod, int *XFState, const double inarg[], double *outarg)
{
static char errstr[30]; // Make sure error string is long enough for messages!
*XFState = 0;
switch ( XFmethod )
{
case XF_INITIALISE :
break; // nothing required
case XF_REP_VERSION :
outarg[0] = VERSN;
break;
case XF_REP_ARGUMENTS :
outarg[0] = 2.0; // 2 in
outarg[1] = 2.0; // 2 out
break;
case XF_CALCULATION : // return an error message
strcpy(errstr, "Test error message.");
// Ignore the compiler warning about the following line:
(int) outarg[0] = (int) &errstr; // the address of the error message
*XFState = -1; // indicates we are returning an error message
break;
}
return;
} // end XFerr * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Fortran example:
O ff i c i a l l e n g t h o f t h e H a r va r d B r i d g e
Appendix Overview
One of the more powerful features of GoldSim is that it is dimensionally-aware.
You enable this capability by assigning dimensions to the outputs (and hence to
the inputs) of the elements in your model. GoldSim has an extensive internal
database of units and conversion factors. This appendix lists all of the units and
conversion factors that are built into GoldSim.
Appendix Overview
In some cases, rather than using the result post-processing capabilities provided
by GoldSim, you may wish to analyze the results using a separate program, such
as a statistical analysis package. To facilitate this, GoldSim allows you to export
all results to a separate file in one of three formats:
• an ASCII text file;
• a binary file; or
• an Access database file.
Read more: Exporting Results (page 471).
In this Appendix This appendix describes the details of the file format for each of these three
export options.
• ASCII Export File Format
• Binary (MAYDAY) Export File Format
• Database Export File Format
Description of ASCII The ASCII result export file consists of six sections:
File Format • Header
• Array Labels
• Time Points
• Elements
• Outputs
• Results
Each section (except the header) is denoted with the section title in bracket
(e.g., [Array Labels]).
Header The first section contains the following information:
• The version of GoldSim being run.
• The name of the model file
• When the simulation was run
• The user name
• A description of the model entered by the user.
• Either the starting date or the elapsed time depending on simulation
settings
• The total simulation time and time unit
• The number of time steps in the simulation.
• The number of time points exported
• The number of realizations simulated
• The number of realizations exported
• The number of elements exported
Array Labels The ID and members of each set of array labels in the model are listed in this
section
Time Points The time points that have been exported are listed in this section.
Elements For each non-stochastic element in the model for which results have been saved,
six items are exported:
• An element number (e.g., E00001). This is assigned when the export
file is created.
• A flag identifying the element type (as specified by a number indicated
below):
0 = Container
1 = Data
2 = Integrator
3 = Expression
7 = Stochastic
8 = Event Delay
9 = Decision
11 = Selector
12 = Reservoir
14 = External
15 = Timed Event
16 = Discrete Change
20 = Spreadsheet
21 = And
22 = Or
23 = Sum
24 = Extrema
27 = Milestone
28 = Status
29 = Not
30 = Material Delay
31 = Information Delay
32 = Discrete Change Delay
33 = Triggered Event
34 = Information Time Series
35 = Material Time Series
36 = Convolution
38 = Previous Value
39 = Random Choice
200 = Pipe (CT Module)
201 = Cell (CT Module)
202 = Species (CT Module)
203 =Receptor (CT Module)
204 = Source (CT Module)
205 = Reference Fluid (CT Module)
206 = Fluid (CT Module)
207 = Solid (CT Module)
208 = External Pathway (CT Module)
209 = Network Pathway (CT Module)
For each output for which results have been saved, the following items are of
Outputs exported:
• The result number (e.g., R000001), assigned when the file is created.
• The element number (see Elements section above).
• The name of the output
• A flag indicating what results have been produced. 1 indicates the
output has final values, 2 indicates the output has histories, and 3
indicates the output has both final values and histories.
• The unit of the output.
Results For each timepoint, the time is listed, followed by line for each result (as
identified by the result number). One value is listed for each realization.
The simulation table is the main table in the database. It collects information
Simulation Table about results from a single model simulation which enables us to store multiple
simulation results in one and the same database.
The fields in the table are shown below:
The most important field is the SimID identifier which is used in several other
tables to find required data subsets.
The author and description fields are directly specified by the GoldSim when
the file is created. If the user does not type in an author, the login name provided
by the environment variable will be stored in the table.
Element_Info Table The fields in the Element_Info table are listed below:
Note that GoldSim not only writes the outputs to the database, but in order to
facilitate sensitivity analyses, GoldSim also writes all independent Stochastic
elements (i.e., Stochastic elements in which none of the inputs contain a link).
Constant_Input_Info The table Constant_Input_Info is only used by Stochastic elements that are
Table entirely defined by constants (i.e., none of the inputs contain a link).
The fields in the table are shown below:
The type field stores a number that identifies the input stochastic element, as
indicated in the following table. The fields Param1 through Param6 are used to
store the input values (as indicated in the table below, a stochastic can have up
to 6 input values). Note, that a constant input expression can still consist of
several parts and might contain functions are an expression using multiple
constants (e.g., “2 * sin(0.8)”). Instead of storing the text for such an expression
string in the database, GoldSim evaluates the expression and stores the value
with a unit based on the element’s primary output unit.
UserDistribution The UserDistribution table is only used for cumulative and discrete stochastic
Table (input) elements. It is used to define the probability/value pairs for these
elements. The fields are shown in the table below:
Output_Info Table The Output_Info table specifies which outputs have been saved, and specifies
the output unit and the dimension of the output data. Note that an element can
have more than one output.
The fields in the table are listed below:
The table relationship figure presented at the beginning of this shows a second
table ArrayItem_Info_1. Note, however, that this table does not really exist.
Microsoft Access simply adds the second table image to distinguish between
two one-to-many relationships going from two different fields of one table
(Output_Info) to a single field in a second table.
AI_Labels Table The AI_Labels table stores a list of all array label set items. Every item has its
own unique number, as well as a reference to an ArrayItem_Info table. The field
index is a number representing the position in the set. The field Label contains
the name of the set member at position Index.
Output_Item Table The Output_Item table uniquely identifies each output item, enabling vector and
matrix results to be output to the database.
Output_Item_ID is a unique identifier. The next field is the reference to the
OutputID uniquely defining a single output. The fields Row and Column specify
the dimension of the output data. Both fields are 1 for a scalar result.
Result Table The actual result values are stored in the Result table:
W i l l i a m B l a k e , To t h e P u b l i c
Appendix Overview
In simulations which require a great deal of input, it may be desirable that the
simulation model can access the various data sources directly to ensure the
quality of the data transfer.
To facilitate this, GoldSim data entry elements can be linked directly to an
ODBC-compliant database.
Read more: Linking Elements to a Database (page 646).
After defining the linkage, you can then instruct GoldSim to download the data
at any time. When it does this, GoldSim internally records the time and date at
which the download occurred, along with other reference information retrieved
from the database (e.g., document references), and this is stored with the model
in the Run Log. This allows you to confirm that the correct data were loaded
into your model, and provides very strong and defensible quality control over
your model input data.
GoldSim can import from three different types of databases: a Generic Database,
a Simple GoldSim Database, and a Yucca Mountain Database. This appendix
describes the details of the structure and format for each of these three database
types.
In this Appendix This appendix discusses the following:
• Creating a Generic Database
• Creating a Simple GoldSim Database
• Creating a Yucca Mountain Database
Note that by assigning multiple records and using multiple fields for each ID,
you can download vector and matrix data from the generic database.
Read more: Downloading from a Generic Database (page 649).
The Database.gsm file in the Examples folder in your GoldSim directory
provides an illustration of how this can be done. This folder also includes the
sample database referenced by this file (Generic_DB.mdb), created using
Microsoft Access 97. In order to use the GoldSim file, you will need to add the
database as data sources to your computer.
Read more: Adding Data Sources to Your Computer (page 647).
The Parameter Table (tbl_Parameter) must contain the following fields (which
Parameter Table must be named as shown below):
Note that the Parameter_Path does not need to be defined (it can be blank). In
this case, it does not matter where the element exists in the model. If you specify
a path, it must start and end with a backslash (e.g., \container1\container2\ ). If
you want to specify the top-level Container (the model root), you should use a
single backslash.
If you specify a path, GoldSim first tries to find a record with a the specified
element name and path. If it does not find it, it tries again, ignoring the path.
If GoldSim finds multiple records with the same name and path, and both have
the Current field marked “Yes”, it will issue an error message (i.e., if multiple
records in the database have the same name and path, only one record can have
the Current flag set to Yes).
Parameter Type Codes The codes for the various parameter types, and their required arguments are
and Arguments shown below:
Value
beta 2800 Mean Std. Minimu Maximum
Deviation m
gamma 2900 Mean Std.
Deviation
truncated gamma 2902 Mean Std. Minimu Maximum
Deviation m
weibull 3000 Minimum Weibull Mean-
Slope Minimu
m
truncated weibull 3002 Minimum Weibull Mean- Maximum
Slope Minimu
m
binomial 3100 # of Picks Probability
(Batch size) of Success
boolean 3200 Probability
of True
Student’s t 3300 Degrees of
freedom
exponential 3400 Mean
Pareto 3500 a B
Truncated Pareto 3502 a b Maximu
m
negative binomial 3600 Successes Probability
of Success
Note that for the discrete and cumulative distributions, the first argument
references the val_pair_UID field in the Probability Value Pairs table (described
below).
Parameter Reference The Parameter Reference Table (tbl_Parameter_Reference) allows you to
Table specify reference information for the element.
The table has the following fields:
o http://
o www.
o ftp://
o ftp.
o file://
• If the character @ is encountered, and text before and after the @ not
delimited by a space or a line break will be considered part of the
hyperlink.
Array Values Table The Array Values Table (tbl_Array_Values) is used to store an arbitrary number
of array values for a vector or matrix Data element.
The table has the following fields:
Probability Value The Probability Value Pair Table (tbl_Probability_Value_Pairs) is used to store
Pairs Table an arbitrary number of value pairs used in defining discrete and cumulative
distributions. No other type of element uses this table.
The table has the following fields:
Example File and The Database.gsm file in the Examples folder in your GoldSim directory
Database Template provides an example of how elements can be linked to a Simple GoldSim
database. This folder also includes the sample database referenced by this file
(Simple_DB.mdb), created using Microsoft Access 97. In order to use the
GoldSim file, you will need to add the database as data sources to your
computer.
Read more: Adding Data Sources to Your Computer (page 647).
The Examples folder also includes a template for creating Simple GoldSim
databases (simple_db_template.mdb). This template file includes two additional
tables (providing parameter type codes and unit abbreviations) which can be
used to support the implementation of custom forms which allow the user to
pick a parameter type code and unit from a list.
Note: The tables described below can contain additional fields not used by
GoldSim. When importing information, GoldSim will ignore any extra fields.
Parameter Table The Parameter Table (GS_Parameter) has one record for each linked Element. It
contains basic descriptive information about the Element, and an index
(Parameter_ID) which links it into the GS_Parameter_Value table. It must
contain the following fields:
Parameter Value The Parameter Value Table (GS_Parameter_Value) has one record for each
Table Element and each effective date. Each record must have a unique Effective_Date
and Value_ID. The Value_ID is an index which is used to link into the actual
data values, which are stored in table GS_Value_Component. The
GS_Parameter_Value table must contain the following fields:
Note: Matrices and 2-D tables can have no more than 60 columns.
For Stochastic elements other than discrete or cumulative types, the arguments
are stored, in sequence, in the Value_Column_1 … Value_Column_n entries.
The order of the arguments for each type of Stochastic is listed below:
For a discrete or cumulative Stochastic element type, there are multiple rows in
the table, with one row for each probability value. Value_Column_1 contains
the probability values, and Value_Column_2 contains the result values.
Example File The Database.gsm file in the Examples folder in your GoldSim directory
provides an example of how elements can be linked to a Yucca Mountain
database. This folder also includes the sample database referenced by this file
(Yucca_DB.mdb), created using Microsoft Access 97. In order to use the
GoldSim file, you will need to add the database as data sources to your
computer.
Read more: Adding Data Sources to Your Computer (page 647).
Charles Babbage
Appendix Overview
The elements and links in a GoldSim model represent a system of equations.
Except in the simplest cases, these are systems of differential equations, and
they are often nonlinear and discontinuous. In general, the systems of equations
that GoldSim must solve will not have an analytical solution (i.e., they cannot be
solved exactly), and must be solved numerically (i.e., using an algorithm that
provides a numerical approximation to the actual solution).
In order to effectively use GoldSim, particularly for complex problems, it is
important to have a basic understanding of the factors affecting the accuracy of
your model, and the nature of the numerical approximations used by GoldSim.
This appendix provides a brief discussion of these numerical algorithms.
In this Appendix This appendix discusses the following:
• Factors Affecting the Accuracy of Simulation Models
• Primary Numerical Approximations in GoldSim
• Summary of GoldSim’s Dynamic Timestepping Algorithm
GoldSim User's Guide Appendix G: Integration Methods and Timestepping Algorithm • 749
Factors Affecting the Accuracy of Simulation Models
750 • Appendix G: Integration Methods and Timestepping Algorithm GoldSim User's Guide
Primary Numerical Approximations in GoldSim
where:
Δti is the timestep length just prior to time ti (typically this will be
constant in the simulation);
Rate of Change(ti- Δti ) is the Rate of Change at time=ti- Δti ; and
Value(ti) is the value at end of timestep i.
Note that the Value at a given time is a function of the Rate of Change at
previous timesteps (but is not a function of the Rate of Change at the current
time).
This particular integration method is referred to as Euler integration. It is the
simplest and most common method for numerically solving such integrals. The
key assumption in the method is that the rate remains constant over a timestep.
The validity of this assumption is a function of the length of the timestep and the
timescale over which the rate is changing. The assumption is reasonable if the
timestep is sufficiently small.
To get a feeling for the errors that can be produced by Euler integration,
consider the following very simple integral:
Value = Initial Value + ∫ -k * (Value)dt
where k is a constant. This is the equation for simple (exponential) first-order
decay, and the analytical solution is:
GoldSim User's Guide Appendix G: Integration Methods and Timestepping Algorithm • 751
Primary Numerical Approximations in GoldSim
*
Solution Value at 20 days % Error
Analytical Solution 25.00 -
Timestep = 5 days 18.24 9.0%
Timestep = 1 days 23.78 1.6%
Timestep = 0.5 days 24.40 0.8%
Timestep = 0.1 days 24.89 0.1%
* Simulated - Analytical
Error computed as
Analytical - Initial Value
A plot of these results is shown below:
Integration Error
50
40
30
20
10
0
0 5 10 15 20
Time (days)
As can be seen, with the exception of the 5 day timestep, the Euler integration
method is relatively accurate. In fact, for most systems that you will be
simulating using GoldSim, a numerical error of several percent is likely to be
acceptable (and much smaller than the error caused by the uncertainty in the
initial conditions, the parameters, and the conceptual model). As a general rule,
your timestep should be 1/3 to 1/10 of the timescale of the fastest process being
simulated in your model.
Read more: Selecting the Proper Timestep (page 754).
752 • Appendix G: Integration Methods and Timestepping Algorithm GoldSim User's Guide
Primary Numerical Approximations in GoldSim
Warning: The magnitude of the integration error depends on the nature of the
model. In stable models that are dominated by negative feedback loops (and
hence tend toward equilibrium), the errors tend to diminish with time. Systems
that are unstable and grow exponentially or oscillate with no damping tend to
accumulate errors over time. For these types of systems (e.g., a swinging
pendulum), a very small timestep may be required to accurately simulate the
system using Euler integration.
Note: In cases where a small timestep is required to maintain accuracy, this can
be done in a very computational efficient way by using Containers with Internal
Clocks, which allow you to locally use a much smaller timestep.
Other Integration Although the Euler method is simple and commonly used, other integration
Methods methods exist which can achieve higher accuracy with a larger timestep (e.g.,
Runga-Kutta, variable timestep methods). Because these methods can use a
much larger timestep without losing accuracy, they are more computationally
efficient.
These methods, while being important for some types of systems (e.g., sustained
oscillators like a pendulum), are not incorporated into GoldSim for the following
reasons:
• Higher order methods are most useful when simulating physical
systems in which the mathematical model, initial conditions and input
parameters are known very precisely, and small integration errors can
be significant. For the most part, the kinds of systems that you will be
simulating using GoldSim can be handled effectively using Euler
integration.
• Higher-order methods work best when simulating continuously-varying
systems. They do not deal well with systems that behave
discontinuously and/or are impacted by discrete changes. Most real
world systems do not vary continuously, and GoldSim therefore
provides powerful algorithms for accurately superimposing discrete
changes (discontinuities) onto a continuously-varying system. These
algorithms are incompatible with higher-order integration methods.
Read more: Accurately Simulating Discrete Events that Occur
Between Timesteps (page 755).
• For some kinds of systems (e.g., mass or heat transport using the
Contaminant Transport Module), GoldSim uses powerful algorithms to
accurately solve nonlinear coupled differential. These algorithms
dynamically adjust the timestep during the simulation, and are
incompatible with higher-order integration methods.
Read more: Using Advanced Algorithms to Solve Coupled Equations
(page 756).
As mentioned above, in cases where a small timestep is required to maintain
accuracy using Euler integration, this can be done in a very computational
efficient way by using Containers with Internal Clocks, which allow you to
locally use a much smaller timestep.
Read more: Specifying Containers with Internal Clocks (page 354).
GoldSim User's Guide Appendix G: Integration Methods and Timestepping Algorithm • 753
Summary of GoldSim’s Dynamic Timestepping Algorithm
Approximate In some situations, you may wish to simulate a static or dynamic processes in
Solutions to Coupled which the variables in the system are coupled such that they respond
instantaneously to each other, with no time lags. In GoldSim, these are referred
Equations to as recursive loops, and they are treated differently from feedback loops.
If you encounter a system such as this in one of your models, you can handle it
in one of two ways. First, you could solve the system of equations directly either
prior to running the model (e.g., using substitution), or dynamically while
running the model (e.g., using an External element or GoldSim’s matrix
functions to solve the appropriate equations). Note, however, that for many
complex models (e.g., non-linear coupled equations), the solution could be very
computationally intensive.
GoldSim offers an alternative: solve the equations approximately and iteratively
using Previous Value elements. A Previous Value element allows you to
reference the previous value (i.e., the previous timestep) of an output.
Read more: Creating Recursive Loops Using Previous Value Elements (page
609).
Selecting the Proper As a general rule, your timestep should be 3 to 10 times shorter than the
Timestep timescale of the fastest process being simulated in your model. In simple
systems, you should be able to determine the timescales of the processes
involved. In more complex models, however, it may be difficult to determine the
timescales of all the processes involved.
In addition, for some kinds of models (e.g., some oscillating systems), this
general rule may not be sufficient and you may need a smaller timestep).
Therefore, after building your model, you should carry out the following
experiment:
4. Carry out an expected value or median value simulation.
5. Reduce the timestep length by half (increase the number of timesteps
by a factor of 2), rerun the model, and compare results.
6. Continue to half the timestep length until the differences between
successive simulations are acceptable.
754 • Appendix G: Integration Methods and Timestepping Algorithm GoldSim User's Guide
Summary of GoldSim’s Dynamic Timestepping Algorithm
that early in a simulation, parameters are changing rapidly, and hence you need
a smaller timestep.
You do this by defining phases, which have different durations and timestep
lengths. An example of pre-specified time phases is shown below:
In this example, the model uses a 1 day timestep for the first 50 days, a 2 day timestep
between 50 days and 100 days, and a 5 day timestep between 100 days and 300 days (the
end of the simulation).
Dynamically Although defining time phases can be very useful, you must fully specify them
Adjusting the prior to running the simulation. That is, you must know how you would like to
alter your timestep prior to running the model. In some cases, however, it may
Timestep not be possible to do this. That is, in complex systems (particularly ones with
uncertain parameters), variables may change at different rates in different
realizations, in ways that you cannot predict prior to running the model.
To better simulate these kinds of systems, GoldSim provides an advanced
feature that allows you to dynamically adjust the timestep during a simulation
(i.e., insert “internal” timesteps) based on the values of specified parameters in
your model. For example, you could instruct GoldSim to use a timestep of 1 day
if X was greater than Y, and 10 days if X was less than or equal to Y. Similarly,
you could instruct GoldSim to use a short timestep for a period of 10 days after a
particular event occurs, and then return to the default timestep.
Read more: Dynamically Controlling the Timestep (page 352).
GoldSim User's Guide Appendix G: Integration Methods and Timestepping Algorithm • 755
Summary of GoldSim’s Dynamic Timestepping Algorithm
model. Hence, GoldSim also provides a method for limiting the degree to which
it creates new “internal” timesteps (by providing a minimum timestep length)
when events occur.
Read more: Controlling How Events are Inserted Between Timesteps (page
350).
Using Advanced For some special types of systems, GoldSim provides additional dynamic
Algorithms to Solve timestepping algorithms (different from the timestep algorithms described
above) to more accurately solve these equations. In particular, the Contaminant
Coupled Equations Transport Module utilizes dynamic timestep adjustment to solve the coupled
differential equations associated with mass and heat transport.
This algorithm allows GoldSim to handle “stiff” systems (systems with widely
varying time constants) as well as nonlinear aspects of the system in a very
accurate and computationally efficient manner. This algorithm is discussed in
the GoldSim Contaminant Transport Module User’s Guide.
756 • Appendix G: Integration Methods and Timestepping Algorithm GoldSim User's Guide
Glossary of Terms
Affects View
A special browser view in GoldSim that allows you to see all the elements the
selected element affects.
Alias
The name by which an exposed output of a localized Container is referenced.
Allocator
An element that allocates an incoming signal to a number of outputs according
to a specified set of demands and priorities. Typically, the signal will be a flow
of material (e.g., water), but it could also be a resource, or a discrete transaction.
Array
A collection of variables that share common output attributes and can be
manipulated in GoldSim elements or input expressions.
Array Labels
A collection of labels identifying the items of an array.
Autocorrelate
To correlate a Stochastic element to a previous value of itself.
Browser
An alternative view of a GoldSim model, in which elements are displayed in a
tree, and organized either hierarchically, or by type.
Built-in Constants
Constants (such as pi) that are built-in to GoldSim and can be used when
creating expressions in input fields.
Built-in Functions
Mathematical functions (such as sine, maximum, round) that are built-in to
GoldSim and can be used when creating expressions in input fields.
Cancellation Code
An alphanumeric code generated by GoldSim that can be used to verify that a
registration has been terminated.
Causality Sequence
The specific order in which GoldSim updates (computes) elements every
timestep.
Change Note
A note added to an element when using versioning that is subsequently
displayed when showing changes.
Chart Style
A collection of settings for a particular type of result display chart.
W
Web site 5
GoldSim Resource Center 23
Weibull distribution 156, 678
Withdrawal rates from Reservoirs
206, 211
Wizard
New model 62
Y
Yucca Mountain database
creating 745
downloading from 651
Z
Zoom toolbar 97
Zooming
in charts 406
in graphics pane 97