GoldSim Vol 1
GoldSim Vol 1
GoldSim
Volume 1 of 2
Copyright GoldSim Technology Group LLC, 1998-2014. 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.
GoldSim makes use of the Cephes Math Library Release 2.8. Copyright 1984, 1987, 1988, 1992, 2000 by
Stephen L. Moshier. The copyright holders require the following disclaimer:
Index 1091
Fra n c i s B a c o n , T h e A d v a n c e m e n t o f
Learning
Chapter Overview
GoldSim is a user-friendly, highly graphical program for carrying out dynamic,
probabilistic simulations to support management and decision-making in
business, engineering and science.
This User's Guide provides a complete description of the features and
capabilities of GoldSim.
In this Chapter This introductory chapter discusses the following topics:
What is GoldSim?
How to Use this Manual
Conventions Used in this Manual
Installing and Registering GoldSim
Learning to Use GoldSim
Using Help and the GoldSim Tutorial
Getting Technical Support
What is GoldSim?
GoldSim is a highly graphical, object-oriented computer program for carrying
out dynamic, probabilistic simulations. In a sense, GoldSim is like a "visual
spreadsheet" allowing you to visually create and manipulate data and equations.
What Can I Do With GoldSim is a simulation program. As used here, simulation is defined as the
GoldSim? process of creating a model (i.e., an abstract representation or facsimile) of an
existing or proposed system (e.g., a business, a mine, a watershed, a forest, the
organs in your body, the atmosphere) in order to identify and understand those
factors which control the system and/or to predict (forecast) the future behavior
of the system. Almost any system which can be quantitatively described using
equations and/or rules can be simulated.
Simulation is an important tool because it provides a way in which alternative
designs, plans and/or policies can be evaluated without having to experiment on
a real system, which may be prohibitively costly, time-consuming, or simply
impractical to do. That is, simulation allows you to ask “What if?” questions
about a system without having to experiment on the actual system itself (and
hence incur the costs and delays associated with field tests, prototypes, etc.).
What Kind of Because GoldSim was designed with flexibility in mind, you can use it to
Problems Can I Apply simulate almost any kind of system. Illustrative examples from the fields of
business, science and engineering include the following:
It To?
Strategic Planning: You could simulate the implementation of a complex
undertaking (e.g., design, manufacture and marketing of a new product) by
describing the tasks involved, any precedent requirements (i.e., what must
be done before a particular task can begin or end), task durations and costs,
and events which could impact the process. The output of such a simulation
might be the probability of successfully completing the undertaking (in a
certain timeframe, or at a certain level of profitability). You could use the
results to identify potential problems that might arise and design
contingency plans. On a larger scale, such a tool could be then used to
evaluate and manage portfolios of projects and investments.
Ecology: The growth of a group of animals could be simulated by
describing in mathematical terms the initial number of animals, the birth
rate, the death rate, the rate at which animals migrate to or away from the
group, possible catastrophic events, etc. The output of this simulation would
then be the number of animals in the group as a function of time (e.g., one
year from now, ten years from now, etc.). You could use the results to better
manage the system in order to stabilize or increase the population (e.g., by
limiting hunting, or introducing predators).
results in any units. You can even define your own customized units.
GoldSim ensures dimensional consistency in your models and carries out all
of the unit conversions internally. As a result, when you use GoldSim, it is
never necessary for you to carry out (error-prone) unit conversions.
GoldSim is highly extensible. You can dynamically link external programs
or spreadsheets directly into your GoldSim model. In addition, GoldSim
was specifically designed to support the addition of customized modules
(program extensions) to address specialized applications.
GoldSim allows you to create compelling presentations of your model.
A model that cannot be easily explained is a model that will not be used or
believed. 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.
What Do I Need to The program runs on personal computers using 32-bit or 64-bit Microsoft
Use GoldSim? Windows operating systems. Specifically, GoldSim requires Windows Vista,
Windows 7, Windows 8, Windows 8.1, or Windows Server 2008. Windows XP,
Windows Server 2003, Windows RT and ARM-based CPUs are not supported.
If you are linking GoldSim to Microsoft Excel, you must have Excel 2003 or
later. You must have Administrative Privileges on the system and a minimum of
200 MB disk space during the installation process, 100 MB of disk space in the
target directory for the installation and 40 MB of free space in Common Files
folder. 16-bit color depth is required (32-bit recommended).
Because GoldSim is very powerful and flexible, it is relatively complex.
Nevertheless, the software can be readily mastered by anyone familiar with the
basic functions of a personal computer and the Windows operating system.
Since a GoldSim model is built by describing functional relationships
(equations) between the components of your system, however, you must be
comfortable with the basics of quantitative analysis. This does not mean you
must be a mathematician or a numerical modeler. As a rule of thumb, if you are
comfortable using a spreadsheet you can learn to build a model in GoldSim.
Finally, although GoldSim can be run in a deterministic manner (i.e., with no
uncertainty specified in the input parameters), one of the key features of the
program is its ability to explicitly represent such uncertainty through the use of
probability distributions. In order to do so, you must have at least a basic
understanding of the representation and propagation of uncertainty. Appendix A
provides a brief primer on this topic, along with suggestions for further reading.
To satisfy those users who do not wish to read the entire manual before starting
a project, the document is heavily cross-referenced, such that each chapter and
each major section can stand alone.
To facilitate the use of these cross-references, whenever they appear in the
manual, they are set off from the text and always proceeded by “Read More:”),
as shown below:
Read more: Example Models (page 5).
This allows the document to be readily used as a reference guide, with the user
accessing topics and features via the cross-references, the table of contents
and/or the index on an as-needed basis. Furthermore, as will be discussed later
in this introduction, nearly all of the information available in the printed
documentation can also be accessed via an extensive help system.
Note: Although the remainder of the manual is written so that it can be used as a
reference document, it is highly recommended that all users read Chapters 2 and
3 before starting to build a model in GoldSim.
Example Models Starting with Chapter 3, the manual references a number of examples that are
relevant to features being discussed. When you install GoldSim, a folder labeled
"General Examples" is installed in the same directory as the program. This
directory contains the example model files mentioned in the text. These example
model files are an excellent way to begin to experiment with GoldSim. Each
example is internally documented with comments on the way the model was
implemented.
Note: You can quickly access these files by selecting File|Open Example…
from the main GoldSim menu.
Note: These examples are read-only files. If you wish to modify them, you will
need to Save As.
Note: Additional example models are periodically added to the Model Library
on the GoldSim Web site.
Note: During the installation process, you will be prompted for a Name and an
Organization. This information will subsequently be displayed in the GoldSim
splash screen and the About dialog after you install and register the program.
From this dialog, you can choose to register GoldSim or to use an existing
network (floating) license.
Read more: Registering and Using a Network (Floating) License (page 14).
Registering GoldSim Pressing the Register Standalone License button displays the following dialog:
via the Internet
Enter the Registration Code at the top of the dialog. Once you do so, there are
two options for registering GoldSim: via the Internet, or using assisted
registration.
If your machine is connected to the Internet, you should select the Internet
Registration, as it is the quickest and easiest way to register GoldSim. To do so,
press the Register button. GoldSim will then automatically be registered on
your machine by connecting to the GoldSim License Server. This process should
take less than one minute.
If, for some reason, a connection cannot be made to the License Server (e.g., the
GoldSim License Server is not responding or there is no internet connection
available), GoldSim will report that a connection with the server could not be
established, and that you should select Assisted Registration. Assisted
Registration is discussed below.
Assisted Registration If you are not connected to the Internet, or if you cannot connect to the GoldSim
License Server, you can register GoldSim manually by pressing the Assisted
Registration button. When you do so, the following dialog will be displayed:
In order to register in this way, you must contact the GoldSim Technology
Group and provide the Registration Code and the Installation Code displayed in
the dialog. The Registration Code shown is the same one provided to you when
you licensed the software. The Installation Code is automatically generated
when you install GoldSim on your machine (and is unique to each installation).
After copying this information from this dialog (the Copy button copies the
Installation Code to the clipboard), you should close the dialog and wait for
In this case, GoldSim provides an option to disconnect from the floating license
and connect to a standalone license.
These topics are discussed in detail below.
Extending or Upgrading When you license GoldSim, you will be provided with a Registration Code to
a License allow you to register (and use) the software. Depending on the type of license
you have, your registration may expire at some point and must be extended if
you want to continue to use GoldSim (e.g., after one year). In any case, your
support period will always be limited, so if you wish to upgrade to a newer
version after your support period has expired, you will need to extend your
license.
You can see if and when your license expires and when your support expires by
selecting Help|Licensing… from the main menu. This will display the
License Manager:
The left portion of the dialog displays the license expiration date and support
end date.
If your registration is close to expiring and you wish to extend it, or if you wish
to upgrade your license (e.g., in order to utilize other extension modules, or
continue to have access to upgrades), you will need to contact the GoldSim
Technology Group and request that your license be extended/upgraded.
Extending/upgrading your license requires an activated Registration Code from
the GoldSim Technology Group. Once you have received this, return to this
dialog and press the Upgrade License button. When you do so, you will be
presented with the standard Registration dialog. Extending/upgrading your
license requires you to re-register using the Registration Code provided by the
GoldSim Technology Group.
Read more: Registering GoldSim via the Internet (page 9).
Warning: When you press Upgrade License button, your existing registration
will be canceled and you will then be immediately prompted to re-register. If
you do not re-register, GoldSim will no longer run on your machine. In order to
re-register, you need a valid (activated) Registration Code. Hence, if you do not
have a Registration Code provided by the GoldSim Technology Group, and a
confirmation that the Code has been activated to extend/upgrade your license,
you should not proceed.
Note: You will be warned every time that you open GoldSim if it is within 30
days of expiring (or for usage-based licenses, within 10 usages of expiring).
Connecting to a If you are currently using a standalone license, you have the option of
Floating License connecting to an existing floating license. This is useful, for example, if you are
using a temporary standalone license (e.g., an evaluation) and want to switch to
a permanent floating license.
To do so, press the Connect to Floating License button in the License Manager
dialog (accessed by selecting Help|Licensing… from the main menu).This
will then display a dialog prompting you for the GoldSim network license
folder:
The folder containing the license on the server must be accessible to the client
machine via a network share and the client must have full access (i.e., read/write
privileges) to the folder. Moreover, it should be specified using the Universal
Naming Convention (i.e., \\computername\sharename). This information should
be provided by your license administrator.
Read more: Registering and Using a Network (Floating) License (page 14).
Note: Once you connect to a floating license, you can easily convert back to a
standalone license, if a valid standalone license still exists on your computer.
Warning: Once you cancel your license, you will not be able to use your
existing Registration Code on another machine until the GoldSim Technology
Group receives the Cancellation Code and reactivates your license. If you cannot
be without your license for several days, you are strongly recommended to
contact the GoldSim Technology Group by phone during business hours (M-F,
8AM – 5PM PST) before beginning the transfer process in order to facilitate a
rapid transfer.
Canceling a License Under some circumstances, you may need to “cancel” a license. Canceling a
license terminates the registration of the installation, and generates a
Cancellation Code that can be sent to the GoldSim Technology Group to verify
that the registration has been terminated.
The most common reason to cancel a license is to facilitate a license transfer
from one machine to another.
A license can be canceled by opening the License Manager (by selecting
Help|Licensing… from the main menu) and pressing the Cancel License
button.
After a warning message, GoldSim will cancel the license and display the
following dialog:
The Cancellation Code displayed here can be copied to the clipboard (and
subsequently pasted into an email). After pressing the Close button, the
program will close. If you subsequently try to run GoldSim, the registration
dialog is displayed (indicating that your installation of GoldSim is not currently
registered).
Note: Canceling a license does not uninstall the program. You should use the
Windows Control Panel Add/Remove Programs tool to uninstall GoldSim.
The GoldSim License After registering GoldSim, the GoldSim License Agreement will be displayed in
Agreement a dialog.
You can press the Print… button to print the document at this time to obtain a
hardcopy version of the License Agreement.
You must select “I Accept” and press OK in order for GoldSim to run.
After accepting the License Agreement and running GoldSim, you can access
the Agreement at any time by opening the License Manager (by selecting
Help|Licensing… from the main menu) and pressing the Show GoldSim
License Agreement…button. The License Agreement will then open in your
default text editor (e.g., Notepad).
Sharing a License GoldSim allows you to automatically share a single license between different
Between GoldSim GoldSim versions on a single machine. This is particularly useful when
Versions on a Single converting files from an old version of GoldSim to a new one. In such a case,
Machine you may want to have two versions of GoldSim on a single machine (e.g.,
Version 10.1 and Version 10.5), and be able to switch back and forth between
versions or run both versions simultaneously.
GoldSim allows you to easily share a license in this way. After installing a
second version on your machine and trying to run it, GoldSim will automatically
detect and use your previously existing license (even if you are running the two
versions simultaneously).
Registering and GoldSim supports network (floating) licenses. This allows multiple machines to
Using a Network access GoldSim over a network. In order to use GoldSim in this manner, your
license must be specified as a floating license (a regular GoldSim license cannot
(Floating) License be run over a network).
If you have a floating license, the machine that is registered will generally be a
network server. The license has a predefined number of users associated with it.
GoldSim will keep track of the number of users (clients) accessing the program
over the network, and will permit no more than the authorized number of users
from accessing GoldSim at any given time.
Note: There is no performance penalty when using a floating license. Only the
license files are stored on the server. All program execution takes place on the
client machines.
These steps, along with instructions for using and maintaining a network license,
are described below.
Choosing and The license must be located on a machine that is accessible to all GoldSim users.
Configuring a License Once the host machine has been identified, you will need to create or select a
Location on a Server folder that will house the license. This folder must be shared and all GoldSim
users will need Full Control (read / write / create / modify / delete) permissions
in the selected folder.
Sharing a License Folder in Windows XP/Server 2003:
1. Right click the license directory and select the Properties… item from
the context menu. Select the Sharing tab:
2. Choose the “Share this folder” option, then click the Permissions
button.
3. Select the Everyone entry (or the GoldSim user group if you are
limiting access), and check the “Full Control” option:
Note: Full control permission is required for the system account in order to run
GoldSim Floating License Manager. By default, the system account is granted
full control in most cases. You can check the permission for the system account
on the Security tab of the directory properties dialog.
Registering a Network After the license directory has been set up, you will need to install the GoldSim
License on a Server Floating License Manager on the machine where the license directory is located.
Note: For best performance the license location should be specified using a
UNC path (e.g. \\computername\sharedfoldername) on the server and all client
machines.
If you want to change the license folder, you can do so by selecting Select
license location….
In order to register the software, you will need to have a Registration Code. A
Registration Code will be provided to you when you license the software. (If
you forget your Registration Code, contact us at support@goldsim.com).
When you press Register Floating License…, the following dialog will be
displayed:
Enter the Registration Code at the top of the dialog. The Register and Assisted
Registration buttons will then be available.
If your machine is connected to the Internet, you should click the Register
button, as it is the quickest and easiest way to register GoldSim. GoldSim will
then automatically be registered on your machine by connecting to the GoldSim
License Server. This process should take less than one minute.
If, for some reason, a connection cannot be made to the License Server (e.g., the
GoldSim License Server is not responding or there is no internet connection
available), GoldSim will report that a connection with the server could not be
established, and that you can register using Assisted Registration.
When you press the Assisted Registration button, the following dialog will be
displayed:
In order to register in this way, you must contact the GoldSim Technology
Group and provide the Registration Code and the Installation Code displayed in
the dialog (the Copy button can be used to copy the Installation Code to the
clipboard). The Registration Code shown is the same one provided to you when
you licensed the software. The Installation Code is automatically generated
when you install the Floating License Manager on the server (and is unique to
each installation). After copying this information from this dialog, you should
exit out of the Floating License Manager and wait for GoldSim to contact you
with a Registration Key to complete the assisted registration process.
Once the GoldSim Technology Group receives your Registration Code and
Installation code, you will be provided with a Registration Key to complete the
registration process. Once you have obtained a Registration Key, return to the
Assisted Registration dialog (by running the Floating License Manager and
pressing Register Floating License…, and then Assisted Registration), enter
the Registration Key (you can paste this into the field rather than entering it by
hand), and press Register. At the end of the process, GoldSim will be registered
on the server and ready to use.
After registering the license on the server, you must now install GoldSim on
Configuring Client each client machine that will utilize the network license. (The GoldSim
Machines to Use a installation file is available from within the GoldSim website). The process will
Network License differ depending on whether or not GoldSim was previously installed on the
client machine.
Client machine with no previous GoldSim installations:
Once GoldSim is installed on a client machine, and you run the program for the
first time, you will be presented with the following dialog:
Select Connect to Floating License. When you do so, you will be prompted to
select the network folder where the license resides:
Note: For best performance the license location should be specified using a
UNC path (e.g. \\computername\sharedfoldername) on the server and all client
machines.
Once you have selected the folder, GoldSim immediately checks to see if a
license is available to use. If not you will be asked whether you want to wait in
a queue for the license (as described below).
Valid standalone license exists on client machine:
This case typically occurs when a machine had an evaluation version of
GoldSim installed. To disconnect from the standalone license and connect to
the floating license, open GoldSim and select to Help|Licensing from the main
menu. The following dialog will be displayed:
Click the Connect to Floating License button. When you do so, you will be
prompted to select the network folder where the license resides:
Note: For best performance the license location should be specified using a
UNC path (e.g. \\computername\sharedfoldername) on the server and all client
machines.
Once you have selected the folder, GoldSim immediately checks to see if a
license is available to use. If not you will be asked whether you want to wait in
a queue for the license (as described below).
Expired standalone license exists on client machine:
This case typically occurs when a machine had an evaluation version of
GoldSim installed, but it has expired. The following message will appear when
you try to run GoldSim:
Click the Use a network license… button and you will be prompted to select
the network folder where the license resides:
Note: For best performance the license location should be specified using a
UNC path (e.g. \\computername\sharedfoldername) on the server and all client
machines.
Once you have selected the folder, GoldSim immediately checks to see if a
license is available to use. If not you will be asked whether you want to wait in
a queue for the license (as described below).
Using a Network A network license has a predefined number of users associated with it. The
License as a Client GoldSim Floating License Manager will keep track of the number of users
(clients) accessing the program over the network, and will permit no more than
the authorized number of users from accessing GoldSim at any given time.
Once you have configured a client to use a network license, it will check for an
available network license whenever you try to run GoldSim. If a license is not
available, you will be told so, and asked if you want to be placed in a queue to
wait for an available license. If you choose to enter the queue, you will be
prompted every 5 minutes for whether you want to remain in the queue or not.
Once you have reached the front of queue, you are notified and asked whether or
not you still want to use GoldSim.
Warning: If you do not respond to dialogs for remaining in the queue or using
GoldSim (when you reach the front of the queue) within 5 minutes, you will
automatically be removed from the queue.
Disconnecting a Client In some cases, you may want to disconnect from the floating license and use a
from a Network License standalone license on your machine or to connect to a different floating license.
To disconnect from the floating license, you must first open GoldSim, then
select Help|Licensing from the main menu. The following dialog will be
displayed:
Managing a Network Once you have registered GoldSim on a server, for the most part, you will not
License Using the need to worry about registration again (until the license needs to be renewed or
Floating License upgraded). Occasionally, however, you may need to take some action to
Manager manage the license. The GoldSim Floating License Manager allows you to
manage your license. When you run the Floating License Manager on the server
(after it has been registered), the following dialog is displayed:
Note: Canceling a license on a server does not uninstall the Floating License
Manager. You should use the Windows Control Panel Add/Remove Programs
tool to uninstall this program.
Transferring a license:
Although GoldSim licenses are not intended to be transferred frequently (e.g.,
weekly) between machines, occasionally you may have a need to do so.
The Transfer License button in the Floating License Manager simply provides
instructions for doing so. Transferring a license requires you to directly
communicate with the GoldSim Technology Group.
Transferring a license requires the following steps:
1. Open the Floating License Manager and cancel your existing license
(by pressing the Cancel License button). This will cause GoldSim to
generate and display a Cancellation Code.
2. Send the Cancellation Code to the GoldSim Technology Group via
email (preferable), fax or phone.
3. Upon receiving the Cancellation Code, the GoldSim Technology Group
will reactivate your license and enable you to use your existing
Registration Code again on another machine or for another folder. You
will be contacted via email when your license is reactivated.
4. You must then install the Floating License Manager and register
GoldSim in the new server location.
Warning: Once you cancel your license, you will not be able to use your
existing Registration Code on another machine until the GoldSim Technology
Group receives the Cancellation Code and reactivates your license. If you cannot
be without your license for several days, you are strongly recommended to
contact the GoldSim Technology Group by phone during business hours (M-F,
8AM – 5PM PST) before beginning the transfer process in order to facilitate a
rapid transfer.
Testing the GoldSim Once GoldSim is registered, you should ensure that the program was properly
Installation installed. To test the GoldSim installation, do the following:
1. Double-click on the GoldSim program icon (on the desktop or, using
Windows Explorer, in the folder into which you installed GoldSim) to
start the program.
2. From the Start dialog that is presented, select Open Model.
3. You will be presented with a standard Windows dialog to select a file.
4. Browse to the GoldSim directory.
5. Within that directory will be a folder named "General Examples".
6. Select a file named "FirstModel.gsm" and press Open.
7. From the main menu, select Run|Run Model, or Press F5. The
GoldSim Run Controller is displayed.
8. Press the Run button. A dialog stating that the simulation has
completed is displayed.
9. Press OK to close the dialog. An object labeled "Volume" is displayed.
10. Right-click the object. A menu is displayed. At the top of the menu,
there is a Time History Result… option.
11. Click on this option. The following chart should be displayed:
Activating and GoldSim was designed to facilitate the incorporation of additional modules
Deactivating (program extensions) to enable the program to address specialized systems.
These modules add additional elements and options to GoldSim. Your license
Extension Modules determines which of these program extensions are available to you.
Read more: Specialized GoldSim Modules (page 61).
You can view which modules are available by selecting Model| Options…
from the main menu, and selecting the Modules tab:
Right-clicking anywhere in this dialog and selecting About displays a dialog with a brief
description of each extension module.
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 (some modules, if licensed, are always active).
By default, whenever you register GoldSim, all available extension modules
allowed by your license will be activated.
If you deactivate a module, the specialized elements associated with that module
will be deleted from your model (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 that
are created.
Note: If you try to open a file that contains elements associated with an
extension module, and you are licensed to use that module but it is not currently
active, GoldSim will automatically activate the module and open the file. If,
however, you are not licensed to use the module, GoldSim will not open the file
(and will display an error message).
Note that each extension module has a separate User’s Manual. In addition,
each module (if activated) adds content to the Help system. Manuals (and the
Help systems) for all extension modules are available on the GoldSim website.
Uninstalling GoldSim To uninstall GoldSim, use the Windows Control Panel Add/Remove Programs
tool.
around. Note that the Help system contains all of the contents of the
User’s Guide, with the exception of the technical appendices.
7. Contact us with questions. When you purchase GoldSim, you are
entitled to 1 year of free email support (support@goldsim.com). This
does not include assistance in building and debugging your models, but
it does include answering questions on how to use GoldSim’s features,
so feel free to contact us!
8. Attend a training workshop. The GoldSim Technology Group puts on
2 and 3 day training workshops on the use of GoldSim. This is an
excellent way to quickly become an effective GoldSim modeler. To
learn more about training workshops, visit the GoldSim website.
R . W. H a m m i n g , N u m e r i c a l M e t h o d s f o r
S c i e n t i s t s a n d E n g i n e e rs
Chapter Overview
This chapter provides an introduction to and "quick tour" of GoldSim. It
presents the basic concepts of how simulation techniques can be applied to solve
problems, and how a simulation model is created in GoldSim. It also provides an
overview of the features and capabilities of the program.
If you read nothing else before starting to use the program, it is strongly
recommended that you read this chapter, as it will tell you what the program is
capable of doing, provide an overview of how to build a model, and direct you
to those portions of the manual where you can obtain further information.
In this Chapter This chapter discusses the following:
Understanding Simulation
What is GoldSim?
Basic GoldSim Concepts
Advanced Computational Features
Documenting and Presenting Your Model
Specialized GoldSim Modules
The GoldSim Player
Understanding Simulation
Before describing what the GoldSim simulation framework is, and what it can
be used to do, it is important to first discuss in general terms what we mean
when we use the term simulation.
The term simulation is used in different ways by different people. As used here,
simulation is defined as the process of creating a model (i.e., an abstract
representation or facsimile) of an existing or proposed system (e.g., a business, a
mine, a watershed, a forest, the organs in your body, the atmosphere) in order to
identify and understand those factors which control the system and/or to predict
(forecast) the future behavior of the system. Almost any system which can be
quantitatively described using equations and/or rules can be simulated.
Dynamic Simulation Simulations can be static or dynamic. In a static simulation, the system does not
change with time. Static simulations can be useful for carrying out simple risk
calculations and decision trees, in which there is no dynamic component to the
model.
In a dynamic simulation, the system changes and evolves with time (in response
to both external and internal influences), and your objective in modeling such a
system is to understand the way in which it is likely to evolve, predict (forecast)
the future behavior of the system, and determine what you can do to influence
that future behavior.
In effect, a dynamic simulation is used to predict the way in which the system
will evolve and respond to its surroundings, so that you can identify any
necessary changes that will help make the system perform the way that you want
it to. For example, a fisheries biologist could dynamically simulate the salmon
population in a river in order to predict changes to the population, and
quantitatively understand the impacts on the salmon of possible actions (e.g.,
fishing, loss of habitat) to ensure that they do not go extinct at some point in the
future:
Probabilistic In many systems, the controlling parameters, processes and events may be
Simulation uncertain and/or poorly understood. In a deterministic simulation, these
parameters are represented using single values (which typically are described
either as "the best guess" or "worst case" values). Probabilistic simulation is the
process of explicitly representing this uncertainty by specifying inputs as
probability distributions and specifying any random events that could affect the
system:
you can predict the reliability of the system, and modify the design so as to
increase reliability and decrease the probability and/or consequences of
failures.
Water resources: By simulating the inflows and future demands on a water
supply reservoir, you can optimize management practices to minimize the
probability of needing to seek other sources and/or impose water use
restrictions at some future date.
Environment: By simulating the performance of a proposed landfill, you
can modify the design to minimize environmental impacts.
Manufacturing: By simulating the supply chain for a product, you can
experiment with technological changes (e.g., improved communication) and
changes in decision rules (e.g., ordering practices) to stabilize inventory
levels throughout the chain.
Resource Planning and Management: By simulating a natural resource
(such as a forest), you can determine which combination of management
practices (e.g., selective harvesting, development of recreational facilities)
maximizes the use of the resource and best satisfies the various
stakeholders.
As will be shown in the following sections, GoldSim is flexible and powerful
enough to be readily applied to any of these problems.
What is GoldSim?
GoldSim is a highly-graphical simulation program that runs on personal
computers using the Windows operating system. Although it was specifically
designed for carrying out dynamic, probabilistic simulations of complex
systems, it can also be readily applied to simpler static and/or deterministic
simulations.
Because simulation can be such a powerful tool for understanding and managing
complex systems, a variety of graphical simulation tools currently exist. The
following combination of features, however, makes the GoldSim approach
unique:
GoldSim is user friendly, highly graphical, and very flexible. It can be
applied to nearly any kind of system. You start to build a model in an
intuitive manner by literally drawing a picture (an influence diagram) of
your system.
GoldSim was specifically designed to quantitatively address the
inherent uncertainty which is present in real-world systems. GoldSim
provides powerful tools for representing uncertainty in processes,
parameters and future events, and for evaluating such systems in a
computationally efficient manner.
GoldSim provides powerful capabilities for superimposing the
occurrence and consequences of discrete events onto continuously
varying systems. This allows for the realistic simulation of discrete events
such as financial transactions, accidents, system failures, storms, labor
strikes, and lawsuits.
GoldSim was designed to facilitate the construction of large, complex
models. You can build a model of your system in a hierarchical, modular
manner, such that the model can readily evolve and add detail as more
knowledge regarding the system is obtained. Other powerful features, such
as the ability to manipulate arrays, the ability to “localize” parts of your
What is needed for such complex, multi-disciplinary systems is a tool that can
be used to integrate all of the various sub-models into a single total system
model. A total system model focuses on creating a consistent framework in
which all aspects of the system, as well as the complex interactions and
interdependencies between subsystems, can be represented.
Because GoldSim is flexible and powerful enough to represent practically any
aspect of your system, and because GoldSim provides unique capabilities for
building your model in a hierarchical, modular manner, it is ideally suited to act
as a system integrator. In fact, this was the original and primary objective
around which GoldSim was designed.
A Visual Information Complex models often require a great detail of input data. These inputs may
Management System reside in databases, spreadsheets, or in written documentation. The user of a
model (e.g., the author of the model, a reviewer of the model, or a decision-
maker evaluating the results) can be most effective if this input information can
be visually integrated with (and readily accessed and viewed alongside) the
simulation model. In addition, for a complex model which requires a great deal
of input, it may be desirable (or even mandated) that the simulation model can
directly access various data sources (e.g., databases or spreadsheets) to ensure
the quality of the data transfer. GoldSim was designed to facilitate both of these
tasks.
Even if you can directly and visually access the input data for your model, in
order for your simulation model to be useful, you must also be able to explain its
assumptions (and the implications of the simulation results) in a compelling and
effective manner. GoldSim provides the tools to enable you to do so.
Hence, at the highest and most powerful level, GoldSim can used as a visual
information management system, providing you with the ability to directly link
to data sources, as well as describe, document and explain your model in a
compelling and effective manner to any audience.
Current Value Initial Value (Rate of Addition - Rate of Withdrawal)dt
A complex GoldSim model can have hundreds (or thousands) of elements and
links.
A Simple Example The easiest way to understand GoldSim is to walk through a very simple
example. In what follows, we illustrate how GoldSim could be used to carry out
a simple dynamic simulation which computes the volume of water in a pond as a
function of time.
Assume that the pond that we wish to simulate is initially empty. We
continuously pump water out of a nearby river and into the pond at a rate of
10,000 m3/day. The pond leaks right back into the river, however, at a rate that
is proportional to the current volume of water in the pond (i.e., the more water in
the pond, the faster it leaks). In particular, 15% of the pond volume is assumed
to leak out every day. We wish to predict the water level in the pond as a
function of time.
We will build this model using three elements: a Data element, a Reservoir and
an Expression. The Data element represents the rate of inflow to the pond, the
Expression calculates the leakage from the pond, and the Reservoir represents
the volume of water in the pond.
Therefore, we begin by inserting a Data element named "Inflow", an Expression
named "Leakage" and a Reservoir named "Volume_in_Pond":
The name of the element is specified in the Element ID field. You add a brief description to
the element in the Description field. The data defining the element is specified in Definition
field. When writing the Definition, the units of the input are specified following the value.
To define the element, we enter the inflow rate of 10,000 m3/day. Note that we
specifically define not only the value, but also the dimensions (the units) of the
input.
Next, we define the Expression element representing the leakage (outflow) from
the pond. The leakage is equal to 15% of the pond volume per day.
Mathematically, this can be written as:
Leakage Volume_in_Pond * 15 %/day
We type the right-hand side of this equation into the input field for the
Expression representing the leakage.
.
The expression representing the leakage is entered in the Equation field.
Finally, we must link the Inflow and Leakage to the Reservoir element. The
properties dialog for a Reservoir is shown below.
It is assumed that the pond is initially empty. The Inflow and Leakage are specified as
Additions and Withdrawals from the Reservoir. The remaining input fields for the Reservoir
are not utilized in this simple example.
For this example, the only required inputs for the Reservoir are the Initial Value
(in this case, zero), the Rate of Addition (set equal to the Inflow), and the Rate
of Withdrawal (set equal to the Leakage).
After defining the elements in this way, the screen looks like this:
The lines (referred to as an "influence") between the elements will initially be drawn as
straight lines (rather than as curve lines). GoldSim allows you to subsequently change the
appearance of these influences (e.g., make them curved).
The arrows indicate how the three elements are related. In this case, the system
has a feedback loop: Volume_in_Pond is a function of Leakage and Inflow, and
the Leakage is a function of Volume_in_Pond. In fact, this is a classic example
of a negative feedback loop: as Volume_in_Pond increases, the Leakage
increases; as the Leakage increases, the Volume_in_Pond decreases. Negative
feedback loops are self-correcting: rather than the pond volume continuing to
increase, the feedback loop will eventually force it toward a steady state value.
Understanding GoldSim is a dynamic simulator, which means that your model can evolve and
Dynamic Simulation change with time. In this example, we are interested in predicting how the
volume of water in the pond changes with time.
In order to do so, GoldSim must solve the equations represented by the elements
and their linkages. In this particular example, the system can be represented by
the following differential equation:
V
Inflow - Leakage Inflow - 0.15 * V
t
where V is the volume in the pond, and δV/δt is the time derivative of the
volume (the rate of change of volume with respect to time).
This particular equation can actually be solved analytically:
V V(0) e -0.15 t
Inflow
0.15
1 - e -0.15 t
In general, however, a particular system will not have an analytical solution (i.e.,
it cannot be solved exactly), and must be solved numerically (i.e., using an
algorithm that provides a numerical approximation to the actual solution).
GoldSim solves differential equations such as this through numerical
integration. That is, GoldSim solves for V as a function of time by integrating
the right-hand side of the equation:
τ
Vτ V(0) ( Inflow - 0.15 V) dt
0
To solve this (or any) integral numerically, it is necessary to discretize time into
discrete intervals referred to as timesteps. GoldSim then “steps through time” by
carrying out calculations every timestep, with the values at the current timestep
computed as a function of the values at the previous timestep. In the case of the
integral represented above, after discretizing time, GoldSim solves the equation
by numerically approximating it as a sum:
τ
Vτ V(0) Inflow * t - 0.15 * V(τ - t)
0
As can be seen, the pond reaches a constant (steady-state) value after about 40
days. At this point, the flow rate into the pond matches the leakage rate out of
the pond.
GoldSim is As you no doubt noticed in the example, when data were entered, the
Dimensionally-Aware dimensions were specified. One of the more unique and powerful computational
features of GoldSim is that the program is dimensionally aware.
GoldSim has an extensive internal database of units and conversion factors. You
can enter data and display results in any units. You can even define your own
customized units.
When elements are created, you must specify their output dimensions. For
example, when the Inflow element was created in the previous example, it was
defined to have dimensions of volume per time (m3/day). When elements are
linked, GoldSim ensures dimensional consistency and carries out all of the unit
conversions internally. For example, you could add meters and feet in an
equation, and GoldSim would internally carry out the conversion. Note,
however, that if you tried to add meters and hours, GoldSim would issue a
warning message and prevent you from doing so.
As a result, when you use GoldSim, it is never necessary for you to carry out
(error-prone) unit conversions.
Read more: Using Dimensions and Units (page 94).
Representing In many systems, you may be uncertain about some of the input parameters. In
Uncertainty such a case, GoldSim allows you to define these parameters as probability
distributions.
In the example presented above, suppose that we were uncertain of the leakage
fraction. In particular, we will assume that rather than being 15%, the leakage
fraction could be anywhere between 10% and 20% of the pond volume per day.
To represent this, we create a new Stochastic element (named Fraction), and
modify the equation for Leakage as follows:
Leakage = Volume_in_Pond * Fraction
A Stochastic element is used to define a probability distribution. In this example,
we will define Fraction (the leakage fraction) as a triangular distribution, with a
minimum value of 10%/day, a most likely value of 15%/day, and a maximum
value of 20%/day:
The type of probability distribution is selected from the list at the top of the dialog box. The
parameters describing the shape of the distribution are defined under “Parameters”.
If the inputs to a model are uncertain, the outputs are necessarily uncertain.
GoldSim propagates (translates) the input uncertainties into uncertainties in the
results using Monte Carlo simulation. In Monte Carlo simulation, the entire
system is simulated a large number (e.g., 1000) of times. Each simulation is
assumed to be equally likely, and is referred to as a realization of the system.
For each realization, all of the uncertain parameters are sampled (i.e., a single
random value is selected from the specified distribution describing each
parameter). The system is then simulated through time (given the particular set
of input parameters) such that the performance of the system can be computed.
This results in a large number of separate and independent results, each
representing a possible “future” for the system (i.e., one possible path the system
may follow through time). For example, 25 realizations of the pond example
using an uncertain Leakage fraction produces 25separate time history results:
Another way to view these results is by plotting a probability of the final volume
of water in the pond (after 50 days):
Feedback loops are present in one form or another in most real-world systems,
and can be readily modeled in GoldSim. The simple pond model presented
above is a good example of a system with a feedback loop. Note that the term
“feedback” implies that the system is dynamic (i.e., A affects B which affects C,
and then C affects A at some time in the future). Feedback loops have inertia,
and involve time lags.
In some cases, you may want to define circular logic that does not conceptually
represent a feedback loop (the loop does not represent a dynamic process). In
these instances, the circular logic indicates that the system responds immediately
(i.e., the system is coupled). In GoldSim, these are referred to as recursive
loops, and they are treated differently from feedback loops. A simultaneous
system of equations is an example of such a system. GoldSim can still represent
such systems, but in order to do so, it is necessary for you to take some
additional steps to define the sequence in which the calculations are carried out.
Read more: Evaluating Feedback Loops (page 314); Creating Recursive Loops
Using Previous Value Elements (page 901).
Simulating Delays In many systems, a signal (e.g., a flow of material, a piece of information) is not
transmitted instantaneously within a system or process, but instead is delayed.
Examples include the movement of water though soils, the movement of
material along a conveyor, and the transfer of information from one person to
another.
Material or information can be conceptualized as moving through (transiting) a
delay process. In some cases, the material or signal may be dispersed while in
transit. For example, if you post 100 letters all at once, they will not be delivered
all at once. Rather, there will be some variability in the time at which they are
delivered (i.e., the delay time). In other cases, the material or signal is not
dispersed. If a conveyor belt moves at a fixed speed, there will be no variability
in the transit times for items that are placed on the conveyor.
Delays can have a major impact on the dynamics of a system, and it is therefore
important to be able to represent them in a straightforward and realistic manner.
GoldSim provides several types of powerful Delay elements to represent these
delays.
Read more: Using Delay Elements (page 291).
GoldSim provides an optional browser view of the system in a pane on the left of the
window. The tree in the browser shows the containment hierarchy in a manner similar to
how a computer's directory hierarchy is shown.
You can "drill down" into the next level of detail in the model by "opening" the
Container. One way to do this is by clicking on a Container's "+".
Additional Function Although you can create complex models using only the elements introduced in
Elements the previous sections, GoldSim provides a variety of additional elements that
provide further modeling capabilities, including:
Logical elements, which allow you to add easy-to-read logic diagrams
to your models;
A Selector, which provides a powerful and user-friendly way to create
complex equations involving nested if…then logic; and
Advanced Features
In addition to the basic features and capabilities discussed above, GoldSim
provides a large number of advanced computational features which increase the
power, flexibility and ease-of-use of the software.
Manipulating Arrays In many systems, you will want to create and manipulate elements that represent
(Vectors and collections of data, rather than individual items. For example, you may want to
create an element that represents your company's revenue for each of five
Matrices) separate divisions, or an element that represents the salmon population in each
of 20 streams.
One way to do this, of course, would be to create separate elements for each
object you wanted to model (e.g., five elements representing revenue, 20
elements representing salmon populations). Such an approach, however, is not
desirable for two reasons:
It could require you to create a very large number of elements (e.g., if
you wanted revenues for 100 subgroups or wanted to evaluate salmon
populations in 200 streams). This could result in very large, cluttered
models.
Usually, you will want to carry out the same types of calculations and
operations on all related objects in such a collection (e.g., multiply all
revenues by 2, compute the number of salmon eggs this year for all 20
streams based on the current salmon population). Having to do this
individually for every object in a large collection would be very
cumbersome and time-consuming.
To address these kinds of problems, GoldSim allows you to create and
manipulate vectors and matrices (collectively referred to as arrays). For
example, you could create a vector Data element that represented the salmon
populations in each of 20 streams, as shown in Figure 1.
You could also create a matrix Data element that represented the salmon
population in each of 20 streams for a period of 5 years, as shown in Figure 2.
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. Note that 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!
If required, you can access a particular item of the array in an equation. For
example,
Salmon_Population[BearCreek, 1996]
references a single (scalar) value representing the salmon population in Bear
Creek in 1996.
GoldSim provides a wide variety of special operators which allow you to
manipulate arrays. For example, the expression
Sumv(Salmon_Population)
would result in a single (scalar) value representing the sum of all items in the
vector.
Read more: Using Vectors and Matrices (page 726).
Modeling Discrete GoldSim provides powerful capabilities for superimposing the occurrence and
Events effects of discrete events onto continuously varying systems. This allows for the
realistic simulation of discrete events such as financial transactions, accidents,
system failures, storms, labor strikes, and lawsuits. Events such as these can
have important effects on the performance of many systems, and it is therefore
important to represent them in a realistic manner. These discrete event modeling
capabilities are particularly useful when using GoldSim for strategic planning
(e.g., evaluating and managing a portfolio of strategic investments or projects by
simulating their potential outcomes).
GoldSim provides a variety of specialized elements for simulating the
occurrence and consequences of discrete events. Events can be generated
regularly ("occur exactly once a year on January 1"), randomly ("occur, on
average, once a year"), or based on certain set of conditions (“when A is greater
than B and the value of C has changed”). An event can trigger one or more
consequences, such as changing the status of something in the model (“this task
The Event “Fire” triggers the Discrete Change “Withdrawal” which modifies the Reservoir
element representing the volume in the pond.
In this particular realization of the system, fires occurred around the 12th and 28th
days of the simulation. Because the event was specified as being random, it did
not occur exactly every 25 days.
Read more: Chapter 5: Simulating Discrete Events (page 319).
Controlling the GoldSim provides a powerful timestepping algorithm that allows you represent
Timestep in a Model the dynamics of your system very accurately. This includes the following:
You can define Reporting Periods, which compute and report
accumulated, average, the change or the rate of change of values over
specified periods (e.g., monthly, annually). Reporting Periods can be
used in conjunction with a shorter “Basic Step” (e.g., you may model
the movement of water or money through a system using a daily
timestep, but need to report the cumulative amount of money or water
that moved from one point to another each month)..
You can increase or decrease the timestep length according to a
specified schedule during a simulation (e.g., start with a small timestep,
and then telescope out to a larger timestep). This can be useful, for
example, if you know that early in a simulation, parameters are
changing rapidly, and hence you need a smaller timestep.
You can dynamically adjust (adapt) the timestep during a simulation
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.
You can apply dynamic adaptive timestepping to specific Containers.
This allows you, for example, to specify different timesteps for
different parts (i.e., Containers) in your model. For example, if one
part of your model represented dynamics that changed very rapidly
(requiring a 1 day timestep), while the rest of the model represented
dynamics that changed much more slowly (requiring a 10 day
timestep), you could assign a 10 day timestep to the model globally,
and a 1 day timestep to the Container representing the subsystem that
changed rapidly.
For some special types of systems, GoldSim provides additional
dynamic timestepping algorithms (different from the timestep
algorithms described above) to more accurately solve these equations.
In particular, the Contaminant Transport Module utilizes dynamic
timestep adjustment to accurately solve the coupled differential
equations associated with mass and heat transport.
In some models, you may want to carry out an iterative calculation at each
Carrying Out Iterative timestep. This might be useful, for example, if you have a coupled system of
(Looping) nonlinear equations that must be solved every timestep by iterating.
Calculations GoldSim allows you to create a Looping Container in which the elements inside
are iteratively updated every timestep until a specified condition is met:
Such a looping calculation is facilitated by the fact that GoldSim also provides a
specialized element that allows you to reference the previous value (of any
variable in your model).
Read more: Using Looping Containers (page 904); Referencing an Output’s
Previous Value (page 898).
Dynamically Linking GoldSim allows you to dynamically link a spreadsheet directly into your model.
to Spreadsheets In the simplest use of such a spreadsheet link, you can use the spreadsheet as a
data source. In particular, a Spreadsheet element can import data from specified
cells in a spreadsheet, assign specified units to these data, and make them
available in your GoldSim model (as outputs of the element).
Note: When you import a row or column of spreadsheet cells into GoldSim
(e.g., A1:A10), the data become items in a vector within GoldSim. When you
import a range of cells involving multiple columns and rows (e.g., A1:E10), the
data become items in a matrix within GoldSim.
Note: The Script element does not expect the user to learn or be familiar with a
particular language. As a result, scripts are not created using a text editor.
Rather, statements are inserted and edited within a “controlled environment”
within the element’s property dialog in which the user selects from a number of
available statement types. The syntax is already defined for each type of
statement – the user simply specifies the attributes and properties for each
statement via a dialog box when the statement is inserted. Statements can
subsequently be moved, deleted, and edited.
In most cases, you need to only make minor modifications to the external
program code to which you want to link in order for it to communicate with (i.e.,
be dynamically called by) GoldSim.
Note that this ability greatly increases the power and flexibility of GoldSim,
allowing nearly any program to be dynamically linked into the dynamic,
probabilistic and highly graphical GoldSim framework.
Read more: External (DLL) Elements (page 873).
Building Large, In addition to the ability to build hierarchical models using Containers, GoldSim
Complex Models also provides a number of other features that were specifically designed to
facilitate the construction, maintenance, and presentation of very large, realistic
(and hence, often complex) models.
This includes:
The ability to “localize” subsystems in your model so that variable
names can be repeated without causing conflicts. This is particularly
useful when your model contains numerous parallel systems (e.g.,
different divisions of a company), in which many of the equations and
variable names would be identical. It also allows multiple people to
work on different subsystems in a model without worrying about
conflicting variable names.
The ability to record versions (revisions) of a particular model file, so
that you can identify the differences between the various versions of the
file as the model is iteratively modified. (Which elements have
changed? Which elements were deleted? Which elements have been
added?)
Read more: Chapter 10: Advanced Modeling Concepts (page 725).
Modeling Scenarios GoldSim provides a powerful capability that allows you to create, run and
compare different scenarios for your model. Scenarios are differentiated by
having different sets of input data. GoldSim’s scenario modeling capability
allows you to directly compare results generated by different sets of input
parameters. In effect, when you use this capability, your model can store (and
subsequently compare) multiple sets of outputs:
This can be very useful for carrying out sensitivity analyses, testing and
comparing alternative designs, and asking “what if” questions.
Optimizing a Model GoldSim provides the ability to carry out a special type of run to facilitate
optimization of your model. For this type of run, you specify an objective
function (a specific result that you would like to minimize or maximize), an
optional constraint (a condition that must be met), and one or more optimization
variables (variables in your model that you have control over).
GoldSim then runs the model multiple times, systematically selecting
combinations of values for each of the optimization variables. By doing so,
GoldSim can determine the values of the optimization variables that optimize
(minimize or maximize) the objective function while meeting the specified
constraint.
Carrying Out GoldSim provides the ability to carry out a special type of run to facilitate
Sensitivity Analyses sensitivity analyses. For this type of run, you specify the result you are
interested in, and one or more variables that you want to analyze (which must be
on a Model Stochastics or Data elements).
GoldSim then runs the model multiple times, systematically sampling each
variable over a specified range, while holding all of the other variables constant.
This then allows GoldSim to produce sensitivity plots (i.e., a tornado chart and
X-Y function charts) to assist you in graphically identifying the variables in your
model to which the result is most sensitive.
In addition, you can modify and save chart styles, which allow you to customize
(and reuse) the style (i.e., appearance) for each type of chart you may wish to
produce:
Using these tabs, you have complete control over the appearance of your chart. You can
customize the header, footer and legend, modify the chart axes, and change the data style
(e.g., color, size and type of line). You can create also chart styles, which can
subsequently be applied to similar charts.
The charts and tables produced by GoldSim can be pasted into other applications
(e.g., a word processor or a spreadsheet), or saved as separate graphics files.
Read more: Chapter 8: Displaying Results in GoldSim (page 511).
Internally In order for a complex model to be understood and easily explained to others, it
Documenting Your is critical that it be properly documented. GoldSim provides tools that allow you
to internally document your model such that the documentation becomes part of
Model the model itself, and hence is immediately available to anyone viewing the
model.
GoldSim allows you to add text, images and other graphic objects directly to
your model. In addition, you can add hyperlinks to other documents (e.g., a web
site or a report). Clicking on the hyperlink then opens that document.
You can add text in any font or color, such as the title in this screen shot. The Drawing
toolbar on the right side of the window provides drawing tools you can use to add text,
lines, boxes and other graphical objects. Hyperlink objects, such as the one in the lower
right corner of the screen, can link directly to a separate document or a web site. You can
also import graphics, such as logos orbackground maps.
Adding Descriptions In addition to adding graphics, text and hyperlinks, you can provide a
and Notes Description for each element. The Description is displayed in a tool-tip
whenever you place your cursor over the element in GoldSim.
To provide more information, you can also attach a Note to any element in your
model. Notes are text files of arbitrary length that are stored with the model.
Using GoldSim as a As discussed previously, GoldSim was specifically designed to allow you to
Presentation Tool organize model elements into a hierarchy (using containers). This facilitates the
creation of "top-down" models, in which the level of detail increases as you
"push down" into the containment hierarchy.
Such a capability is essential if you wish to effectively describe and explain your
model at different levels of detail to different audiences. For example, your
manager may only want to see the "big picture", while a technical colleague may
want to see the low-level details of a particular model.
The ability to create hierarchical, top-down models, in which at any level,
details can be "hidden" (inside containers), coupled with GoldSim's powerful
documentation features, allows you to design models which can be effectively
explained to any audience at the appropriate level of detail.
To further facilitate presentations, GoldSim can be run in Full Screen View in
which all menus and toolbars are hidden, and only the model screen is visible:
Read more: Chapter 9: Documenting and Presenting Your Model (page 693).
The Contaminant Transport Module adds these ten specialized elements to GoldSim.
In effect, the Dashboard Authoring tools enable you to use GoldSim as a high-
level programming language to create custom simulation applications for
distribution to end users who may not necessarily be modelers. Users do not
need to have a licensed version of GoldSim to view and run a "dashboarded"
model. They simply need to download the free GoldSim Player.
Read more: The GoldSim Player (page 65).
The Dashboard Authoring tools are incorporated into all versions of GoldSim.
They are described in detail in a separate document, the GoldSim Dashboard
Authoring Module Users Guide.
Distributed Monte Carlo simulation, in which multiple realizations of a system are
Processing Module simulated, naturally lends itself to distributed processing, since each realization
is totally independent of the others. GoldSim has the capability to utilize
multiple computers (linked over a network such as a LAN or even the Internet)
to carry out probabilistic simulations of a system. Such a feature greatly
facilitates probabilistic simulation of highly complex systems (in which a single
realization may take many minutes or even hours).
In general, the user interface for the GoldSim Player is identical to that of the
full GoldSim version, with menu options and controls for editing the model
removed or disabled. You can view and navigate any GoldSim model using the
GoldSim Player. This allows a modeler to distribute a model to others without
requiring them to license GoldSim.
If a Dashboard was created for the model using the Dashboard Authoring
Module, you can even modify selected inputs and run the model using the
GoldSim Player.
The GoldSim Player can be downloaded (for free) from the GoldSim Web site
(www.goldsim.com/player).
Read more: Dashboard Authoring Module (page 64); Creating a GoldSim
Player File (page 722).
Ro ber t Collier
Chapter Overview
This chapter describes the GoldSim user interface and presents all of the basic
techniques required to build a model. The objective of the chapter is to acquaint
you with the user interface components and provide you with the procedural
knowledge required to navigate the interface and utilize GoldSim's basic
features. Conceptual issues (e.g., which element should I use to accomplish a
particular task?) are discussed in the following chapter (Chapter 4).
Since the only way to learn a new tool is to use it (rather than just read about it),
it is highly recommended that as you read this chapter, you simultaneously
begin to use and explore the program. That is, as a feature or action is described
in the text, experiment with it yourself within GoldSim.
Warning: This chapter assumes that you have read the previous chapter,
"GoldSim in a Nutshell", which provides some basic background information on
the features and capabilities of GoldSim.
The largest part of the screen is occupied by the graphics pane. This is where
the graphical depiction of the model is shown. It is the "canvas" on which the
model is drawn. For most users, this is where most model building and
manipulation tasks will be carried out.
Note: If you are running a GoldSim extension module, there may be some
default items present in your models. For example, the Contaminant Transport
Module adds a Container named Materials.
When you open GoldSim for the first time, the browser will be shown. The
browser represents an alternative way to view a GoldSim model. In particular, it
organizes the model in one of two ways:
In a hierarchical manner (by containment), similar to the way that files
and directories on a computer are organized;
By element type.
The browser is initially docked on the left side of the screen. You can move it,
undock it (so that it floats as a separate window) or deactivate (hide) it. You can
turn the browser off and on by pressing the browser toolbar button.
Browser toolbar button
Read more: Using the Browser (page 110).
The menu bar provides access to menus from which nearly any GoldSim
operation can be carried out. Although there are sometimes more convenient
ways to carry out a particular action in GoldSim (e.g., tool bar buttons, context-
sensitive menus), if you are stuck, you will find that most GoldSim functions
and operations can be carried out via the main menu.
The Standard toolbar provides buttons for common GoldSim actions (e.g., Save
a file, Run the model). The Drawing Tools toolbar (originally docked to the
right of the graphics pane) provides buttons for adding graphical images to your
models. These two toolbars are present the first time you open GoldSim. Other
specialized toolbars can be activated, and all toolbars (as well as the menu bar)
can be customized, hidden, and moved if desired.
The status bar at the bottom of the screen describes the action of selected menu
items (when you place your cursor over them). It also provides information
regarding the mode that the model is in, as well as access to tools (e.g.,
zooming):
Types of GoldSim The GoldSim simulation environment is highly-graphical and completely object-
Objects oriented. That is, you build, document, and present models by creating and
manipulating objects representing variables and relationships between the
variables. For the purposes of discussing how to manipulate objects in GoldSim,
it is important to differentiate between two types of objects: model objects and
graphical objects.
A model object is used to quantitatively represent the variables and relationships
in your model. Elements, the basic building blocks of a GoldSim model, are the
primary model objects. Input and Output objects associated with each element,
as well as Influences, are also model objects.
Read more: Element Inputs and Outputs (page 82); Understanding Influences
(page 102).
A graphical object is used to embellish or document the model. Graphical
objects consist of images, text, lines, and other graphics that you can add to your
model in order to document it. They have no impact on the simulation model
itself, and only serve to improve the way in which the model is presented and
documented. This chapter focuses on the use of model objects.
There are some differences in the manner in which these two types of objects are
manipulated in GoldSim, and this is specifically noted throughout the
documentation. In particular, whenever the word "object" is used to describe an
action or behavior, it applies to both model objects and graphical objects. If a
particular action or behavior only applies to a certain type of object, the object
type (e.g., model object, element, or graphical object) is explicitly used.
Common Mouse The most common and important GoldSim mouse actions are summarized
Actions in GoldSim below:
A click selects an object in the graphics pane or the browser. The selected
object is highlighted.
Note how the selected element (Data2) is highlighted in both the graphics pane and
the browser.
If you right-click on an element, a menu is displayed containing actions you can take
for that element:
Note: GoldSim utilizes right-click context menus extensively. In fact, you may
come to rely almost solely on this technique to carry out most GoldSim actions.
If you want to do something with an object, and are in doubt about how to
accomplish the action, right-click!
Selecting multiple objects: You can select multiple objects in the graphics
pane by Ctrl-clicking on multiple objects in succession or by creating a
"selection box" by dragging your cursor from one point in the graphics
pane (not on an object) to another point.
To select elements Data1 and Data2, use the cursor to drag a box around the two
elements.
Saving, Opening, and GoldSim models are saved in files with the extension gsm (e.g., mymodel.gsm).
Closing GoldSim GoldSim does not produce separate input and output files. The model definition
and the results generated by the model are all stored in one file – the gsm
Files (GoldSim Model) file.
To save a file, press Ctrl+S, press the Save button on the Standard toolbar, or
select File|Save from the menu bar
Save button
The first time that you save a new file, you will be prompted for the file name.
GoldSim can have only one model file open at a time (although you can have
multiple instances of GoldSim running simultaneously, each with a different
model file).
If you select File|Save As from the menu bar, GoldSim saves the current
model with a new (user-specified) name, keeping the newly named file open.
Selecting File|Save Copy As from the menu bar also saves the file to a new
(user-specified) name, but keeps the original file open.
If you have made changes to a file but have not yet saved it, this will be
indicated by an asterisk (*) next to the file name in the title bar for the GoldSim
window.
To close a file (without exiting GoldSim), you can either open a new file or open
an existing file. When you do so, if the current file has been changed, you will
be prompted to save it before the new file is loaded.
To open a new GoldSim file, press the New File button on the Standard toolbar,
press Ctrl+N, or select File | New from the menu bar. By default, the
New File button
Simulation Settings dialog will automatically be displayed when a new file is
created. If you do not immediately want to specify the simulation settings, you
can simply close this dialog by pressing the Cancel button.
Open File button
Read more: Simulation Settings (page 412).
To open an existing file, press the Open File button on the Standard toolbar,
press Ctrl+O, or select File | Open from the menu bar. You will be prompted
for a file name.
You can also open any of the previous four files you have saved by selecting
one from the File menu.
The four most recently saved files are listed at the bottom of the File menu.
Restoring Files After GoldSim allows you to recover a copy of your model file should GoldSim
an Unexpected unexpectedly terminate for some reason while your file is open. This would
allow you to restore changes you made to the file since you last manually saved
Failure Using Auto- it.
Save
It is critical that you do not press Cancel when you see this (or the next) dialog.
If you do, your auto-saved recovery file will be deleted!
A second dialog will then appear, indicating that GoldSim is looking for a
recovery file:
Finally, once the file is located, the following dialog will be displayed:
Note that the dialog will tell you if the recovered model file is more recent than
the original file. If you choose “No”, the recovered file will be deleted and a
new file will be opened.
If you select “Yes”, the recovered file will be opened. In the Title Bar, you will
notice that “[recovered]” will be appended to the end of the filename:
If you choose to Save, you will be prompted for a filename. You can save this
model with the same name as the original (to overwrite it) or save it with a new
name. Once that is done, the auto-saved model will be deleted from Apps Data
directory on your computer.
The frequency at which the model is auto-saved can be controlled from the
General tab of the Options dialog (accessed via Model | Options… from the
main menu):
To remove the password-protection, simply clear both fields and press OK.
Note that once a file is password-protected, users will be prompted for a
password under the following circumstances:
When the user tries to open the file;
When the user tries to change the password (by accessing
File|Protect…;
When the model is used to create a Player file, and the Player file is
opened;
When the model is imported as a SubModel; and
When the model is opened using command line arguments.
Read more: Creating a GoldSim Player File (page 722); Importing SubModels
(page 948); Running GoldSim from the Command Line (page 507).
Sending Your Model If you wish to send a model to someone else via email, you can quickly do so by
to Someone Via Email selecting File|Send to…. GoldSim will open your default email program, and
attach the model file to a new message.
Simulation Modes At any given time, a GoldSim model is in one of four states (referred to as
modes):
Edit Mode: The model is currently being edited and does not contain any
simulation results.
Run Mode: The model is currently running. In this mode, you can pause
the simulation and view the model, but model objects can not be edited
(although graphical objects can be changed).
Result Mode: The model has been run and contains simulation results. In
this mode, you can navigate the model and view results, but model objects
cannot be edited (although graphical objects can be changed).
Scenario Mode: This is a special mode that only exists if you are using
GoldSim’s scenario feature. To be in this mode, the model must contain at
least one scenario that has been defined by the user, and at least one
scenario must have scenario results. In this mode, you can navigate the
model and compare scenario results, but no elements (other than Result
elements and Scenario Data elements) can be added, deleted or edited.
Read more: Understanding Simulation Modes (page 456); Carrying Out a
Simulation (Run Mode) (page 457); Viewing Results (Result Mode) (page 461);
Creating, Running and Comparing Scenarios (page 463).
The mode that the model is in is clearly identified in the status bar (in the lower
right hand corner of the GoldSim window).
This model is in Result Mode, as indicated on the right side of the status bar. Directions for
leaving Result Mode are indicated on the left side of the status bar.
You can only edit a model when it is in Edit Mode (and to a very limited extent,
in Scenario Mode). When you create a new model file, it is in Edit Mode until
you run it for the first time.
If you are viewing a model that is in Result or Run mode (e.g., if you open a
model which contains results), editing will be locked (e.g., most of the property
dialogs and menu items will be grayed out), although you can edit graphical
objects such as texts, icons and images. The status bar provides instructions for
leaving a particular mode (e.g., to leave Result Mode and return to Edit Mode,
press F4).
Note: The symbols used for elements in the graphics pane can be customized by
the user. However, the icons (which appear in the browsers) cannot be changed.
Input elements are used to create inputs (exogenous data) that subsequently
Overview of Input define the properties of other elements.
Elements
Read more: Using Basic Input Elements (page 154); Using Time Series
Elements (page 187).
Overview of Stock Stocks elements are elements which impart inertia and memory to a system.
Elements These kinds of elements are responsible for internally generating the dynamic
behavior of a system. At any point in time in a simulation, the outputs of stock
elements are computed based on the historical values of their inputs.
Mathematically, stocks represent integrals.
Overview of Function Function elements are elements that manipulate and transform information or
Elements material. At any point in time in a simulation, the outputs of these elements are
computed based on the current values of their inputs.
Read more: Using Basic Function Elements (page 248); Script Elements (page
803); Solving Convolution Integrals (page 759); Generating Stochastic Time
Histories (page 768).
A special subcategory of function elements can be used to link GoldSim to
external applications:
File
Dynamically copies a file to a
specified directory (for use by
External elements).
Overview of Event Another category of elements allows you to superimpose the occurrence and
Elements effects of discrete events onto continuously varying systems:
Overview of Delay Delay elements represent a type of element which imparts inertia and memory
Elements to a system by delaying (and optionally dispersing) continuous and discrete
signals or flows. Like Stocks, at any point in time in a simulation, the outputs of
Delays are computed based on the historical values of their inputs.
Overview of Result Result elements provide a convenient and powerful mechanism to collect,
Elements analyze and display simulation results.
Creating Elements There are three ways to create (insert new) elements in GoldSim:
using the context menu of the graphics pane;
using the context menu for a Container element; and
using the main menu.
The first method is the most common and straightforward method, and it also
has the advantage that it allows you to specify exactly where the element is
inserted in the graphics pane.
Inserting an Element The steps involved to insert a new element using the context menu of the
Using the Context Menu graphics pane are as follows:
of the Graphics Pane 1. Right-click anywhere in the graphics pane away from an object (i.e., in
an empty part of the screen). A context-sensitive menu is displayed.
2. Place your cursor over the Insert Basic Element item to expand the
menu. All of the GoldSim elements are listed by category.
Element Inputs and GoldSim models are built by linking the outputs of one (or more) elements to
Outputs the inputs of other elements. Most GoldSim elements have at least one input and
one output. You can view the inputs and outputs for an element by expanding
the element in the browser:
Clicking on a "+" expands the element in the browser, showing its inputs and outputs.
Clicking on a "-" collapses the element in the browser, hiding its inputs and outputs.
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).
Input Output
As can be seen above, inputs and outputs have distinct names. Input names are
"hard-wired" for each element type and cannot be changed by the user (e.g., the
input names for all Integrator elements are the same: Initial Value, Rate,
Discrete Change).
Some elements, such as an Integrator, have a single output. Other elements,
such as a Stochastic, have multiple outputs. If an element has multiple outputs,
one of the outputs is usually defined as the primary output for the element. All
of the other outputs for the element are referred to as secondary outputs.
The name of the primary output of an element is always the same as the name of
the element itself. Hence, the name for the primary output of the Reservoir
element shown above is “B”, the same as the name of the element. The output
names for secondary outputs are "hard-wired" for each element type and cannot
be changed by the user. For example, a Stochastic always has two secondary
outputs named “Probability_Density” and “Cumulative_Probability”.
Output names are important, because links between elements are created by
referencing the name of the output of one element in an input field of another
element.
The inputs and outputs for an element can also be viewed in the graphics pane
by using the element's input and output ports:
Placing the cursor over a port changes the appearance of the cursor to a pointing
hand. If you left-click on the port with this cursor, a browser view window
Port cursor (referred to as an input or output interface) is displayed. The input interface
displays the element's inputs.
The output interface displays the element's outputs:
Editing an Element's The properties of an element can be edited either when it is first created, or by
Properties and double-clicking on it at any time (or by selecting the element and pressing Alt-
Enter).
Creating Links
The properties dialog for a typical element (in this case, an Integrator) is shown
below:
With a few special exceptions (e.g., Containers, Result elements), all elements
have the following fields or buttons:
Element ID. The name of the element
Description. A brief description of the element.
Appearance button. Provides access to a dialog for changing the graphical
appearance of the element.
Display Units. The units (which determine the dimensions) of the element's
primary output.
Type button. Provides access to a dialog for editing the type (value or
condition) and order (scalar, vector, matrix) of the element's primary output.
Save Results checkboxes. Used to specify whether or not results are saved
for the element.
Definition fields. One or more input fields that define the properties of the
element.
Editing an Element's The default ID (name) for a new element is the element type followed by a
Name, Description and number (e.g., Expression1, Integrator3). You can, of course, change the name.
Appearance
Note: Element names can only include letters, numbers, and the underscore
("_") character. They cannot include spaces and must begin with a letter. In
addition, some names (e.g., sin, cos, min) are reserved for use as functions and
cannot be used as an element name.
Note: Two types of elements (Result elements and Dashboards) have slightly
more flexibility in terms of their names. In particular, their names can include
spaces.
In addition to changing the element's name in the dialog, you can also edit it by
Ctrl+double-clicking on the name of the element in the graphics pane. If you
Ctrl+double-click on the element name in the graphics pane, it will become
selected and available for editing (indicated by the dark background). The cursor
will be placed at the end of the name. A single click in the name while it is
selected will move the cursor to that location in the name.
In most models, element names are forced to be unique. For advanced
applications, however, GoldSim provides a mechanism by which you can build
models which have elements with non-unique names. In order to do so, the
identically-named elements must have different scopes. An advanced GoldSim
feature, the ability to localize Containers, is used to control the scope of an
element.
Read more: Localizing Containers (page 886).
You should enter a Description for the element below the ID in the properties
page. Note that this description appears in the tool-tip displayed for the element
in the graphics pane and the browser.
A tool-tip is displayed when you hold the cursor over the element in the graphics pane. The
description is always displayed in the tool-tip below the element name.
You can access a menu for changing the graphical appearance of an element by
pressing the Appearance… button.
Read more: Editing the Appearance of Elements (page 395).
You specify the contents of an input field in a properties dialog in one of three
Specifying the Contents ways:
of an Input Field
You type in a number;
You create a link to another element by entering the name of an output
of that element; or
You enter a mathematical expression, such as 3*log(250). Note that the
expression itself can incorporate links (the names of element outputs),
such as A*log(B), where A and B are output names.
Examples of all three of these types of inputs are shown below:
Referencing Outputs of Some elements, such as an Integrator, have a single output, while other
Other Elements elements, such as a Stochastic, have multiple outputs. If an element has multiple
(Creating Links) outputs, one of the outputs is usually defined as the primary output for the
element. Any other outputs for the element are referred to as secondary outputs.
Read more: Element Inputs and Outputs (page 82).
The name of the primary output of an element is always the same as the name of
the element itself. Output names are important because links between elements
are created by referencing the name of the output of one element in one of the
input fields for another element. In the example above, A, B, and Accident are
the names of the primary outputs of the elements A, B and Accident,
respectively.
The names for secondary outputs are "hard-wired" for each element type. For
example, a Stochastic always has two secondary outputs named
“Probability_Density” and “Cumulative_Probability”. As a result, when
referencing the secondary output of an element, it is not sufficient to simply
enter the output name, as GoldSim would not be able to distinguish between the
outputs if there were multiple occurrences of that type of element in the model
(e.g., if there were two Stochastics in the model, GoldSim would not know
which element was being referred to).
To avoid this problem, an output which is not the primary output is referenced
by using both the element name and the output name: elementID.outputID. For
example, the two secondary outputs of the Stochastic element named B would
be referenced as:
B.Probability_Density
and
B.Cumulative_Probability.
Links and Influences When a link is made between the output of one element and the input of another
element in the same Container, GoldSim automatically draws an arrow
connecting the two elements in the graphics pane:
Entering and Editing When you place your cursor into an input field and begin to type, you will notice
Expressions in Input that GoldSim color-codes the text as you type. Red underlined text indicates that
Fields GoldSim cannot interpret that portion of the expression (e.g., due to incorrect
syntax). Once the item becomes valid, it will no longer be shown in red and
underlined. If you leave an input field that is invalid (e.g., change the focus to
another field), the entire field will be highlighted in pink.
Read more: Error Checking in Input Fields (page 98).
Note: In addition to displaying errors and color-coding text as you type, as you
enter characters into an input field, GoldSim automatically suggests the names
of existing outputs (that are consistent with those characters) that you may want
to link to at the bottom of the input field.
The precedence of the operators determines the manner in which expressions are
interpreted and evaluated. For example, in the expression:
4+3*6
3 times 6 would be evaluated first, then 4 would be added to that quantity
(resulting in a value of 22) because the “*” operator has a higher precedence
than “+” operator. However, (4 + 3)*6 would result in a different value (42)
because the parentheses have higher precedence than the “*” operator.
Warning: The precedence of the unary minus as listed in the table above (lower
precedence than exponentiation) only applies when it precedes a variable (as
opposed to a number). That is, the expression -X**2, where X = 3 would be
interpreted as -9. However, if a unary minus directly precedes a number, it is
always considered to be part of the number itself, and hence the operator has a
higher precedence that exponentiation. That is, the expression -3**2 would be
interpreted as 9.
Note: The equality (= = and =) and inequality (<> and !=) operators assume that
two values are identical if they are the same to 12 sigificant figures. Because
double-precision arithmetic (used in the GoldSim code) has a precision of about
15 significant figures, random roundoff errors should never become significant.
However, there is a caveat to this rule: if GoldSim compares a non-zero value to
a zero value, they are never treated as identical, even if the non-zero value is
extremely small. For example, if A was exactly 1 and B was different from 1 at
the 14th significant figure, then A=B would be true, but A-B=0 would be false.
Note: The input field for an Expression element is larger than for other elements
(i.e., it is always expanded and hence accommodates several rows without
requiring the focus).
Divide By Zero Errors in In some cases, you may enter an expression into an input field such as X/Y
Input Fields where at some point during the simulation, both X and Y are zero. In most
instances, when GoldSim encounters zero in the denominator of an expression,
it will display a fatal error and stop the simulation. However, if both the
numerator and the denominator are zero, GoldSim will not display and fatal
error; instead, the resulting expression will be set to zero and the simulation will
continue. This can be very convenient, as it allows you to avoid adding complex
logic to check for such cases.
Note, however, that GoldSim only sets the expression to zero if both the
numerator and denominator are zero. To understand this, consider an example
where A and C are equal to zero, and B is non-zero. In this case, the following
two expressions would be treated differently by GoldSim:
A*B/C: would return zero, as A*B would be evaluated first (and
considered to be the numerator for C.
A*(B/C) would result in a fatal error, as B/C would be evaluated first,
and B is non-zero.
Displaying Link When editing an input field, by default GoldSim automatically suggests the
Suggestions in Input names of existing outputs at the bottom of the input field. That is, when you
Fields place your cursor into an input field and begin to type, GoldSim provides a list
of suggestions for output names that are consistent with what you have entered
so far.
For example, assume that the outputs A1, A2 and A3 all exist in your model (at
a scope that is accessible from the current input field), and within an input field
you type the letter A. The following will be displayed at the bottom of the input
field:
Note: If you simply want to select the first item in the list, you can press the Tab
key. The suggestion box will close, the selection will be inserted, and in the
input field, the cursor is placed to the immediate right of the selected output.
You can select one of the other suggestions either by selecting it with your
mouse or using the Up and Down arrow keys to select an option.
If you use the mouse to make the selection, the suggestion box will close, the
selection will be inserted, and in the input field, the cursor is placed to the
immediate right of the selected output.
If you use the Up and Down arrows to make the selection, then the following
rules apply:
You can continue to move through the list using the Home, End, PgUp
and PgDn keys.
If you press the Tab key or right arrow, the suggestion box will close,
the selection will be inserted, and in the input field, the cursor is placed
to the immediate right of the selected output.
If you press a non-character key (such as an operator like +), the
suggestion box will close, the selection will be inserted, and in the
input field, the operator is inserted and the cursor is placed to the
immediate right of the inserted operator.
The suggestion list will also be closed if you left or right click elsewhere in the
input field, or press Esc.
The following should be noted regarding how GoldSim constructs the
suggestion list:
The list only contains items that are within the scope of the input field.
Read more: Localizing Containers (page 886).
All locally available variables are included in the list (you can see these
by typing ~):
Input Field Context Right-clicking within an input field (or pressing Ctrl+M) displays a context
Menu menu to assist you in adding links and creating expressions:
Selecting Insert Link… from this menu (or pressing Ctrl+I directly from the
input field) displays a browser tree showing all of the elements in the model.
Note: For some elements, an input field may only accept a limited class of links,
and will not allow the user to enter an expression. In these cases, the Insert Link
dialog will only display a limited subset of the elements in the model (those that
can actually be linked to this particular input).
Note: The Previous and Home buttons at the top of the dialog are very useful
for rapidly finding elements to link to. Whenever you use the Insert Link dialog,
GoldSim opens the tree in the directory containing the element to which you are
linking (i.e., it assumes that in most instances you will want to link to a nearby
element). GoldSim also remembers the Container of the last place that you
inserted a link from. Pressing the Previous button opens the tree at this location.
Pressing Home returns to the directory of the element to which you are linking.
Holding the Ctrl key down while opening the dialog (i.e., selecting Insert Link)
is equivalent to opening the dialog and immediately pressing the Previous
button.
At the top of this browser (and all other browser dialogs) is a search field to
assist you in finding elements.
The context menu for an input field can also be used to insert the built-in
functions and constants provided by GoldSim, and to insert units into an
expression.
Read more: Understanding Containers (page 100); Finding Elements (page
116); Entering Mathematical Expressions into Element Input Fields (page 128);
Using Dimensions and Units (page 94).
You cannot delete a link between two elements by simply deleting the influence.
Deleting Links and In fact, GoldSim provides no direct way to delete the influence (e.g., you cannot
Influences select it and press Delete).
The only way to delete a link (and hence the influence representing it) is to
remove the output being referenced from the input field of the other element.
For example, if Data element A is entered into one of the input fields for
element B, a link will be created (and an influence will be drawn) between
element A and element B. To delete this link (and influence), you must delete
the reference to A in the input field for B.
Understanding All element outputs in GoldSim have three output attributes: a type, an order,
Output Attributes and dimensions:
Type: The output type is either a value or a condition. Values can take on
any real number. Conditions have only two states: True or False.
Order: The order of an output can be scalar, vector or matrix. A scalar is a
single item. A vector is a column (or row) of items. A matrix is a table (with
rows and columns) of items.
Dimensions: Outputs can be assigned dimensions (e.g., length, volume,
velocity) which can be displayed in any units that you choose (meters,
gallons, feet/second). Dimensions can only be assigned to values (not to
conditions).
Most GoldSim outputs default to being dimensionless, scalar values.
Output attributes are important because GoldSim uses them to ensure
consistency between inputs and outputs when you link elements. That is, when
you define the output attributes for an element, this also affects the required
input attributes for that element.
For example, if you assign units of gallons to a Reservoir element, GoldSim will
only accept an input into the "Initial Value" field for the Reservoir which has
dimensions of volume. (For those readers with programming experience, this is
analogous to a programming language which is strongly-typed.)
Read more: Error Checking in Input Fields (page 98).
Note: The strong-typing built into GoldSim may at first appear bothersome:
until you get used to ensuring that the inputs to an element are consistent with
the specified output attributes, you may wish that GoldSim did not enforce this.
It is our experience, however, that users quickly become accustomed to this
requirement and greatly appreciate it as they become more proficient with the
program. The idea is that a small amount of inconvenience when you first begin
to learn the tool is more than made up for in the prevention of errors as you are
building your models.
Note: The output attributes refer to the primary output of the element. For
elements with multiple outputs, the attributes of the secondary outputs are
automatically inferred by GoldSim based on the attributes of the primary output.
(only the order and dimension can be specified), and the output of a logical
element (And, Or, Not) is always a scalar condition (in this case, the output
attributes are completely fixed).
The output attributes that you will most commonly specify are the dimensions.
Dimensions are specified by defining the Display Units for the element. For any
element which can be assigned dimensions, the Display Units can be specified
on the main dialog (directly below the Description field). Note that if the output
is defined as a condition (rather than a value), the Display Units field is grayed
out.
Read more: Using Dimensions and Units (page 94).
If the other two attributes (order and type) can be modified for an element, a
Type… button will be present in the dialog immediately to the right of the
Display Units. Pressing this button displays the following dialog:
The type is specified in the Type box by selecting Value or Condition. The order (scalar,
vector, or matrix) is specified by selecting from the Order list. If the order is vector or matrix,
you define the Labels for the array in the Row Labels and Column Labels boxes.
Many models can be built using only scalar values. Vectors and matrices,
however, are very powerful, and you will want to take advantage of them for
more complex simulations.
Read more: Using Vectors and Matrices (page 726).
Although the use of condition outputs is not required in GoldSim (you can
almost always accomplish the same thing using values), their use can streamline
and add clarity to a model. Conditions are particularly useful when modeling
discrete events.
Read more: Chapter 5: Simulating Discrete Events (page 319).
Continuous and In most situations, information is transferred between elements (via links)
Discrete Outputs continuously in time. For example, if Expression element X is defined as being
equal to A + B, the values of A and B are continuously sent to X (i.e., the
information is "broadcast" through the link throughout the simulation).
Conceptually, at any given time in the simulation, X is receiving a signal from A
and B.
In order to propagate discrete events (and their consequences) between elements
in a model, however, it is necessary to send information between elements
intermittently as a "spike" or discrete "packet" of information. To facilitate this,
GoldSim allows certain elements to emit and receive (i.e., produce as outputs
and/or accept as inputs) discrete signals. Discrete signals are a special category
of outputs which emit information discretely, rather than continuously.
Read more: Chapter 5: Simulating Discrete Events (page 319).
Using Dimensions One of the more powerful features of GoldSim is that it is dimensionally-aware.
and Units You enable this capability by assigning display units (and hence dimensions) to
the elements (and hence to the inputs and outputs) of your model. GoldSim has
an extensive internal database of units and conversion factors. You can enter
data and display results in any units. You can even create your own units.
When you create a link, GoldSim ensures dimensional consistency and carries
out all unit conversions internally. For example, you could add feet and meters
in an expression, and GoldSim would internally carry out the conversion. (If you
tried to add feet and seconds, however, GoldSim would issue a warning message
and prevent you from doing so.)
You assign dimensions by entering the Display Units. The Display Units
determine both the dimensions of the output(s) for the element, and the units in
which the output will be displayed (in tool-tips and result tables and charts). You
must enter a valid unit string (e.g., m, m3) made up of unit abbreviations.
Appendix D lists all of the internal units (and their valid abbreviations) provided
by GoldSim.
The context menu for the Display Units field includes a sub-menu containing
valid units and their abbreviations. Clicking on one of these inserts it into the
field.
Only a portion of the units in GoldSim, however, are active. Although you can
reference inactive units (at which point they become activated), only active units
are displayed in context menus. (By default, a large number of units are active
and you will likely want to inactivate many of these).
Read more: Viewing and Creating Units (page 399).
When entering unit strings, the following rules should be followed:
Units can only be separated by a "-" or a "/". No other operators or
blank spaces are allowed. For example, meters per second would be
entered as "m/sec". Grams per meter per second would be entered as
"g/m-sec" or as "g/m/sec". “g/m sec” would be invalid.
For clarity, you can use parentheses in unit strings. For example,
"kg/(m-sec)" is a valid string.
Only the first "/" in the string (or the first "/" within a set of
parentheses) is recognized, and the rest are ignored. Everything after
You must, however, abide by several rules to ensure that the expression you
enter can be unambiguously interpreted by GoldSim:
Within a unit string, you cannot have any spaces. For example, meters
per second must be entered as m/s rather than m / s.
In general, you should enter a space after each unit string. In some
cases, this space is required to ensure that the expression can be
unambiguously interpreted (e.g., if the unit string is followed by a
subtraction or division). In other cases, even if GoldSim is able to
unambiguously interpret the expression, it is good practice to add a
space after unit strings to make the expression more readable.
You can also explicitly identify the units by enclosing them in braces:
Braces are not required, but they can help make expressions more readable.
Moreover, when you use them, it is not necessary to abide by the two rules
mentioned above.
Note: Braces should only be used in an element's input fields. You should not
use braces when defining the display units for an element.
In general, you only append unit strings to numbers. You should never append a
unit string to an output name (a link) which itself has dimensions (this will result
in a warning message). You can, however, append units to an output name or
expression if the output or expression is dimensionless:
Dealing with Currency Unlike all other types of units, currency conversion rates cannot be assigned a
Units single value (i.e., they change with time). To facilitate using various currency
units, GoldSim provides a special dialog for specifying and editing currency
units. It is accessed by pressing Model | Currencies… from the main menu.
Dealing with You must take special care when using temperature units in GoldSim, since
Temperature Units unlike other unit categories, different temperature units are related not just
through a conversion factor, but an offset. That is, the zero-values for Celsius
(C) and Fahrenheit (F) temperatures are not absolute (i.e., whereas 0 m = 0 ft; it
is not true the 0 F = 0 C).
To handle this properly, when you deal with temperatures in GoldSim, you have
to be clear whether you are actually specifying a temperature (C, F, or K) or
degrees of a particular temperature scale (Cdeg, Fdeg, or K). Temperature and
degrees of temperature are treated the same in K, so there is no reason to
differentiate when expressing temperature in K.
Use of these units is best explained through examples:
If the temperature yesterday was 20C, and today is 5C warmer, you
should calculate today’s temperature as "20 C + 5 Cdeg". If you
mistakenly entered "20 C + 5 C", it would be interpreted as “293.15 K
+ 278.15 K” which equals 571.3 K or 298.15C!
Similarly, when defining a temperature as a Stochastic, you must be
careful. For example, a normal distribution for a temperature defined in
Celsius degrees as 20 +/- 5 should be specified as Mean: 20 C, SD: 5
Cdeg. Specifying it incorrectly as Mean: 20 C, SD: 5 C would result in
a very large standard deviation!
If you use a compound unit, you should always specify degree units.
For example, when defining of a rate of temperature change of 2.5
Celsius degrees per day, you should enter "2.5 Cdeg/day", NOT "2.5
C/day".
Automatically When you enter a dimensioned number, link or expression into an input field
Appending Units which expects (based on the element’s display units) a different set of
dimensions, the text will be displayed in red, indicating that the input is invalid.
For example, if you specify the display units for an Expression element as days,
and you define it as “10 ft”, GoldSim will indicate that there is an error.
Note, however, that if you enter a dimensionless number into an input field that
expects a dimensioned input, rather than treating the input as invalid, GoldSim
will automatically apply the correct dimensionality to the number when you
close the dialog by appending the appropriate units (based on the specified
display units for the element). For example, if you specify the display units for
an Expression element as days, and you define it as “10”, GoldSim will
automatically append “days” to the entry when you close the dialog.
Note that GoldSim will only do this for dimensionless numbers. Hence, if you
specify that the display units for an Expression element as days, and you define
it as “A”, GoldSim will indicate that there is an error (unless A has dimensions
of time). Similarly, if you define the element as an expression (e.g., 3 + 4),
GoldSim will not automatically append units and will indicate that there is an
error.
Unit Casting In some cases, you may need to turn a dimensioned value into a dimensionless
value in order to use it in an expression. This is necessary, for example, if you
need to use an empirical equation (which by definition may be dimensionally
inconsistent), or if you need to raise a value to a power, where the power itself
has dimensions, such as X**Time.
GoldSim allows you to do this by casting a dimensioned value or expression to a
dimensionless value. For example, the expression
A |ft|
would evaluate A (which, in this case, must have dimensions of length), convert
it to a value in feet, and cast it (output it) as a dimensionless value. That is, | |
removes dimensions from a preceding dimensioned value and produces a
dimensionless value.
The following are all valid expressions using unit casting:
A simple example file illustrating casting units (Units.gsm) can be found in the
General Examples folder in your GoldSim directory
Error Checking in As you enter an expression into an input field, GoldSim attempts to interpret the
Input Fields expression, and if it is unable do so, it indicates this in two ways:
The item in the expression that is causing the problem is highlighted ;
and
A tool-tip is displayed to explain the error.
For example, in the following expression, GoldSim indicates that a right
parenthesis is missing by marking as red and underlining the last item in the
expression (just prior to the error), and displaying a tool-tip:
In this example, GoldSim indicates that a plus sign must be followed by another
operand:
If you start typing (or move the focus to another field), the tool-tip will
disappear. If you stop typing, the tool-tip will reappear.
Note that when evaluating an expression, GoldSim identifies and underlines the
first error it encounters. Items shown to the left of the error are displayed in
green (for links), black (for values), gray (for operators) or blue (for units),
indicating that these have been successfully parsed and interpreted. Items
shown to the right of the error are shown in light gray, indicating that they have
not yet been parsed:
Once you change the focus away from an invalid input field, the entire field will
be highlighted in pink to indicate that there is a problem:
You can view the tool-tip for an input field such as this by simply holding the
cursor over the field (while the focus is elsewhere). The tool-tip disappears
when you move the cursor away.
In some cases, GoldSim may be able to interpret the expression you enter, but
the output attributes may be incorrect. That is, GoldSim uses the specified
output attributes (dimensions, order and type) to ensure consistency when you
enter information into input fields. If the attributes of the specified input
number, link or expression are inconsistent with the required attributes for the
field, the input is considered invalid and the entire field will be highlighted in
pink.
Read more: Understanding Output Attributes (page 93).
For example, if you created a Reservoir element and assigned it display units of
m3, then the Initial Value input for the Reservoir must have dimensions of
volume. If not, the input would be considered invalid:
Note: Whenever you change the output attributes for an existing element,
GoldSim will keep the existing input numbers, links or expressions in the input
fields (and mark them as invalid). There is, however, one exception to this rule.
If you change the display units for an element, GoldSim will automatically reset
any inputs which are currently specified as zero to be consistent with the new
dimensions. For example, if you create a new Reservoir element, and assign it
display units of m, and then later change this to gallons (but have not yet defined
an Initial Value), GoldSim will automatically replace the default input for the
Initial Value (0 m) with 0 gal.
Creating Links Using The link cursor provides an alternative method for creating links between
the Link Cursor elements using the browser and input/output interfaces rather than the element's
editing dialog.
In particular, double-clicking on an input or an output object in the browser or
interface invokes the link cursor. Moving to a compatible (in terms of type,
Link cursor order and dimensions) input or output (in the browser or input/output interface)
and double-clicking on it creates a link. If the link is compatible, both "boxes"
on the cursor will turn green when you place the link cursor over the
input/output to which you wish to link (initially, the bottom box is green and the
top box is red)
You can deactivate the link cursor (returning it to a normal cursor) by right-
clicking anywhere in the screen or by pressing the Esc key.
Understanding A complex model may consist of many hundreds or thousands of individual
Containers elements. In order to manage, organize and view such a model it is useful (in
fact, essential) to create separate sub-groups or collections of elements.
Such sub-groups are created in GoldSim by placing elements into Containers.
A Container is simply a "box" into which other elements have been placed. In a
sense, it is like a directory folder on your computer. Containers can be placed
inside other Containers, and any number of levels of containment can be created.
The graphics pane in GoldSim shows the elements inside a single container.
When you open a file in GoldSim, you will initially be viewing the inside of the
Model Container (also referred to as the Model Root). This is analogous to the
top-most directory on your computer.
To create a new sub-group of elements within the Model Root (or any other
Container) in your model, you need only insert a Container element.
Containers in a model are easily identified in the graphics pane: they all have a
small "+" in their upper left-hand corner :
You can "enter" a particular Container (view its contents) by clicking on the "+".
You can also enter a Container via a Crtl+double-click on the element (holding
the Ctrl key down while double-clicking the left mouse button).
When you create a new Container element, it is initially empty (it contains no
elements or objects of any kind). You place new elements in a Container by
entering it and inserting elements, or using the context menu of the Container.
You can also copy and move an element from one Container to another.
Read more: Moving Elements Between Containers (page 106).
Containers can be placed inside other Containers, and any number of levels of
containment can be created. This ability to organize model elements into a
hierarchy provides a powerful tool for creating "top-down" models, in which the
level of detail increases as you "push down" into the containment hierarchy.
The example below shows a system which has been divided into a number of
distinct sub-groups.
The browser shows the containment hierarchy in a manner similar to how a computer's
directory hierarchy is shown. Clicking on a "+" for a Container in the browser expands it to
show its contents. Clicking on a "-" of an expanded Container collapses it and hides its
contents.
You can move through the containment hierarchy using the navigation bar at the
top of the graphics pane:
Keys Action
Alt-Left Moves back to previously viewed
Container.
Alt-Right Moves forward (only active if you have
already moved back).
Alt-Home Moves up to the Model Root.
Alt-Up or Alt-PgUp Moves up one level.
Note: Many modern mice come with additional buttons that are typically used to
navigate the history of visited “places” (websites or folders). These buttons are
also supported by GoldSim. The Backward and Forward buttons go backward or
forward in the visited Container history. Pressing either of these buttons while
holding the Ctrl key down goes up one level in the hierarchy. Pressing either of
these buttons while holding the Ctrl and Shift keys down goes to the top level of
the model.
While the various images in the graphics pane can be customized by the model
author, the small icons in the browser cannot be changed. Hence, Containers in
the browser are always indicated by a small box (although some may be open
and some may be closed). Expanding the Container in the browser (clicking on
the "+") shows all of its contents (all of the elements it contains).
Read more: Editing the Appearance of Elements (page 395).
Note that the browser and the graphics pane are synchronized. Hence, if you
click on an object in the browser, the Container in which the object resides will
be shown in the graphics pane. This provides a convenient way to navigate
through the subsystems in the model.
Read more: Using the Browser (page 110); Using Containers (page 136).
Note: When you save a GoldSim file, GoldSim remembers the last Container
that was being viewed, and that Container is shown the next time the file is
opened.
Understanding When you create a link between two elements, GoldSim draws an arrow
Influences between the two elements in order to graphically indicate that the two elements
are linked.
The property dialog for an influence lists all the links represented by the
influence. Each link is represented by rows: an Output (where it originates), and
an Input (where it ends).
When you select a specific link in the top part of the dialog, it is highlighted in
yellow and its details are displayed in the bottom part of the dialog. The details
include a listing of the full path of the input or output. The "path" refers to the
containment path (e.g., A\B\C\X indicates that the element named "X" is located
in Container C, which is inside Container B, which is inside Container A).
Note: Input names are hard-wired. A specific input is referenced in the Influence
dialog as ElementId.InputID (e.g., "Volume.Initial Value" refers to the Initial
Value input of the Reservoir element named Volume).
By default, all links are curves (drawn with no curvature). You can add
curvature to the link by selecting it and dragging the control point with your
cursor:
You can modify the appearance of influences by changing their color and
thickness, changing their shape (straight lines or orthogonal lines), adding nodes
to segment straight lines, and adding text.
In some instances, in order to simplify the appearance of the graphics pane you
may want to hide all the influences of a particular type (e.g., hide all influences
consisting of condition outputs). This is referred to as filtering the influences.
Read more: Editing the Appearance of Influences (page 389); Filtering
Influences (page 392).
Note: Influences are not drawn to between the element(s) being referenced by a
Result element (a specialized element in GoldSim) and the Result element itself.
This is because unlike other elements in GoldSim, when you reference an output
of an element within a Result element, it is not treated as a “link”. GoldSim
provides other tools for viewing these kinds of connections.
Read more: Browsing Between Result Elements and Referenced Outputs (page
530).
Influences Between When an element is linked to an element in another Container, it is useful to be
Containers able to visually signify this (i.e., since the linked element is in a different
Container, when viewing the element there is no port to which the influence can
be connected). GoldSim provides a solution to this problem. If an element is
linked to an element in a different Container, GoldSim indicates this by drawing
an outline around the input and/or output port:
Note: Input names are hard-wired. A specific input is referenced in the Influence
dialog as ElementId.InputID (e.g., "Volume.Initial Value" refers to the Initial
Value input of the Reservoir element named Volume).
The if function is one of the built-in functions provided by GoldSim. This function has three
arguments and can be written in two ways:
The above would be interpreted as "If A is a true condition, the expression is equal to B,
otherwise it is equal to C".
GoldSim also allows you to begin your simulation at a specific date/time (e.g.,
January 1, 2001) and reference the calendar (as opposed to elapsed) simulation
time (as DateTime):
Note: When you place the cursor over an element, an input or an output prior to
running a simulation, GoldSim displays a tool-tip showing the object's current
(expected) value. If the object is a function of Etime, by default this calculation
assumes a value of 0s. You can modify the value used in such a calculation by
editing Time to use for Edit Mode updates in the Advanced Time Settings
dialog (accessed from the Advanced… button on the Time tab of the
Simulation Settings dialog).
Read more: Using Tool-Tips (page 113); Referencing Time in Edit Mode
(page 437).
Copying, Moving, and You can cut, copy and paste elements to and from the Windows clipboard using
Deleting Elements the Ctrl+X, Ctrl+C and Ctrl+V keys, respectively. Elements can be deleted by
selecting the element and pressing the Delete key. These actions can also be
carried out from the main menu (under Edit) or from the context menus for
elements and the graphics pane.
Multiple elements can be selected, and then cut or copied to the clipboard and
pasted. You can also cut or copy an entire Container, in which case the
Container and all of its contents will be copied to the clipboard.
Warning: When you paste an element, GoldSim will append a number to the
name if it conflicts with an element at the location where it is being pasted.
When you paste an entire Container, GoldSim will automatically localize the
Container if the names of elements inside the pasted Container conflict with
those at the location where it is being pasted. Elements with the same name will
conflict if they are located in the same scope. Localizing a Container changes
the scope of its contents.
Moving Elements Often while building a model you will want to reorganize your model by adding
Between Containers Containers and moving elements into them, or moving elements between
existing Containers. GoldSim provides two methods by which you can move
one or more elements between Containers.
For both methods, you must first select the element (or elements) which you
wish to move (multiple elements can be simultaneously selected).
Note: You can use these same methods to move graphical objects (such as
images and text) that you have added to the graphics pane. You can also
simultaneously select and move elements and graphical objects from one
Container to another.
The first method for moving the elements(s) involves using the context menu for
the object. After selecting the elements(s), access the context menu for a
selected element (via a right-click) and choose Move To…. A browser window
showing all of the Containers in the model will be displayed.
Note: Internally, a move is treated as a cut and paste operation. When the
element is cut, all links are temporarily lost. This means that any links to or from
the moved element(s) must be recreated by GoldSim after the move. This can
have implications if you are cutting and pasting to/from localized containers.
Note: If you try to move an element into a localized Container such that a
naming conflict occurs (i.e., because the Container already has an element with
that name inside), GoldSim will warn you and provide you with an opportunity
to change the name of the element being moved.
Copying Elements In many cases, you may wish to create different portions of your model in
Between Model Files different model files. For example, one individual may be working on one part
of a model (a particular subsystem), while another is working on a different
subsystem. At some point, you would then want to combine the various
subsystems into a single model file.
GoldSim allows you do so by simply opening two instances of GoldSim (each
with a different file), copying the desired elements (including entire Containers)
to the clipboard, and then pasting them into the other model. When doing so,
however, you must be aware of three points:
Multiple objects can be copied to the clipboard at one time (e.g., you
can select multiple objects and copy them to the clipboard). You can
also copy an entire Container (and all of its contents) to the clipboard.
When copying Containers between models, GoldSim will localize the
Container if the names of elements inside the pasted Container conflict
with those in the model into which it is being pasted.
If you are copying elements with vector or matrix inputs or outputs
between models, you must ensure that the Array Labels defining those
vectors and matrices are identical in both models. If they are different,
it would cause a conflict when the item is pasted, and GoldSim will
issue a warning message and prevent you from doing so.
Read more: Localizing Containers (page 886); Using Vectors and Matrices
(page 726).
To activate the Zoom toolbar, right-click anywhere in an active toolbar or the menu bar, and
select Zoom from the context menu.
When you click on the Pan button in the toolbar, the cursor will change to an
open hand. Pressing (and holding) the left mouse button in the graphics pane
allows you to pan in any direction. To deactivate the pan cursor, click on the
Selection button in the Zoom toolbar.
If your mouse has a wheel, you can also use this for panning. After clicking
anywhere in the graphics pan, the wheel moves upward and downward in the
graphics pane. If you hold the Shft key the wheel moves the pane left and right.
Note that if you scroll far enough horizontally or vertically you will eventually
reach the "edge" of the graphics pane. That is, the graphics pane represents a
document of fixed size.
Read more: Adjusting the Size of the Graphics Pane (page 388).
In addition to panning the graphics pane, you can change the scale at which the
graphics pane is viewed (i.e., zoom in and zoom out). There are four ways to do
this:
Clicking the Scale button in the status bar (at the bottom of the
GoldSim window) displays a dialog for adjusting the scale.
Using the Browser For simple models containing a small number of elements with only a few
subsystems (Containers), you may wish to only use the graphics pane to
navigate and view your model. For most models, however, particularly those
which are large and complex, use of the browser becomes essential.
You can activate (show) and deactivate (hide) the browser by pressing the
browser button in the Standard toolbar (or F6). When you run GoldSim for the
first time, the browser is activated and is initially docked on the left side of the
screen. You can undock the browser 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 at the top of the browser and dragging it to the desired
location. If you press the Ctrl key while you drag the browser, it will become a
floating window. You can also undock the browser (and turn it into a floating
window) by double-clicking on the docking grab bar or de-selecting "Allow
Docking" in the context menu for the browser.
The browser organizes the model into one of two views in a tree structure,
which greatly facilitates navigation of complex models. The two browser views
are referred to as Containment View and Class View, and you toggle between
these alternative views using the tabs at the bottom of the browser.
The default browser view is Containment View. In Containment View, elements
are organized in a hierarchical manner (by containment), similar to the way that
files and directories on a computer are organized.
In this view, elements at the same hierarchical level are listed in alphabetical
order (except for Containers, which are always listed first).
Read more: Understanding Containers (page 100).
In Class View, rather than being organized by containment, the browser is
organized by element type.
When you expand an element within the browser, the inputs and outputs are
color-coded:
An input which contains a link (or an expression with a link) is green;
an undefined input or an input defined by a number is red.
An output which is linked to an input field is green; an output which is
not linked anywhere is red.
In addition, you will note that condition inputs and outputs and discrete signal
inputs and outputs have a slightly different appearance:
T/F is superimposed on the image of condition inputs and outputs.
An exclamation point is superimposed on inputs and outputs
representing discrete signals (referred to as transactions).
Read more: Understanding Output Attributes (page 93); Chapter 5: Simulating
Discrete Events (page 319).
Using Tool-Tips Elements, input objects and output objects, and input fields all display tool-tips
when the cursor is placed over them.
Element Tool-Tips Holding your cursor over an element in the graphics pane (or the browser)
displays a tool-tip:
In addtition to this information, other basic information about the element may
also be displayed, depending on the element type, as well has how it has been
defined. If the element has a primary output, the tool-tip will show the display
units for the output (in parentheses). If the element is a vector or a matrix, the
array label set(s) will be displayed (in brackets).
Read more: Element Inputs and Outputs (page 82); Using Vectors and
Matrices (page 726).
To augment this basic information, State and Property information is also
displayed for some elements. When displayed, these are separated from the
basic information by a line.
State information consists of a current or initial Value for the element. Only
elements that have a primary output display State information. GoldSim has
three different modes (or states) that a model can be in: Edit Mode, Run Mode
and Result Mode. When in Edit Mode (prior to running the model), the current
or initial value is shown in the tool-tip. This represents the value of the output
prior to running the simulation.
Read more: Simulation Modes (page 76).
If an element has invalid inputs such that a current value cannot be computed,
the value is reported as "undefined".
When the model has finished and has results (Result Mode), the Value shown in
a tool-tip represent is the final value (i.e., the value at the end) of the final
realization.
While a model is running (Run Mode), it can be paused and the model can be
navigated. In this case, the Value shown in a tool-tip represents the last value
that was calculated (since the simulation has not yet been completed).
Note: You can control the number of significant figures displayed in tool-tips
from the Results tab of the Options dialog (accessed via Model |Options…
from the main menu).
Read more: The Results Tab of the Options Dialog (page 409).
In addition to the basic information and the State (value) information, some
elements will also display some of their input properties in the tool-tip. This
allows you to view the key inputs for the element without having to open the
dialog.
Input and Output Tool- Holding your cursor over an input or output object in a browser (or an interface
Tips in the graphics pane) displays a tool-tip.
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).
Input Field Tool-Tips Holding your cursor over or placing your cursor into an input field in a dialog
displays a tool-tip showing the computed value of the entry or expression in the
input field:
The value is computed based on the current value when in Edit Mode and the
last value when in Result Mode (the final value of the final realization) and Run
Mode (the last value calculated).
If you place your cursor on a link from another element and left-click, that link
will be selected (and highlighted in italics), and the tool-tip will display the
value just for that link (as opposed to the entire input field):
If the link is the primary output for the element, it will show the element’s tool-
tip:
These kinds of tool-tips can be very useful when debugging and/or exploring
models. Note that the icon for the link is also provided (identifying the element
type).
As pointed out elsewhere, if the input field is invalid for some reason, the tool-
tip will display an appropriate error message:
If you start typing (or move the focus to another field), the tool-tip will
disappear. If you stop typing, the tool-tip will reappear.
Read more: Error Checking in Input Fields (page 98).
Note: You can control the number of significant figures displayed in tool-tips
from the Results tab of the Options dialog (accessed via Model |Options…
from the main menu).
Read more: The Results Tab of the Options Dialog (page 409).
Viewing Very Large and GoldSim carries out all of its internal calculations using double precision
Very Small Numbers in numbers. In general, this means that GoldSim can internally handle absolute
Tool-Tips values as small as 2.2E-308 and as large as 1.8E+308. If you enter (or GoldSim
calculates) a value whose absolute value is outside this range, the tool-tip for the
element and the output will be displayed as 1.#INF (or –1.#INF).
Note: Although internal calculations are carried out using double precision
numbers, results are only stored as single precision numbers (in order to reduce
storage requirements). This means that when results are viewed in tables or
charts (see Chapter 8), the range of absolute values that can be displayed is
between 1.2E-38 and 3.4E38.
Finding Elements To assist in finding specific elements in a model, GoldSim provides a Search
utility. At the top of the browser, a Search field is always present.
To start a search, enter a string. Note that if you press Ctrl-F, the cursor will
jump to the search field. Pressing F3 or the Search button (the binoculars) finds
the next item in the browser that matches the search string. By default, GoldSim
searches for the string in element names (IDs), Descriptions and Notes. The
search is not case-sensitive.
Read more: Creating, Editing and Viewing Notes (page 709).
You can limit where GoldSim searches by pressing Search Options…, which
will display a dialog for selecting whether you want to search in IDs,
Descriptions, and/or Notes.
These Search options are stored in the Windows Registry (so that once you
change them, they will remain until you edit them again, even when editing
other GoldSim files).
Note that the Search field is present in all browser windows, including the Insert
Link dialog and the Function Of and Affects Views (see below).
Read more: Input Field Context Menu (page 91).
Viewing Element In complex models, it is often useful to explore the interdependencies of the
Dependencies various elements (i.e., who affects who). GoldSim provides two very powerful
utilities for doing this: the Function Of View, and the Affects View. If you right-
click on an element in either the graphics pane or the browser (to access the
context menu) and select Function Of…, a floating window is displayed:
This is a specialized browser view of the model. It starts with the selected
element, and only shows those elements which affect that element (i.e., those
elements which the selected element is a function of). In the above example,
Earnings is a function of three elements: EBIT, Interest_Paid and Tax_Paid.
EBIT, in turn, is a function of Depreciation and EBITDA. EBITDA is a function
of Corporate_Overhead and Total_Net_Revenue. Total_Net_Revenue is a
function of Capital_Cost, Gross_Revenue and Operating_Costs.
Similarly, if you select Affects… from the context menu, a window like this will
be displayed:
This view of the model starts with the selected element, and only shows those
elements which are a function of that element (i.e., those elements which the
selected element affects).
In the above example, Gross_Revenue affects Total_Net_Revenue, which
affects EBITDA, which affects EBIT, which affects Balance, Earnings and
Net_Cash.
Note: The Function Of… and Affects… options are only available if the
element is either a function of other elements or affects other elements.
These two browser views have all the functionality of the regular browser (e.g.,
tool-tips, context menus). If you double-click on an element in one of these
views, its property dialog is displayed.
In addition, the context menu for an item in the Function Of or Affects browser
includes an option to immediately jump to the opposite view. That is, if you are
viewing a Function Of list, you can right click on any element in the list, and
immediately jump to the Affects list for the selected element.
By default, Function Of and Affects browser views are synchronized with the
regular browser (and hence the graphics pane). As a result, as you explore the
interdependencies of the elements, you can simultaneously observe where they
are located in the containment hierarchy.
Note: If desired, you can turn off the synchronization by right-clicking on white
space in the Function Of or Affects view (i.e., not on an element), and clearing
the Synchronize option in the context menu.
Like all browser dialogs, the Function Of and Affects have a search field, and
this can be very useful for answering questions like "Is Y a function of X?" or
"Is Y affected by X?".
Read more: Finding Elements (page 116).
Note that if you have defined a circular or looping model, GoldSim will stop at
the point of recursion. For example, if “Volume” is a function of “Leakage”, and
“Leakage” is a function of “Volume”, the Function Of View for “Volume”
would look like this:
Note: Result elements do not appear in the “Affects” list for elements that they
reference. This is because unlike other elements in GoldSim, when you
reference an output of an element within a Result element, it is not treated as a
“link”. GoldSim provides other tools for navigating these kinds of connections.
Read more: Browsing Between Result Elements and Referenced Outputs (page
530).
GoldSim is a dynamic simulator, which means that your model can evolve and
change with time. In order to carry out a dynamic simulation, GoldSim steps
through time in discrete intervals (referred to as timesteps).
Calculations are carried out every timestep. In GoldSim, you specify the
duration of the simulation (e.g., 1 year) and the length of timestep to use (e.g., 1
day).
The appropriate timestep length is a function of how rapidly the system
represented by your model is changing: the more rapidly it is changing, the
shorter the timestep required to accurately model the system. GoldSim allows
you to change the timestep during a simulation (e.g., use short timesteps at early
times when things are changing rapidly, and larger timesteps at later times).
Specifying Simulation To run a model, you must first specify its simulation settings.When you create a
Settings new model, the simulation settings dialog is automatically displayed. After the
model has been created, the simulation settings can be accessed and edited from
the main menu under Run | Simulation Settings, or by double-clicking on
the Simulation Settings button in the standard toolbar. When you do so, the
following dialog is displayed:
The Time tab of the dialog is used to specify the duration of the simulation, the
timestep length, and the units in which time will be displayed in results.
The Monte Carlo tab of the dialog is used to specify Monte Carlo options (how
probabilistic simulations will be carried out), such as the number of realizations,
and whether Latin Hypercube sampling is to be used.
Saving Results Before you run a model, you select the results that you wish to save. With regard
to saving results, there are two things that you must specify:
Which specific results do you want to save (i.e., which outputs of which
elements)?
When do you want to save these results?
Within GoldSim, there are two fundamental types of results:
Final Value Results: These are usually used to view results involving
multiple realizations (or items in an array), and allow you to display
distributions, multi-variate results (e.g., scatter plots) and array plots. By
default, “Final Value” type results are only available at the final time point
in the simulation. In some cases, however, you may also want to view
distributions or scatter plots at other points in time (other than the end of the
simulation). GoldSim facilitates this by allowing you to create Capture
Points at which these results are also made available.
Read more: Creating Capture Points for Final Value Results (page 428).
Time History Results: These are saved at selected timesteps, and allow
you to display how an output changes as a function of time.
All element property dialogs have check boxes (at the bottom of the dialog) to
specify whether output(s) of the element are to be saved. You can save the Final
Values (the values at the end of each realization in the simulation) and/or Time
History (the value at selected timesteps throughout the simulation).
By default, when you create a new scalar element, the Save Results checkboxes
will be checked (on). For array elements, the Time History checkbox defaults
off.
The Final Values checkbox always controls whether Final Value results are
saved. However, the Time History checkbox can be overridden. In particular, it
is always applied for single realization runs, but is overridden for multiple
realization runs. In particular, Time History results for multiple realization runs
are only saved for outputs that are connected to Result elements.
Read more: Saving Outputs as Results (page 453).
When Time History results are saved, by default GoldSim saves the values of
outputs at every Basic Step (and Reporting Period). You can instruct GoldSim to
only save results at selected timesteps (e.g., every tenth Basic Step) when
defining timestepping options in the Simulation Settings dialog.
Read more: Understanding Timestepping in GoldSim (page 415); Specifying
When Time History Results Will Be Saved (page 423).
Running a Model Selecting Run | Run Model, pressing F5, or pressing the Run button in the
toolbar causes GoldSim to check the model for errors (to see if it can be run). If
an error is found in the model such that it cannot be run, GoldSim will display a
fatal error message describing the problem. In most cases, a button on the dialog
displaying the error message will allow you to jump directly to the element
causing the problem.
If GoldSim does not detect any errors, the model will be placed into Run Mode.
In Run Mode, the GoldSim Run Controller is displayed:
Press the Run button from the main menu, F5, or the second button from the left
on the Run Controller to start the simulation. While the model is running, the
Run button Run Controller will display the status of the run (i.e., current realization,
timestep, and elapsed time).
In addition to displaying this information, the Run Controller can also be used to
pause and resume a simulation, and/or step through the simulation one timestep
or one realization at a time.
Read more: Using the Run Controller (page 456).
A small dialog will alert you when the simulation is complete. Clicking the OK
button in this dialog (the only button) will close the Run Controller and place the
model into Result Mode.
If there were any warning messages generated during the simulation, you will
immediately be given an opportunity to view the Run Log. The Run Log
contains basic statistics regarding the simulation (e.g., the version of the
program, the date, the simulation length), and any warning or error messages
that were generated.
Read more: The Run Log (page 506).
Viewing Results After a simulation is complete, the model will be placed in Result Mode. “Result
Mode” will be displayed in green in the right hand side of the status bar. More
importantly, editing the model’s logic (i.e., the properties of model objects) will
be disabled. This is also indicated in the status bar. In addition, the cursor takes
on a different appearance (it turns green) to indicate that editing is disabled.
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. The Last Value is displayed in tool-tips regardless
of whether results (Time Histories or Final Values) have been saved for the
output.
When in Result Mode, elements which have saved results will be identified in
two ways: 1) the elements (and their outputs) will be bold in the browser; and 2)
the element output ports in the graphics pane will be green (rather than red).
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 results.
Depending on the type of output and which results have been saved, up to three different
options will be displayed at the top of the menu.
Clicking on one of the items at the top of this menu displays the results for the
selected object.
Read more: Element Inputs and Outputs (page 82).
This manner of viewing results in GoldSim is so fundamental to the GoldSim
design that it bears repeating: To view the result of an element, right-click on
the element (or one of its outputs) and select the appropriate result type at
the top of the menu.
Note: Time history results may not be available in this manner, depending on
the nature of the simulation. In particular, for runs with multiple realizations,
extra steps must be taken to save and view time history results.
Building and Running We close this chapter by walking through a simple example to allow you (if you
Your First Model have not already done so) to build and run your first GoldSim model.
This simple example uses a Reservoir element to simulate the volume of water
in a pond. The completed model file (FirstModel.gsm) can be found in the
General Examples folder in your GoldSim directory.
1. Open GoldSim.
2. Select New Model from the Start dialog.
3. In the Time tab of the Simulation Settings dialog, you will note that
“Elapsed Time” is selected. Leave this unchanged.
4. Set the Duration to 20 days.
5. Set the Basic Step to 0.2 days.
6. Press OK to close the dialog.
7. Insert a Data element using the context-sensitive menu of the graphics
pane (right-click in the graphics pane, select Insert Basic Element, go to
the Inputs category, and click on Data).
8. The element will be named Data1 by default. Change the name to
Initial_Volume.
9. Specify the Display Units as cubic meters (m3).
10. Specify the entry in the Definition input field as 10 m3.
The dialog should look like this:
21. Press OK. Your screen should look something like this:
If it doesn't, you can drag the elements around the graphics pane so that
it does.
22. Save the file by pressing the Save button on the main menu. You will
be prompted for a filename.
23. We are now ready to run the model. To do this press the Run button in
the toolbar (or press F5).
24. The GoldSim Run Controller will appear:
Congratulations! You have built and run your first GoldSim model. The details
of using the various elements, customizing the interface, running the model,
viewing results and documenting your model are provided in the remaining
chapters. You should certainly have enough information at this point, however,
to begin to experiment with GoldSim.
L ew i s C a rro l l
Chapter Overview
This chapter describes the details of using each of the basic GoldSim elements.
After first describing the details of a topic that is applicable to all elements
(entering expressions into input fields), the manner in which each of the basic
GoldSim elements is defined and used is presented. A number of advanced
elements, such as those related to linking to external programs, are described in
Chapter 10.
In this Chapter The following topics are discussed in this chapter:
Entering Mathematical Expressions into Element Input Fields
Using Containers
Overview of GoldSim Element Types
Using Basic Input Elements
Using Time Series Elements
Using Stock Elements
Using Basic Function Elements
Using Delay Elements
Creating Feedback Loops
The “max” function, shown above in the Equation field, returns the maximum of a list of
arguments.
The arguments to a built-in function are enclosed in parentheses, and if there are
multiple arguments, they are separated by commas. The arguments to the built-
in functions can be links, constants or expressions, but typically must meet
certain requirements (e.g., the arguments to a “max” must all share the same
dimensions). The first four categories of functions (and any requirements
imposed on their arguments) are summarized below.
Trigonometry GoldSim provides the following trigonometry functions:
Functions
Function Description
sin(A) Sine of A
cos(A) Cosine of A
tan(A) Tangent of A
Function Description
cot(A) Cotangent of A
sinh(A) Hyperbolic sine of A
cosh(A) Hyperbolic cosine of A
tanh(A) Hyperbolic tangent of A
asin(U) Arcsine of U. The result has dimensions of an angle.
acos(U) Arccosine of U. The result has dimensions of an angle.
atan(U) Arctangent of U. The result has dimensions of an angle.
A: An angle (i.e., a value). It can have angular units or no units, in which case it is assumed
to be in radians. Can be a scalar or an array.
U: Must be a unitless value. Can be a scalar or an array.
Function Description
abs(X) Absolute value of X
exp(U) Exponential (e^U)
ln(U) Natural logarithm of U
log(U) Logarithm base 10 of U
max(X,Y,…) Returns the maximum of a list of arguments. The first
argument determines the order of the output. Arguments
must either be all scalars, all arrays of the same order (and
set of array labels), or a mixture of arrays of the same order
and scalars (in which case the first argument cannot be a
scalar).
min(X,Y,…) Returns the minimum of a list of arguments. The first
argument determines the order of the output. Arguments
must either be all scalars, all arrays of the same order (and
set of array labels), or a mixture of arrays of the same order
and scalars (in which case the first argument cannot be a
scalar).
mod(X,Y) Modulus: remainder of X/Y; sign is sign of X. The first
argument determines the order of the output. Arguments
can be scalars, arrays of the same order (and set of array
labels) or mixed (in particular, if X is an array, Y can be a
scalar; if X is a scalar, however, Y cannot be an array). If X
and Y have dimensions, they must have the same
dimension (although the units can be different), and the
result has the same dimension as X and Y.
round(U) Rounds off U
sqrt(X) Square root of X. Note: if X has units, they must be an
even power, for example: sqrt(5 m2) is OK, but sqrt(5m) is
not.
trunc(U) Truncates U
ceil(U) Returns the next integer that is greater than U
floor(U) Returns the next integer that is less than U
U: Must be a unitless value. Can be a scalar or an array.
X, Y: A value. Can be a scalar or an array.
Note: Because round-off may result in a calculated interger value being slightly
above or below the exact integer, GoldSim allows for a fractional error of 1e-12
when evaluationg the ceil() and floor() functions. For example, although
ceil(4.000001) returns 5, ceil(4.000000000001) returns 4.
Function Description
erf(U1) Gauss error function of U1
if(C,E,F) or If C is true then E else F
if(C then E else F)
bess(U1,U2) Bessel function of U1 of order U2
beta(U1,U2) Beta function of U1 and U2
gamma(U1) Gamma function of U1
normprob(U1) Returns a value representing the cumulative
probability level for the specified number of
standard deviations (U1) away from the mean for a
standard normal distribution. A negative argument
represents values to the left of (less than) the mean.
normsds(P) Returns a value representing the number of
standard deviations away from the mean for the
specified cumulative probability level (P) for a
standard normal distribution. A negative output
represents a value to the left of (less than) the mean.
tdist(P,nu) Student’s t distribution for the specified cumulative
probability level (P), with nu degrees of freedom.
tprob(X,nu) Student’s t distribution, returns the cumulative
probability for value X, with nu degrees of
freedom.
ImpProb(Old,Target,Width) Used for customized importance sampling for a
given target probability and probability width.
Takes a probability (Old) and returns a biased
probability.
ImpWeight(Prob,Target,Width) Used for customized importance sampling for a
given target probability and probability width.
Takes a biased probability (produced by ImpProb)
and returns a weight.
ImpOld(Prob,Target,Width) Used for customized importance sampling for a
given target probability and probability width.
Takes a biased probability (produced by ImpProb)
and returns the unbiased probability. This is the
inverse of ImpProb.
PDF_Value(D, P1) Returns the value of the distribution at the specified
cumulative probability level P1. The output has the
same dimensions as the distribution being
referenced.
PDF_CumProb(D, V) Returns the cumultive probability of the distribution
at the specified value V. The output is
dimensionless.
Function Description
PDF_Mean(D) Returns the mean of the distribution. The output has
the same dimensions as the distribution being
referenced.
PDF_SD(D) Returns the standard deviation of the distribution.
The output has the same dimensions as the
distribution being referenced.
PDF_CTE(D, P1) Returns the conditional tail expectation of
cumulative probability P1 (i.e., the expected value
of the output given that it lies above a specified
cumulative probability P1). This result represents
the mean of the worst 100(1 – P1)% of outcome.
The output has the same dimensions as the
distribution being referenced.
PDF_DiscreteProb(D, V) Returns the discrete probability of the distribution
at the specified value V. The output is
dimensionless. This function returns 0 for
continuous distributions (i.e., it should only be
applied to discrete distributions).
changed(Z) Returns a condition. True if the argument has
changed since the last update (e.g., timestep). False
if the argument has not changed. See Note below.
occurs(T) Returns a condition. True if the argument has
occurred this update (e.g., timestep). False if the
argument has not occurred.
U1,U2: Must be a unitless value. Can be a scalar or an array.
D: A distribution output.
V: A scalar value.
X, Y: A value. Can be a scalar or an array.
E, F: A value or a condition. Can be a scalar or an array.
C: Must be a condition. C can be an array or scalar; if it is an array, then the “if” test is
done on a term-by-term basis and either E or F (or both) must be an array with the same
set of array labels as C. If C is scalar, E and F can be either scalar, arrays of the same
order (entire array is then selected), or one can be an array and one can be a scalar (in
which case the scalar is treated as an array of identical values).
P: A value between 0 and 1, inclusive. Can be a scalar or an array.
P1, Old, Target: A scalar value between 0 and 1, inclusive.
Width: A scalar value between 10-6 and 0.5, inclusive.
nu: A positive integer. Can be a scalar or an array.
Z: A value or a condition. Must be a scalar.
T: Must be a discrete event signal.
These functions assume discrete compounding. That is, the functions assume
compounding once per period.
Since #periods represents the number of periods in these functions, it must be a
unitless value. For example, in order to compute the annuity value (the annual
payment amount) for a 15 year loan of $100,000 with an interest rate of 7% per
year (compounded annually), you would write the following in an expression:
100 $ * ftop(0.07, 5)
GoldSim also provides more advanced financial functions for use in conjunction
with the GoldSim Financial Module. These are described in the GoldSim
Financial Module User's Guide.
Warning: If there is an element name which conflicts with (i.e., is identical to) a
constant name, the element name always has precedence. Hence, if you type an
expression such as 3*R, and an element named R exists in the same scope,
GoldSim will try to create a link to the element rather than using the built-in
constant R, even if the element's dimensions are incompatible (such that the
expression becomes invalid).
A>B
A=B
A>5 AND A<10
!A
The operators that can be used in conditional expressions, along with their
precedence, are summarized below:
Conditional expressions are very useful, because they allow you to add if…then
logic to your model. This can be accomplished by using GoldSim's if function in
an expression. For example, the expression
if(ETime>10 yr and ETime<20 yr then 33 else 44)
would be interpreted as "If the elapsed time is between 10 years and 20 years,
the value is equal to 33, otherwise it is equal to 44".
Read more: Built-in Functions (page 128).
Complex if…then logic can be defined by nesting this function, or by using a
Selector element. Conditional expressions are also of great use when modeling
discrete events and consequences.
Read more: Selector Elements (page 252); Specifying Triggering Events (page
324).
Note: Tool-tips for conditional outputs by default display true or false. You can
specify what is displayed (e.g., on/off, yes/no, etc.) by editing the “Show
condition result outputs as” field in the Results tab of the Options dialog
(accessed from the main menu via Model|Options…)
and then saved the file and subsequently opened the file on a computer with
Australian or European settings, the same expression would appear like this:
Warning: You should take extra care when exchanging date information with
other programs, such as Microsoft Excel, since they may treat Julian date
references differently than GoldSim. Microsoft Excel, for example, actually uses
a Julian reference date of December 31, 1899 00:00:00, but mistakenly adds an
extra day into its calendar that did not actually exist (February 29, 1900).
Fortunately, as a result of this, the effective Julian date reference for all times
after March 1, 1900 in Excel is actually the same as that used by GoldSim,
December 30, 1899 00:00:00.
Warning: If you enter a date using only two digits for the year (e.g., “10/1/09”),
GoldSim interprets years less than or equal to 29 as being in the 21st century,
and years greater than 29 as being in the 20th century. To avoid confusion, it is
strongly recommended that you always use four digits to specify the year.
Using Containers
Containers are perhaps the most important element type in GoldSim, because
they allow you to create hierarchical, "top-down" models. This section provides
the basic information required to use Containers in your models.
The example model Container_Basic.gsm in the General Examples/Containers
folder of your GoldSim directory presents the basic concepts associated with the
use of Containers.
Read more: Understanding Containers (page 100).
The Container Like any element in GoldSim, you can edit the properties of a Container by
Properties Dialog double-clicking on it either in the graphics pane or the browser, or right-clicking
anywhere inside the graphics pane when inside the Container, and selecting
Properties…. The properties dialog looks like this:
Note: If you turn on some of the other features for a Container, additional tabs
are added.
Within the General tab (shown by default), the top part of the dialog allows you
to enter and edit the ID, Description and Appearance of the element.
Within the middle portion of the General tab, you can select which Features
you would like the Container to have. By default, it has none of these features
(it is a simple Container). If you click on the name of a feature, a brief
description of the feature will appear in the Details window. Features are added
and removed using the checkboxes to the left of the feature name.
Read more: Container Options and Features (page 137).
At the bottom of the General tab are options to Save/Enable Results. By
default, a Container does not have any outputs of its own, and these checkboxes
are grayed out. Under some conditions (e.g., making the Container conditional),
it does have outputs, and in this case, checkboxes become available for editing.
The Graphics tab of the Container provides access to options for controlling the
appearance of elements inside the Container (e.g., size of the graphics pane, and
the manner in which the influences between elements are drawn).
Read more: Controlling the Appearance of the Graphics Pane in a Container
(page 143).
The Information tab of the Container provides summary information for the
Container, such as the total number of elements it contains, and the size of the
results being saved inside the Container. It also provides the ability to
recursively turn off result saving for all elements inside the Container.
Read more: Summary Information for a Container (page 144); Controlling
Result Flags for Elements in the Container (page 145).
Note: The properties dialog of the Model (root) Container is slightly different
than that described above. In particular, within the “Features” section, some
features are hard-wired on, and others are not applicable (and hence not
available).
Container Options Within the middle portion of the General tab of the Containers dialog, you can
and Features select which Features you would like the Container to have:
Image Features
Simple (global) Container
Localized Container
SubSystem Container
Conditional Container
Looping Container
Note: If SubSystems (conditional, looping, Resource and internal clock Containers) are also
localized, this is indicated by displaying the "+" in the upper left hand corner of the
Container's symbol in the graphics pane in red (instead of black)
Local and Global Each Container in a model is either global or local. The contents of a global
Containers Container can be "seen" (referenced) by any other element in the model. The
contents of a local Container can typically only be referenced by other elements
inside the Container.
By default, Containers are global. Containers can be localized by selecting the
Localization feature in the Container dialog, or by right-clicking on the
Container and selecting Localize. In addition, when you paste a Container,
GoldSim will localize it if the names of elements inside the pasted Container
conflict with element names at the location where it is being pasted.
You can recognize a localized Container in three ways:
The "+" in the upper left hand corner of the Container's symbol in the
graphics pane is red (instead of black).
The icon for the Container in the browsers and the default symbol for
the Container in the graphics pane is a closed box (rather than an open
box):
This symbol is only used for simple Containers. Localized SubSystems use a
different symbol but retain the red "+".
Treating a Container as One of the advanced options for a Container is to treat it as a SubSystem. If you
a SubSystem select the Conditionality, Internal Clock, Looping Capability or Provide
Resources feature for a Container, it will automatically be treated as a
SubSystem (these features require this to be the case):
In this example the Conditionality feature is selected, and therefore the Treat as
SubSystem feature is also automatically selected (and grayed out so it cannot be
changed).
Containers with Internal In some situations, you may wish to use different timesteps in different portions
Clocks of your model. This is useful, for example, if the processes represented in one
portion of your model occur rapidly and hence require a small timestep to model
accurately, while processes represented in the rest of your model occur much
more slowly, such that a larger timestep can be used.
GoldSim allows you to assign a timestep that is smaller than the “global”
timestep to one or more Containers. For example, your model could have a 10
day “global” timestep, but you could assign a 1 day timestep to a specific
Container in your model that represents a system that changes rapidly and hence
requires a smaller timestep to simulate accurately.
You can specify smaller timesteps for a Container by assigning the Container an
“internal clock”. Containers can be assigned internal clocks by selecting the
Internal Clock feature in the Container dialog.
Note: When you specify a Container as having an Internal Clock, you cannot
also define it as having Looping Capability (these two options are mutually
exclusive).
Looping Containers In some models, you may want to carry out an iterative calculation at each
timestep. This might be useful, for example, if you have a coupled system of
nonlinear equations that must be solved every timestep by iterating.
You can define a Container as a looping Container by selecting the Looping
Capability feature in the Container dialog.
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).
Protected Containers In some cases, you may want to protect the contents of a Container from being
modified. GoldSim provides two options (sealing and locking) for doing so.
Sealing a Container causes a warning message to be displayed whenever you
attempt to modify the contents of the Container. Locking a Container completely
prevents you from editing or modifying the contents of the Container. A
password is required to unlock a Container.
You can protect the contents of a Container by selecting the Protection feature
in the Container dialog. When you do so, the following dialog for specifying
how you would like to protect the Container is displayed:
Controlling the The Graphics tab of the Container dialog provides access to options for
Appearance of the controlling the appearance of elements inside the Container:
Graphics Pane in a
Container
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 a grid is displayed.
Read more: Adjusting the Size of the Graphics Pane (page 388); The Graphics
Pane Grid and Background (page 386).
The bottom portion of the dialog (the Influences section) is used to specify the
default shapes for influences in the Container, and to define whether and in what
manner influences within the Container 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 easier to view and understand.
Read more: Links and Influences (page 86); Editing the Appearance of
Influences (page 389); Filtering Influences (page 392).
Note: The graphical properties are of particular interest for the Model Container,
as they allow you to control the appearance of the entire model. You can view
the properties of the Model Root (the Model Container) by double-clicking on it
in the browser or by right-clicking anywhere in the graphics pane (when viewing
the Model Root) and selecting Properties….
Summary Information The Information tab of the Container dialog provides access to summary
for a Container information regarding the Container:
The dialog provides some useful summary statistics for the Container, including
the number of model elements and graphical components and the degree of
subcontainment. The number of levels of subcontainment does not refer to the
number of Containers; it refers to the number of hierarchical levels of
Containers. For example, if A contained Containers B and C, A would have 1
level of subcontainment; if A contained B, and B contained C, A would have 2
levels of subcontainment.
Note: These properties are of particular interest for the Model Container, as they
tell you the size of the entire model. You can view the properties of the Model
Root (the Model Container) by double-clicking on it in the browser.
The dialog also indicates the total size of the results being saved for all elements
within the Container. This information can be very useful in helping you to
manage the size of the model file.
The bottom of the dialog contains some advanced options to allow you to
deactivate the results flags for all elements contained within the Container.
This is described in detail in the next section.
Controlling Result Before you run a model, you select the results that you wish to save. You can
Flags for Elements in save Final Values (the values at the end of each realization in the simulation)
and/or Time History (the value at selected timesteps throughout the simulation).
the Container Typically, these are specified by separately setting flags for each element (and
each output).
In some cases, however, you may want to change these settings for all the
elements in a Container at once (i.e., globally deactivate the result flags for all
elements inside the Container).
You can do this using the two buttons located at the bottom of the Information
tab or the Container dialog:
Note: The Time Histories button is only available if you are running a single
realization. If you are running multiple realizations, the state of each
element’sTime History flags are determined by whether or not the element is
referenced by an active Time History Result element. If it is, the flag is turned
on. If it is not, the flag is turned off. In both cases, the flag is grayed out and
cannot be manually changed.
Note: This capability is of particular interest for the Model Container, as it can
be used to globally turn off all result options for the entire model.
By default, you cannot turn off results for outputs which are linked to Result
elements (unless the Result element is a Time History Result element that has
been disabled). That is, any output linked to a Result element is automatically
saved , even if you choose to turn off results using the buttons described above.
This behavior can be changed in Time History Result elements (so the outputs
linked to the Result element are not automatically saved) by disabling the
element.
Read more: Disabling a Time History Result Element (page 591).
You can choose to globally disable all Time History Result elements in a
Container by clearing the Enable Time History Result Elements checkbox at
the bottom of the General tab of the Container dialog.
Sealing and Locking GoldSim provides two options to protect the contents of a Container from being
Containers modified: sealing a Container and locking a Container.
Sealing a Container is the weakest of the two methods. Sealing causes a
warning message to be displayed whenever you attempt to modify the contents
of the Container, but does not prevent you from modifying the contents if you
choose to “break” the seal. Locking a Container completely prevents you from
editing or modifying the contents of the Container without providing a
password.
Sealing a Container Sealing is the lowest level of protection you can place on a Container. Sealing a
Container causes a warning message to be displayed whenever you attempt to
modify the contents of the Container, but does not prevent you from modifying
the contents if you choose to “break” the seal. It is typically used simply to
remind users that a particular Container has been verified and/or checked in
some manner and hence should not be edited. It also can be used to verify that
the contents of a particular Container has not been modified.
You can seal the contents of a Container by selecting the Protection feature in
the Container dialog. When you do so, the following dialog for specifying how
you would like to protect the Container is displayed:
Your Windows user name will be inserted by default into the Name field (which
you can subsequently edit).
By default, the option to Seal Container will be selected. The Container can
then be sealed by pressing the OK button. Upon doing so, the following dialog
will be displayed:
When a Container is sealed, the Container and all of its contents appear grayed
out when viewed in a browser. In addition, the tool-tip for the Container
indicates that it is sealed, and the Details section for the Container dialog
displays the name of the person who sealed the Container, along with the date
and time that the Container was sealed.
Once a Container has been sealed, you can make “cosmetic” changes to the
contents (moving elements around in the graphics pane, adding text, graphics or
images to the Container), but if you try to make any other kind of change (e.g.,
Note: If you seal a Container which contains other Containers, all of the
Containers within the parent Container are also sealed. If you then remove the
seal from the parent Container, however, the other Containers within it remain
sealed.
Warning: The values of Data elements that are located within a sealed
Container and are controlled via a Dashboard control can be changed via the
control withing breaking the seal. Dashboard controls are discussed in the
GoldSim Dashboard Authoring Module User’s Guide.
If you need to protect the contents of a Container such that they cannot be edited
at all, you should lock the Container.
Locking a Container Locking is the highest level of protection you can place on a Container. Locking
a Container completely prevents the user from editing or modifying the contents
of the Container without providing a password.
You can lock the contents of a Container by selecting the Protection feature in
the Container dialog. When you do so, the following dialog for specifying how
you would like to protect the Container is displayed:
Your Windows user name will be inserted by default into the Name field (which
you can subsequently edit).
By default, the option to Seal Container will be selected. To lock the Container,
select the Lock Container radio button. When you do so, the Password and
Verify fields will become editable. To lock the Container, enter a password,
verify it, and press the OK button. Upon doing so, the following dialog will be
displayed:
When a Container is locked, the Container and all of its contents appear grayed
out when viewed in a browser. In addition, the tool-tip for the Container
Lock Cursor indicates that it is locked, and the Details section for the Container dialog
displays the name of the person who locked the Container, along with the date
and time that the Container was locked. Moreover, whenever you are inside a
locked Container, the cursor is changed to the “Lock Cursor”, to remind you that
the Container is locked.
Note also that the property dialog is grayed out (except for the Protection
checkbox). In fact, the property dialogs of all elements within a locked
Container will also be grayed out. In addition, when viewing the contents of a
locked Container, most menus are disabled. This is because you cannot make
any changes at all to the contents of a locked Container (or to the properties of
the locked Container itself). You can view the contents of a locked Container
(and all the properties of the elements within the Container), but the contents of
the Container cannot be edited until the Container is unlocked.
To unlock a locked Container, click on the Protection checkbox on the
properties dialog for the Container. You will be prompted for a password.
Enter the password and press OK. The Container and its contents will then be
available for editing.
Note: When you lock a Container, you can choose not to specify a password
(leave the password blank). If you do this, the Container will unlock as soon as
you press the Protection checkbox (without prompting you for a password).
Note: The Properties page for Result elements in locked Containers cannot be
edited. However, when displaying a result via a Result element that is inside a
locked Container, you can edit the style (e.g, headers, axes titles) via the Edit
Style button on the display page.
Warning: The values of Data elements that are located within a locked
Container and are controlled via a Dashboard control can be changed via the
control withing unlocking the Container. Also, the values of Data elements that
are located within a locked Container and are specified as being Scenario Data
can be changed via the Scenario Manager without unlocking the Container.
Dashboard controls are discussed in the GoldSim Dashboard Authoring
Module User’s Guide.
Read more: Creating and Using Result Elements (page 526); Scenario Data:
Defining Inputs for Different Scenarios (page 465).
The various categories are discussed in general terms below. Most of the
elements are then discussed in detail in the remainder of this chapter. Several of
the more advanced elements are discussed in subsequent chapters.
Input Elements Input elements define the basic inputs to your model. There are three input
elements in GoldSim: Data, Stochastic, and Time Series.
Data elements allow you to specify a single scalar value (e.g., the discount rate)
or an array of related values (e.g., the salaries of each individual in a group).
Stochastic elements allow you to specify that a particular value is uncertain by
defining it as a probability distribution. Time Series elements allow you to
specify a time series of a value (e.g., monthly rainfall rates, quarterly
cashflows).
Read more: Using Basic Input Elements (page 154); Using Time Series
Elements (page 187).
Stock Elements Stocks are elements that impart inertia and memory to a system, and hence are
responsible for internally generating the dynamic behavior of many systems. In
GoldSim, Stocks, a second element category called Delays, and a special
function element (Convolution) are collectively referred to as dynamic elements.
Mathematically, Stocks are time integrals (i.e., they integrate flows or signals
over time). As a result, they have the property that their outputs are determined
by the historical (integrated) value of their inputs.
GoldSim provides two Stock elements, Reservoirs and Integrators.
Function Elements Functions compute outputs based on the current (instantaneous) values of their
inputs. Hence, unlike Stocks, Functions do not impart inertia or memory to a
system. Rather, they instantaneously transform or convert inputs to outputs.
GoldSim provides a wide variety of Function elements.
As can be seen in the menu, Function elements are subdivided into three types:
Standard Functions, which include Expressions and Lookup Tables, Logical
Functions for manipulating logical expressions, and External Application
Functions for linking external applications such as spreadsheets into GoldSim.
Read more: Using Basic Function Elements (page 248); Script Elements (page
803); Solving Convolution Integrals (page 759); Generating Stochastic Time
Histories (page 768); Using External Application Elements (page 852).
Event Elements Event elements allow you to superimpose the occurrence and effects of discrete
events onto continuously varying systems.
This allows for the realistic simulation of such things as financial transactions,
accidents, system failures, storms, labor strikes and lawsuits.
There are nine elements that can be used to create and react to discrete events.
Seven of these are available under the Events submenu. Two additional
elements are available under the Delays submenu.
Delay Elements Delay elements simulate processes that delay continuous or discrete signals and
flows. That is, their outputs lag their inputs. Therefore, like Stocks, their outputs
are computed based on the historical values of their inputs.
As a result, Delays also impart inertia and memory to a system, and can
internally generate dynamic behavior within a system.
There are four Delay elements in GoldSim: Material Delays delay continuous
flows of material; Information Delays delay continuous flows of information;
Event and Discrete Change Delays delay discrete signals.
Read more: Using Delay Elements (page 291); Chapter 5: Simulating Discrete
Events (page 319).
Result Elements Result elements provide a convenient way to collect, analyze and display results.
While you can look at the results associated with any element by finding the
element and right-clicking on it, Result elements provide a mechanism for
making key results readily accessible in a location separate from the element
itself.
Read more: Viewing Results (page 122).
GoldSim provides four types of Result elements, one for each of the basic types
of results that can be displayed in GoldSim.
Differentiating The purpose of any dynamic model is to describe the movement, evolution
Between Material and and/or transformation of materials and/or information. Material can be thought
of as “stuff”: things that are tangible, like widgets, water, dirt, buildings or cash.
Information Flow Information is intangible, and represents things like temperature, interest rates,
prices, or a person’s perceptions.
Many models simulate the movement or transformation of materials. A water
resources model simulates the movement of water through a system. A financial
model simulates the movement and transformation of assets (e.g., cash,
property) within a system. Other models simulate the evolution of information
(e.g., the status of a project, a person’s perception of or degree of belief in
something, the price of a commodity).
Many models simulate both material and information flows. For example, a
supply chain model simulates the movement and transformation of parts and
products (materials) as well as the perceptions of purchasing managers and other
individuals (information).
Although the movement/evolution/transformation of materials and information
within a system are similar in many respects, they have an important difference.
In particular, material is conserved as it moves through a system, while
information generally is not. Treating material and information flows in the
same manner within a model can lead to conceptual and mathematical errors. It
can also add to the complexity (and lack of transparency) in a model.
As a result, GoldSim explicitly distinguishes between the
movement/evolution/transformation of material and information by providing
separate elements that are intended only to operate on a particular type of input.
This ability facilitates the construction of internally-consistent and transparent
models.
GoldSim provides this differentiation for two kinds of elements:
Stocks: GoldSim provides two basic Stock elements. Reservoirs are
intended to integrate/accumulate material flows, and represent things such
as reservoirs of water, account balances, and inventories. Integrators are
intended to simply integrate information. For example, integrating a time
series of the velocity of a projectile using an Integrator would yield the
distance that the projectile had traveled.
Delays: GoldSim provides two Delay elements for delaying continuous
signals. Material Delays are intended to accept flows of material (e.g.,
gal/day or $/yr), and conserve the material in transit, outputting a flow. An
Information Delay element accepts any kind of signal (which is generally
not a flow), and does not enforce conservation of the signal.
While building your models, you should think carefully about whether you are
operating on material or information, and use the appropriate element. As a
Note: Even though their value is not necessarily conserved (e.g., due to currency
fluctuations or fluctuating market values), cash and other assets such as stocks
should always be thought of as materials (since they represent quantities of bills
or shares, which are conserved). That is, the quantity of shares that you own is a
material; the value of those shares is information.
Data Elements Data elements are intended to represent the constant inputs in your model.
A Data element can represent both values and conditions (i.e., True/False), and
can represent a single scalar datum, or an array of data.
As can be seen, the dialog is very simple. Other than the ID, Description and
Display Units, the Data element property dialog has only a single input field
(labeled Definition). Because Data elements are meant to represent constants in
your model, typically you will enter a number into this field. (The field does,
however, accept expressions.)
If you specify that the output of the Data element is a vector or a matrix, the
dialog will be slightly modified (in order to allow you to define the members of
the array). Instead of displaying an input field, it displays a button for defining
the array:
Note: Although you can enter expressions (with links) into the Definition field
for a Data element, it is generally recommended that you only enter numbers in
this field (and use an Expression element when you need to define equations
with links to other elements). Doing so helps to make your models more
transparent, since the Data symbol will visually indicate to anyone viewing the
model that the element represents a constant.
Data elements have a single output, which can be a value or a condition, and can
be specified as a scalar, a vector or a matrix. You can specify these attributes by
pressing the Type… button. By default, a new Data element is a scalar,
dimensionless value.
Data elements also have a Data Source field,that allows you to download data
directly from an ODBC-compliant database.
Read more: Linking Elements to a Database (page 972).
If you are using GoldSim’s advanced scenario feature, and have defined at least
one scenario, Data elements include an additional field that allow you to define
the element as Scenario Data:
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).
Stochastic Elements Stochastic elements allow you to explicitly represent uncertainty in the input
data for your model. GoldSim uses the Monte Carlo method to sample
Stochastic elements in order to carry out probabilistic simulations.
The probabilistic simulation techniques used by GoldSim are discussed in
general terms in Appendix A "Introduction to Probabilistic Simulation". If you
are unfamiliar with probabilistic modeling, you should read this appendix before
using a Stochastic element.
The dialog for a Stochastic element looks like this:
The Edit… button is used to define the distribution type and specify its
parameters. The two Mode radio buttons are used to control when a Stochastic
element is sampled.
The More button expands the dialog to provide access to a number of advanced
features:
Note: The More button becomes a Less button when the dialog is expanded. If
any of these options are selected, the Less button is removed (the dialog remains
expanded) the next time you open it.
The first three outputs of Stochastic elements are always scalar or vector values
(unless the Stochastic is defined as a Boolean, in which case the primary output
is a condition). By default, a new Stochastic element is dimensionless. You
specify the dimensions (display units) of the primary output of a Stochastic
element in the Display Units field. The dimensions of the Probability_Density
output are the inverse of those of the primary output (e.g., if the primary output
has units of meters, the Probability_Density has units of inverse meters). The
Cumulative_Probability output is dimensionless.
The fourth output of a Stochastic element (Distribution) is a complex output that
represents all the statistical information necessary to define a probability
distribution. It can only be used in several specialized locations (e.g., SubModel
Interface, inputs to specialized distribution functions, inputs for an Externally-
defined distribution, specialized input to Timed Events and Event Delays). It can
also be viewed directly in a Distribution Result display in order to display the
analytical form of the distribution.
Read more: Creating the Input Interface to a SubModel (page 921); Specialized
Functions that Operate on Distributions (page 183); Externally-Defined
Distribution (page 168); Timed Event Elements (page 333); Modeling Event
Delays with Dispersion (page 348); Add a Distribution Output to a Distribution
Result.
You can save the results for a Stochastic element by clicking Final Values
and/or Time Histories in the properties dialog. Checking one of these causes all
three outputs to be saved as results. If 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 on or off one or more of the three outputs. In this case,
the checkbox in the properties dialog will 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 by right-clicking anywhere in the browser.
Stochastic elements are discussed in detail in the sections below.
Specifying the The Edit … button on the Stochastic dialog accesses a dialog for specifying the
Distribution for a probability distribution defining the element.
Stochastic Element
The first field in the upper left-hand corner of the dialog contains a list of all of
the distributions provided by GoldSim.
Directly below this field, you enter the parameters defining the selected
distribution (the parameters differ depending on the distribution type). These can
be constants, links or expressions.
The statistics for the distribution (Mean, Standard Deviation, Skewness, and
Kurtosis) are shown directly below the distribution's parameters. The
significance of these four statistics is described in Appendix A, "Introduction to
Probabilistic Simulation".
The Percentile button displays the percentiles of the distribution:
Percentile button
The Calculator section of the dialog 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 toolbar at the top of the dialog is used to control the distribution plot. The
functions of the various buttons are as follows:
Button Action
Exit the dialog.
Export (inactive and grayed out for the preview; only available when
viewing a full chart).
Copy the preview to the clipboard (as a bitmap).
Button Action
Print (inactive and grayed out for the preview; only available when
viewing a full chart).
Edit the appearance of the preview. This will display a dialog for
modifying the appearance of the preview.
Specify the scales and the type (log or linear) for the X and Y-axes. If the
"Auto" button is checked (the default), GoldSim will automatically set the scale.
Note that if Fill Area is checked below the preview, the area below the
PDF line is filled in (this applies to CDF and CCDF previews also).
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.
Button Action
Display the preview as a CCDF (complementary cumulative distribution
function):
Display a full chart of the distribution. (You can also display the full
chart by double-clicking on the preview or pressing Ctrl+Shft+T).
(When viewing the full chart, pressing the button again returns to the
Distribution dialog.) A full chart can be customized to a much
greater degree than a preview chart (e.g., you can add headers and
footers; axis labels, etc.).
Read more: Viewing a Distribution Chart (page 604).
Note: You can toggle through the three types of distribution displays (PDF,
CDF, CCDF) using the PgUp and PgDn keys.
Stochastic Distribution The types of probability distributions supplied by GoldSim are summarized
Types below:
Distribution Type
Beta
Generalized Beta
BetaPERT
Binomial
Boolean
Cumulative (and log-
Cumulative)
Discrete
Exponential
Externally-defined
Extreme Probability
Extreme Value
Gamma
Log-Normal
Negative Binomial
Normal
Pareto
Distribution Type
Pearson Type III
Poisson
Sampled Results
Student’s t
Triangular (and log-
Triangular)
Uniform (and log-Uniform)
Weibull
The fields that appear in the Parameters section of the dialog will change with
the distribution type. As a general rule, you should not specify the parameters of
a distribution as a function of time, since GoldSim does automatically resample
the distribution unless you specifically instruct GoldSim to do so.
Read more: Controlling When a Stochastic Element is Sampled (page 178).
The required inputs for each of the distributions types are summarized below.
An example file which uses all of the Stochastic elements
(StochasticDistributions.gsm) is in the General Examples/Stochastic folder in
your GoldSim directory. The mathematical details of each of the distributions
are provided in Appendix B.
Beta Distribution The Beta distribution is a continuous distribution used to represent the
uncertainty in the probability of occurrence of an event given some data
regarding observations of the event occurrence in previous experiments. As
such, the Beta distribution represents the probability distribution of a frequency,
and therefore always ranges between 0 and 1.
It is defined by specifying results of an experiment or a number of trials (e.g., a
coin flip) in terms of Number of Successes and Number of Failures:
Both inputs must be positive values. The displayed distribution represents the
underlying probability of a Success. For example, in the screen shown above, if
we define Success as heads on a coin flip, and Failure as tails, the distribution
represents the uncertainty in the probability of obtaining heads on the next flip
of the coin. If the number of trials is small, the uncertainty is high. As the
number of trials increases, the uncertainty in the outcome decreases (and in the
example of a coin flip, if the coin is unbiased, the probability of heads would
collapse to 0.5).
Generalized Beta The Generalized Beta distribution provides a flexible way to specify a
Distribution probability distribution over a particular range (i.e., with a specified minimum
and maximum). It is commonly used within project management simulations to
represent the time to complete a task.
It is defined by specifying a Mean, Standard Deviation, Minimum and
Maximum:
Note: The theoretical maximum standard deviation (SD) for a beta distribution
(ranging from 0 to 1) is equal to sqrt[mean*(1-mean)]. However, with such a
high SD, the beta distribution would have a “spike” of probability density at
both its upper and lower bounds. With a somewhat lower SD, there will only be
a spike at the limit closest to the mean. GoldSim restricts the SD to 0.6 of the
maximum theoretical value in order to avoid having any spikes in the density
function. If you need probability distributions that combine discrete spikes with
continuous curves, you should construct this explicitly (by combining multiple
distributions using an Expression, or by using a Cumulative distribution.
Alternatively, if you check the 10% / 90% checkbox, you can specify the 10th
percentile, Most Likely and 90th percentile.
Read more: Generalized Beta Distribution (page 163).
Binomial Distribution The Binomial distribution describes the probability of a certain number of
instances, given a (dimensionless) batch size and a probability of occurrence. As
such, by definition, a Binomial distribution is dimensionless.
For example, you could use a Binomial distribution to define a probability
distribution for the number of defective widgets produced, given a particular
batch size (e.g., 10) and the probability of any given widget being defective
(e.g., 0.05).
It requires two inputs, the Batch Size (which should be an integer) and the
Probability. Like the Poisson distribution, it is a discrete distribution containing
only integer numbers.
Boolean Distribution The Boolean distribution takes on one of two values: True or False. It requires a
single input, Probability of True. It is useful for representing binary systems
which have a given probability (e.g., flipping a coin):
Note that when plotted, GoldSim shows a True condition as 1, and a False
condition as 0.
Cumulative Distribution The Cumulative distribution is used to define custom continuous distributions.
You define the distribution by specifying [cumulative probability, value] pairs.
A given pair (defined by a Prob. Level and a Value) implies that the cumulative
probability of the Value is equal to the specified Prob. Level:
In this example, the cumulative probability of the value being less than or equal to 4 is 90%.
You add and remove pairs using the Add and Remove buttons (new pairs are
inserted below the selected pair). In addition, if you place the cursor in the grid,
the following hotkeys can be used:
Keys Action
Ctrl+Enter creates a new row below the cursor
Ctrl+Shift+Enter creates a new row above the cursor
Ctrl+Backspace deletes the current row
By definition, the first cumulative probability specified must be 0 and the last
cumulative probability specified must be 1. The Prob. Level and the Value of
the pairs cannot decrease as you move downward through the list. If the Prob.
Levels decrease as you move down the table, GoldSim will sort the rows so that
they are in increasing order when you close the dialog or press Apply. If the
Values decrease as you move downward, GoldSim will warn you and ask you to
fix the distribution.
Note: Specifying two or more Prob Levels with the same number results in a
horizontal line in the CDF. Specifying two or more Values with the same
number results in a vertical line in the CDF (and an infinite spike in the PDF).
You can also define the distribution as a log-cumulative (by checking the Log
box). Whereas in a cumulative distribution, the density between values is
constant (i.e., the distribution between values is uniform), in a log-cumulative,
the density of the log of the value is constant (i.e., the distribution between
values is log-uniform). If Log is checked, all Values for the distribution must be
positive. Log-Cumulative distributions are often applied to quantities with large
(order-of-magnitude) uncertainties.
Note: The values and cumulative probabilities must be entered as numbers and
cannot be specified using links or expressions. The values are assumed to be
entered in the Display Units for the element (which are displayed in the header
for the editing grid).
Note: You can copy and paste the entries for a Cumulative distribution from a
spreadsheet. To do so, select the two columns in the spreadsheet (Probability
Level and Value), and copy them to the clipboard. Then place the cursor in the
upper left-hand corner of the grid (i.e., the first Probability Level) and paste (by
pressing Ctrl+V).
Discrete Distribution A Discrete distribution is used to specify a discrete (as opposed to continuous)
probability density function. In a Discrete distribution, probabilities are assigned
to discrete values. The probability of a value between the specified values is
zero.
You define the distribution by specifying [probability, value] pairs. A given pair
(defined by a Probability and a Value) implies that the probability of the Value
is equal to the specified Probability:
You add and remove pairs using the Add and Remove buttons (new pairs are
inserted below the selected pair). In addition, if you place the cursor in the grid,
the following hotkeys can be used:
Keys Action
Ctrl+Enter creates a new row below the cursor
Ctrl+Shift+Enter creates a new row above the cursor
Ctrl+Backspace deletes the current row
By definition, the probabilities must sum to one. The Values do not need to be
in any particular order (GoldSim will automatically sort them in increasing order
when the data is applied). However, if the Probabilities do not sum to one,
GoldSim will warn you and ask you to fix the distribution.
Note: The values and probabilities must be entered as numbers and cannot be
specified using links or expressions. The values are assumed to be entered in the
Display Units for the element (which are displayed in the header for the editing
grid).
Note: You can copy and paste the entries for a Discrete distribution from a
spreadsheet. To do so, select the two columns in the spreadsheet (Probability
and Value), and copy them to the clipboard. Then place the cursor in the upper
left-hand corner of the grid (i.e., the first Probability) and paste (by pressing
Ctrl+V).
The input must be a positive value. The displayed distribution represents the
probability of the maximum or minimum value corresponding to a particular
probability level given a specified number of samples. For example, in the
screen shown above, the distribution represents the uncertainty in the probability
level of the maximum value assuming 15 samples. It indicates that the expected
value of the maximum probability level is 0.9375.
Extreme Value The Extreme Value distribution (also referred to as the Gumbel distribution) is a
Distribution continuous distribution used to describe the maximum (or the minimum)
observed values for a variable. For example, you could use this distribution to
specify the probability of the maximum flow rate in a river in a particular year
by fitting a list of the maximum values observed for each of the past 25 years to
this distribution. It is therefore commonly used to predict the chance of extreme
events such as earthquakes or floods.
It is defined by specifying two parameters: a Location parameter and a Scale
parameter. You must also specify whether you are interested in the Maximum
value or the Minimum value:
Gamma Distribution The Gamma distribution is similar to a Log-Normal, but is less positively-
skewed. Because it mathematically represents the time required for the
occurrence of a specified number of Poisson events, it is often used to represent
the time required to complete a particular task or reach a particular milestone. It
is defined by a Mean and a Standard Deviation:
Note: If the Mean and Standard Deviation are identical, the Gamma distribution
collapses to an exponential distribution.
Negative Binomial The Negative Binomial distribution describes the distribution of the number of
Distribution failures in order to achieve a specified number of successes, with a specified
probability of success for each attempt. It is frequently used in actuarial models.
The distribution requires two inputs, the Number of Successes (which must be a
dimensionless positive integer) and the Probability of Success. Like the
Poisson distribution, the Negative Binomial is a discrete distribution consisting
of only integer values.
Normal Distribution The Normal distribution is perhaps the most commonly used probability
distribution. It can be used, for example, to represent uncertainties resulting
from unbiased measurement error, and (because of the central limit theorem)
the value of a sum of other variables.
The Normal distribution is defined by a Mean and a Standard Deviation.
GoldSim also allows you to truncate the distribution by checking the Truncated
box and specifying a Minimum and a Maximum:
Pareto Distribution The Pareto distribution is a continuous, long-tailed distribution that is commonly
used to model traffic patterns in network modeling, the size of insurance claims,
and income levels in economic modeling.
It requires two inputs, a shape parameter (a) and a scale parameter (b), which
defines the lower bound and mode of the Pareto distribution. Both of these
parameters must be positive numbers.
GoldSim also allows you to truncate the distribution by checking the Truncated
box and specifying a Maximum.
Pearson Type III The Pearson Type III distribution is a continuous distribution that is used for
Distribution representing skewed observations. It is widely used in hydrological applications
(often for the log of the underlying variable, such as a flood flow).
It is defined by specifying three parameters: a Location parameter, a Scale
parameter, and a Shape parameter:
Poisson Distribution The Poisson distribution is used to represent the number of occurrences or
instances of a particular event (e.g., number of storms during a year, number of
defects in a length of a pipe).
It is a discrete distribution containing only integer numbers. It is defined by a
single value, the Expected Value of the number of occurrences or instances
(which must be positive):
Sampled Results The Sampled Results distribution provides a flexible way to create a non-
Distribution parametric distribution using a list of sampled (observed) results. GoldSim
generates a CDF by sorting the observations and assuming that a cumulative
probability of 1/(Number of Observations) exists between each data point. If
there are multiple data points at the same value, a discrete probability equal to
N/(Number of Observations) is applied at the value, where N is equal to the
number of identical observations.
In addition to providing the list of observations, you also specify whether or not
GoldSim should extrapolate at the ends of the data set. If the Extrapolation
option is cleared, a discrete probability of 1/(2*Number of observations) is
assigned to the minimum and maximum values. When the Extrapolation option
is selected, GoldSim extends the generated CDF to cumulative probability levels
of 0 and 1 by extrapolating existing observations.
A simple example (using 50 data points) is shown below:
Typically, a Sampled Results distribution would only be used with a fairly large
number of data points (50 or more). With fewer data points, in most cases, it
would be more appropriate to fit the data to a known parametric distribution.
Note: You can copy and paste the entries for a Sampled Results distribution
from a spreadsheet. To do so, select the column of data points in the
spreadsheet, and copy them to the clipboard. Then place the cursor in the first
field in the GoldSim dialog, and paste (by pressing Ctrl+V).
Student’s t Distribution The Student’s-t distribution is most commonly used to represent the distribution
of an uncertain population mean, given a sample mean and standard deviation.
It is characterized by one parameter, the number of degrees of freedom, which
equals the number of samples minus one. The t distribution is symmetric.
The t distribution is often used as follows:
sx
p(μ X t c )c
n
where:
μ = the population mean;
X = the sample mean;
tc = the t-distribution for n-1 degrees of freedom, at a cumulative value of c;
sx = the sample standard deviation;
n = the number of samples; and
c = the desired confidence level.
Triangular Distribution The Triangular distribution is useful in situations where you may have little
information about a value, but can provide upper and lower bounds, as well as a
"best guess" or most likely value. By default, it is defined by specifying either a
Minimum (0th percentile), Most Likely and Maximum (100th percentile):
Alternatively, if you check the 10% / 90% checkbox, you can specify the 10th
percentile, Most Likely and 90th percentile.
You can also specify that the logarithms of the values have a triangular
distribution (by checking the Log box). In this case, all inputs to the distribution
must be positive values. Note that for a Log-Triangular distribution, the Most
Likely input represents the value whose logarithm is most likely. Log-Triangular
distributions are often applied to quantities with large (order-of-magnitude)
uncertainties.
Uniform Distribution The Uniform distribution is useful for defining quantities that vary uniformly
between two values. You enter a Minimum and a Maximum:
You can also specify that rather than the values being uniformly distributed, the
logarithms of the values are uniformly distributed (by checking the Log box). In
this case, the Minimum and Maximum must be positive values. Log-Uniform
distributions are often applied to quantities with large (order-of-magnitude)
uncertainties.
Controlling When a By default, Stochastic elements are sampled once per realization (typically at the
Stochastic Element is beginning). Hence, if you specify the parameters describing a Stochastic as a
Sampled function of time, unlike other GoldSim elements, Stochastic elements are not
updated (resampled) if the parameters change.
GoldSim does provide a mechanism, however, to force a Stochastic to either 1)
be sampled at a specified time; or 2) be resampled multiple times during a
simulation. In particular, you can define one or more triggers for the Stochastic
which specify when (or under what circumstances) the Stochastic is resampled.
How a Stochastic is resampled is controlled by the Mode specified on the
dialog:
Conditional Containers can also be used to control when Stochastic elements are
resampled.
Read more: Using Conditional Containers (page 841).
An example file which illustrates how a Stochastic is sampled
(StochasticBasics.gsm) is in the General Examples/Stochastic folder in your
GoldSim directory
Correlating Stochastic Frequently, parameters describing a system will be correlated (inter-dependent)
Elements 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 independent of each other).
The preferred method to represent a correlation is to explicitly model the cause
of a dependency. For example, the height and weight of children are correlated
primarily due to a common dependency on age (both increase with age). In such
a situation, the best way to represent this correlation would be to explicitly
define the mean and standard deviation of the height and the weight as functions
of the primary parameter causing the dependency (age).
In many cases, however, specifying such a dependency may be difficult.
Therefore, GoldSim provides a mechanism to specify a statistical correlation.
To do so, you must use the Correlation section of the Stochastic dialog (accessed
via the More button). You will note that in that section, GoldSim provides three
options for correlation:
C2 = exp[ln(C1) * (DT2/DT1)]
where C1 is the coefficient for sampling period DT1, and C2 is the coefficient
for sampling period DT2. Note that if you are resampling every timestep
(OnChanged Etime), and need to compute an appropriate value for C2, DT2
should be specified as Timestep_Length (as it may change during the
simulation).
The above discussion relates to correlating Stochastics that are defined as
scalars. Stochastics can also be defined as vectors (arrays), and in that case, it is
possible to specify a correlation matrix to define how the items of the vector are
correlated. Stochastic vectors cannot be autocorrelated. They can be correlated
to other vectors (in which chase the correlation is term-by-term) or to scalars.
Read more: Creating a Stochastic Vector (page 184).
An example file which illustrates correlation of Stochastics
(StochasticCorrelation.gsm) is in the General Examples/Stochastic folder in
your GoldSim directory
Specifying a In some cases, you will want to run a deterministic simulation (i.e., a single
Deterministic Value for realization which does not try to represent the uncertainty in inputs), even
a Stochastic though the model contains some Stochastic elements. For these kinds of
simulations, it is necessary to specify the value that a Stochastic element takes
on during the simulation.
In order to run a deterministic simulation, you must open the Simulation
Settings dialog, go to the Monte Carlo tab, and select the Deterministic
Simulation radio button.
Read more: Deterministic Simulation Options (page 442).
For each Stochastic, you must then define the Deterministic Value to be used
when a deterministic simulation is carried out:
To access this portion of the dialog, you may need to press the More button on the
Stochastic dialog.
The default is for the mean (expected) value of the Stochastic to be used as the
Deterministic Value. By pressing the Define… button, however, you can specify
other values:
The other options are to use the median value, use a specified quantile (e.g.,
0.95), or to use a specified value (e.g., 3.7 m).
If you select one of the first three options in the dialog, you can choose to apply
the selection to all Stochastics in the model (by checking the Apply to all
Stochastic elements box).
If you select the fourth option (a specified value), you must specify the units
when you enter the value.
Within the Simulation Settings dialog, when running a deterministic simulation,
you can choose to use these individually specified deterministic values, or
override them all and use the mean or a specified quantile.
Note: When you define a specified value, GoldSim remembers it, so that if you
switch to a mean value, a median value or a quantile, and then switch back to a
specified value, GoldSim retains that value (and you do not have to enter it
again).
Note: A specified value can be outside the defined range of the distribution.
Applying Importance For risk analyses, it is frequently necessary to evaluate the low-probability,
Sampling to a high-consequence end of the distribution of the performance of the system.
Stochastic Element Because the models for such systems are often complex (and hence need
significant computer time to simulate), 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.
To facilitate these type of analyses, GoldSim allows you to utilize an
importance sampling algorithm to modify the conventional Monte Carlo
approach so that the tails of distributions (which could correspond to high-
consequence, low-probability outcomes) are sampled with an enhanced
frequency. During the analysis of the results that are generated, the biasing
effects of the importance sampling are reversed. The result is high-resolution
development of the high-consequence, low-probability "tails" of the
consequences, without paying a high computational price.
Importance sampling is specified by selecting an option from the Importance
Sampling button (the default is “None”):
If you select “High-End”, GoldSim will preferentially bias toward the high end
of the distribution; if you select “Low-End”, it will preferentially bias toward the
low end of the distribution.
It is important to understand that you should use importance sampling sparingly
(i.e., only for those elements that really need it). This is because the degree of
biasing for distribution tails that GoldSim can apply decreases with the number
of elements for which importance sampling is applied.
The importance sampling algorithm is discussed in detail in Appendix B.
Note: In addition to the importance sampling method described here (in which
you can choose to force importance sampling on either the low end or high end
of a Stochastic element’s range), GoldSim also provides an advanced feature
that supports custom importance sampling that can be applied over user-defined
regions of the Stochastic element’s range.
greatest 100(1 - P)% of outcomes. The output has the same dimensions as
the distribution being referenced.
Note: In some cases, GoldSim cannot compute a direct solution for a statistic
(e.g., computing the standard deviation for a truncated Weibull). In this case,
the function returns an error.
Creating a Stochastic GoldSim allows you to define a Stochastic element as a vector of data. If you
Vector define your element as a vector, rather than inputting a single probability
distribution, you specify a set of distribution parameters (one for each item of
the vector).
Read more: Using Vectors and Matrices (page 726).
To define your element as a vector, press the Type… button on the dialog. The
following dialog will appear:
From the Order drop-list select “Vector (1-D Array)”. You will then need to
specify a set of Row Labels.
Read more: Understanding Array Labels (page 727).
If you specify the Stochastic as a vector, the dialog for defining the distribution
(accessed via the Edit Distribution… button) will look similar to this:
This dialog is identical to the standard dialog for a scalar Stochastic, with two
exceptions:
The input fields for the parameters for the distribution must be vectors.
Hence, when you create a Stochastic vector, all of the items of the
vector have the same distribution type, but may have different values
for the input parameters for the distribution.
You view the distribution and the statistics for a particular item of the
vector by selecting the item from the drop-down list at the top of the
dialog (immediately to the right of the distribution type).
term. If the other Stochastic is a scalar, all terms are correlate to the scalar
value.
You can also specify correlations between members of the vector via a
correlation matrix. A correlation matrix specifies the correlations between
variables, and generally has the following form:
This button provides access to a dialog for specifying the correlation matrix:
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 have specified a quantile or a specified value for the Deterministic
Value, this also appears as an input in the browser. In addition, if the Stochastic
is explicitly triggered, a number of additional inputs related to triggering also
appear.
Note: Time Series elements are for time series that are known in advance of the
simulation. If you want to generate random (stochastic) histories during your
simulation, you should use a History Generator element instead.
Note: A number of advanced options are initially hidden by the More button.
Each of these steps, as well as some example files and advanced options, are
described below.
Read more: Using a Time Series Element to Record and Play Back a History
(page 222).
Several files are provided within the TimeSeries subfolder of the General
Examples folder of your GoldSim directory that include examples on the use of
Time Series elements.
Defining the Data The first step involved in defining a Time Series element is to define the data
Type and Units for a type and units for the time series.
Time Series Units are specified in the Display Units field. This defines the dimensions of the
input and primary output. By default, a Time Series is dimensionless.
Like all GoldSim elements, the data type is specified by pressing the Type…
button.
In most applications, your time series will represent a set of scalar values (one
value at each specified time point). Because this is the default, in most
situations, there is no need to edit the Type.
If you do press the Type… button, the following dialog is displayed:
The Type can be defined as a Value (the default) or a series of Discrete Change
Signals.
Read more: Generating Discrete Changes Using Time Series Elements (page
379).
The Order can be defined as a Scalar (the default), a vector or a matrix.
Defining time series of vectors or matrices (i.e., in which each time point is
defined in terms of an array of data, rather than just a single datum) is useful in
some situations (e.g., defining a time series for the concentrations of a set of
chemicals, or the prices for a set of securities).
Read more: Specifying Time Series Data as Vectors or Matrices (page 200).
After the data type and units are defined, the next step is to define the source of
the input data for the Time Series.
Specifying the Time Series elements can be defined in four ways. The two most common ways
Source of the Input to define a Time Series are as follows:
Data for a Time You can define the series locally by entering the data directly; or
Series You can import the data by linking to a spreadsheet.
In addition, GoldSim provides two advanced options for defining Time Series
elements:
You can read the output of any other element in GoldSim, and "record"
the results, and then "play them back" in a subsequent run of the model.
Among other applications, this can be used to plot and compare the
results of multiple simulations.
You can link to a "time series definition" that was output by another
Time Series element within an embedded SubModel or from an
external function (a DLL). The primary application of this advanced
option is to transfer time series between SubModels.
Read more: Using SubModels to Embed Models Within Models (page
914).
The way that the input data are defined is specified in the Data Source drop-list:
Locally defined data. This is the default. You enter the data directly into a
table using the Edit Data button.
Read more: Viewing and Editing Time Series Inputs (page 192).
Imported from MS-Excel Spreadsheet. You import the data from an
Excel spreadsheet. When you select this option, a new tab appears (Excel)
from which you can specify the spreadsheet filename and other required
information. You can import the data immediately, or wait until the
simulation begins (the data will always be automatically imported when you
start a simulation). The View Data button allows you to view the imported
data (it cannot be edited unless you switch back to "Locally defined data").
Read more: Importing Data into a Time Series from a Spreadsheet (page
194).
Linked to external Time Series Definition. In this advanced option, you
read a "time series definition" that was output by another Time Series
element (within a separate SubModel) or from an external element. When
you select this option, a new tab appears (Linked) from which you specify
the link from the other element.
Read more: Referencing a Time Series Definition Output (page 226).
Recording output history. In this advanced option, you can select an
output of any other element in GoldSim, and "record" the results (in order to
"play them back" in a subsequent run of the model). When you select this
option, a new tab appears (Recording) from which you specify the link
from the other element, as well as several additional options regarding how
the output is recorded.
Read more: Using a Time Series Element to Record and Play Back a
History (page 222).
After specifying the source of the input data for the Time Series, the next step is
to specify what the input to the Time Series represents.
The input to a Time Series element is always a set of time series records (i.e., a
Specifying What the table consisting of time/value pairs). However, since a time series can represent
Input to a Time Series several different kinds of data (e.g., values, rates), the first step in defining a
Represents Time Series element (prior to actually defining the records) is to specify what
these records represent. GoldSim provides several different ways for you to
define the inputs to Time Series elements.
In particular, you can specify the input to a Time Series as representing one of
six kinds of data:
The instantaneous value of a variable at specified times: Examples include
the price of a commodity (e.g., gold), the price of an asset (e.g., a stock), or
the height of a projectile.
Read more: Example: Time Series Inputs Represent Instantaneous Values
(page 205).
The constant value of a variable over the next time interval or the
constant value of a variable over the previous time interval. In some
cases, a value is assumed to be constant over a specified interval (i.e.,
follow a "stair-step" function from interval to interval). In some instances,
this may reflect the fact that the variable actually is held constant over each
interval. In other cases, it may be an artifact of how the data was recorded
(e.g., it may have only been recorded in terms of an average value over the
interval). GoldSim provides two options for entering this kind of data (one
is forward-looking, and one is backward-looking).
Read more: Example: Time Series Inputs Represent Constant Values Over
Specified Intervals (page 207).
The (uniform) change (increment) in a variable over the next time interval
or the (uniform) change (increment) in a variable over the previous time
interval: These options are usually used to output cumulative values (e.g.,
cumulative sales, cumulative rainfall) and/or rates (e.g., sales rates, rainfall
rates) that are specified by defining incremental changes in a variable (e.g.,
monthly sales, monthly rainfall) over specified intervals. When this option
is selected, the Primary Output of the Time Series is not the specified time
series itself; rather, it is the cumulative value of the variable at each point
in the simulation (assuming that the specified changes occur uniformly over
each interval).
Good examples of this type of time series data are rainfall and sales rates. In
these cases, what is actually measured and recorded are totals (e.g., rainfall
in mm or sales in $) over a particular interval (e.g., 31 days). Based on this
data, you could then use GoldSim to compute the cumulative rainfall and
sales (over the entire simulation), as well as the average daily rainfall or
sales rate for each interval (e.g., month). GoldSim assumes that the variable
(e.g., cumulative rainfall or sales) changes uniformly over the time period,
which means that the rate of change is constant over the interval (i.e., it
"stair-steps"). GoldSim provides two options for entering this kind of data
(one is forward-looking, and one is backward-looking).
Read more: Example: Time Series Inputs Represent Changes Over
Specified Intervals (page 209).
Discrete changes to a variable at specified times. In some cases, your time
series may not represent the current value of a variable, but a series of
discrete changes (additions and subtractions) to a variable. An example of
this kind of time series would be product price increases and decreases that
happen discretely (e.g., once a month). Note that this option is only
available if the Data Type has been defined as a Discrete Change Signal
with an Add instruction.
Read more: Example: Time Series Inputs Represent Discrete Changes
(page 212); Defining the Data Type and Units for a Time Series (page 189).
Prior to defining the time series records, you must select one of these four
options from the drop-list labeled Represents.
After specifying what the input to the Time Series represents, the next step is to
define the actual Time Series input data.
Viewing and Editing The data for your time series are viewed and edited by pressing the Edit Data…
Time Series Inputs (or, in some cases, the View Data… button) in the main Time Series dialog.
When you press the Edit Data…(or View Data…) button, the following dialog
is displayed:
Note: Time series data can only be edited if the Data Source is defined as
"Locally defined data". If any other Data Source is specified, the data can only
be viewed (and cannot be directly edited) in this dialog.
You can enter an optional Description at the bottom of the dialog to help
document the time series data.
If you are defining the data locally, you can add rows to the table using the Add
Row button. If you hold down the Ctrl key when you press this button, you will
Add Row button be prompted for the number of rows to add (otherwise, a single row will be
added).
You can also add rows by pasting in a block of data from the Windows
clipboard.
To delete one or more rows, select them and press the Remove Row button. If
you hold down the Shft key when you press this button, all of the rows from the
Remove Row button selected row to the bottom will be deleted).
All shortcut keys for editing the time series table are summarized below:
or Ctrl+
Shift+Ctrl+Tab Insert new row above active cell
Delete row containing active cell or all currently
Ctrl+Backspace or Ctrl+ selected rows
Note: When you press OK to close the dialog, GoldSim deletes all blank rows
(rows in which the time value and data value are not defined).
The fields in the table only accept numbers (they do not accept links). Moreover,
you should not append units to the numbers.
The time entries can be entered either as numbers or as dates. If your
Simulation Settings are set to Elapsed Time when you insert the element, they
default to being entered as numbers; if your Simulation Settings are set to Date-
Time when you insert the element, they default to being entered as dates.
However, you can override the default setting by changing the selection in the
Time Unit field.
Read more: Entering Time Series Data as Dates or Elapsed Times (page 198).
If time entries are entered as numbers, the assumed units for the time column are
defined in the Time unit field. (This field defaults to the Time Display Units
specified in the Time tab of Simulation Settings dialog.)
You can enter time in seconds, minutes, hours, days, weeks, months or years:
Note: Because month and year do not represent a constant period of time (the
length of these units changes depending on the month or the year), GoldSim
assumes that each of these units is defined by their average value. In particular,
one year is assumed to consist of 365.25 days, and one month is assumed to
consist of 30.4375 days (365.25/12).
If you select "Calendar Time" from the Specify time unit field, time entries are
entered as dates. The date format that is expected is determined by the Windows
settings for your machine. A typical setting might be MM/DD/YYYY
HH:MM:SS. (To change these settings, go to Control Panel and edit the
Regional Options.)
The assumed units for the data are the Display Units specified on the main Time
Series dialog. The assumed units are displayed in the column headers.
Note: The values of Time must increase monotonically as you move downward
in the table. If they do not, GoldSim will automatically sort the rows into the
correct order.
Two important rules must be followed when defining time series data:
Unless your input data represent Discrete Changes, the first data point
must be at or prior to the beginning of the simulation. That is, if you
have specified time entries as elapsed times, the first data point must be
0. If you have specified time entries as dates, the first date must be at or
prior to the start time for the simulation.
Unless you are using the Time Shifting feature, if the data is specified
to represent either "Instantaneous value" or "Change over the next time
interval", the last data point must be at or beyond the end of the
simulation. That is, if you have specified time entries as elapsed times,
the last data point must be greater than the simulation duration. If you
have specified time entries as dates, the last date must be at or after the
end time for the simulation.
Read more: Time Shifting Time Series Data (page 215).
If either one of these requirements is not met, GoldSim will issue a fatal error
when you try to run the model.
After you have defined the data and closed the dialog, the number of defined
data points is indicated in the main Time Series dialog.
Importing Data into a You can link a Time Series element directly to a spreadsheet. This allows you
Time Series from a to automatically import data from a spreadsheet at the beginning of each
Spreadsheet simulation.
You link a Time Series element to a spreadsheet by selecting “Imported from
MS-Excel Spreadsheet” from the Data Source field in the Data Definition
portion of the dialog:
When you do so, a new tab (Excel) is added to the dialog that allows you to
define the properties of the spreadsheet link:
You must first enter the name of a Microsoft Excel spreadsheet file 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: GoldSim supports both .xlsx and .xls Excel files. However, if you have an
older version of Excel (prior to Office 2007), you will need to install Microsoft’s
Office Compatibility Pack in order to read .xlsx files. Excel 2007 and later
support an extended worksheet size (1,048,576 rows by 16,384 columns) than
earlier versions (65,536 rows by 256 columns). If you wish to import data from
an extended worksheet range into GoldSim, you must use Excel 2007 or newer,
and the file format must be .xlsx. Note that GoldSim does not officially support
versions of Excel prior to Excel 2003.
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 try to interact with a spreadsheet that is being used by GoldSim during a
simulation, all interaction with the spreadsheet is blocked by GoldSim.
However, under some circumstances this may not be possible and could lead to
errors. Hence, as a general rule, you should not use Excel while a Goldsim
model that references Excel is running.
Warning: Within Excel, a date is stored internally as the number of days (which
can be fractional) since December 31, 1899 00:00:00. When GoldSim imports a
date from Excel, it converts this Julian value to a date. Unfortunately, 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. However, for
dates prior to March 1, 1900, GoldSim and Excel will differ by one day.
After selecting the spreadsheet file, you must specify the direction of the data in
the spreadsheet. That is, the data can be organized into Columns or Rows.
Columns implies that the data exists in the spreadsheet vertically: there is one
column containing all of the time entries with a different time entry for each
row, and another column containing all the value entries with a different value
entry for each row. Rows implies that the data exists in the spreadsheet
horizontally: there is one row containing all of the time entries with a different
time entry for each column, and another row containing all the value entries with
a different value entry for each column.
The time and value data do not need to be contiguous rows or columns in the
spreadsheet. They must, however, either both exist as rows, or both exist as
columns.
You must also specify when GoldSim should stop importing the data. There are
two options:
Read data until first empty time value cell is found. Data is read until an
empty or non-numeric time value cell is encountered.
Read specific number of rows or columns. A specific number of time
value entries are read.
You then specify the location of the data. You do this by specifying the Excel
Sheet and the Start Cell (e.g., A2) for both the series of Elapsed Times and for
Edit Location button
the series of Values. You can do this directly by typing this information into the
Starting Cell field. Alternatively, you can press the Edit Location button
(located at the end of each row in the dialog), which opens the spreadsheet and
provides a dialog allowing you to directly select the desired cell.
Note: GoldSim allows you to define a time series of vector (or matrix) data and
import it from the spreadsheet. If you define your element as a vector (or
matrix), rather than specifying an Excel Sheet and a Start Cell for a single data
value at each time point, you specify these for multiple data values (one for each
item of the vector or matrix).
Read more: Specifying Time Series Data as Vectors or Matrices (page 200).
The row or column of time entries that you import from the spreadsheet can
exist either as numbers or as dates in the spreadsheet. If they are formatted as
dates in the spreadsheet, they will always be imported as dates into the Time
Series element. If they are formatted as numbers in the spreadsheet, they will
always be imported as elapsed time values into the Time Series element. Once
they are imported into the Time Series element, GoldSim provides a mechanism
by which you can convert dates to elapsed times, and vice-versa.
Read more: Entering Time Series Data as Dates or Elapsed Times (page 198).
You must also specify the units in which the time and value entries are
represented in the spreadsheet. Obviously, the time entries must have
dimensions of time. The units for the value entries must have the same
dimension as the Display Units specified in the Time Series dialog (and defaults
to those units).
Read more: Setting the Basic Time Options (page 413).
GoldSim automatically imports data from the spreadsheet at the start of a
simulation if either 1) any of the properties on the Excel tab have been modified;
or 2) the Excel file itself has been changed since the last import. You can also
import data manually at any time prior to running a simulation (e.g., so you can
view it) by pressing the Import Data button in the Excel tab.
Note: If GoldSim cannot find the spreadsheet when you try to run the model but
you have already imported the data previously, it will use the data that was
imported previously and will log a warning message to the Run Log.
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 want to ensure that you do not import data from a spreadsheet that has
been inadvertently edited since you last imported the data, you can choose to
“Lock onto” a spreadsheet file (by checking “Lock onto selected file” from the
Options>> button). If you are locked onto a file, GoldSim will not allow the
simulation to run if the file has been modified in any way (the file is set to read
only when it is locked onto). In order to run a simulation with a changed file,
you must first remove the lock (by clearing “Lock onto selected file” from the
Options>> button).
The example file (TimeSeries_Spreadsheet_Link.gsm) in the TimeSeries
subfolder of the General Examples folder of your GoldSim directory includes an
example of how a Time Series can be imported from a spreadsheet.
Note: When you link a Time Series to a spreadsheet, the Edit Data… button
changes to View Data…. If you press this button to access the dialog
displaying the time series data, you will note that they are no longer editable.
Once you are linked to a spreadsheet in this way, you can not edit the data
manually unless you change Data Source back to “Locally defined data”. When
you do so, GoldSim keeps the imported data and makes it editable.
Note: Spreadsheets cannot be used to import multiple time series. That is, if a
Time Series is linked to a spreadsheet, it can only import a single series.
Importing multiple time series from a spreadsheet into a Time Series element is
not supported.
Read more: Defining Multiple Time Series in a Single Time Series Element
(page 219).
Pasting Data into a You can paste directly from a spreadsheet, Word table or from a comma
Time Series delimited text file into the table of time series data. To paste data from the
Windows clipboard into a table, simply click once in the cell representing the
upper left-hand corner of the region of the table into which you wish to paste the
data, and press Ctrl+V.
When you paste data into a time series table, GoldSim will overwrite any data
existing in the target region, and if necessary, will automatically expand the size
of the table (i.e., add rows) to accommodate all of the data being pasted.
Entering Time Series You can carry out dynamic simulations in one of two ways in GoldSim (this is
Data as Dates or controlled via the Simulation Settings dialog):
Elapsed Times Elapsed Time: In an Elapsed Time simulation (the default), you
specify a Duration and the number of timesteps (and optionally, a Start
date-time). The simulation is tracked in terms of elapsed time from the
point the simulation began.
Date-time: In a Date-time simulation, you enter a Start date-time and
an End date-time, along with the number of timesteps, and the
simulation is tracked in terms of the date-time.
Read more: Setting the Basic Time Options (page 413).
Whether you are carrying out a Date-time simulation or an Elapsed Time
simulation, you can choose whether your time series data is defined in terms of
elapsed time or date-time. If your Simulation Settings are set to Elapsed Time
when you insert the element, they default to being entered as numbers (with the
default Time Unit being the Time Display Units specified in the Time tab of the
Simulation Settings dialog); if your Simulation Settings are set to Date-Time
when you insert the element, they default to being entered as dates.
However, you can override the default setting by changing the selection in the
Time Unit field:
If you select "Calendar Time" from this list, the column expects a date-time to
be entered:
Warning: If you are importing your time series from a spreadsheet, and the time
series is formatted as dates in the spreadsheet, it will always be imported as
dates into the Time Series element (even if Specified time unit is not set to
“Calendar Time”).
Read more: Importing Data into a Time Series from a Spreadsheet (page 194).
The date format that is expected is determined by the Windows settings for your
machine. To change these settings, go to Control Panel and edit the Regional
Options. In the example above, the date-time is specified as MM/DD/YYYY
HH:MM:SS. You can use 12 hour formatting (and must then specify AM or
PM) or use 24 hour formatting. Note that if you omit the hours, minutes, and
seconds, GoldSim assumes 00:00:00 AM (the start of the day).
Note: Time Series elements accept dates between 1 January 100 and 31
December 9999.
Warning: Dates are entered in expressions in a different way than they are
entered into a Time Series element. In particular, in an expression, dates must be
surrounded by quotation marks. This requirement, however, does not apply
when entering dates into Time Series elements.
After entering (or importing) time series in one format or the other, you can
modify the format changing the selection for Specify time unit. If the data are
in Date-time, they will be converted to elapsed time relative to the specified
Start-time in the Simulation Settings dialog. If the data are in elapsed time, they
will be converted to Date-time by adding the elapsed time to the specified Start-
time in the Simulation Settings dialog.
Specifying Time Series GoldSim allows you to define a time series of vector or matrix data. If you
Data as Vectors or define your element as a vector or matrix, rather than inputting a single data
Matrices value for each time point, you specify a set of data values (one for each item of
the vector or matrix) at each time point.
Read more: Using Vectors and Matrices (page 726).
To define your element as a vector, press the Type… button on the dialog. The
following dialog will appear:
From the Order drop-list select “Vector (1-D Array)”. You will then need to
specify a set of Row Labels.
Read more: Understanding Array Labels (page 727).
If you specify the time series as a vector, the dialog for defining the data records
for your time series (accessed via the Edit Data… button) will look similar to
this:
There is one data column for each item of the vector. In this example, the vector
has three items (Gold, Silver, Platinum). Note that each data column is labeled
with the vector’s array labels.
To define your element as a matrix, select “Matrix (2-D Array)” as the Order
when defining the Type. You will then need to specify a set of Row Labels and
a set of Column Labels.
If you specify the time series as a matrix, the dialog for defining the data records
for your time series (accessed via the Edit Data… button) will look similar to
this:
There is one data column for each item of the matrix. In this example, the matrix
has three rows (Gold, Silver, Platinum) and 4 columns (NE, SE, SW, NW).
Hence, there are 12 items (12 data columns). Note that each data column is
labeled with the matrix's array labels (row, column).
The example file (TimeSeries_Array.gsm) in the TimeSeries subfolder of the
General Examples folder of your GoldSim directory includes an example of how
a Time Series can be defined as a vector or a matrix.
Specifying Time After you have defined the time series data (the input), it is necessary to define
Series Outputs what outputs are to be produced by the element. That is, you must specify how
GoldSim should manipulate the time series input data to produce one or more
time series outputs that can subsequently be used in your model.
By default, GoldSim produces a single output, which (if the output is a value, as
opposed to a discrete change) corresponds to the instantaneous value of the
output at each point in time (i.e., at each model timestep), computed by simply
interpolating between the specified data points. In many cases, this will meet
your needs, and there is no reason to modify this.
However, in some cases, you may want to take advantage of some advanced
features of the Time Series element when specifying Time Series outputs. To
access these features, you must press the More button on the Time Series
dialog:
Pressing this button provides access to the following section of the dialog:
The first two options in this section pertain to options for specifying Time Series
outputs.
Because the time series data can be specified at arbitrary time points (that are
unrelated to the timesteps used in the GoldSim model), GoldSim allows you to
specify exactly how the time series will be mapped to timesteps in GoldSim.
GoldSim provides two options for the Primary Output:
Note: If your input data represents Discrete Changes (i.e., the data Type has
been defined as a Discrete Change Signal, rather than a Value), the only option
available for the Primary Output is "Discrete Change". In this case, the element
will generate Discrete Change Signals with an Add instruction at the specified
time points (and independent of the scheduled timesteps).
Read more: Example: Time Series Inputs Represent Discrete Changes (page
212); Defining the Data Type and Units for a Time Series (page 189).
In addition to the primary output, you can also choose to produce a secondary
output that represents the Rate of Change of the variable. This is done by
checking the Enable Rate of Change output option:
Note: Because GoldSim computes the Average Value over the next timestep
primary output and the Rate_of_Change secondary output by assuming a
timestep length, and under some circumstances the timestep length could
subsequently be shortened (due to an event), the values that are computed could
contain a slight error. In such a case, GoldSim tracks any error that is incurred,
and corrects for it at the next timestep (in order to ensure conservation of the
variable).
Note: If the input represents an Instantaneous value, and the last data point
corresponds exactly with the end of the simulation, the Rate_of_Change output
drops to zero at the last timestep (since GoldSim cannot compute a "forward
looking" rate of change at that point).
Note: The Rate_of_Change output is not available if your input data represent
Discrete Changes.
Referencing a Time In some situations, you might want to reference a value from a Time Series
Series Using a element at some point in the future or past (as opposed to at the current time in
the simulation). To support this, Time Series elements can be referenced in the
Function way that you would reference a built-in function (like sin or min). That is, once
you define a Time Series, you can reference it in input expressions for other
elements as if it were a function:
This expression instructs GoldSim to use the Time Series defined by the element
named Rainfall and compute its value at time = 35 days. When specifying a
date, you must enclose it in quotation marks. The format for referencing a date is
determined by the Regional and Language time/date settings specified by the
operating system.
Read more: Referencing Dates in Expressions (page 135).
Of course, once you have defined the table, you can reference it at multiple
locations (i.e., in the input fields for various elements) using different input
arguments (different time values) in the same manner as you would use the
built-in functions provided by GoldSim multiple times.
The dimensions of the Time Series function are determined by the Display Units
specified when the Time Series element was defined. Note that if the Time
Series itself is defined as an array, the output of the function is an equivalent
array.
Time Series functions have two arguments (with the second one being optional).
In most cases, you will call the function with only the first argument. The first
argument is the time value. If you omit the second argument, the first argument
is interpreted in the same manner in which the Time Series was defined. Hence,
if the Time Series was defined based on Calendar Time, the first argument is
assumed to be a date. If the Time Series was defined based on Elapsed time, the
first argument is assumed to be an elapsed time.
By using the second argument, you can specifically override the default setting
for how the first argument in interpreted. In particular, if
Second Argument = 1: The first argument is interpreted as a date.
Second Argument = 2: The first argument is interpreted as an elapsed time
from the beginning of the simulation.
Note: If your Time Series is defined as an array, you can use GoldSim’s array
functions to reference a single item from the array. For example, to reference
the value at 4 days for the 3rd item of a Time Series vector named X, you would
use the following expression: getitem(X(4 day), 3).
Time Series In order to gain a better appreciation for how to use Time Series elements, the
Examples manner in which the outputs are computed for each of the four kinds of input
data is described in the sections below, along with an example for each kind of
input. The specific examples mentioned here can be viewed in the file named
TimeSeries_Basic.gsm, which can be found in the TimeSeries subfolder of the
General Examples folder in your GoldSim directory.
Example: Time Series This example illustrates the use of a Time Series where the input data represent
Inputs Represent the instantaneous value of a variable at specified times. This is useful for
Instantaneous Values simulating such things as the price of a commodity (e.g., gold), the price of an
asset (e.g., a stock), or the height of a projectile.
The example can be viewed in the file named TimeSeries_Basic.gsm, which can
be found in the TimeSeries subfolder of the General Examples folder in your
GoldSim directory.
In this example, the input data represent the instantaneous price of a commodity
(e.g., gold) at specified points in time:
Note: If the data are specified to represent an "Instantaneous value", the last data
point must be at or beyond the end of the simulation. That is, if you have
specified time entries as elapsed times, the last data point must be greater than
the simulation duration. If you have specified time entries as dates, the last date
must be equal to or after the end time for the simulation.
This example illustrates the use of a Time Series where the input data represent
Example: Time Series constant values over specified intervals. That is, the data "stair-steps" from
Inputs Represent interval to interval. In some instances, this may reflect the fact that the variable
Constant Values Over actually is held constant over each interval. In other cases, it may be an artifact
Specified Intervals of how the data was recorded (e.g., it may have only been recorded in terms of
an average value over the interval).
The example can be viewed in the file named TimeSeries_Basic.gsm, which can
be found in the TimeSeries subfolder of the General Examples folder in your
GoldSim directory.
In this example, the input data represent the average temperature over specified
time periods:
The Primary Output is computed by assuming that the specified values stay
constant over the time intervals between data points. That is, GoldSim does not
interpolate between the data points. Hence, in this example, between 59 and 90
days, the temperature is assumed to be constant at 10.2 C.
Note: There are two options for representing time series that represent constant
values over specified intervals. You can specify that the data is constant over
the next interval (as specified above), or you can specify that the data is constant
over the previous interval. In the latter case, the data set shown above would
imply that between 59 and 90 days, the temperature is assumed to be constant at
12.1 C. (In order for the two representations to provide the same results, you
would need to shift the data column by one row.)
The Primary Output and the Rate_of_Change outputs for this particular example
are shown below:
In this example, the Rate_of_Change output is also computed, although for this
type of input data (constant values over intervals), this would typically not be
done. The Rate_of_Change is computed by differentiating the Values. Because
the value is assumed to remain constant between data points, and then jumps
discontinuously, the Rate is zero between data points, and then “spikes” when
the Value changes. Theoretically, the derivative at this point is infinite (the
curve is a vertical line). GoldSim computes the derivative as the difference
between values divided by the timestep length. As such, the Rate_of_Change is
somewhat arbitrary. Note, however, that due to the way the Rate_of_Change is
computed, if you were to integrate this, it would correctly reproduce the Primary
Output.
Note: If the data is specified to represent a "Constant value over the next
interval", the first data point must be at or before the beginning of the
simulation. That is, if you have specified time entries as elapsed times, the first
data point must be less than or equal to zero. If you have specified time entries
as dates, the first date must be at or before the start time for the simulation.
Similarly, if the data is specified to represent a "Constant value over the
previous interval", the last data point must be at or beyond the end of the
simulation. That is, if you have specified time entries as elapsed times, the last
data point must be greater than the simulation duration. If you have specified
time entries as dates, the last date must be at or after the end time for the
simulation.
Example: Time Series This example illustrates the use of a Time Series where the input data represent
Inputs Represent changes over specified intervals. This option is usually used to output
Changes Over cumulative values (e.g., cumulative rainfall, cumulative sales) and/or rates (e.g.,
Specified Intervals sales rates, rainfall rates) that are specified by defining incremental changes in a
variable (e.g., monthly sales, monthly rainfall) over specified intervals.
The example can be viewed in the file named TimeSeries_Basic.gsm, which can
be found in the TimeSeries subfolder of the General Examples folder in your
GoldSim directory.
It is important to understand that when this option is selected, the Primary
Output of the Time Series is not the specified time series itself. Rather, it is the
cumulative value of the variable at each point in the simulation (assuming that
the specified changes occur uniformly over each interval). This option therefore
typically takes advantage of the Rate_of_Change output.
The Rate_of_Change output for a Time Series that is defined as a series of
changes over specified intervals represents the rate of change of the cumulative
value. For example, if the data was entered as monthly sales increments, the
Rate_of_Change would represent the sales rate.
The rate is computed by dividing the incremental change in the variable over the
interval by the interval length. GoldSim assumes that the variable (e.g.,
cumulative rainfall or sales) changes uniformly over the time period, which
means that the rate of change is constant over the interval (i.e., it "stair-steps").
Note: This option is particularly useful for time series that are collected at
variable time points (e.g., once per month, since the number of days in a month
is not constant). GoldSim is able to readily turn such data into rates.
In this example, the input data represent the total rainfall over specified time
periods:
In this example, between 59 and 90 days, the value is assumed to have changed
by 3.5 mm.
Note: There are two options for representing time series that represent changes
over specified intervals. You can specify that the data changes over the next
interval (as specified above), or you can specify that the data changes over the
previous interval. In the latter case, the data set shown above would imply that
between 59 and 90 days, the value changed by 3.7 mm. (In order for the two
representations to provide the same results, you would need to shift the data
column by one row.)
The Primary Output and the Rate_of_Change outputs for this particular example
are shown below:
The Primary Output is computed by integrating the changes, assuming that the
changes occur uniformly over each interval. Note that this implies that the rate
of change is constant over the interval (i.e., it "stair-steps"). This is the
appropriate way to represent variables that are measured on a monthly basis
(e.g., sales, rainfall) and need to be converted into rates for use in your model
(e.g., sales rate, rainfall rate).
Example: Time Series This example illustrates the use of a Time Series where the input data represent
Inputs Represent discrete changes at specified times. It can be viewed in the file named
Discrete Changes TimeSeries_Basic.gsm, which can be found in the TimeSeries subfolder of the
General Examples folder in your GoldSim directory.
In this example, the input data represent discrete changes to a price (in this case,
gasoline):
When the input data represent discrete changes to a variable at specified times,
the Primary Output is a discrete change signal (with an Add Instruction). Only
certain elements in GoldSim can accept discrete change signals as inputs.
Read more: Propagating Discrete Signals Between Elements (page 321);
Generating Discrete Changes Using Time Series Elements (page 379).
Discrete change signals are instantaneous quantities that cannot be directly
plotted. They are used to instantaneously change the value of a quantity
(represented in most cases by an Integrator or a Reservoir element). In this
example, an Integrator is used to represent the current gasoline price. It is
modified by the output of the Time Series:
Note: Unlike other kinds of Time Series, when the input data represent discrete
changes, it is not necessary for the first data point to start prior to or at the start
of the simulation.
Advanced Time GoldSim provides five advanced options for defining and using Time Series
Series Options elements:
You can enter historic time series data and then instruct GoldSim to
adjust the time/date column (time shift) in a specified way for each
simulation (e.g., in order to start at a random point in the data series, or
to shift the series forward so that historic dates are appropriately
mapped onto the simulated dates).
You can specify multiple sets of time series data within a single Time
Series element, and then specify which series is to be used for any
particular simulation. For example, this allows different time series data
to be used for each separate realization in a Monte Carlo simulation.
You can read the output of any other element in GoldSim, and "record"
the results, and then "play them back" in a subsequent run of the model.
Among other applications, this can be used to copy results from one
model and use them as inputs for another.
You can link to a "time series definition" that was output by another
Time Series element within an embedded SubModel or from an
external function (a DLL). The primary application of this advanced
option is to transfer time history data between SubModels.
These features are discussed in detail in the sections below.
Many of these advanced features are accessed by pressing the More button on
the Time Series dialog, which provides access to the “Advanced” section of the
dialog:
Time Shifting Time In many cases, you will want to use historic data to populate a Time Series.
Series Data Having done so, you then want to apply that historic data to your simulation
(which likely looks forward in time). In order to do this, therefore, you need to
time shift the data so that the historic data is applied in an appropriate and
consistent manner.
To support this, GoldSim provides an option to time shift a data series in an
appropriate manner. This feature is provided in the “Advanced” section of the
Time Series dialog, accessed via the More button:
If you check Enable Time Shifting of Time Series Data, the Settings… button
becomes available, providing access to this dialog (in fact, when you first check
the Time Shifting box, this dialog opens automatically):
Note: Time shifting is not available if the input represents a “Change over the
next time interval”, a “Change over the previous time interval” or a “Discrete
Change”.
GoldSim provides two different ways that Time Series can be shifted.
The first option is to Use random starting point. This option randomly samples
a starting point in the data set for each realization. This is useful, for example, if
you have 50 years of rainfall data, you want to carry out a 1 year simulation, and
you want GoldSim to randomly sample a different historic year for each
realization.
The manner in which GoldSim randomly samples the starting point in a data set
is controlled by two things:
The Data periodicity, which is either “none”, “annual”, or “diurnal”;
and
Whether or not the time series data is specified in terms of Dates
(Calendar Time) or Elapsed Time.
Read more: Entering Time Series Data as Dates or Elapsed Times (page 198).
The behavior is summarized below:
If the Data periodicity is “none”, for each realization GoldSim
randomly picks a point from within the total span of the time series
data, and assumes that this time point corresponds to an elapsed time of
zero. Note that this means that if data is entered as Calendar Time, the
date-time is not respected; GoldSim randomly selects a point in time
(and corresponding data value) from the time series data set, and
“shifts” this point in time so that in the simulation it becomes an
elapsed time of zero (i.e., the Simulation Start Date).
If the Data periodicity is “annual”, GoldSim ensures that the random
starting point for each realization is sampled such that all starting points
are a multiple of 1 (average) year apart. In particular, random starting
points for successive realizations are always multiples of 365.25 days
apart (rounded to the nearest day). Hence,
o If data is entered as elapsed time, the random starting point is
either 0d, 365d, 731d, 1096d, etc.).
o If data is entered as dates (Calendar Time), the random starting
points for successive realizations would be generated by first
finding the first data point in the data set that respected the month,
day and time of the Simulation Start time, and then randomly
shifting from that point by a multiple of 365.25 days (rounded to
the nearest day). (Note that this implies that the shifted calendar
day could be off by one day from the actual date).
Note: When specifying time shifting using annual periodicity, your time series
should contain at least 366 days of data.
Note: The random sampling also takes into account the amount of data. For
example, if you had 1000 days of data and selected “annual” Data periodicity,
the probability of picking the first two years for the starting point would be
(365/1000), while the probability of picking the last year would be only
(270/1000). In this example, in order to have equal probability of picking any
year as a starting point, you would require three full years of data.
The second option for time shifting Time Series is to Shift data years to align
with simulation dates. This option is only available if the Time Series data is
specified using Calendar Time.
This option shifts the time series data forward (or backward) by a multiple of a
year such that the simulation begins by using data from the specified Data year
to start in. For example, if the actual data set started on 31 July1989 and ended
on 31 December 2011, the Simulation Start Date was 1 January 2013, and the
Data year to start in was entered as 1990, GoldSim would treat the data set
such that the data point corresponding to 1 January 1990 would be used for 1
January 2013 (and, assuming daily data was entered, the data point for 2 January
1990 would be used for 2 January 2013, etc.).
This is useful, for example, if you wish to apply historic data to a forward-
looking simulation, assuming no uncertainty or randomness. That is, this option
assumes that with regard to the Time Series, the future will be exactly the same
as the past (as represented by the historic data).
Note: If you wanted to account for uncertainty and randomness while still
directly using historic data, you could do so by entering multiple years of data,
and then using the Use random starting point option with “annual periodicity”.
In order to better understand how this works, the table below summarizes how
the data would be shifted under various conditions. For this table, it is assumed
that the actual time series data range is from 31 July 1989 to 31 December 2011,
and the Simulation Start Date is 1 January 2013:
If using a random starting point with diurnal periodicity, when the end
of the data set is reached, the data set is effectively replicated and
shifted forward by N days, where N is the number of whole days in the
data set. For example, if there were 21.5 days of data in the data set,
the last data point was on day 21.5 days, and the simulation extended
beyond 21.5 days, the data set would be shifted forward by 21 days, so
that the data point at 0.5 days would follow the last point in the data set.
The example file (TimeSeries_TimeShifting.gsm) in the TimeSeries subfolder
of the General Examples folder of your GoldSim directory includes examples on
the use of time shifting Time Series elements.
Defining Multiple Time One of the advanced features of Time Series elements is the ability to specify
Series in a Single Time multiple sets of time series data within a single Time Series element, and then
Series Element specify which series is to be used for any particular simulation. This provides a
way, for example, for different time series data to be used for each separate
realization in a Monte Carlo simulation.
This feature is provided in the “Advanced” section of the Time Series dialog,
accessed via the More button:
If you check Enable Multiple Series, there are two changes to the dialogs:
1. The Active Series field becomes available, and defaults to
“Realization” (this will be discussed further below); and
2. The time series editing dialog accessed via the Edit Data button is
modified to support specifying multiple series.
This expanded editing dialog (with two additional series added in this case)
looks like this:
In addition to the two original buttons (add and remove rows), there are six new
buttons at the top of the dialog:
Button Action
Add new row to current series
Remove selected row from current series
Add new series
Remove current series
Go to previous series (hold Ctrl key to go to first series)
Go to next series (hold Ctrl key to go to last series)
Go to series at a specified index (dialog will prompt for series
number)
Change the current series number to a specified number (dialog
will prompt for series number). If the specified series is higher
than the current series, the specified series (and all series before
it) are shifted down. If the specified series is lower than the
current series, the specified series (and all series after it) are
shifted up. (Instead of entering a number, you can also hold the
Ctrl key and press the button to shift the data series to the next
index; or also hold the Ctrl and Shft keys and press the button to
shift the data series to the previous index.)
These buttons allow you to create, remove, edit and navigate the various time
series data sets.
As you are moving between time series, the current series is indicated in the
Title bar (e.g., “Series 2 of 3”).
The Description field can be valuable when creating multiple series, as it
provides a mechanism for you to document what that particular series represents
(e.g., “Scenario 3”).
The Time Unit that is specified in the dialog is always applied to all the series.
That is, if you change it for one series, it is changed for all series.
Note: When you have multiple series, they do not have to have the same time
points, or even the same duration or data span (although they often will). Of
course, as is the case for any Time Series element, if the time series data does
not contain appropriate starting and end points, it may trigger an error message
at run time.
Once you have specified multiple time series, for any given simulation, you
must specify which series to use via the Active Series field. This field must be a
scalar dimensionless value that corresponds to one of the defined time series.
Note that the time series are numbered sequentially, starting with 1. So, for
example, if you had defined 10 series, then Active Series would need to be a
number between 1 and 10, inclusive.
GoldSim will round off real numbers that are entered in the field (e.g., 2.3 would
be interpreted as 2). However, if the rounded number does not correspond to one
of the defined series numbers, GoldSim issues a fatal error.
The two most common ways that multiple time series are likely to be used are to
1) represent alternative input scenarios; and 2) to represent multiple realizations.
For example, if you had six different scenarios for a model (each with a different
input time series), you could represent this by defining six series in a Time
Series element, and setting the Active Series to “Scenario”, which would be an
element in the model that took on values of 1 through 6 (i.e., a Scenario Data
element).
Read more: Scenario Data: Defining Inputs for Different Scenarios (page 465).
To use multiple time series to represent different realizations, you could define a
different series for each Monte Carlo realization, and then set Active Series to
“Realization”. In fact, this is the default setting when you activate multiple
realizations:
Why would you want to use different time series for each realization?
There are two primary reasons why you might want to enter a large number of
time series, each representing a different realization:
1. To represent uncertainty in time series inputs. For example, you could
generate (using another program) 100 different random time series
records. Every realization would then use a different time series.
The Record from field represents the output that you wish to record. It must
have the same dimensions and Type as specified on the main page (Definition
tab) of the Time Series dialog.
The manner in which GoldSim records Time Series is controlled by how you
have defined what the Time Series Represents, and whether or not the Trigger
recording option is selected:
Read more: Specifying What the Input to a Time Series Represents (page 191).
When recording Time Series, you should follow these general guidelines to
ensure that the data is recorded in such a way that it fully captures the actual
behavior of the output:
If the output that is being recorded represents a quantity (e.g., the
output of a Reservoir), the Time Series Represents should be set to
"Instantaneous value".
For most other outputs (and particularly for outputs that represent flows
of material), the Time Series Represents should be set to "Constant
value over the next (or previous) interval".
Note that the recording logic listed in the preceding table represents the
minimum set of data points that GoldSim records. When the Time Series
repesents Instantaneous data, you can instruct GoldSim to record additional data
by selecting one or more of the options below.
Record at unscheduled timesteps (inserted by events). When recording,
the Time Series adds a time point at each scheduled timestep in the
simulation. Some elements (that generate events) can also insert
"unscheduled" timesteps (in between the scheduled timesteps). If this box
is checked (the default), the Time Series records (adds a timepoint) at these
unscheduled events also.
Read more: Understanding Timestepping in GoldSim (page 415).
Record at all timesteps even if the input value is unchanged. By default,
when recording for some types of outputs (see above), the Time Series does
not necessarily record every time point. If this box is checked, the Time
Series records (adds a timepoint) at all timesteps.
The final two options only apply if the input data to the Time Series represent
discrete changes. In this case, the Record from link specified must be a
Discrete Change Signal. Note that multiple discrete change signals can be
entered into this field by separating them with a semicolon.
Record discrete changes with zero value. This determines whether or not
discrete changes with a zero value are recorded as time points. This box is
defaulted on.
Combine discrete changes that arrive simultaneously. If two or more
discrete changes that are being recorded by this Time Series occur at the
same time, this checkbox determines whether the discrete changes are
combined (the default), or if both are to be recorded separately.
While you are recording a Time Series, the element passes through as its output
the instantaneous value of the input being recorded.
Note: Even if Enable Rate of Change output is checked, the Rate of Change
output is not calculated while recording the history (it is output as zero).
Note: Even if the Primary Output is set to “Average value over the next
timestep”, the output of a Time Series that is currently recording is always the
instantaneous value.
Recording time series can also be used to record multiple series. To do so, you
must check Enable Multiple Series on the Time Series dialog:
Note that when enabling multiple series when recording, the Active Series field
defaults to “Realization” and cannot be changed.
Read more: Defining Multiple Time Series in a Single Time Series Element
(page 219).
There are three primary applications for a "recording" Time Series:
By recording the output of an element and then changing the Data
Source field back to "Locally defined data", you can "play back" the
history in a subsequent run of the model.
You can record the times of "unscheduled" updates.
You can pass the output of a Time Series that is "recording" to another
Time Series element. The primary application of this is to transfer time
histories between SubModels.
These applications are discussed briefly below.
Recording and Playing Back a History
This can be useful, for example, if you want to copy the result of one model into
another model. In order to use a Time Series in this way, you would need to do
the following:
1. Insert one or more Time Series elements (one for each output you are
interested in), set their Data Source to "Recording output history", and
specify the output that you wish to record on the Recording tab.
2. Run the model. After you run the model, copy and paste the Time
Series element into a different model, and set Data Source to “Locally
defined data”.
3. The Time Series elements you have pasted will contain the results from
the other model and can now be used as input for te current model.
Recording the Time of Unscheduled Events
Because GoldSim only saves results at scheduled timesteps, the impact of
"unscheduled" timesteps that are inserted by events can sometimes be difficult to
see directly.
Note: Although recording Time Series can be used in this manner, under most
circumstances, there is a much easier way to achieve the same thing. GoldSim
provides an option (under a specified set of conditions) to view the values of
selected outputs at unscheduled updates in the Advanced Time settings.
Note: Although recording Time Series can be used in this manner to transfer a
time series out of a SubModel, under most circumstances, there is a more
straightforward way to achieve the same thing. GoldSim provides an option to
directly add an output inside a SubModel as a Time Series Definition to the
SubModel interface. This allows you to skip step #1 above. The primary
motivation to use a recording Time Series rather than adding the output directly
to the SubModel interface would be if it was necessary to capture high
resolution results (i.e., unscheduled updates) from inside the SubModel.
Note: This field will not accept a Time Series Definition output directly from
another Time Series. It will only accept Time Series Definition outputs from the
output interface of a SubModel, or Time Series Definition outputs produced
directly by an external function (a DLL).
Read more: Using SubModels to Embed Models Within Models (page 914).
The primary application of this Time Series feature is to transfer time history
data between SubModels. In this case, it is used in conjunction with a Time
History Definition output on the output interface of a SubModel.
Read more: Creating the Output Interface to a SubModel (page 925).
Occasionally, rather than reading the time history directly into a Time Series
outside of the SubModel, you may wish to first process that data in some way.
This is facilitated by allowing external functions (DLLs) to read and write Time
Series Definitions.
Read more: External (DLL) Elements (page 873).
Note: If using an External element to output a Time Series Definition, the DLL
can only be called at etime = 0. That is, because a Time Series must be defined
at the beginning of the simulation, if you try to redefine the time series in the
middle of the simulation, GoldSim will issue a Fatal Error.
To use the Time Series in this way, you would need to do the following:
1. Insert one or more Time Series elements into your SubModel, set their
Data Source to "Recording output history", and specify the outputs
that you wish to transfer outside of the SubModel.
2. Add the Time Series Definition Output of each Time Series that you
wish to transfer to the output interface of the SubModel.
Read more: Creating the Output Interface to a SubModel (page 925).
3. For each Time Series that you wish to transfer from the SubModel, you
must define a corresponding Time Series element outside of the
SubModel. For these Time Series, set their Data Source to "Linked to
external Time Series Definition", and on the Linked tab, enter the
Time Series Definition output from the SubModel interface.
Note: If you wanted to process the data in some way, after exporting it from the
SubModel, you could read the Time Series Definition into a DLL that
subsequently passed an updated Time Series Definition to another Time Series
element.
4. The output of these Time Series elements will reflect the time histories
generated by the Time Series elements inside the SubModel.
The example file (TimeSeries_OtherDataSource.gsm) in the TimeSeries
subfolder of the General Examples folder of your GoldSim directory includes an
examples of a Time Series element reading in a Time Series definition input
from a SubModel.
Browser View of a The browser view of a Time Series element shows at least two, and in some
Time Series Element cases, three outputs (the number of outputs produced by the element being user-
determined):
Note: Element 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).
Value Initial Value (Rate of Change) dt
where ti is the timestep length just prior to time ti (typically this will be
constant in the simulation), and Value(tn) is the value at the end of timestep n.
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).
In order to better understand how GoldSim carries out this numerical
integration, it is worthwhile to consider the following example. Consider a car
that drives on a road for five minutes. We input the time history of the velocity
of the car as follows:
Hence, it is stopped for the first minute, travels at 20 km/hr for the second
minute, 60 km/hr for the third minute, 20 km/hr for the fourth minute, and 60
km/hr for the fifth minute.
If we put this time history into an Integrator element, and run the simulation for
5 minutes with a constant 1 minute timestep, we get the following for the
cumulative distance traveled (assuming an Initial Value of 0):
The dashed line represents the specified Rate of Change. The solid line illustrates how the
Integrator element would interpret the Rate of Change, assuming a 1 minute timestep.
Note: By default, the Rate of Change at time t is treated as the constant rate of
change over the next timestep (i.e., from t to t + Δt). GoldSim provides an
advanced option to allow you to modify this behavior such that the Rate of
Change at time t is treated as the constant rate of change over the previous
timestep (i.e., from t to t - Δt).
Note: Euler integration is the simplest and most common method for numerical
integration. However, if the timestep is large, this method can lead to significant
errors. This is particularly important for certain kinds of systems in which the
error is cumulative (e.g., sustained oscillators such as a pendulum). In these
cases, these errors can be reduced by using Containers with Internal Clocks,
which allow you to locally use a much smaller timestep.
Read more: Modifying How Integrators Treat the Rate of Change (page 233);
Specifying Containers with Internal Clocks (page 434).
Specifying the Inputs to The Display Units determine the dimensions of the Integrator’s output. This
an Integrator output can only be specified as a value (it cannot be a condition), and can be
specified as a scalar, a vector or a matrix. You can specify whether the
Integrator is a scalar, vector or matrix by pressing the Type… button. By
default, the output of a new Integrator element is a scalar, dimensionless value.
Read more: Using Vectors and Matrices (page 726).
The Initial Value input to the Integrator must have the same attributes (order
and dimensions) as the output.
Note: The Initial Value must be a number or a link from a static variable (e.g., a
constant Data element or some other output that does not change with time).
The Rate of Change input (which can be positive or negative) must have the
same order, but the dimensions must represent a rate of change of the output
(e.g., if the output has units of length, the Rate of Change must have units of
length per time).
Note: The specified Rate of Change represents the constant rate over the next
timestep. Hence, if a Rate of Change was defined as “if(time > 10 day, 2 m/day,
1 m/day)”, and you were using a 1 day timestep, the rate would not actually
change to 2 m/day until time = 11 days. That is, since at time = 10 days, the if
statement indicates that the rate is equal to 1 m/day, GoldSim would assume that
the rate was equal to 1 m/day between 10 days and 11 days. If you wanted the
rate to change at 10 days, you would write the if statement as “if(time >= 10
day, 2 m/day, 1 m/day)”.
You can save the results for the single output of an Integrator element by
clicking Final Values and/or Time Histories.
Specifying Discrete Integrators can also accept discrete (as opposed to continuous) changes. That is,
Changes to an Integrators actually compute their Current Value by accounting for discrete
Integrator changes as follows:
n
Value(t n ) Initial Value Rate of Change(t
i 1
i t i )t i Discrete Changes
Discrete changes are specified by linking a discrete change signal input into the
Discrete Change field.
Read more: Basic Concepts of Discrete Event Modeling (page 320); Modeling
Discrete Changes to an Integrator (page 354).
Modifying How By default, the Rate of Change at time t is treated as the constant rate of change
Integrators Treat the over the next timestep (i.e., from t to t + Δt). In some very special cases,
Rate of Change however, you may actually want GoldSim to treat the Rate of Change in a
different manner. In particular, you may want to modify this behavior such that
the Rate of Change at time t is treated as the constant rate of change over the
previous timestep (i.e., from t to t - Δt).
The most common reason for doing this is when you want to use an Integrator to
integrate a mass flux coming from a pathway element in the GoldSim
Contaminant Transport Module. Pathway elements output mass flux rates that
represent rates over the previous timestep. Therefore, in order to correctly
integrate such a flux, an Integrator element would need to treat the Rate of
Change as if it represented the rate of change over the previous timestep.
GoldSim provides an option to allow Integrators to treat Rates of Change in this
way. By default, the option is deactivated. To activate it, you must press the
More button to expand the dialog:
(Rate of Change) dt
t ETime - ATime
Moving Average
ATime
Note: To account for elapsed times that are less than the averaging time, the
actual averaging time used is the minimum of the elapsed time and the specified
averaging time. The value of the moving average at elapsed time = 0 is equal to
the intial value of the Rate of Change.
By checking a box, you can specify the name of the moving average output and
define the Averaging Period. If you specify multiple moving average outputs,
they must have unique names. The Output IDs follow the same naming
conventions as element names. The Averaging Period must have units of time,
and must be a number or a link from a static variable (e.g., a constant Data
element or some other output that does not change with time).
Discrete changes (applied in the Discrete Change field) will affect the moving
average ouputs. In particular, any discrete changes that are applied to the
Integrator will affect the moving average as if they were distributed uniformly
over the preceding timestep (i.e., from the previous update of the element to the
update where the discrete change was applied.
The moving average outputs have the same dimensions as the Rate of Change
input. The Display Units for these outputs are the Display Units for the element
divided by the Time Display Units (specified in the Simulation Settings dialog).
Using an Integrator to In some situations, it is necessary to keep track of the age structure of a stock of
Model an Aging Chain material or objects. For example, you may want to track the number of people
in each of a number of age groups, the number of people in a company at
different experience levels (e.g., new hire, experienced, expert), or the number
of trucks of different age groups on the road.
To model such a situation, you cannot use a single Stock (e.g., an Integrator).
Rather, you must disaggregate the total stock into multiple categories (referred
to as cohorts). Each cohort “graduates” to the next cohort over time (and can
only move in one direction). However, each cohort may grow and shrink for
other reasons (e.g., if you were modeling a population of people, a particular
category could grow due to immigration, and shrink due to emmigration and
death). Note that these rates of growing and shrinking are likely a function of
the specific cohort (e.g., death rates).
GoldSim provides several methods for modeling aging chains. One of these
involves using an Integrator and processing a specialized discrete change signal
(called a Push). The advanced option to “Provide a Pushed_Out discrete
change signal” is used for this method:
Read more: Modeling Aging Chains Using Integrators with Discrete Pushes
(page 756).
Browser View of an By, default, the browser view of an Integrator element shows three inputs and a
Integrator Element single output:
Severla Advanced Options can add inputs and outputs. If the moving average
options is used, the browser would display additional inputs and outputs (one for
each moving average specified). If the option to provide a “Pushed_Out” output
is selected, the browser would display an additional Discrete Change 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).
Reservoir elements are elements that accumulate flows. You use them to
Reservoir Elements accumulate and track material, such as the quantity of water in a lake, the
amount of money in a bank account, and the number of widgets in a warehouse.
Their default symbol is a dam and a reservoir since this is an excellent analogy for
the behavior of the element. Like a real reservoir, a Reservoir element has a current
value (e.g., the volume of water in the reservoir), inflows, withdrawals and
overflows.
A Reservoir is fundamentally similar to an Integrator (since both are Stocks),
but is different in three important ways:
Reservoirs are designed to integrate (accumulate) materials; Integrators
are designed to integrate information.
Reservoirs explicitly differentiate between positive rates and discrete
changes (additions) and negative rates and discrete changes
(withdrawals).
Reservoirs allow you to specify upper and lower bounds. Due to these
bounds, a Reservoir has more than one output.
Like an Integrator, a Reservoir requires an Initial Value and a rate of change.
The rate of change, however, is specified in terms of two separate inputs, an
Addition Rate and a Withdrawal Rate.
In the absence of upper and lower bounds, the primary output of the Reservoir
(its Value) is computed as follows:
Value Initial Value (Rate of Addition - Rate of Withdrawal) dt
where
In these equations, ti is the timestep length just prior to time ti (typically this
will be constant in the simulation), and Value(tn) is the value at end of timestep
n. Note that the Value at time ti is a function of the Rates of Addition and
Withdrawal at previous timesteps (but is not a function of these Rates at time ti).
Note that if you specify Upper or Lower Bounds for a Reservoir, the equation
shown above is constrained by the specified bounds (i.e., the Value cannot
exceed the Upper Bound and can not be less than the Lower Bound).
Read more: Defining Upper and Lower Bounds for a Reservoir (page 239).
Reservoirs and Integrator elements use the same numerical integration method,
referred to as Euler Integration. A simple example illustrating this integration
method is provided in the section discussing how an Integrator element
computes its output.
Read more: How an Integrator Element Computes its Output (page 229).
The key assumption involved in this integration method is that at any point in
time, the Rates of Addition and Withdrawal represent the rates over the next
timestep, and those rates are assumed to be constant over the timestep. Euler
Integration is discussed in additional detail in Appendix F.
Note: Euler integration is the simplest and most common method for numerical
integration. However, if the timestep is large, this method can lead to significant
errors. This is particularly important for certain kinds of systems in which the
error is cumulative (e.g., sustained oscillators such as a pendulum). In these
cases, these errors can be reduced by using Containers with Internal Clocks,
which allow you to locally use a much smaller timestep.
Specifying the The primary output of a Reservoir is its Value. The Display Units determine the
Dimensions, Initial dimensions of this output. This output can only be specified as a value (it cannot
Value and Flow Rates be a condition), and can be specified as a scalar, a vector or a matrix. You can
for a Reservoir specify the order by pressing the Type… button. By default, the primary output
of a new Reservoir element is a scalar, dimensionless value.
Read more: Using Vectors and Matrices (page 726).
Note: GoldSim encourages (but does not require) you to specify Display Units
for a Reservoir whose dimensions are consistent with materials. In particular, it
expects the units to have dimensions of mass, volume, energy, amount,
currency, or to be dimensionless. When you first specify your Display Units,
GoldSim will warn you if your units do not have one of these dimensions.
GoldSim will not, however, prevent you from using other units. Note, however,
that in future versions of GoldSim, these requirements will likely be enforced.
The Initial Value input to the Reservoir must have the same attributes (order
and dimensions) as the primary output.
Note: The Initial Value must be a number or a link from a static variable (e.g., a
constant Data element or a Stochastic).
The Addition Rate and Withdrawal Rate inputs must have the same order, but
the dimensions must represent a rate of change of the output (e.g., if the output
has units of mass, the Addition Rate must have units of mass per time).
The Addition Rate and Withdrawal Rate must be entered as non-negative values.
Negative values for these inputs during a simulation will result in a fatal error.
Note: The specified Addition Rate and Withdrawal Rate represent constant rates
over the next timestep. Hence, if an Addition Rate was defined as “if(time > 10
day, 2 m3/day, 1 m3/day)”, and you were using a 1 day timestep, the rate would
not actually change to 2 m3/day until time = 11 days. That is, since at time = 10
days, the if statement indicates that the rate is equal to 1 m3/day, GoldSim would
assume that the rate was equal to 1 m3/day between 10 days and 11 days. If you
wanted the rate to change at 10 days, you would write the if statement as
“if(time >= 10 day, 2 m3/day, 1 m3/day)”.
Using the Withdrawal By default, a Reservoir element has two outputs: the Value (which has the same
Rate Output of a name as the element) and a Withdrawal_Rate. In the absence of a Lower Bound,
Reservoir the Withdrawal_Rate output is exactly equal to the Withdrawal Rate input.
To illustrate its usefulness, consider an example in which Reservoir1 flows into
Reservoir2 (i.e., the Withdrawal_Rate from Reservoir1 is the Addition Rate to
Reservoir 2). One way to build this model is as follows:
By using the Withdrawal_Rate output, however, this model can become more
transparent:
example, if the Reservoir is at the Lower Bound, and the Addition Rate
is zero, the Withdrawal_Rate output must be equal to zero, regardless
of the requested Withdrawal Rate (there is no material available to be
withdrawn). By default, when you create a new Reservoir element, the
Lower Bound is checked (and a value of 0 is assumed).
Most real-world Reservoirs have such bounds. For example, many Reservoirs
would have a logical lower bound of zero (e.g., a pond cannot contain a negative
quantity of water, a parking lot cannot contain a negative number of cars). Many
Reservoirs also have a logical upper bound (e.g., tanks and parking lots have
maximum capacities). Some Reservoirs may have a lower bound, but no upper
bound (e.g., a bank perhaps could not be negative, or at least there will be some
limit on the amount that can be overdrawn, but would probably have no practical
upper bound).
Note: If your specified Upper Bound is reached during a simulation, and the
Overflow_Rate output is not referenced by any other element (e.g., as an inflow
to another Reservoir), GoldSim will display a Fatal Error, as this could indicate
that you have neglected to track flows leaving the Reservoir.
How a Reservoir The Overflow_Rate output of a Reservoir has meaning (and is computed) only if
Computes the Overflow you have specified an Upper Bound. GoldSim computes the overflow rate such
Rate that the flowing material (e.g., water, widgets, people, rocks) is conserved. To
understand how it does so, recall the key assumption regarding the Euler
integration method: The specified Addition Rate and Withdrawal Rate represent
constant rates over the next timestep.
Hence, at the beginning of a timestep, GoldSim can project what the Value will
be at the end of timestep, compare it to the Upper Bound, and easily compute an
overflow rate for that timestep. To illustrate this, consider the following simple
example. Assume we are modeling a pond with an Upper Bound of 3000 m3,
and that at time = 10 days, the pond contains 2700 m3 of water. Let’s further
assume that our model has a 2 day timestep. Assume that for times greater than
10 days, the Addition Rate and the Withdrawal Rate are constant and equal to
500 m3/day and 100 m3/day, respectively, so that the pond will fill up and start
to overflow at 10.75 days.
In order to compute overflow rates accurately, by default GoldSim inserts an
“unscheduled update” when the Reservoir reaches an upper bound. Unscheduled
updates are timesteps that are automatically inserted by GoldSim during the
simulation in order to more accurately simulate the system.
Read more: Understanding Timestepping in GoldSim (page 415).
In particular, the overflow rate for the example described above is treated as
follows. At 10 days, GoldSim would report an (instantaneous) overflow rate of
zero. A new timestep (an “unscheduled update”) would then be inserted at
10.75 days when the pond would start to overflow. The overflow rate at this
time would actually be internally calculated as 400 m3/day. However, because
by default GoldSim only reports values at scheduled timesteps (e.g., 10 days, 12
days), the overflow rate will not be displayed as 400 m3/day until 12 days.
Hence, it is important to understand that the Overflow_Rate represents the
instantaneous overflow rate at the reported time. You cannot assume that
this rate is constant over the next scheduled timestep. That is, it would be
incorrect to assume that the overflow rate was zero between 10 and 12 days. In
fact, at 10 days, the overflow rate was indeed 0 m3/day, but it changed to 400
m3/day at 10.75 days (between the scheduled updates). Because 10.75 days is
an unscheduled timestep, you would not see this in a time history plot. However,
if the Overflow_Rate was integrated (using an Integrator or another Reservoir
that represented the total amount of water that has overflowed), the following
results would be obtained:
Note that the amount of water is properly conserved. At 12 days, the pond has
been overflowing for 1.25 days (at a rate of 400 m3/day), so that a total volume
of 500 m3 has overflowed. At 14 days, the pond as been overflowing for 3.25
days, so a total volume of 1300 m3 has overflowed.
Note: In some cases, it may be of interest to see the values (such as the overflow
rate) that were computed at unscheduled updates. To facilitate this, GoldSim
provides an option to do so (under a specified set of conditions) in the Advanced
Time settings.
Note: You can record when Reservoirs hit or depart from their upper and lower
bounds in the model’s Run Log. This logging can be activated via the General
tab of the Options dialog (accessed via Model|Options from the main menu).
Read more: The General Tab of the Options Dialog (page 408).
The calculation of an Overflow_Rate is further complicated because the Upper
Bound can be specified to change with time (i.e., you could specify this input as
being time-variable). If you do so, GoldSim makes the following assumption:
like the Rates, the Upper Bound is assumed to remain constant over a timestep.
For example, if you specify that the Upper Bound varies linearly from 3000 m3
to 2000 m3 over 100 days, and simulate the system with a 10 day timestep,
GoldSim will approximate the Upper Bound curve internally as a stair-step
function:
Hence, within a given timestep, GoldSim follows the same logic outlined in the
previous example to compute the Overflow_Rate for that timestep.
Note that an Overflow_Rate can be generated even if there is no net inflow of
material into the Reservoir. This can happen if the Upper Bound decreases
below the Value. To illustrate this, consider the following simple example.
Assume we are modeling a pond with an Upper Bound of 3000 m3. Further
assume that at the beginning of a timestep, the pond contains 2700 m3 of water.
There are no further additions or withdrawals from the pond. However, assume
that over the next timestep, the Upper Bound decreases from 3000 m3 to 2500
m3 (e.g., it fills up with silt).
How would GoldSim handle this? During the timestep the Upper Bound would
be assumed to remain at 3000 m3. At the beginning of the following timestep,
however, it would instantaneously decrease to 2500 m3. This would result in
2700 – 2500 = 200 m3 of water that would instantaneously have to overflow.
GoldSim actually spreads this out over the following timestep, such that with a 2
day timestep, the Overflow_Rate over the following timestep would be 200/2 =
100 m3/day.
Note: If the Upper Bound is constant, the Current Value in the Reservoir will
never exceed the Upper Bound. However, if the Upper Bound is changing with
time, under some circumstances, it is possible for the Current Value of the
Reservoir to exceed the Upper Bound. If the Upper Bound is exceeded (because
it has changed during a timestep), GoldSim will overflow the excess uniformly
over the next timestep.
Note: Although GoldSim conserves mass in these situations, this does not imply
that the result is perfectly accurate. In fact, the accuracy of the result is a
function of the timestep, since GoldSim is approximating continuously varying
functions (i.e., rates and bounds) using stair-step functions. This approximation
is discussed further in Appendix F.
How a Reservoir In the absence of a Lower Bound, the Withdrawal_Rate output is equal to the
Computes the Withdrawal Rate input. However, if a Lower Bound is specified, the
Withdrawal Rate Withdrawal_Rate output represents the actual rate of withdrawal from the
Reservoir, which may be less than the specified Withdrawal Rate (which can be
thought of as the demand or requested rate of withdrawal).
GoldSim compares the requested Withdrawal Rate to the amount of material
available, and only outputs what can actually be withdrawn from the Reservoir
over the timestep. Hence, if the Value is above the Lower Bound throughout the
timestep, the Withdrawal_Rate output is exactly equal to the specified
Withdrawal Rate. If the Value is at the Lower Bound throughout the timestep,
the Withdrawal_Rate output is equal to the specified Addition Rate.
If the Reservoir reaches (or leaves) the Lower Bound during the timestep,
GoldSim uses logic similar to that for computing overflow rates in order to
correctly compute the actual withdrawal rate. In order to compute withdrawal
rates accurately, by default GoldSim inserts an “unscheduled update” when the
Reservoir reaches a lower bound. Unscheduled updates are timesteps that are
automatically inserted by GoldSim during the simulation in order to more
accurately simulate the system.
Read more: Understanding Timestepping in GoldSim (page 415).
To illustrate how GoldSim treats withdrawal rates, consider the following
simple example. Assume we are modeling a pond with a Lower Bound of zero.
Further assume that at time = 10 day, the pond contains 200 m3 of water.
GoldSim computes the constant Addition Rate and the Withdrawal Rate for
times greater than 10 days to be 100 m3/day and 300 m3/day, respectively.
Therefore, the pond will run out of water at 11 days. Let’s further assume that
our model has a 2 day timestep (so that this occurs in the middle of the
scheduled timesteps).
The withdrawal rate is computed as follows. At 10 days, GoldSim will report a
withdrawal rate of 300 m3/day. A new timestep (an “unscheduled update”) is
then inserted at 11 days when the pond becomes empty. The withdrawal rate at
this time will actually be internally calculated as 100 m3/day (since the pond is
empty, the withdrawal rate can be no greater than the rate of addition). However,
because by default GoldSim only reports values at scheduled timesteps (e.g., 10
days, 12 days), the withdrawal rate will not be displayed as 100 m3/day until 12
days.
Note that the amount of water is properly conserved. At 12 days, the pond has
been empty for 1 day (and hence the withdrawal rate during that period has been
equal to the inflow rate of 100 m3/day), so that a total volume of 300 m3/day * 1
day + 100 m3/day * 1 day = 400 m3 has been withdrawn. At 14 days, the pond
as been empty for 3 days, so that a total volume of 300 m3/day * 1 day + 100
m3/day * 3 day = 600 m3 has been withdrawn.
Note: In some cases, it may be of interest to see the values (such as the
withdrawal rate) that were computed at unscheduled updates. To facilitate this,
GoldSim provides an option to do so (under a specified set of conditions) in the
Advanced Time settings.
Note: You can record when Reservoirs hit or depart from their upper and lower
bounds in the model’s Run Log. This logging can be activated via the General
tab of the Options dialog (accessed via Model|Options from the main menu).
Read more: The General Tab of the Options Dialog (page 408).
The calculation of a Withdrawal_Rate can be complicated because the Lower
Bound can be specified to change with time (i.e., you could specify this input as
being time-variable).
Note: If the Lower Bound is constant, the Current Value in the Reservoir will
never fall below the Lower Bound. However, if the Lower bound is changing
with time, under some circumstances, it is possible for the Current Value of the
Reservoir to fall below the Lower Bound. The primary purpose of the Lower
Bound to to accurately compute the Withdrawal_Rate. If the Lower Bound
exceeds the amount in the Reservoir (because the Lower Bound has changed
during a timestep), the Reservoir will not permit any withdrawals until it returns
to the Lower Bound (via additions).
As is the case with Upper Bounds, GoldSim carries out such calculations by
assuming that bounds remain constant over a timestep. A simple example
illustrating this is provided in the section discussing how GoldSim computes the
Overflow Rate with a changing Upper Bound.
Read more: How a Reservoir Computes the Overflow Rate (page 241).
Using the Is_Full The Is_Full output is only available if you specify an Upper Bound for a
Output of a Reservoir Reservoir. It is a condition (False if the Reservoir is below the Upper Bound,
and True if it is at the Upper Bound.
This output is useful because it is a special type of output called a state variable
(the primary output of a Reservoir is also a state variable). This has the
important implication that inputs to the Reservoir (e.g., the Addition Rate) can
reference this output without causing a recursive error.
Read more: Evaluating Feedback Loops (page 314).
As an example, suppose that you wanted to add water to a Reservoir only if it
was not overflowing; once it started to overflow, you wanted the flow rate to go
to zero. To accomplish this, you could define an Expression as follows:
However, you can solve this problem by using the Is_Full output:
If the inflow Expression was defined as above, then you could link to this
Expression in the Addition Rate field without causing a recursive error.
Specifying Discrete In addition to continuous Rates of Addition and Withdrawals, Reservoirs can
Additions and also accept discrete changes. That is, the Reservoirs actually compute their
Withdrawals to a Value by accounting for discrete changes as follows:
Reservoir n
Note: If you have specified an Upper or Lower Bound, and choose to Replace
the current value of a Reservoir, the replacement value must be within the
bounds (or GoldSim will display a fatal error message).
Browser View of a The browser view of a Reservoir element shows up to seven inputs and up to six
Reservoir Element outputs (depending on which boxes are checked in the dialog). If the Upper and
Lower Bound boxes are checked, the browser view looks like this:
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 save the results for a Reservoir element by clicking Final Values
and/or Time Histories.
The properties dialog for an Expression is very simple, and is almost identical to
that of the Data element. Other than the ID and Description, there is only a
single input field. Typically, you will enter a mathematical expression into this
field. (You could, of course, just enter a number. In such a case, however, it
would be clearer to someone viewing your model if you used a Data element for
this).
Note that the input field for an Expression (the "Equation") is always expanded
to several lines to better accommodate and display large equations.
Expression elements have a single output, which can be a value or a condition,
and can be specified as a scalar, a vector or a matrix. You can specify these
attributes by pressing the Type… button. By default, a new Expression element
is a scalar, dimensionless value.
Read more: Using Vectors and Matrices (page 726).
You can save the results for an Expression element by clicking Final Values
and/or Time Histories.
The browser view of an Expression element shows a single input (referred to as
the Definition), and a single 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).
shown below, the Peak and Valley curves are the outputs of Extrema elements
with X as an input:
Extrema elements are very useful for tracking things like the peak contaminant
concentration in a river, the peak number of customers in a check-out line, or the
lowest water level reached in a water supply reservoir.
The properties dialog for an Extrema element looks like this:
An Extrema element has a single primary input (the value you wish to track).
This input must have the same attributes (order and dimension) as the Extrema
element, and can be a link or an expression. The Type determines whether Peak
(maxima) or Valley (minima) values are tracked (as illustrated in the example
shown above). Note that the default symbol for the Extrema changes depending
on whether you are tracking a Peak or a Valley:
Peak Valley
Extrema elements have two outputs, one of which is optional. The primary
output is the actual peak or valley. It is always a value, but can be specified as a
scalar, a vector or a matrix. You can specify these attributes by pressing the
Type… button. By default, a new Extrema element is a scalar, dimensionless
value. You can also use Extrema elements to operate on and/or create vectors
and matrices.
Read more: Using Vectors and Matrices (page 726).
The secondary output (which is optional) is the time of the greatest peak or
valley. This output is only created if Record Time of Occurrence of
Peak/Valley is checked. If it is checked, this output represents the elapsed time
at which the peak (or valley) last occurred. The output is always a value with
dimensions of time. It has the same order (scalar, vector, matrix) as the primary
output.
Extrema elements have two options which affect how the primary output of the
Extrema is computed:
Use Absolute Value of the Input: If this is checked, GoldSim uses the
absolute value of the input to determine the Peak or Valley, but the
primary output retains the sign of the input (i.e., it could be negative).
Hence, if you were computing the Peak, the output would represent the
value of the Input which has had the highest absolute value since the
beginning of the simulation (or since the element has been reset – see
below). If you were computing the Valley, the output would represent
the value of the Input which has had the lowest absolute value since the
beginning of the simulation (or since the element has been reset – see
below).
Reset when Triggered: If this is checked, the Reset… button becomes
available, which provides access to a standard GoldSim Trigger dialog.
Read more: Understanding Event Triggering (page 323).
When an Extrema is reset by a trigger, the Peak/Valley calculation is
restarted on the next update (ignoring everything that has occurred
previously, as if it was the start of the simulatiuon again).
You can save the results for an Extrema element by clicking Final Values
and/or Time Histories.
The browser view of an Extrema element shows a single input and two outputs
(if you choose to save the time of the peak/valley). Additional inputs are also
present if the element is being reset:
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).
if A = 10
then X = 5
else if A = 20
then X = 6
else if A < 40 and B = 2
then X = 7
else X=8
This would be represented within an Expression element using GoldSim's built-
in if..then function and relational operators as follows:
Selector elements have a single output, which can be a value or a condition, and
can be specified as a scalar, a vector or a matrix. You can specify these
attributes by pressing the Type… button. By default, a new Selector element is a
scalar, dimensionless value. You can also use Selector elements to operate on
and/or create vectors and matrices.
Read more: Using Vectors and Matrices (page 726).
You can save the results for a Selector element by clicking Final Values and/or
Time Histories.
Each switch (row) in the Selector dialog represents a single if…then statement
and has two parts: the condition (the first column), and the result if the condition
is true (the second column). The if statements are evaluated in order, and the
Selector takes on the value corresponding to the first true statement that is
encountered. All Selectors have a final else statement, which represents the
result if all the conditions are false.
A new Selector has a single switch. A Selector with a single switch has the same
functionality as a simple if..then statement: If(A then B else C).
You can add switches using the Add Switch button. New switches are added
below the switch which is currently selected. If the final else is selected,
however, the switch will be inserted above it. If the first switch is selected, you
will be prompted for whether you want to insert the new switch above or below
the selected switch.
To delete a switch, select it (it will turn yellow) and press Delete Switch. Note
that the last result (the else) cannot be deleted.
The example discussed above would be represented in a Selector as follows:
This is clearly easier to enter and read than using nested if..then functions.
Note: If an expression does not completely fit into one of the fields, like other
input fields in GoldSim, the field will expand and the expression will wrap when
you click into it. In addition, the Selector dialog is resizable. This allows you to
stretch the dialog so as to see all of the expressions that you may have entered
into the dialog at once.
Both the condition column and the result column can be entered as links or
expressions. The first column (the condition) must either be:
a link which is a scalar condition;
a conditional expression; or
the words "True" or "False".
Read more: Creating Conditional Expressions (page 134).
The entries in the result column must have the same data type, order and
dimensions as the element's output.
As shown below, the browser view of a Selector element shows a single output,
and the following inputs: an Else (the result if all conditions are false), and two
inputs for every switch (If_n and Then_n, where n is the switch number):
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 incoming signal to a Splitter element (the Amount) must be a scalar. The
Type drop-list allows you to specify whether the incoming signal is a Value or a
Discrete Change Signal.
A Splitter can accept multiple discrete changes. This is indicated in the input
field by separating the individual discrete change signals by semi-colons (e.g.,
Multiple Discrete Signals Change1; Change2; Change3). You can also specify the multiple discrete
button changes using the Multiple Discrete Signals button, which displays a table
listing the multiple discrete change signals.
Read more: Propagating Discrete Signals Between Elements (page 321).
The outputs of the Splitter element are specified in the "Outputs" section of the
dialog. By default, a Splitter element initially has two outputs (named Output1
and Balance). You can add additional outputs by pressing the Add button (the
plus sign) below the list. Outputs can be deleted using the Delete button (the X),
and moved up and down in the list using the two buttons to the right of the
Delete button.
The names of the outputs can be changed by editing the items in the Name
column.
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 a Splitter outputs discrete change signals, the outputs preserve the
Instruction of the input signal.
Note: If a Splitter outputs discrete change signals, signals with a zero value and
an “Add” instruction are not propagated as outputs.
You can save the results for a Splitter element by clicking Final Values and/or
Time Histories.
An example model which uses a Splitter element (Splitter.gsm) can be found in
the General Examples folder in your GoldSim directory.
Allocator Elements Allocator elements allocate 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 discrete transaction.
In this case, Output1 would have a value of 75m3/day (its entire demand would
be met), Output2 would have a value of 20m3/day (its entire demand would be
met), Output3 would have a value of 5m3/day (only part of its demand would be
met), Output4 would have a value of 0m3/day (none of its demand would be
met), and the "Unused" output would have a value of 0m3/day.
By default, each output has a fixed (and unique) Priority (which is an integer).
The Priority of the outputs always decrease downward (with the first item
having a Priority of 1). Priority 1 therefore represents the highest priority
demand, 2 the next highest, and so on. New outputs are added below the output
that is selected when pressing the Add button. You can move outputs up and
down the Priority list using the Move Up and Move Down buttons (found
directly below the list).
If you check the Allow editing of Priorities checkbox, the Priority column
becomes editable. In this case, the Priorities can be specified as constants or
expressions and/or links, and may change with time. They do not need to be
integers and can be any real value (positive or negative). Outputs with lower
valued Priorities are met first (e.g., Priority -2.4 is met before Priority 5.7).
If multiple outputs have the same Priority, you can specify the manner in which
equal priorities are treated in the For equal priorities field. There are two
options: 1) “share the input equally”; or 2) “share proportional to demands”.
If “share the input equally” (the default) is selected, each output with equal
priority receives the same amount up until either its demand is satisfied, or
nothing more is available. The calculation is carried out recursively starting
with the smallest demand.
To illustrate this, consider the following example:
In this case, Output1 would have a value of 75m3/day (its entire demand would
be met), Output2, Output3 and Output4 would share the remainder (25m3/day)
as follows:
Output4 would receive its full demand (5m3/day); Output2 and Output3
would receive the same amount.
Output2 and Output3 would then equally share the remaining 10m3/day
(such that each would receive a total of 10m3/day). So Output3 and
Output4 would meet their demands, and Output2 would not.
If “share proportional to demands” is selected, if there is not enough supply to
meet all of the demands, it is shared proportionally according to the demand.
To illustrate this, consider the same example as above, with proportional
sharing:
In this case, Output1 would still have a value of 75m3/day (its entire demand
would be met), Output2, Output3 and Output4 would share the remainder
(25m3/day) as follows:
Output2 would receive 20/35 = 57.1% of the remaining 25 m3/day.
Output3 would receive 10/35 = 28.6% of the remaining 25 m3/day.
Output4 would receive 5/35 = 14.3% of the remaining 25 m3/day.
The table below summarizes the results for these two examples (note that the
total supply is 100m3/day and the total demand is 110 m3/day):
Note: In situations where several rows have equal priorities, the ~Remainder for
a particular row is equal to the total amount available to the row divided by the
number of remaining unmet equal priority rows. In this calculation, the equal
priority rows are ordered not based on the order they where entered, but from
smallest demand to largest demand.
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 an Allocator outputs discrete change signals, the outputs (including the
Unused output) preserve the Instruction of the input signal.
Note: If an Allocator outputs discrete change signals, signals with a zero value
andand “Add” Instruction are not propagated.
You can save the results for an Allocator element by clicking Final Values
and/or Time Histories.
Several example models which use a Allocator element (Allocator.gsm) can be
found in the General Examples folder in your GoldSim directory. This file
includes the use of an Allocator to simulate competing demands on a Reservoir.
Sum Elements Sum elements add values together. Although this can also be done using an
Expression, a Sum element provides a somewhat more convenient and user-
friendly way to create a sum if a large number of items are involved. More
importantly, it provides a powerful visual indication of what operation it is
carrying out, and this adds to the transparency of your model.
The properties dialog for a Sum element looks like this:
Sum elements have a single output, which must be a value, and can be specified
as a scalar, a vector or a matrix. You can specify whether the output is a scalar,
vector or matrix by pressing the Type… button. By default, a new Sum element
is a scalar, dimensionless value. You can also use Sum elements to operate on
and/or create vectors and matrices.
Read more: Using Vectors and Matrices (page 726).
You can save the results for a Sum element by clicking Final Values and/or
Time Histories.
You add an item to the Sum by pressing the Add Input button. A browser tree
showing all of the elements in the model will be displayed.
Note that this tree is organized by containment in the same manner as the main
browser. To insert a link from this dialog, you select a specific output object (or
an element having a primary output), and then press OK. If you press Cancel,
GoldSim will insert a new blank (zero) item. In either case, the dialog will close
and the item will be added to the list of inputs for the Sum:
The inputs to the Sum must all have the same attributes (data type, order,
dimensions) as the output. Note that the inputs can be expressions (in addition to
simply links). You can edit any of the input fields after the input is added (and
can insert links using the context menu for the input field).
As shown below, the browser view of a Sum element shows a single output, and
an input for each item in the Sum:
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).
An example model which uses a Sum element (Sum.gsm) can be found in the
General Examples folder in your GoldSim directory.
Lookup Table Lookup Table elements allow you to define your data in terms of a lookup table
Elements (or response surface). You define the table in terms of either one, two, or three
independent variables.
For example, consider the following table:
This table defines the value of a dependent variable in terms of two independent
variables (referred to as a row variable and a column variable). Hence, it is a
two-dimensional lookup table. If the row variable was equal to 40 m, and the
column variable was equal to 500 kg, the independent variable would take on a
value of 11.3; if the row variable was equal to 60 m, and the column variable
was equal to 1000 kg, the independent variable would take on a value of 17.5;
and so on.
When you define a table like this in GoldSim, it determines the value of the
dependent variable for any given values of the independent variables by
interpolating between the data points supplied in the table. For example, if the
row variable was equal to 30 m, and the column variable was equal to 500 kg,
the independent variable would take on a value of 10.3 (assuming linear
interpolation).
Lookup Table elements are unique in that you don’t reference them in the same
manner that you reference the outputs of other elements. Instead, you reference
them in the same manner that you would reference a built-in function (like sin or
min). That is, once you define a table like the one above, you reference it in
input expressions for other elements as if it were a custom function:
This expression instructs GoldSim to use the lookup table defined by the
element X_Table and compute an output value based on a value for the row
variable of 15m and a value for the column variable of 150kg.
An example model which uses a Lookup Table element
(LookupTable_Basic.gsm) can be found in the General Examples/LookupTable
folder in your GoldSim directory.
The manner in which you define and reference a Lookup Table is discussed in
detail in the sections below
Defining a Lookup The dialog for a Lookup Table element looks like this:
Table
Units. For the 3-D Table, you must specify the Row, Column and
Layer Units. In all cases, you must also specify the Result Units.
These are the units in which the data in the table will be specified for
the dependent variable (i.e., the result or output of the table).
3. You specify data points which define your table. This consists of a
dependent variable value for each of a number of specified
combinations of the independent variables. You can specify this data
table manually (by typing or pasting in the data), you can import the
data from a text file, or you can link the data directly to an external data
source (such as a spreadsheet file).
4. GoldSim determines the value of the dependent variable for any
combination of values of the independent variables by interpolating
between the data point supplied in the table. You must specify how
you want to carry out the interpolation (e.g., linear, log, next lower),
and how you want GoldSim to handle combinations of variables that
are outside the range of data supplied in the table (e.g., should GoldSim
extrapolate?).
Steps 3 and 4 are discussed in detail in the sections below.
Specifying Data in a 1-D You specify the data in a 1-D Lookup Table element manually by pressing the
Lookup Table Manually Edit Data… button.
The following dialog will be displayed:
simply click once in the cell representing the upper left-hand corner of the
region of the table into which you wish to paste the data, and press Ctrl+V.
When you paste data into a table, GoldSim will overwrite any data existing in
the target region, and if necessary, will automatically expand the size of the
table (i.e., add rows) to accommodate all of the data being pasted.
In addition to entering the data by hand, or pasting from another application, you
can also import data directly from a specially formatted text file. This is
discussed further below.
The values of the Independent Variable must increase monotonically as you
move downward in the table. When you press OK to close the dialog, GoldSim
automatically sorts the rows into the correct order, and also deletes all empty
rows.
Note: If, after defining a 1-D Table, you change the units for one of the
variables without changing the dimensions (e.g., from feet to meters), GoldSim
will automatically convert the existing data in the table to the new units. For
example, if one of the entries for a dependent variable was 1 ft, and you changed
the units for the dependent variable to meters, GoldSim would automatically
convert the entry to 0.3048 meters. If the units are changed in such a way that
the dimensions for the variable are different, the numbers will not be changed.
Note: If you are defining a 1-D Table, and the Row Variable represents the
simulation time (i.e., Time or Etime), instead of using a Lookup Table element,
you should use a Time Series element. This element is essentially a one-
dimensional lookup table that is specifically designed to represent Time Series
data (i.e., 1-D lookup tables in which the independent variable is time).
Importing 1-D Lookup GoldSim allows you to directly import a text file representing a 1-D Lookup
Table Data from a Text Table. The format for this text file is as follows:
File 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
For example, the following table:
Since you are importing a text file into a table in which the variables may have
dimensions, you must tell GoldSim the units of the data that you are importing.
Obviously, these units must be consistent with the dimensions specified for the
variables.
If the units specified here for the data in the text file are different from the units
for the variables specified in the Lookup Table dialog (but the dimensions are
consistent), GoldSim will convert the values in the text file when it imports them
into the table. If the dimensions are inconsistent, GoldSim will display an error
message and will not import the data.
Note: In addition to importing from a text file into a Lookup Table directly
from the Editing dialog, you can also link a text file to a Lookup Table, so that it
is imported automatically when the file changes.
You specify the data in a 2-D Lookup Table element manually by pressing the
Specifying Data in a 2-D Edit Data… button, which will display a dialog for defining the data in the
Lookup Table Manually table.
The following dialog will be displayed:
By default, the table is created with a single column and a single row, and all the
data values set to zero.
Within this dialog, you add rows and columns to the table using the Add Row(s)
and Add Column(s) buttons. If you hold down the Ctrl key when you press
these buttons, you will be prompted for the number of rows or columns to add
(otherwise, a single row or column will be added).To delete one or more rows or
columns, select them and press the Remove Row(s) or Remove Col(s) button.
The first column of the table is where you enter the values for the independent
(row) variable; the first row of the table is where you enter the values for the
second independent (column) variable, and the remainder of the table is where
you enter the values for the dependent variable (the result).
The fields in the table only accept numbers (they do not accept links). You
should not append units to the numbers. The assumed units for the values that
you enter are the units specified for the three variables on the main Lookup
Table dialog. These units are displayed in the row and column headers (for the
Row and Column Variables) and at the top of the dialog (for the Dependent
Variable).
You can paste data from a spreadsheet, Word document or comma delimited
text file into a 2-D table. To paste data from the Windows clipboard into a table,
simply click once in the cell representing the upper left-hand corner of the
region of the table into which you wish to paste the data, and press Ctrl+V.
When you paste data into a table, GoldSim will overwrite any data existing in
the target region, and if necessary, will automatically expand the size of the
table (i.e., add rows and columns) to accommodate all of the data being pasted.
In addition to entering the data by hand, or pasting from another application, you
can also import data directly from a specially formatted text file. This is
discussed further below.
The values of the Row and Column Variables must increase monotonically as
you move downward or across in the table. When you press OK to close the
dialog, GoldSim automatically sorts the rows and columns into the correct order,
and also deletes all empty rows and columns.
Note: If, after defining a 2-D Table, you change the units for one of the
variables without changing the dimensions (e.g., from feet to meters), GoldSim
will automatically convert the existing data in the table to the new units. For
example, if one of the entries for a dependent variable was 1 ft, and you changed
the units for the dependent variable to meters, GoldSim would automatically
convert the entry to 0.3048 meters. If the units are changed in such a way that
the dimensions for the variable are different, the numbers will not be changed.
Importing 2-D Lookup GoldSim allows you to directly import a text file representing a 2-D Lookup
Table Data from a Text Table. The format for this text file is as follows:
File number of dimensions (in this case, 2)
the number of columns, the number of rows
column value 1, column value 2, …, column value n
row value1, row value 2, …, row value n
dependent(row 1, column 1), …, dependent(row 1,column n)
dependent(row 2, column 1), …, dependent(row 2,column n)
…
dependent(row n, column 1), …, dependent(row n, column n)
For example, the following table:
2.5, 3, 5
5, 6, 10
The data in the file can be comma delimited or space delimited, and lines
beginning with "!" are ignored.
To import the text file press the Import Table… button in the Edit 2-D Table
dialog. Note that when you import a file, you will be prompted with the
following:
Since you are importing a text file into a table in which the variables may have
dimensions, you must tell GoldSim the units of the data that you are importing.
Obviously, these units must be consistent with the dimensions specified for the
variables.
If the units specified here for the data in the text file are different from the units
for the variables specified in the Lookup Table dialog (but the dimensions are
consistent), GoldSim will convert the values in the text file when it imports them
into the table. If the dimensions are inconsistent, GoldSim will display an error
message and will not import the data.
Note: In addition to importing from a text file into a Lookup Table directly
from the Editing dialog, you can also link a text file to a Lookup Table, so that it
is imported automatically when the file changes.
Specifying Data in a 3-D You specify the data in a 3-D Lookup Table element manually by pressing the
Lookup Table Manually Edit Data… button, which will display a dialog for defining the data in the
table.
A 3-D table can be thought of as a 2-D table with multiple layers or slices. The
Layer Variable defines the layer or “slice” of the look-up table, the Row
Variable defines the rows, and the Column variable defines the columns.
The following dialog will be displayed:
By default, the table is created with a single column, a single row and a single
layer, and all the data values set to zero.
Within this dialog, you view one 2-D layer or slice of the table at a time. Each 2-
D layer is associated with a particular value of the Layer Variable. When you
first create a 3-D Table, there is by default, a single layer (a single value for the
Layer Variable), and it is equal to 0. You can edit the value for a Layer Variable
by pressing the Edit Layer… button, which will display the following dialog:
You can only enter a number into this field and should not append units. The
assumed units for the values that you enter are the units specified for the Layer
Variables on the main Lookup Table dialog. These units are displayed just
above the Layer Variable edit field.
You can add additional layers by pressing the Add Layer button (which will
display the same dialog as shown above). The Delete Layer button deletes the
current layer. You can edit the value of an existing layer variable by pressing the
Edit Layer… button.
You add rows and columns to the table using the Add Row(s) and Add
Column(s) buttons. If you hold down the Ctrl key when you press these
buttons, you will be prompted for the number of rows or columns to add
(otherwise, a single row or column will be added). To delete one or more rows
or columns, select them and press the Remove Row(s) or Remove Col(s)
button. Note that all Layers have the same rows and columns.
Within this dialog, the first column of the table is where you enter the values for
the independent (row) variable; the first row of the table is where you enter the
values for the second independent (column) variable, and the remainder of the
table is where you enter the values for the dependent variable (the result).
The fields in the table only accept numbers (they do not accept links). You
should not append units to the numbers. The assumed units for the values that
you enter are the units specified for the three variables on the main Lookup
Table dialog. These units are displayed in the row and column headers (for the
Row and Column Variables) and at the top of the dialog (for the Dependent
Variable).
You can paste data from a spreadsheet, Word document or comma delimited
text file into a Layer of a 3-D table. To paste data from the Windows clipboard
into a table, simply click once in the cell representing the upper left-hand corner
of the region of the table into which you wish to paste the data, and press
Ctrl+V.
When you paste data into a table, GoldSim will overwrite any data existing in
the target region, and if necessary, will automatically expand the size of the
table (i.e., add rows and columns) to accommodate all of the data being pasted.
In addition to entering the data by hand, or pasting from another application, you
can also import data directly from a specially formatted text file. This is
discussed further below.
The values of the Row, Column and Layer Variables must increase
monotonically as you move downward or across in the table. When you press
OK to close the dialog, GoldSim automatically sorts the rows and columns into
the correct order, and also deletes all empty rows and columns.
Note: If, after defining a 3-D Table, you change the units for one of the
variables without changing the dimensions (e.g., from feet to meters), GoldSim
will automatically convert the existing data in the table to the new units. For
example, if one of the entries for a dependent variable was 1 ft, and you changed
the units for the dependent variable to meters, GoldSim would automatically
convert the entry to 0.3048 meters. If the units are changed in such a way that
the dimensions for the variable are different, the numbers will not be changed.
Importing 3-D Lookup GoldSim allows you to directly import a text file representing a 3-D Lookup
Table Data from a Text Table. The format for this text file is as follows:
File number of dimensions (must be 3)
the number of columns, the number of rows, number of layers
column value 1, column value 2, …, column value n
row value1, row value 2, …, row value n
layer value1, layer value 2, …, layer value n
dependent(row 1, column 1, layer 1), …, dependent(row 1,column n,
layer 1)
dependent(row 2, column 1, layer 1), …, dependent(row 2,column n,
layer 1)
…
dependent(row n, column 1, layer 1), …, dependent(row n, column n,
layer 1)
.
.
.
dependent(row 1, column 1, layer n), …, dependent(row 1,column n,
layer n)
dependent(row 2, column 1, layer n), …, dependent(row 2,column n,
layer n)
…
dependent(row n, column 1, layer n), …, dependent(row n, column n,
layer n)
The data in the file can be comma delimited or space delimited, and lines
beginning with "!" are ignored.
To import the text file press the Import Table… button in the Edit 3-D Table
dialog. Note that when you import a file, you will be prompted with the
following:
Since you are importing a text file into a table in which the variables may have
dimensions, you must tell GoldSim the units of the data that you are importing.
Obviously, these units must be consistent with the dimensions specified for the
variables.
If the units specified here for the data in the text file are different from the units
for the variables specified in the Lookup Table dialog (but the dimensions are
consistent), GoldSim will convert the values in the text file when it imports them
into the table. If the dimensions are inconsistent, GoldSim will display an error
message and will not import the data.
You can also import a text file representing a two-dimensional look-up table into
a layer. To do this, you define a 2-D table in a text file and press the Import
Layer… button. You will be prompted for the file to import (and the units for
the Row, Column and Dependent Variables). The data from the table overwrites
the information in the current layer.
Read more: Importing 2-D Lookup Table Data from a Text File (page 269).
Note: In addition to importing from a text file into a Lookup Table directly
from the Editing dialog, you can also link a text file to a Lookup Table, so that it
is imported automatically when the file changes.
In addition to allowing you to specify the data for a Lookup Table manually (by
Linking a Lookup Table typing or pasting in the data, or manually importing the data from a text file),
to an External Data GoldSim also allows you to link the data directly to an external data source.
Source
GoldSim provides four options for doing this:
You can link the table to a spreadsheet file;
You can link the table to a text file;
You can link the table to a database; and
You can link the table to an external program (a DLL) which outputs
the table directly to the Lookup Table element.
You link a Lookup Table to an external source by selecting a data source type
from the Data Source field at the bottom of the Lookup Table dialog:
By default, this is set to “None”. To link the Lookup Table to a Data Source,
you select a different option from this list box (MS-Excel, Yucca Mountain
Database, External DLL or ASCII Text File).
When you do so, a new tab is added to the dialog that allows you to define the
properties of the Data Source link.
The four options for linking to an external Data Source are described in detail
below.
Read more: Linking a Lookup Table to a Spreadsheet (page 274); Linking a
Lookup Table to a Text File (page 278); Linking a Lookup Table to a Database
(page 279); Defining a Lookup Table Using an External Function (page 280).
Linking a Lookup Table You link a Lookup Table to a spreadsheet by selecting “MS-Excel” from the
to a Spreadsheet Data Source field at the bottom of the Lookup Table dialog:
When you do so, a new tab (Excel) is added to the dialog that allows you to
define the properties of the spreadsheet link:
You must first enter the name of a Microsoft Excel spreadsheet file 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: GoldSim supports both .xlsx and .xls Excel files. However, if you have an
older version of Excel (prior to Office 2007), you will need to install Microsoft’s
Office Compatibility Pack in order to read .xlsx files. Excel 2007 and later
support an extended worksheet size (1,048,576 rows by 16,384 columns) than
earlier versions (65,536 rows by 256 columns). If you wish to import data from
an extended worksheet range into GoldSim, you must use Excel 2007 or newer,
and the file format must be .xlsx. Note that GoldSim does not officially support
versions of Excel prior to Excel 2003.
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 try to interact with a spreadsheet that is being used by GoldSim during a
simulation, all interaction with the spreadsheet is blocked by GoldSim.
However, under some circumstances this may not be possible and could lead to
errors. Hence, as a general rule, you should not use Excel while a Goldsim
model that references Excel is running.
If the Row Variable Starting Cell was specified as A2, the Row Variable values
would be imported as 10, 20, 30, 40 and 50. If the Column Variable Starting Cell
was specified as B1, the Column Variable values would be imported as 3, 6 ,9,
12, and 15. B2 would be imported as representing the dependent variable when
the Row Variable was equal to 10 and the Column Variable was equal to 3.In this
file A1 would never be used.
The values of the Row and Column Variables must be the same in
every Layer sheet. If they are not, GoldSim will not import the table.
Dependent data for a particular Row and Column Variable in a
particular Layer sheet is assumed to be at the intersection of these two
variables in the sheet. For example, if the Row Variable Starting Cell
was A2 and the Column Variable Starting Cell was in the B1, the
dependent variable for the first row and the first column would be
imported from B2:
If the Row Variable Starting Cell was specified as A2, the Row Variable values
would be imported as 10, 20, 30, 40 and 50. If the Column Variable Starting Cell
was specified as B1, the Column Variable values would be imported as 3, 6 ,9,
12, and 15. B2 would be imported as representing the dependent variable when
the Row Variable was equal to 10 and the Column Variable was equal to 3. In
this file, A1 represents the value of the Layer Variable for this sheet.
Note: When data is imported from Excel into a Lookup Table, it is assumed that
the values for the independent and dependent variables in Excel are in the same
units as those specified in the Lookup Table dialog.
Note: When data is imported from Excel into a Lookup Table, it will stop the
import and report an error if the values of the independent variables do not
increase monotonically as you move downward/across the table. That is, unlike
the case when you enter the data directly, GoldSim will not automatically sort
the entries.
Note: When you link a Lookup Table to a spreadsheet, the Edit Data… button
changes to View Data…. If you press this button to access the dialog
displaying the data, you will note that they are no longer editable. Once you are
linked to a spreadsheet in this way, you can not edit the data manually unless
you change Data Source back to “None”. When you do so, GoldSim keeps the
imported data and makes it editable.
If you want to ensure that you do not import data from the spreadsheet that has
been inadvertently edited since you last imported the data, you can choose to
“Lock onto” a spreadsheet file (by checking “Lock onto selected file” from the
Options>> button). If you are locked onto a file, GoldSim will not allow the
simulation to run if the file has been modified in any way (the file is set to read
only when it is locked onto). In order to run a simulation with a changed file,
you must first remove the lock (by clearing “Lock onto selected file” from the
Options>> button).
The example file (LookupTable_Spreadsheet.gsm) in the General
Examples/LookupTable folder of your GoldSim directory illustrates how the
Lookup Table data can be imported from a spreadsheet.
Linking a Lookup Table You link a Lookup Table to a text file (at runtime) by selecting “ASCII Text
to a Text File File” from the Data Source field at the bottom of the Lookup Table dialog:
When you do so, a new tab (Text File) is added to the dialog that allows you to
define the name of the text file:
You must first enter the name of a text file by pressing the Options >> button.
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 your default text editor.
The format for the text file is identical to the format used when importing into a
Lookup Table directly from the Editing dialog.
Read more: Importing 1-D Lookup Table Data from a Text File (page 266);
Importing 2-D Lookup Table Data from a Text File (page 269); Importing 3-D
Lookup Table Data from a Text File (page 272).
Note: Unlike the case when data is imported from a text file into a Lookup
Table directly from the Editing dialog, when the text file is linked to the Lookup
table through the Text File tab, it is assumed that the values for the independent
and dependent variables in the text file are in the same units as those specified in
the Lookup Table dialog.
Note: When data is imported from a text file into a Lookup Table, it will stop
the import and report an error if the values of the independent variables do not
increase monotonically as you move downward/across the table. That is, unlike
the case when you enter the data directly, GoldSim will not automatically sort
the entries.
GoldSim automatically imports data from the text file at the start of a simulation
if either 1) the filename has been changed; or 2) the file itself has been changed
since the last import. You can also import data manually at any time prior to
running a simulation (e.g., so you can view it) by pressing the Import Data
button in the Text File tab.
Note: When you link a Lookup Table to a text file, the Edit Data… button
changes to View Data…. If you press this button to access the dialog
displaying the data, you will note that they are no longer editable. Once you are
linked to a text file in this way, you can not edit the data manually unless you
change Data Source back to “None”. When you do so, GoldSim keeps the
imported data and makes it editable.
If you want to ensure that you do not import data from the text file that has been
inadvertently edited since you last imported the data, you can choose to “Lock
onto” a text file (by checking “Lock onto selected file” from the Options>>
button). If you are locked onto a file, GoldSim will not allow the simulation to
run if the file has been modified in any way (the file is set to read only when it is
locked onto). In order to run a simulation with a changed file, you must first
remove the lock (by clearing “Lock onto selected file” from the Options>>
button).
Linking a Lookup Table You link a Lookup Table to a database by selecting “Yucca Mountain Database”
to a Database from the Data Source field at the bottom of the Lookup Table dialog:
Note: Only 1-D and 2-D Lookup Tables can be linked to a database. GoldSim
does not currently support linking a 3-D Lookup Table to a database.
Note: When you link a Lookup Table to a database, the Edit Data… button
changes to View Data…. If you press this button to access the dialog
displaying the data, you will note that they are no longer editable. Once you are
linked to a database in this way, you can not edit the data manually unless you
change Data Source back to “None”. When you do so, GoldSim keeps the
imported data and makes it editable.
Defining a Lookup In some cases, you may wish an external program to directly generate the data
Table Using an External that you can use to dynamically define a Lookup Table element. To facilitate
Function this, GoldSim allows you to output the table from a DLL using an External
element.
You link a Lookup Table to an external function by selecting “External DLL”
from the Data Source field at the bottom of the Lookup Table dialog:
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.
In order to do so, you must first be familiar with creating DLLs and linking them
to GoldSim using External elements.
Read more: Using an External Element to Define Lookup Tables (page 880).
Note: When a Lookup Table is linked to an external DLL, you can view the data
once the model has been run. If you subsequently wish to edit the data, you can
do so by first removing the link to the external DLL (by changing Data Source
to “None”).
Controlling By default, the interpolation carried out by GoldSim to determine the value of
Interpolation and the Dependent Variable for a given value of the Independent Variable (i.e., the
Extrapolation for a argument) is done linearly with respect to both variables. However, you can
Lookup Table change the interpolation to be used for any or all of the variables. This is done
via the Interpolation drop-lists for the independent variables and the Result
Interpolation drop-list for the dependent variable:
for the table, GoldSim uses the largest independent variable entry in the
table that is less than or equal to the input argument. For example, if
your independent variable entries were 10, 20 and 30, and the input
argument was 17, GoldSim would assume an independent variable
value of 10.
Exact only: If this option is selected, the Lookup table will only accept
arguments that exactly match independent variable entries in the table.
If there is not an exact match, rather than interpolating between points,
GoldSim issues a fatal error.
The only options available for Result Interpolation are Linear and Log.
The general guidance below can be used to determine when to use Linear or
Log interpolation for the Result variable:
If you plot the Results against an independent variable, and it becomes
approximately a straight line, select Linear for both the Result and the
Independent Variable.
If you plot the logarithm of the Results against an independent variable,
and it becomes approximately a straight line, select Log for Result and
Linear for the Independent Variable.
When you define a Lookup Table, you must also specify how GoldSim is to
handle references to the table that are outside the bounds of the table. For
example, if your Row Variable varied between 1 and 10, and you used the
Lookup Table to evaluate a value for the Row Variable equal to 15, how should
GoldSim handle this?
The Handling of Data Outside Table Bounds field specifies how GoldSim is
to handle such an instance. GoldSim provides three options for 1-D Tables, and
two options for 2-D and 3-D Tables:
Fatal Error: This is the default. If you try to reference a point outside the
bounds of the table, GoldSim will display a Fatal Error message when you
try to run the simulation.
Do Not Extrapolate: If you try to reference a point outside the bounds of
the table, GoldSim will not extrapolate. Instead, it will compute the value
for the dependent variable based on the values for the independent variables
at the nearest portion of the defined region. That is, it assigns a value from
the nearest “edge” of the table.
Extrapolate: This option is only available for 1-D Tables. GoldSim
extrapolates beyond the range of the specified data by using the two closest
data pairs.
An example model which illustrates various interpolation and extrapolation
options (LookupTable_Interpolation.gsm) can be found in the General
Examples/LookupTable folder in your GoldSim directory.
Referencing a Lookup Lookup Table elements are unique in that you don’t reference them in the same
Table manner that you reference the outputs of other elements. Instead, you reference
them in the way that you would reference a built-in function (like sin or min).
That is, once you define a table, you reference it in input expressions for other
elements as if it were a custom function:
In either case, the table is inserted as a function (i.e., with parentheses for
arguments, and commas if there are multiple arguments):
Inverse Lookup: In some cases, you may want to do an inverse lookup into a Lookup Table. For
Referencing a 1-D example, suppose that you had defined a Lookup Table in which the
Lookup Table Using the independent variable is the volume of water in a pond, and the dependent
Dependent Variable variable is the water elevation in the pond (hence, the values in the table are
determined by the shape of the pond). You would then use the Table to return a
value for the water elevation for a specified value of the volume. However, what
if you wanted to know the corresponding volume for a specified value of the
water elevation?
GoldSim supports this by allowing you to carry out a reverse lookup; that is, you
can reference a 1-D table by sending it a value for the dependent variable, and
the function will return the corresponding value for the independent variable.
To implement this, you must add a second argument to the table function:
Tablename(Row Variable, TBL_Inverse)
Using the example described above, if you had a Lookup Table (named
Elevation) in which the independent variable is the volume of water in a pond,
and the dependent variable is the water elevation in the pond, then the following
expression would return the elevation corresponding to a volume of 150 m3:
In some cases, you may want to compute the integral or derivative of the
Computing the Integral function defined by a Lookup Table.
or Derivative of a 1-D
Lookup Table To implement these, you can add a second argument to the table function:
Tablename(Row Variable, TBL_Derivative): This returns the
derivative of the function at the specified row value.
Tablename(Row Variable, TBL_Integral): This returns the integral of
the table function up to the specified row value.
Tablename(Result Variable, TBL_Inv_Integral): This returns the row
value corresponding to a specified integral for the table result (the
result variable).
For example, if you had a Lookup Table (named VOL) in which the independent
variable was a length and the dependent variable was a volume, then the
following expression would return the derivative of the corresponding function
(an area) when the independent variable was 5 m:
The best way to illustrate how these functions are calculated is to consider a
simple example. Consider the following 1-D Table (named “Volume), in which
the independent variable has dimensions of length and the dependent variable
has dimensions of volume:
Surface_Area = Area_from_Elevation(Elevation)
An example model which illustrates these functions
(LookupTable_Functions.gsm) can be found in the General
Examples/LookupTable folder in your GoldSim directory.
Building a Dynamic Because all the values defining a Lookup Table must be constants, the definition
Lookup Table of the table cannot change dynamically.
In some situations, however, you may need to change the definition of the table
as a function of time. There are two ways to build dynamic lookup table logic:
You can define multiple Lookup Table elements, and use if,then logic
to switch between the different tables as a function of time; or
You can use a vector to define a lookup table. GoldSim provides
several array functions that allow you to interpolate into the entries in a
vector. Since vector entries can change with time, this allows you to
use this functionality to create a dynamic lookup table.
Read more: Using a Vector as a Lookup Table (page 740).
Browser View of a A Lookup Table is an unusual element in that it does not have any inputs that
Lookup Table Element accept links from other elements (since the entries to the table must be
numbers). As a result, when you view a Lookup Table in the graphics pane, you
will note that it does not have an input port:
In addition, the output of a Lookup Table itself is not an actual value; rather it is
simply a definition that does not take on a value unless you add the appropriate
arguments. As a result, you could not use the Link Cursor to connect a Lookup
Table to an input field.
As a result, the browser view of a Lookup Table is unusual in that it does not
show any inputs or outputs (even when you have chosen the option to display
these in the browser by selecting Show element subitems):
Note: If the table is defined using an external function, the Table does have an
input port and a single input – the table definition.
Read more: Defining a Lookup Table Using an External Function (page 280).
And elements have a single output, which is always a scalar condition. If all of
the input conditions to an And element are True, the output is True; otherwise,
the output is False.
You can save the results for an And element by clicking Final Values and/or
Time Histories.
You add an input to the element by pressing the Add Input button. A browser
tree showing all of the elements in the model will be displayed.
Note that this tree is organized by containment in the same manner as the main
browser. To insert a link from this dialog, you select a specific output object (or
an element having a primary output), and then press OK. If you press Cancel,
GoldSim will insert a new blank (False) item. In either case, the dialog will
close and the item will be added to the list of inputs for the element.
The inputs to the And element must all be conditions. Note, however, that the
inputs can be conditional expressions (in addition to simply links). You can edit
any of the input fields after the input is added (and can insert links using the
context menu for the input field).
The browser view of an And element shows a single output, and an input for
each input condition:
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).
Or elements have a single output, which is always a scalar condition. If all of the
input conditions to an Or element are False, the output is False; otherwise, the
output is True. You can save the results for an Or element by clicking Final
Values and/or Time Histories.
You add an input to the element by pressing the Add Input button. A browser
tree showing all of the elements in the model is displayed.
Note that this tree is organized by containment in the same manner as the main
browser. To insert a link from this dialog, you select a specific output object (or
an element having a primary output), and then press OK. If you press Cancel,
GoldSim will insert a new blank (False) item. In either case, the dialog will
close and the item will be added to the list of inputs for the element.
The inputs to the Or must all be conditions. Note, however, that the inputs can
be conditional expressions (in addition to simply links). You can edit any of the
input fields after the input is added (and can insert links using the context menu
for the input field).
As shown below, the browser view of an Or element shows a single output, and
an input for each input condition:
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).
Not elements are very simple. They perform a logical Not operation on a single
Not Elements input argument. That is, the output of a Not element is simply the opposite of its
conditional input. Although this can also be done using an Expression, a Not
element explicitly illustrates the operation being carried out, increasing the
transparency of your model and allowing you to create easy-to-read conditional
logic diagrams.
The properties dialog for a Not element looks like this:
Information Delay Information Delay elements are intended to be used to simulate delays in
Elements measuring, reporting, and/or responding to information. Such delays exist
because it invariably takes time to collect, assimilate and act on new
information.
These delays often have a critical impact on the dynamic behavior of systems.
Many systems that are observed to oscillate (e.g., commodity markets) involve
i such information delays.
In all of these examples, the reported or perceived value (i.e., the output of the
Information Delay) is computed based on the historical values of its inputs.
Note that because Information Delays usually represent processes such as
perception, measurement and reporting, by definition, these elements are
typically used to simulate human actions. In particular, they are often used to
represent the decision-making process of someone (or some group) in the
system being simulated. Hence, models that simulate a purely physical process
in which humans play no part rarely use Information Delay elements.
The properties dialog for an Information Delay element looks like this:
Note: The Initial Value must be a number or a link from a static variable (e.g., a
constant Data element or a Stochastic).
The Delay Time must have dimensions of time and must be positive.
Note: The Delay Time for an Information Delay must be greater than or equal to
the timestep. That is, GoldSim cannot delay a signal for a smaller time period
than a timestep. If you enter a Delay Time which is less than a timestep,
GoldSim internally treats the Delay Time as being equal to a timestep. Delay
Times that are less than or equal to zero will result in a fatal error.
The Dispersion drop-list provides three choices: “None” (the default), “Erlang
n”, and “Std. Deviation”.
If one of the latter two is selected, you must enter a value which quantifies the
degree of dispersion to the right of this field. If “Erlang n” is selected, you must
enter a dimensionless value greater than or equal to 1. If “Std. Deviation” is
selected, you must enter a value with dimensions of time. The value must be
greater than or equal to zero and less than or equal to the Delay Time.
If the Information Delay is specified as being an array (i.e., a vector or a matrix),
you can specify whether the Delay Time and Dispersion are defined as scalars
(with the same value being applied to all items of the array), or as arrays (with
different values applied to each item of the array). This is done via the Use
scalar delay time and dispersion checkbox. If this box is checked (the
default), the Delay Time and Dispersion must be entered as scalars. If the box is
cleared (which is only possible if the element is specified as an array), the Delay
Time and Dispersion must be entered as arrays.
You can save the results for the single output of an Information Delay element
by clicking Final Values and/or Time Histories.
Modeling Information The simplest use of an Information Delay element is to represent the delay of a
Delays without non-dispersed signal. To simulate such a system, the Dispersion must be set to
Dispersion “None”. In this case, the output at any time t is simply the input lagged by the
Delay Time:
Output(t) = Input(t -Delay Time)
An example of such a delay is any process where a variable is instantaneously
measured (e.g., the inventory in a warehouse) but not reported or received by a
manager or decision-maker until after a Delay Time. In the example shown
below, the variable changes as a step, but there is a 5 day delay in reporting the
value:
In the somewhat more interesting example shown below, the variable varies
continuously (as a sine curve with a period of 15 days), and there is a 5 day
delay in reporting the value. The Initial Value of the output of the Delay is set to
10:
Note that n = 1 (the highest level of dispersion allowed) is a special case referred
to as exponential smoothing. In this case, the calculation carried out by the
Information Delay element to compute its output is equivalent to exponentially
weighting the previous values (i.e., the most recent value has the highest weight,
and the weights of older values decrease exponentially). Exponential smoothing
is a commonly used forecasting model.
Read more: Simulating Forecasts Using Information Delays (page 299).
Specifying Initial Values Information Delays always have a specified Initial Value. The Initial Value is
for Information Delays assumed to have been the value of the input signal prior to the start of your
simulation. That is, it is the initial output of the Information Delay element. The
default is zero.
The ability to define an Initial Value is important since the actual processes that
you will be simulating may not necessarily start when your simulation begins.
That is, in many cases, the process probably will have been ongoing for some
time prior to the time that you decide to simulate it.
As a result, whatever your Information Delay actually represents (e.g., a
perception, a forecast) will have some real value at the start of the simulation,
and this value is not necessarily zero (the default). Therefore, you should take
care to properly define an Initial Value for your Information Delay.
Information Delays with In some cases, the Delay Time for your Information Delay may change as a
Time-Variable Delay function of time. For example, a company may recognize and respond to
Times improving economic conditions faster than deteriorating conditions. The figure
below shows a situation in which the time to perceive a change in the system is
faster when the current perceived state is less than the actual state (i.e., the state
of the system has improved) and slower when the current perceived state is
greater than the actual state (i.e., the state of the system has deteriorated).
To better understand how an Information Delay behaves when the Delay Time
changes, it is worthwhile to consider a simple example. In this example, we
assume no dispersion in the signal. The signal is a linear function of time. Prior
to 10 days, the Delay Time is equal to 1 day. After 10 days, the Delay Time is
equal to 5 days. The simulated result is shown below (Info_Delay is the output
of the Delay element):
To understand this result, let’s assume that the signal represents some
measurement, and before the measurement gets reported, it must pass through a
chain of ten individuals. Prior to 10 days, it takes 1 day for the information to
move through these individuals. After 10 days, it takes 5 times longer (e.g.,
perhaps they change from working 5 days per week to one day per week). Any
measurement received before 9 days is delayed exactly one day. Any
measurement received after 10 days is delayed exactly 5 days. Any
measurement received between 9 and 10 days (during the tenth day), is delayed
from 1 to 5 days. Measurements received early in the 10th day nearly made it all
the way through the chain of individuals before their work rate decreased (the
delay time increased). These signals are delayed for a little more than 1 day.
Measurements received late in the 10th day were not very far along the chain of
individuals before their work rate decreased. These signals are delayed nearly 5
days.
Mathematics of In the absence of dispersion and assuming a constant Delay Time, the output of
Information Delays an Information Delay is simply computed as follows:
Output(t) = Input(t - Delay Time)
If the signal is dispersed (or the Delay Time is variable), the solution involves a
convolution integral of the form:
t
Output(t) Input( ) f(t - )d
0
t n -1e -t / β
f(t)
β n (n )
where:
Browser View of an As shown below, the browser view of an Information Delay element shows a
Information Delay single output, and has three inputs (the Signal, the Initial Value, and the length
Element of the Delay:
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).
Material Delay Material Delay elements are intended to be used to simulate delays in the
Elements physical movement (flow) of material. These delays often have a critical impact
in the dynamic behavior of systems.
You would use a Material Delay element to simulate processes like the
movement of parts on a conveyor belt, the flow of water through an aquifer, the
movement of cars from one location to another, and the movement of letters
through the mail system.
Material is conserved as it moves through a Material Delay. In some cases, the
material may be dispersed while in transit. For example, if you send 100 letters
all at once, they will not be delivered at the same time. Rather, there will be
some variability in the time at which they are delivered (i.e., the delay time).
In other cases, the material is not dispersed. If a conveyor belt moves at a fixed
speed, there will be no variability in the transit times for items that are placed on
the conveyor.
The properties dialog for a Material Delay element looks like this:
A Material Delay requires one or more Inflows and a Delay Time. You can
optionally define the degree of Dispersion.
The element has two outputs: the primary output of the Material Delay is the
lagged flow (the Outflow), which has the same dimensions and order as the
Inflow. The secondary output is the amount of material in transit within the
Material Delay.
The best way to understand how to use Material Delays is to examine the
behavior of the element in a number of simple examples. A file containing these
examples (MaterialDelay.gsm) can be found in the General Examples folder in
your GoldSim directory.
Specifying the Inputs to Within the Material Delay properties dialog, two sets of Display Units must be
a Material Delay specified for a Material Delay (the Outflow Units and the Quantity Units), one
for each of the element’s outputs. The Outflow Units determine the dimensions
of the Material Delay’s primary output.
Note: GoldSim encourages (but does not require) you to specify Outflow Units
for a Material Delay whose dimensions are consistent with a flow of materials.
In particular, it expects the units to have dimensions of mass/time, volume/time,
energy/time, currency/time, or 1/time. When you first specify the Outflow Units,
GoldSim will warn you if your units do not have one of these dimensions.
GoldSim will not, however, prevent you from using other units. Note, however,
that in future versions of GoldSim, these requirements will likely be enforced.
The Inflows must have the same attributes (order and dimensions) as the
primary output (the Outflow). Although you can edit any of the input fields after
the Inflow is added, the Inflows must all be single links to another element (i.e.,
you cannot enter an expression here). In addition, the Inflows must be non-
negative.
Inflows can be deleted using the Remove Material Inflow button (the red X).
The Initial Outflow to the Material Delay must have the same attributes (order
and dimension) as the Outflow.
Note: The Initial Outflow must be a number or a link from a static variable
(e.g., a constant Data element or a Stochastic).
The Delay Time must have dimensions of time and must be positive.
Note: The Delay Time for a Material Delay must be greater than or equal to the
timestep. That is, GoldSim cannot delay a signal for a smaller time period than a
timestep. If you enter a Delay Time which is less than a timestep, GoldSim
internally treats the Delay Time as being equal to a timestep. Delay Times that
are less than or equal to zero will result in a fatal error.
The Dispersion drop-list provides three choices: “None” (the default), “Erlang
n”, and “Std. Deviation”.
If one of the latter two is selected, you must enter a value that quantifies the
degree of dispersion to the right of this field. If “Erlang n” is selected, you must
enter a dimensionless value greater than or equal to 1. If “Std. Deviation” is
selected, you must enter a value with dimensions of time. The value must be
greater than or equal to zero and less than or equal to the Delay Time.
If the Material Delay is specified as being an array (i.e., a vector or a matrix),
you can specify whether the Delay Time and Dispersion are defined as scalars
(with the same value being applied to all items of the array), or as arrays (with
different values applied to each item of the array). This is done via the Use
scalar delay time and dispersion checkbox. If this box is checked (the
default), the Delay Time and Dispersion must be entered as scalars. If the box is
cleared (which is only possible if the element is specified as an array), the Delay
Time and Dispersion must be entered as arrays.
You can save the results for the outputs of a Material Delay element by clicking
Final Values and/or Time Histories.
Modeling Material The simplest use of a Material Delay element is to represent the delay of a non-
Delays without dispersed material flow. To simulate such a system, the Dispersion must be set
Dispersion to “None”.
In this case, the Outflow at any time t is simply the Inflow lagged by the Delay
Time:
Outflow(t) = Inflow(t -Delay Time)
An example of such a delay is an assembly line that moves at a constant speed
(regardless of the rate at which material enters the line).
In the example shown below, the rate changes as a step (at 10 days), and it takes
exactly 5 days to traverse the line:
In the somewhat more interesting example shown below, the rate of addition to
the line varies continuously (as a sine curve with a period of 15 days). Again, it
takes 5 days to traverse the line:
Modeling Material In many cases, a material flow is dispersed, “smoothed” or “smeared” such that
Delays with Dispersion the output represents a weighted average of previous values for the input signal.
(With no dispersion, the weight for the input value at t – Delay Time is one, and
all other previous inputs have a weight of zero).
To specify that the material is dispersed, you must select either “Erlang n” or
“Std. Deviation” from the Dispersion drop-list. These are two alternative ways
to quantify the degree of dispersion while the flow traverses the delay.
Read more: Mathematics of Material Delays (page 307).
If the “Erlang n” is selected, you must enter a dimensionless value greater than
or equal to 4. As n increases, the degree of dispersion decreases. As n goes to
infinity, the dispersion goes to zero. The maximum amount of dispersion
allowed is represented by n = 4.
If “Std. Deviation” is selected, you must enter a value with dimensions of time.
The value must be greater than or equal to zero and less than or equal to the half
of the Delay Time. As the Std. Deviation decreases, the degree of dispersion
decreases. When the Std. Deviation goes to zero, the dispersion goes to zero.
The maximum amount of dispersion allowed is represented by Std. Deviation =
0.5 * Delay Time.
The Erlang n and the Std. Deviation are related by the following equation:
2
Delay Time
n
Std. Deviation
The figure below shows the response of a Material Delay to a step function at
ten days for various values of n:
Specifying Initial A Material Delay can be assigned an Initial Outflow (the default is zero). The
Outflows for Material ability to do so is important since the actual processes that you will be
Delays simulating may not necessarily start when your simulation begins.
In many cases, the process may have been ongoing for some time prior to the
start of the simulation. As a result, your Material Delay (e.g., an assembly line,
an aquifer, a pipe) probably already contains some material (and is outflowing
material) at the start of the simulation.
GoldSim allows you to specify the Initial Outflow for a Material Delay. The
Initial Outflow is related to the initial amount of material in transit by the
following equation:
Initial Amount in Transit
Initial Outflow
Initial Delay Time
Material Delays with In some cases, the Delay Time for your Material Delay may change as a
Time-Variable Delay function of time. For example, suppose a conveyor moves dirt from one location
Times to another. It is loaded at a constant rate of 2E6 kg/day. The conveyor moves
rather slowly, so that it takes 2 days for dirt which is loaded at one end to be
offloaded at the other end. Let’s further assume that at 10 days, the conveyor
breaks down, and it takes 3 days to fix it. The figure below plots the Outflow
Rate and the Amount in Transit for this simple model:
To understand this result, let’s first examine the Outflow curve. Prior to time =
10 days, the Outflow Rate is constant and equal to the Inflow Rate (i.e., it is at
steady state). At time = 10 days, the conveyor shuts down, and hence the
Outflow goes to zero. After time = 13 days, the conveyor starts up again, and the
Outflow resumes its original rate. At time = 15 days, however, a large spike of
material outflows, and then the Outflow returns to the steady state value again.
Where did this spike come from?
To understand this, examine the Amount in Transit output. Notice that while the
conveyor is stopped, the Amount in Transit continues to increase. This is
because the Inflow Rate has remained constant at 2E6 kg/day. This mass has to
go somewhere (Material Delays conserve mass), so it is “piled up” at the start of
the conveyor. Conceptually, it is as if the conveyor was continuing to be loaded,
even though it was no longer moving (i.e., a large pile was growing on the first
section of the conveyor. It is this “pile” that is released as a spike at time = 15
days (the height of the spike is actually off the scale shown here). Once the
conveyor restarted, it took 2 days for the pile to traverse the conveyor.
Of course, this simple example is not very realistic. In reality, they would stop
loading the conveyor (e.g., they would pile it next to the conveyor). This is true,
and in that case, we would need to control the Inflow Rate. In the simple model
above, the Inflow Rate was assumed to remain constant in order to explain the
functionality of the element. A more realistic way to represent this particular
system is to represent an inflow limit for the Material Delay (that might change
with time). In this example, the inflow limit would go to zero when the
conveyor stopped. The manner in which you could implement this is discussed
below.
Representing a Material In some situations, a Material Delay may have a physical limit with regard to the
Delay with an Inflow Inflow rate that it can accept. For example, an assembly line has a maximum
Limit rate at which it can accept and process parts. A road also has a maximum rate at
which cars can move along it. A conveyor belt has a maximum rate at which it
can accept material (e.g., it will have some weight limit), and when it stops
moving, this maximum rate goes to zero.
In this case, while the conveyor is stopped, material accumulates in the Pile (it is
not placed on the conveyor). The size of the Pile increases while the conveyor is
stopped, and then remains constant (since inflow to the Pile = outflow from the
Pile) once the conveyor restarts.
Mathematics of Material In the absence of dispersion and assuming a constant Delay Time, the output of
Delays a Material Delay is simply computed as follows:
Outflow(t) = Inflow(t - Delay Time)
If the flow is dispersed (or the Delay time is variable), the solution involves a
convolution integral of the form:
Outflow(t) Inflow( ) f(t - )d
0
t n -1 e -t / β
f(t)
β n (n )
where:
n is the Erlang value (specified by the user);
β = D/n;
D is the mean delay time; and
Г is the gamma function (not the Gamma distribution).
The Erlang distribution is equivalent to the distribution of passage times through
a cascaded series of n mixing cells, each of which has a mean residence time of
D/n. The gamma distribution represents the time until the occurrence of n
sequential Poisson-process events, where each event’s random time is
represented by an exponential distribution with mean D/n.
The gamma distribution is a generalized version of the Erlang distribution, and
does not require n to be an integer. Note that for n=1, the distribution is
exponential, and for increasing values of n it becomes less skewed, approaching
normality for large n.
The standard deviation of the gamma probability distribution is equal to D/√n.
The degree of dispersion for a Material Delay can be specified in terms of either
n or the standard deviation.
Read more: Modeling Material Delays with Dispersion (page 304).
GoldSim actually solves the convolution integral by first carrying out a
transformation of the time axis. This allows for accurate representation of
variable Delay Times.
The Amount in Transit within a Material Delay is computed by taking the
integral of the difference of the Inflow and the Outflow:
t
Amount in Transit(t) Inflow( ) - Outflow( ) d
0
Browser View of a As shown below, the browser view of a Material Delay element shows two
Material Delay Element outputs, and has at least three inputs (an Inflow, an Initial Outflow, and the
length of the Delay:
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).
Additional inputs appear for each Inflow that is added to the element.
Element Output
Integrator Current Value
Reservoir Current Value
Is_Full
Stochastic Current Value
Probability Density
Cumulative Probability
Script Result (primary output)
Extrema Current Value
Status Current Status
Element Output
Decision Last Decision
Milestone Completion Status
Date of Completion
Elapsed Time of Completion
Timed Event Generator Cumulative Number Emitted
Triggered Event Generator Cumulative Number Emitted
Discrete Change Cumulative Number Emitted
Information Delay Current Value
Material Delay Current Value
Amount in Transit
Event Delay Cumulative Number Emitted
Number in Transit
Number in Queue
Mean Time for Emitted Events
Current Service Time
Discrete Change Delay Cumulative Number Emitted
Number in Transit
Number in Queue
Conditional Container Activity Status
Completion Status
Previous Value Previous value of input
Time Series Current Value
History Generator Current Value
Outputs listed in bold fall into category #1 above (i.e., they can never be impacted by
inputs from the current timestep).
The icons for state variables are highlighted in browsers (e.g., output ports):
The Causality In order for GoldSim to determine how to carry out its calculations, it first must
Sequence and create the causality sequence for all of the elements. This represents the
sequence in which the elements must be logically computed. For example, if A
Element Updating
In this model, we are computing the volume of water in a pond. The inflow to
the pond (Pumping_Rate) is an Expression that is defined as a function of time.
Inflow1, Inflow2, and therefore Total_Inflow are constant values. The
Water_Level is a simple function of the Volume. So what does the causality
sequence look like for this model?
We can actually view the causality sequence by pressing F10, which brings up
the following dialog:
Read more: Viewing and Modifying the Causality Sequence (page 908).
There should be two items that immediately catch your attention here: 1) three
of the elements (Inflow1, Inflow2 and Total_Inflow) do not appear in the list;
and 2) the sequence is probably not what you would have expected (you may
have expected Pumping_Rate to be #1, Volume to be #2, and Water_Level to be
#3).
The first item can be explained by pointing out that there are actually two
different sequences: the Static Sequence and the Function Sequence. The Static
Sequence consists of those elements that only need to be computed once (at the
beginning of the simulation), since they cannot change with time. The Function
Sequence consists of those elements that can change as a function of time.
By default, the dialog displays the Function Sequence. If we choose to view the
Static Sequence (in the top right corner of the dialog), it looks like this:
These three elements cannot change with time, and only need to be computed
once. As expected, Inflow1 and Inflow2 are computed before Total_Inflow.
Returning to the Function Sequence, let’s explore why the sequence is in the
order that we see. To do so, we need to understand how GoldSim actually
carries out its calculations every timestep. As noted above, at the beginning of
the simulation, GoldSim first computes all of the static elements (i.e., those
elements in the Static Sequence). After doing so, it does not have to compute
these again for the rest of the simulation.
Every timestep, GoldSim carries out its calculations in three steps:
1. It changes the system clock to the appropriate time (e.g., moves it
forward a timestep).
2. It computes those elements that have state variables that are intrinsic
functions of time (e.g., Reservoirs).
3. It computes the elements in the Function Sequence.
Note that some elements (those that are instrinsic functions of time and can also
be updated by other elements) may actually be evaluated twice: first in step #2,
and again in step #3.
With this information, we can now understand the Function Sequence shown
above. Every timestep, after changing the system clock, GoldSim first computes
the state variables that are instrinsic functions of time. In this example, the only
element that falls into this category is the Reservoir named Volume. It then
computes the Function Sequence. First, it computes the Water_Level (based on
the updated value of the Volume). Then it computes the Pumping_Rate. Note
that this will not be applied until the next timestep when the Volume is
computed in step #2. Finally, it evaluates the Reservoir again. In this particular
case, however, no other element impacts the Reservoir, so its value is not
changed by the Function Sequence calculation. (However, the Reservoir
remembers its inputs for this timestep, to use the next time the clock is
advanced.)
Several additional points should be noted regarding the causality sequence:
The three steps above are not only carried out during scheduled
timesteps. They are also carried out during unscheduled timesteps that
GoldSim automatically inserts to more accurately represent the system,
and in some cases, may be carried out multiple times within the same
timestep (e.g., within a looping Container).
Read more: Understanding Timestepping in GoldSim (page 415).
Evaluating Feedback Many models have a direct chain of causality: input data affect some elements,
Loops which affect other elements, and so on, until eventually the elements that
calculate the desired results of the model are reached:
If we were to view the causality sequence for the simple looping system above,
it would look like this:
Every timestep, after changing the system clock, GoldSim first computes the
state variables that are instrinsic functions of of time. In this example, the only
element that falls into this category is the Reservoir named C. So C is first
brought up to the current time. After doing this, GoldSim then computes the
Function Sequence. First, it computes A (based on the updated value of C).
Then it computes the B. Note that B impacts the value of C for the next
timestep; not this timestep. Finally, GoldSim evaluates C again. (In some
cases, for example, if C was impacted by a discrete change, it would need to be
updated here. In this particular case, however, this is not the case, so C is not
changed by the Function Sequence calculation. It does, however, store the new
inputs for use the next time the clock is advanced.)
Note: In some cases, you may want to define circular logic that does not
conceptually represent a feedback loop (the loop does not represent a dynamic
process). Rather, you may wish to simulate a coupled system (i.e., a system that
responds immediately). A simultaneous system of equations is an example of
such a system. In GoldSim, these are referred to as recursive loops. If you tried
to build such a model, GoldSim would be unable to create a valid causality
sequence, and would display an error, warning you that the system is recursive.
GoldSim can still represent such systems, but in order to do so, it is necessary
for you to utilized one of GoldSim’s advanced features to remove the recursion
and/or iterate to a solution (e.g., Previous Value elements, Script elements, or
looping Containers).
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).
Read more: Finding Elements (page 116).
Invalid and When creating complex models, determining the appropriate causality sequence
Ambiguous Causality can sometimes become difficult. In particular, two problems can sometimes
occur:
Sequences
GoldSim may not be able to create a valid sequence at all. This is the
result of the system having circular (recursive) logic without a state
variable involved. If you tried to build such a model, GoldSim would
be unable to create a valid causality sequence, and would display an
error, warning you that the system is recursive. GoldSim can still
represent such systems, but in order to do so, it is necessary for you to
explicitly add a state variable to the system (typically, a Previous Value
element) to remove the recursion.
Read more: Creating Recursive Loops Using Previous Value
Elements (page 901).
GoldSim can sequence the system, but there may be more than one
valid way to sequence the system, and these produce different results.
This can occur, for example, if state variables that are impacted by an
event (e.g., a discrete change) affect another element. Should the
downstream element be updated before or after the state variable is
modified? From the point of view of GoldSim, both sequences for the
downstream element may be equally valid, but depending on the
application, you may specifically require one instead of the other. In
these cases, you can manually force a particular causality sequence to
ensure that the model accurately represents your system.
Read more: Addressing Ambiguous Causality Sequences (page 911).
Dan Quayle
Chapter Overview
Most of the elements in GoldSim (e.g., Reservoirs, Expressions, Time Series
elements) were designed primarily to be used to represent continuous variables
and processes. In many systems, however, processes occur that are discrete as
opposed to continuous. These discrete occurrences are referred to within
GoldSim as events. GoldSim provides powerful capabilities for superimposing
the occurrence and effects of discrete events onto continuously varying systems.
This allows for the realistic simulation of things such as financial transactions,
accidents, system failures, storms, labor strikes, and lawsuits. Events such as
these have important effects on the performance of many systems, and it is
therefore important to represent them in a realistic manner.
This chapter describes the GoldSim elements that you can use to simulate the
occurrence and consequences of discrete events.
In this Chapter The following topics are discussed in this chapter:
Basic Concepts of Discrete Event Modeling
Understanding Event Triggering
Generating Discrete Event Signals
Responding to Events
Generating Discrete Changes Using Time Series Elements
How GoldSim Inserts Events into a Simulation
Determining if an Event Has Occurred
Controlling the Calculation Sequence of Events
Note: Depending on how the event was generated, it may not fall exactly on a
“scheduled update” (i.e., a timestep that was defined in the Time tab of the
Simulation Settings dialog). That is, an event could actually occur between
scheduled updates of the model. Such events can trigger an “unscheduled
update” of the model.
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).
In this example, the “Trigger1” input only accepts (receives) discrete signals. The output
“”DiscreteChange1” produces (emits) discrete signals.
Within GoldSim, there are actually two types of discrete signals that can be
passed from one element to another: discrete event signals and discrete change
signals.
A discrete event signal is a discrete signal indicating that something (e.g., an
earthquake, a monthly bank deposit, a traffic accident) has occurred. It does not
describe the consequence of that occurrence; it simply emits a signal between
elements indicating that an event has occurred.
A discrete change signal, on the other hand, emits information regarding the
response to an event. In particular, a discrete change signal contains two pieces
of information: a value (e.g., 10 dollars) and an instruction (e.g., Add). A
discrete change signal can only be generated in response to an event. It can only
be received by a few select elements (e.g., a Reservoir, some Financial Module
elements) which understand how to process it.
Only certain elements in GoldSim can emit (as outputs) or receive (as inputs)
discrete signals. These elements and the manner in which they can interact with
discrete signals are summarized in the tables below.
Elements that Emit and Receive Discrete Event Signals
Element Emits Discrete Receives Discrete
Event Signals Event Signals
Timed Event x
Triggered Event x x
Event Delay x x
Decision x x
Random Choice x x
Stochastic x
Status x
Milestone x
Discrete Change x
Extrema x
Interrupt x
In addition to being triggered by discrete event signals, the elements indicated in
the right-hand column can also be triggered by discrete change signals (which
are treated as discrete event signals when entered into a field that accepts
discrete event signals).
Read more: Understanding Event Triggering (page 323).
Note: An additional type of element, a conditional Container, can also emit and
receive discrete event signals.
Splitter x x
Allocator x x
Note: Some elements in the various GoldSim extension modules can also emit
and receive discrete signals. The elements listed above only include those found
in the basic GoldSim framework.
The manner in which each of these elements can be used to simulate the
occurrence and consequences of discrete events is discussed in detail in the
sections below.
An example model which demonstrates the basic types of discrete event
configurations (DiscreteEvents.gsm) can be found in the General
Examples/Events folder in your GoldSim directory. The folder also includes
more detailed examples that utilize discrete event logic.
Note: Holding your cursor over the Trigger… button displays a tool-tip
summarizing the current trigger settings.
Note that for some elements, an additional button (for specifying Resource
interactions) is available on the Trigger dialog:
Note: There is one exception to this rule. The Deactivation trigger for
conditional Containers has a default defined trigger.
By default, the Type of event added will be “On Event”. If you click on the
small button in the Type column, a drop-list will be presented allowing you to
edit the event type:
Note: At Stock Test, At Date and At ETime triggers interupt the clock and insert
an unscheduled update when they occur (whereas On True, On False and On
Changed triggers do not create an unscheduled update). To understand the
implications of this, consider an example in which your scheduled updates were
every 10 days. There are two different ways you could try to trigger an event
when the value of Reservoir A became greater than the value B. You could
create an At Stock Test trigger of A > B, or you could create an On True trigger
of A > B. If we assume that A > B actually became true at 15 days, these two
triggers would behave very differently. The At Stock Test trigger would catch
this point exactly, and insert an unscheduled update at 15 days. In the absence
of any other unscheduled updates, however, the On True trigger would not be
evaluated and implemented until 20 days. Similarly, if you wished to trigger an
event at a specific elapsed time (e.g., 17 days), you could try to do so in two
different ways. You could trigger the event using an At ETime trigger of 17
days, or you could create an On True trigger with ETime >=17days. Again,
these two triggers would behave very differently. The At ETime trigger would
catch this point exactly, and insert an unscheduled update at 17 days. In the
absence of any other unscheduled updates, however, the On True trigger would
not be evaluated and implemented until 20 days.
Unless the Trigger Definition has a well-defined initial value (e.g., such
as a Reservoir), On Changed triggers cannot fire at the beginning of a
simulation (Etime = 0).
You should never reference an item of an array within an On Changed,
On True or On False trigger (e.g., On Changed vector1[A]). If you do,
the trigger will fire if any item of the vector changes (or becomes true
or false). If you need to do this, create a scalar Expression with the
appropriate definition and use that in the trigger.
On True events are triggered when the condition switches from False to
True. Conversely, On False events are triggered when the condition
switches from True to False. The one exception to this rule is the
behavior of these triggers at Etime = 0. In particular, an On True trigger
that is true at Etime = 0 (e.g., “Etime >= 0 days”) or an On False trigger
that is False at Etime = 0 (e.g., “Etime != 0 days”) will fire at Etime =
0.
You should generally not use equality conditions which reference Time
or Etime as a trigger (e.g., an On True triggering event with “Etime =
10 day”). This is because the expression is only evaluated every
timestep (and not between timesteps), such that if a timestep does not
fall exactly on the time referenced in the condition, the condition will
never be True. In such a case, it is always better to use expressions such
as “Etime >= 10 day”.
If the argument to the On Changed trigger is a Run Property that
conceptually cycles (e.g., Hour), and your timestep is such that the
actual value remains unchanged (e.g., Changed(Hour), with a 1 day
timestep), GoldSim will still consider that the argument has changed
after such a timestep (since the fact that it remains unchanged is simply
an artifact of timestepping).
Read more: Understanding and Referencing Run Properties (page
445).
Several elements have a checkbox on the Trigger dialog labeled For
simultaneous events, act once. If this box is checked and multiple
events occur at the same time, the element will be triggered only once.
If the box is cleared, the element will be triggered once for each event.
In cases where the triggering of an element multiple times by
simultaneous events would not make any difference (e.g., Stochastics),
this checkbox is not available in the Triggering dialog, and the
simultaneous events only trigger the element once.
The example model Triggers.gsm in the General Examples/Events folder of
your GoldSim directory contains examples of the various types of triggers.
Specifying a In some cases, it may be convenient to “hold” or delay the triggering of an
Precedence element until a particular precedence requirement is met. If the triggering event
occurs after the precedence requirement is met, the element is immediately
Condition for a
Trigger
The triggering of the element is “held” until the specified Precedence Condition
is met (the Condition becomes True), and then the element is triggered. Hence,
unless the Precedence Condition is met at the time that the triggering event
occurs, the element will be triggered (if it is triggered at all) after the actual
triggering event has occurred.
For example, suppose that you were simulating a project, and you wanted to
trigger a particular task to start. Before you can start the task, however, you must
first ensure that 1) you received the necessary permission (e.g., a building
permit); and 2) you had sufficient money to carry out the task.
To simulate this, you could model the permit process as a triggering event (i.e.,
obtaining a permit is a triggering event), while the Precedence Condition could
be modeled as a simple condition related to the amount of money available.
Your Triggering dialog might look like this:
Note: If you define multiple triggering events that occur at different times, and
you have specified a Precedence Condition, it is possible that both events could
occur (at different times), and then upon the Condition becoming true, both
would be simultaneously released. In such a case, if For simultaneous events,
act once is checked, only one event would be released.
Specifying a In some cases, you may not want to trigger an element unless a particular
Required Condition required condition is met at the time that the triggering event occurs.
for a Trigger To facilitate these kind of triggers, GoldSim allows you to specify a Required
Condition for a triggering event.
You add a Required Condition by pressing the More button on the Trigger
dialog to expand it, and then selecting the Then check if Required Condition
is True checkbox. When you do so, the Required Condition field becomes
available. The field accepts any condition output or conditional expression.
If the condition is True when the triggering event occurs, the element is
triggered; otherwise it is not triggered (i.e., the triggering event is ignored).
For example, suppose that you were simulating the performance of a dam, and
you defined an event (e.g., a storm) which resulted in the failure of the dam. The
dam only failed, however, if at the time the storm occurred, the dam’s spillway
was degraded to a certain extent.
To simulate this, you could model the storm as a triggering event, monitor the
spillway condition elsewhere in the model, and enter this as the Required
Condition that must be met in order for the element to be triggered.
Your Triggering dialog might look like this.
Note: Triggered events are not “held” until the Required Condition is met (as
they are for Precedence Conditions). If the condition is not True when the
triggering event occurs, the triggering event is ignored (i.e., discarded).
Specifying a A Resource is something that has a limited supply (e.g., spare parts, fuel, skilled
Resource Interaction personnel, money) and is required in order for elements of the modeled system
to carry out certain actions.
for a Trigger
Read more: Using Resources (page 781).
Only certain kinds of elements in GoldSim can interact with Resources. Some of
these elements can interact with Resources through their Trigger dialog. In
these cases, a Resources button is added to the dialog:
This button allows you to define Resource Requirements for the trigger. These
represent special conditions that must be met in order for the trigger to be
pulled. If they are not met, the trigger is held (similar to a precedence condition)
until the Resource Requirements are met.
Note: Holding your cursor over the Resources… button displays a tool-tip
summarizing the current Resource Requirements.
Triggered Events;
Decisions;
Random Choices; and
Event Delays.
These elements are described below.
Timed Event Timed Event elements produce discrete event signals based on a specified rate
Elements of occurrence.
The dialog for a Timed Event looks like this:
11 12 1
10 2
9 3
8 4
7 6 5
The first item that must be specified for a Timed Event is the Type.
The Type list box contains five choices:
Regular time intervals. The event occurs exactly according to the
specified Rate. Hence, if the rate was 0.5 day-1, the event would occur
exactly every two days, starting at two days. The Rate must have
dimensions of inverse time. If desired, you can specify the rate as a function
of time such that it changes during the simulation.
Random time intervals (Poisson). The event is simulated as a Poisson
process, such that the expected number of occurrences over some time
period T is equal to the product of the Rate and T. The mathematics of a
Poisson process are discussed in more detail in Appendix B. The Rate must
have dimensions of inverse time. If desired, you can specify the rate as a
function of time such that it changes during the simulation.
Stochastic element time intervals. For this event, a Stochastic element
must be specified (rather than a Rate). The Stochastic element that is
specified represents the distribution of the time intervals between events.
As such, it must have dimensions of time.The Distribution output of the
Stochastic must be referenced:
Note: Timed Event elements with a Defined cumulative event count do not
influence when the model is updated.
Note: Timed Events are designed to interrupt the clock and insert a new update.
If you choose to disable unscheduled updates, the events will be deferred to the
next scheduled update.
The discrete event signal output itself cannot be saved or viewed as a result.
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 discrete event signal output itself cannot be saved or viewed as a result.
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 first specify when the Decision is to be triggered via the Trigger… button.
The Trigger… button in the Decision dialog provides access to a standard
Trigger dialog.
Read more: Understanding Event Triggering (page 323).
When the element is triggered, it evaluates the Condition to test field to
determine which output will emit a discrete event signal. By default, there are
two discrete event signal outputs, which are named Case1 and Case3. The
Condition to test field accepts any condition output or conditional expression.
The ID of output can be modified by the user to any string. (Note, however, that
the same rules which apply for element names apply for these IDs.)
Read more: Editing an Element’s Name, Description and Appearance (page
85).
To understand how a Decision element works, consider the following example:
In this case, whenever the element is triggered, GoldSim evaluates the output
“My_Condition” (which must be a condition). If this condition is True, a
discrete event signal is emitted from the Yes output of the element (in this case,
named Decision1.Yes). Otherwise, a discrete event signal is emitted from the No
output of the element (in this case, named Decision1.No).
You can add a second condition (and a third output) by clicking the checkbox to
the left of the “else if” on the dialog.
discrete event signal is emitted from the “Left” output of the element (in this
case, named Decision1.Left). If neither of these conditions is True (i.e.,
My_Condtion is False and A<= B), a discrete event signal is emitted from the
“Center” output of the element (in this case, named Decision1.Center).
In addition to the two (or three) discrete event signal outputs associated with a
Decision element (which you provide a name for), an additional output is
produced called Last_Decision. This is a value which takes on one of four
values: 0, 1, 2, or 3. Prior to the Decision being triggered, it takes on a value of
0. After a Decision element is triggered, it records which of the three discrete
event signal outputs emitted the signal. These are always 1, 2 or 3. Note that
even if there are only two outputs, the last event signal output (the “else”) is
referred to as output 3.
The inputs to a Decision are the trigger(s) and any associated Precedence or
Required Conditions, as well as the test conditions. Decisions have up to three
discrete event signal outputs, along with the Last_Decision 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).
You first specify when the Random Choice is to be triggered via the Trigger…
button. The Trigger… button in the Decision dialog provides access to a
standard Trigger dialog.
Read more: Understanding Event Triggering (page 323).
You must then define a set of Probability/Event pairs. That is, you specify the
name of an Output Event (a discrete event signal output) and a corresponding
Probability.
By default, there are two Output Events, which are named Event1 and
LastEvent. The Output Event name can be modified by the user to any string.
(Note, however, that the same rules which apply for element names apply for
these IDs.)
Read more: Editing an Element’s Name, Description and Appearance (page
85).
You can define the Probability for all of the Events, except the last. The
probability of the last event is always equal to 1 – (the sum of the other
probabilities). The Probability can be specified as a number, links or
expression, and can change with time. At all times, however, the specified
values must sum to a value less than or equal to 1 (otherwise, a fatal error will
be displayed when you run the simulation).
When the element is triggered, it randomly selects one of the Output Events
based on the specified discrete probabilities, and emits a discrete event signal
from that output.
To understand how a Random Choice element works, consider the following
example:
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 first specify when the element is to be triggered via the Trigger… button in
the Event Delay dialog. The Trigger… button provides access to a standard
Trigger dialog.
Read more: Understanding Event Triggering (page 323).
Each time the element is triggered, it waits for a specified time, and then emits a
discrete event signal.
The delay time is computed based on a specified Delay Type. There are four
types:
Defined Delay Time.
Defined Delay Time + Erlang Dispersion
Defined Delay Time + Std. Deviation
Stochastic Delay Time Definition
The last three options allow the delay time to have a specified dispersion. That
is, they allow you to simulate variability in when a signal is emitted once the
element is triggered. This is equivalent to saying that there is a distribution of
actual delay times around some mean, and whenever the element is triggered,
the delay time for that event is sampled from a distribution.
The first three options require a specified Delay Time (or a Mean Time if
dispersion is specified). The Delay Time, and Mean Time must have
dimensions of time and generally should be positive.
The fourth option requires a Stochastic that represents a distribution of Delay
Times. The Stochastic element that is specified represents the distribution of the
delay time. As such, it must have dimensions of time. The Distribution output
of the Stochastic must be referenced:
Note: If the specified delay time is equal to zero, the event is emitted
immediately (i.e., on the same update) without any delay. A negative delay time
will result in a fatal error.
Note: The Use conveyer-belt approach box only impacts the behavior of the
Delay if the delay time changes with time.
Read more: Event Delays with Time-Variable Delay Times (page 349).
You can optionally specify that an Event Delay requires one or more Resources
in order to process the signal.
Read more: Specifying Resources for an Event Delay (page 350).
Event Delay elements have the ability to influence when a model is updated.
Typically, a model is updated at every “scheduled” timestep. That is, all the
elements are computed at every timestep. However, an Event Delay can force a
model to be updated between “scheduled” timesteps.
For example, suppose that you have specified a 10 day timestep. If an Event
Delay receives a signal at 20 days, and has a 3 day delay time, GoldSim will
insert an update (an “internal” event) between timesteps (i.e., at 23 days) in
order to more accurately represent the event.
Read more: Understanding Timestepping in GoldSim (page 415).
Warning: Event Delays are designed to interupt the clock and insert a new
update when the event is released. If you choose to disable unscheduled
updates, the event in the Delay will be deferred to the next scheduled update
(and hence the actual Delay Time will be longer than specified).
t n -1 e -t / β
f(t)
β n (n )
where:
n is the Erlang value (specified by the user);
β = D/n;
D is the mean delay time; and
Г is the gamma function (not the Gamma distribution).
f(t) is the gamma probability distribution, which is equivalent to (and a
generalization of) the Erlang distribution that is frequently used in simulation
models.
The gamma distribution represents the time until the occurrence of n sequential
Poisson-process events. Each event’s random time is represented by an
exponential distribution with mean D/n. The gamma distribution does not
require n to be an integer. Note that for n=1, the distribution is exponential, and
for increasing values of n it becomes less skewed, approaching normality for
large n.
The “Stochastic Delay Time Definition” option provides a way to specify a
custom distribution for the delay time (rather than the gamma used for the
Erlang and Std. Deviation options). If this option is selected, you must specify a
Stochastic element. The Stochastic element that is specified represents the
distribution of the delay time. As such, it must have dimensions of time. The
Distribution output of the Stochastic must be referenced:
Note: When dispersion is specified for a Delay, each event which triggers the
element is “assigned” an actual delay time by sampling from the distribution
presented above. As a result, when Event Delays are dispersed, the events will
not necessarily be "released" in the order that they were received.
Event Delays with Time- In some cases, the delay time for your Event Delay may be specified to change
Variable Delay Times as a function of time. You would do this by directly specifying the Delay Time
or Mean Time as varying as a function of time.
Whenever the Delay Time or Mean Time are specified to vary with time in a
simulation, you have two options as to how GoldSim can represent this.
If the Use conveyer-belt approach box is checked, GoldSim will treat the delay
as if it is a conveyer belt. In particular, if the Delay Time or Mean Time is
specified to become shorter (or longer) during the simulation (e.g., by defining it
as a function of time), it can be imagined that the speed at which the belt moves
has simply been increased (or decreased), and all events that are in the Delay at
the time of the change start to move faster (or slower) by a common factor (the
ratio of the old Delay or Mean Time to the new one).
For example, if the Event Delay was triggered at 10 days while the Delay Time
was equal to 1000 days, and again at 15 days at which time the Delay Time was
equal to 1 day, both signals would effectively be emitted at 16 days. That is, at
the time that the Delay Time decreased, the first event would not have traversed
a significant distance along the conveyer, and therefore it would be emitted from
the conveyer just slightly in front of the second event.
If the Use conveyer-belt approach box is cleared, each event is assigned an
effective delay time when it enters the Delay. Once an event enters the Delay, its
delay time is not impacted at all if the Delay Time or Mean Time is
subsequently specified to become shorter (or longer) during the simulation.
Referring to the example above, if the Use conveyer-belt approach box was
cleared, then the first event would be emitted at 1010 days, while the second
event would be emitted at 16 days.
Note: When using the “Stochastic Delay Time Definition” option, the Delay can
never act as a conveyer (the Use conveyer-belt approach box is cleared and
grayed out). Every event is assigned an actual delay time by sampling from the
Stochastic. If the Stochastic is modified during a simulation, it does not affect
events that have already been assigned a delay time.
The discrete event signal output itself cannot be saved or viewed as a result.
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).
Responding to Events
Elements such as Timed Events and Decisions can emit (and in some cases,
receive) discrete change signals. Ultimately, however, discrete event modeling
must involve discretely impacting an element in some manner in response to the
occurrence of the event. There are five elements that, when triggered, respond to
an event:
Discrete Changes;
Statuses;
Milestones;
Stochastics; and
Interrupts.
The manner in which these elements respond to events is described below.
Discrete Change The Discrete Change element is triggered by an event, and responds by emitting
Elements a discrete change signal. The triggering event can be a discrete event signal or
another type of event (e.g., a condition, such as X becoming greater than Y).
The discrete change signal output by the element can only be used by
a number of elements. In particular, it can be delayed by a Discrete
Change Delay element; and it can instantaneously impact the value
of an Integrator or a Reservoir. It can also act as an input to some
elements in GoldSim's specialized modules (e.g., the Financial
Module).
Read more: Propagating Discrete Signals Between Elements (page 321).
The dialog for a Discrete Change element looks like this:
You first specify when the element is to be triggered via the Trigger… button in
the Discrete change dialog. The Trigger… button provides access to a standard
Trigger dialog.
The discrete change signal output itself cannot be saved or viewed as a result.
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).
Discrete changes to the Integrator are entered In the Discrete Change field, or by clicking
the Multiple Discrete Change button.
The Discrete Change input only accepts discrete change signals. The
dimensions and order of the discrete change signals must be the same as those of
the Integrator.
When an Integrator receives a discrete change signal with an Add instruction, it
instantaneously adds the value of the signal to the Current Value of the
Integrator. When an Integrator receives a discrete change signal with a Replace
instruction, it instantaneously replaces the Current Value of the Integrator with
the value of the signal.
An Integrator can also accept a discrete change signal with a Push instruction,
which facilitates the modeling of aging chains.
Read more: Modeling Aging Chains (page 752).
An Integrator can accept multiple discrete changes. This is indicated in the input
field by separating the individual discrete change signals by semi-colons (e.g.,
Change1; Change2; Change3).
You can also specify the multiple discrete changes using the Multiple Discrete
Signals button, which displays a table listing the multiple discrete change
Multiple Discrete Signals signals:
button
Discrete changes to the Reservoir are entered in the Discrete Additions and Discrete
Withdrawals fields.
If the checkbox to the left of Additions in the Reservoir dialog is checked, then:
the input field is activated; and
if the Reservoir has an Upper Bound, a new output called
Discrete_Overflow is created on the element.
The Additions input accepts discrete change signals which have a positive value
Add instruction. It also accepts discrete change signals which have a Replace
instruction. The dimensions and order of the discrete change signal must be the
same as those of the Reservoir.
Note: If you have specified an Upper or Lower Bound, and choose to Replace
the current value of a Reservoir, the replacement value must be within the
bounds (or GoldSim will display a fatal error message).
If the checkbox to the left of Withdrawals is checked, then the input fields is
activated.
The Withdrawals input only accepts discrete change signals which have a
positive value and an Add instruction. The dimensions and order of the discrete
change signal must be the same as those of the Reservoir.
When a Reservoir receives a Discrete Withdrawal, it instantaneously subtracts
the value of the signal from Current Value of the Reservoir. In addition, a
discrete change signal (Discrete_Withdrawals) which echoes the Discrete
Withdrawal that was removed from the Reservoir is automatically emitted.
If the Reservoir has a Lower Bound and this is exceeded by the Discrete
Withdrawal, the Current Value is fixed at the Lower Bound, and the Reservoir
produces (emits) a discrete change signal (Discrete_Withdrawals) which
represents the actual Discrete Withdrawal that was removed from the Reservoir
(i.e., the difference between the Current Value prior to the withdrawal and the
Lower Bound).
Read more: Defining Upper and Lower Bounds for a Reservoir (page 239).
A Reservoir can accept multiple Discrete Additions and Withdrawals. This is
indicated in the input field by separating the individual discrete change signals
by semi-colons (e.g., Change1; Change2; Change3).
You can also specify the multiple discrete changes using the Multiple Discrete
Signals button, which displays a table listing the multiple discrete change
Multiple Discrete Signals signals:
button
Delaying a Discrete Discrete Change Delay elements provide a mechanism for delaying a discrete
Change Signal change signal. Once a Discrete Change Delay receives a discrete change signal,
it holds it for a specified time period, and then emits it.
The dialog for a Discrete Change Delay looks like this:
Within the Discrete Change Delay dialog, you must first specify which discrete
change signal(s) you wish to delay. The Input Signals field accepts only
discrete change signals. The discrete change signal inputs to a Discrete Change
Delay must all have the same attributes (order and dimensions) as the output.
The required order (scalar, vector or matrix) of the output signal is specified in a
dialog accessed via the Type… button. The required dimensions of the signal
are specified in the Display Units field. By default, the signal is a dimensionless
scalar.
A Discrete Change Delay can accept multiple discrete change signals. This is
indicated in the input field by separating the individual discrete change signals
by semi-colons (e.g., Change1; Change2; Change3).
You can also specify the multiple discrete changes using the Multiple Discrete
Signals button, which displays a table listing the multiple discrete change
Multiple Discrete Signals signals:
button
After defining the signal(s) to be delayed, you then define the delay itself. The
delay time is computed based on a specified Delay Type. There are three types:
Defined Delay Time.
Defined Delay Time + Erlang Dispersion
Defined Delay Time + Std. Deviation
The last two options allow the delay time to have a specified dispersion. That is,
they allow you to simulate variability in when a signal is emitted once the
element is triggered. This is equivalent to saying that there is a distribution of
actual delay times around some mean, and whenever the element is triggered,
the delay time for that event is sampled from a distribution.
All three options require a specified Delay Time (or a Mean Time if dispersion
is specified). The Delay Time and the Mean Time must have dimensions of
time and generally should be positive.
Note: If the specified delay time is equal to zero, the signal is emitted
immediately (i.e., on the same update) without any delay. A negative delay time
will result in a fatal error.
Note: The Use conveyer-belt approach box only impacts the behavior of the
Delay if the delay time changes with time.
Read more: Discrete Change Delays with Time-Variable Delay Times (page
361).
You can optionally specify that a Discrete Change Delay requires one or more
Resources in order to process the signal.
Read more: Specifying Resources for a Discrete Change Delay (page 362).
Discrete Change Delay elements have the ability to influence when a model is
updated. Typically, a model is updated at every “scheduled” timestep. That is,
all the elements are computed at every timestep. However, an Event Delay can
force a model to be updated between “scheduled” timesteps.
For example, suppose that you have specified a 10 day timestep. If a Discrete
Change Delay receives a signal at 20 days, and has a 3 day delay time, GoldSim
will insert an update (an “internal” event) between timesteps (i.e., at 23 days) in
order to more accurately represent the event.
Read more: Understanding Timestepping in GoldSim (page 415).
Warning: Discrete Change Delays are designed to interupt the clock and insert
a new update when the discrete change is released. If you choose to disable
unscheduled updates, the discrete change in the Delay will be deferred to the
next scheduled update (and hence the actual Delay Time will be longer than
specified).
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).
To simulate such a system, the Delay Type should be set to “Defined Delay
Time”. In this case, after being triggered, the element “holds” the signal for a
time period equal to the specified Delay Time, and after this delay, emits a
discrete change signal.
Modeling Discrete In some cases, when you are delaying a discrete change signal in a Discrete
Change Delays with Change Delay element, there may be some variability in delay times for signals.
Dispersion This is equivalent to saying that there is a distribution of actual delay times
around some mean, and whenever the element receives a signal, the delay time
for that signal is sampled from a distribution.
If we conceptualize the Delay as a conveyer belt for the signal, another way to
view signal dispersion is that as the signal moves along the belt, it slips
randomly forward or backward on the belt, with the amount of movement
proportional to the degree of dispersion.
You can specify such dispersion in the delay time in two different ways:
By specifying the dispersion in terms of an Erlang dispersion factor; or
By specifying the dispersion in terms of a standard deviation.
If “Defined Delay Time + Erlang Dispersion” is selected, you must enter an
Erlang n-value, which is a dimensionless value greater than or equal to 1. As n
increases, the degree of dispersion decreases. As n goes to infinity, the
dispersion goes to zero. The maximum amount of dispersion allowed is
represented by n = 1, which corresponds to an exponential distribution of delay
times.
If “Defined Delay Time + Std. Deviation” is selected, you must enter a Std.
Deviation, which is a value with dimensions of time. The value must be greater
than or equal to zero and less than or equal to the Mean Time. As the Std.
Deviation decreases, the degree of dispersion decreases. When the Std.
Deviation goes to zero, the dispersion goes to zero. The maximum amount of
dispersion allowed is represented by Std. Deviation = Delay Time.
The Erlang n and the Std. Deviation are related by the following equation:
2
Delay Time
n
Std. Deviation
If the signal is dispersed, for every signal received, the Delay Time for that
signal is sampled from the following distribution:
t n -1 e -t / β
f(t)
β n (n )
where:
n is the Erlang value (specified by the user);
β = D/n;
D is the mean delay time; and
Г is the gamma function (not the Gamma distribution).
f(t) is the gamma probability distribution, which is equivalent to (and a
generalization of) the Erlang distribution that is frequently used in simulation
models.
The gamma distribution represents the time until the occurrence of n sequential
Poisson-process events. Each event’s random time is represented by an
exponential distribution with mean D/n. The gamma distribution does not
require n to be an integer. Note that for n=1, the distribution is exponential, and
for increasing values of n it becomes less skewed, approaching normality for
large n.
Note: When dispersion is specified for a delay time, each signal received by the
element is “assigned” an actual delay time by sampling from the distribution
presented above. As a result, when signals in a Discrete Change Delay are
dispersed, the signals will not necessarily be "released" in the order that they
were received.
Discrete Change Delays In some cases, the delay time for your Discrete Change Delay may be specified
with Time-Variable to change as a function of time. You would do this by directly specifying the
Delay Times Delay Time or Mean Time as varying as a function of time.
Whenever the Delay Time or Mean Time are specified to vary with time in a
simulation, you have two options as to how GoldSim can represent this.
If the Use conveyer-belt approach box is checked, GoldSim will treat the delay
as if it is a conveyer belt. In particular, if the Delay Time or Mean Time is
specified to become shorter (or longer) during the simulation (e.g., by defining it
as a function of time), it can be imagined that the speed at which the belt moves
has simply been increased (or decreased), and all items that are in the Delay at
the time of the change start to move faster (or slower) by a common factor (the
ratio of the old Delay or Mean Time to the new one).
For example, if the Discrete Change Delay was triggered at 10 days while the
Delay Time was equal to 1000 days, and again at 15 days at which time the
Delay Time was equal to 1 day, both signals would effectively be emitted at 16
days. That is, at the time that the Delay Time decreased, the first item would not
have traversed a significant distance along the conveyer, and therefore it would
be emitted from the conveyer just slightly in front of the second item.
If the Use conveyer-belt approach box is cleared, each item is assigned an
effective delay time when it enters the Delay. Once an item enters the Delay, its
delay time is not impacted at all if the Delay Time or Mean Time is
subsequently specified to become shorter (or longer) during the simulation.
Referring to the example above, if the Use conveyer-belt approach box was
cleared, then the first item would be emitted at 1010 days, while the second item
would be emitted at 16 days.
Note: The Use conveyor-belt approach option is not available if you have
referenced the discrete change signal Value directly when specifying the delay
time.
Referencing the In some cases, the delay time for a Discrete Change Delay may be a function of
Discrete Change Value the Value that is associated with the Discrete Change signal being processed.
to Determine the Delay For example, perhaps the Discrete Change Delay represented a manufacturing or
Time treatment process, the Value of the signal represented the size of the item to be
processed, and the processing time was a function of the size.
This can be simulated by referencing "~DC_Value", which is a locally available
property within the Discrete Change Delay dialog:
Read more: Discrete Change Delays with Time-Variable Delay Times (page
361).
Note that the “~DC_Value” locally available property can be referenced in any
field in the Discrete Change Delay element, including those associated with
specifying Resource requirements.
Read more: Specifying Resources for a Discrete Change Delay (page 362).
The ability to reference the discrete change signal Value within a Discrete
Change Delay, coupled with the ability to reference the discrete change signal
Value within a Splitter, enables a wide range of discrete event processes to be
simulated within GoldSim.
Read more: Using Splitter Elements to Route Discrete Changes Based on Their
Value (page 363).
Specifying Capacities By checking the Maximum number of signals simultaneously processed
and Modeling Queues checkbox within the Discrete Change Delay dialog, you can specify a capacity
for a Discrete Change for the Delay in the input field directly below the checkbox.
Delay For example, if you specify this value as 3, the element can only have three
signals in transit at any given time. Any other signals that it receives are placed
in a queue. Signals in the queue must wait for one of the signals in transit to be
emitted before they can begin to traverse the delay. GoldSim keeps track of the
number of signals in transit (Num_in_Transit) and the number of signals in the
queue (Num_in_Queue).
Specifying Resources Discrete Change Delays can have specified Resource Requirements.
for a Discrete Change Read more: Using Resources (page 781).
Delay
To define one or more Resource Requirements for a Discrete Change Delay,
press the Resources… button on the main dialog for the element. The following
dialog will be displayed:
Note: The Quantity/Rate field can reference the locally available property
~DC_Value (the Value that is associated with the Discrete Change signal being
processed). This allows you to define a Resource Requirement that is a function
of this value.
Read more: Referencing the Discrete Change Value to Determine the Delay
Time (page 361).
Resources are an advanced feature, and you should read the sections below
before attempting to use them.
Using Splitter In some situations, you may want to route a discrete change signal based on the
Elements to Route Value it is carrying. For example, based on the Value associated with the
discrete change signal, you may want to route the item to different processing
Discrete Changes streams.
Based on Their Value
This can be accomplished by using a Splitter to route the discrete change signal
based on its Value. This is possible because 1) a Splitter can accept (and route)
discrete change signals; and 2) the specified fraction (or amount) for a Splitter
output can reference the value of the signal using the ~Amount local property.
Read more: Splitter Elements (page 255).
Note: If you only wanted to adjust the delay time for a single process, you could
do so without using the Splitter at all by defining a single Discrete Change
Delay and referencing the ~DC_Value. The example above is simply meant to
illustrate how you could split a signal into one of several processing directions
(which might each have many subsequent processing steps).
Read more: Referencing the Discrete Change Value to Determine the Delay
Time (page 361).
Status Elements Status elements allow you to monitor the status of something that is changed
instantaneously (i.e., is triggered) by events. The single output of a Status
element is a condition (True or False). The element has an initial condition (True
or False) and two triggers: one that sets the Status to True, and another that sets
the Status to False.
You would use a Status element to track the status or state of processes or
objects in your model. For example, if you were modeling a material handling
facility, you could use a Status element to signify whether or not a particular
storage area could accept any more material (i.e., is it full?). You might then
reference the output of the Status element in a Selector element or a Decision
element to determine the flow of material in your model.
The dialog for a Status element looks like this:
Within the Status dialog, you should first specify the Initial Condition for the
element (True or False). This can be entered as a condition (e.g., False) or a
conditional expression. By default, it is False.
You must then specify the triggering event(s) which cause the element to be set
to True and False. These are both defined via Trigger… buttons, which provide
access to standard Trigger dialogs.
Read more: Understanding Event Triggering (page 323).
Note: You don’t have to specify both the True and the False trigger. However, if
you do not specify the trigger that represents the opposite of the Initial
Condition, GoldSim will issue a warning when you close the dialog.
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 key inputs in the Milestone dialog are the triggering event(s) which cause
the Milestone to be set.. This is defined via a Trigger… button, which provides
access to a standard Trigger dialog
Read more: Understanding Event Triggering (page 323).
A Milestone also has several radio buttons and checkboxes.
If Event may only occur once is selected, then the Milestone records the time
that it was first triggered. If it is triggered multiple times, a warning message is
written to the Run Log.
If Event may occur multiple times is selected, then you must also select
whether the Milestone is to Store time of the first occurrence, or Store time of
the last occurrence. In the former case, the Milestone records the time that it
was first triggered and ignores any other events. In the latter case, the Milestone
records the time that it was last triggered.
If Record a warning message if this milestone is never achieved is checked, a
warning message is written to the Run Log if the Milestone is never triggered.
To better understand how a Milestone element works, consider the following
simple example. Assume that a Milestone element is triggered by an event that
occurs every ten days, the Milestone is defined such that Event may occur
multiple times is selected, and the Milestone is set to Store time of the first
occurrence. The output of the Etime output of the Milestone in this case would
look like this (note that in a chart, 1 corresponds to True, and 0 corresponds to
False):
The Milestone records when it was first triggered (at 10 days), and sets its
Completion Status to True (1).
Note that the initial value of the Etime output for a Milestone (i.e., its value prior
to being triggered) is zero (0). Similarly, the initial value of the Date output for a
Milestone (i.e., its value prior to being triggered) is the Start Date/time. This can
be misleading, because if the Milestone is never achieved during a realization,
the result will actually indicate that it was achieved at the beginning of the
realization (Etime = 0). Such a result is particularly confusing when viewing
probabilistic results.
To illustrate this, consider the following probabilistic result (accessed by
selecting the Etime output and viewing the Distribution Result…:
This plot indicates that about 30% of the time, the Milestone was achieved
immediately. In reality, about 30% of the time, it was not achieved at all, but
because the initial value for the time achieved was 0, the result indicates
otherwise.
To get around this problem (and provide additional Milestone results), the
Milestone element contains a Results tab:
At the bottom of the page are two buttons (Dates… and Elapsed Time…).
Pressing these buttons displays the probability distribution of when the
Milestone was achieved (in terms of calendar time or elapsed time, respectively)
considering only those realizations in which it was achieved. Here is the
Elapsed Time… result corresponding to the one shown previously:
As can be seen, the distribution no longer shows the (misleading) jump at Etime
= 0; it only includes those realizations during which the Milestone was achieved.
Note: The Dates… and Elapsed Time… buttons are grayed out when the model
is in Scenario Mode. That is, you cannot view these results when running and
comparing scenarios.
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 sections below describe the use of the Interrupt element in detail.
The example file Interrupt.gsm in the General Examples/Events folder of your
GoldSim directory includes a simple example on the use of Interrupt elements.
Specifying When the The key inputs to an Interrupt element are the interrupt triggers: the events
Simulation is to be and/or conditions that cause the simulation to be interrupted.
Interrupted These are defined via the Trigger… button, which provides access to a standard
Trigger dialog
Read more: Understanding Event Triggering (page 323).
The simulation will be interrupted whenever the trigger event occurs. Like all
triggers in GoldSim, the Interrupt trigger can consist of multiple events and
conditions.
In some cases, you may want to disable (turn off) an Interrupt element. When
an Interrupt is disabled, it does not interrupt the simulation. You can disable the
element by checking the box labeled Disable Interrupts by this Element at the
bottom of the page.
When you do so, you will notice that the symbol for the element in the graphics
pane (and browser) changes (to indicate that it is currently disabled):
! !
Interrupt Enabled Interrupt Disabled
Read more: Controlling the Message Dialog for an Interrupt (page 374).
Controlling the The middle part of the Interrupt element is used to control the message dialog
Message Dialog for an and the run log when a simulation is interrupted:
Interrupt
You can also specify whether or not additional information is included in the
message dialog when the simulation is interrupted via the Add Element and
Simulation Information to Message checkbox.
If this box is checked (the default), the message will look like this:
Note: If you have added special formatting to the message, this will be ignored
if the Add Element and Simulation Information to Message box is checked.
That is, the formatting only appears in the message box if the extra simulation
information is not written to the dialog.
Whenever a message dialog is displayed, you have the choice to Ignore for
remainder of simulation. If you check this box and then continue (by either
pressing the Continue button, or by pressing the Pause button and subsequently
resuming the simulation using the Run Controller), the Interrupt element that
triggered the message will be ignored for the remainder of the simulation.
Note: If the message is also written to the run log, and is specified to be written
as a Warning, the message dialog box displays a Warning symbol in the upper
left-hand corner. Otherwise, it displays an Information symbol.
Read more: Writing the Interrupt Message to the Run Log (page 377).
Continuing, Pausing When a simulation is interrupted and a message dialog is displayed, two buttons
and Aborting a are provided on the dialog: Continue and Pause:
Simulation After an
Interrupt
Pressing the Continue button simply closes the dialog and continues the
simulation. The simulation continues to the end (or until the next Interrupt
occurs).
Note: If you check the Ignore for remainder of simulation box and then press
the Continue button, the Interrupt element that triggered the message will be
ignored (disabled) for the remainder of the simulation.
Pressing the Pause button closes the dialog and pauses the simulation. When a
simulation is paused, the Run Controller appears and can be used to control the
simulation:
The options include aborting the simulation, resuming the simulation (which is
equivalent to pressing the Continue button in the Interrupt message dialog),
stepping one realization at a time, or stepping one timestep at a time.
Read more: Pausing and Stepping through a Simulation (page 460).
Once a model is paused, you can browse it and explore results in largely the
same manner you would if you were in Result Mode.
While a model is paused, you may decide you want to ignore future interrupts
before resuming the simulation. You can do this by navigating to the Interrupt
element, right-clicking on it, and selecting Ignore Interrupts from the context
menu before pressing the Resume button on the Run Controller.
You can control what part of the model is displayed in the graphics pane when
you press the Pause button in the message dialog using the On Pause, Select
this Element field in the Interrupt properties dialog:
The drop list always contains two options: "None" (the default), and "This
Interrupt Element". If "None" is selected, when you press the Pause button in a
message dialog, the model view does not change from the view when the
simulation was started. If "This Interrupt Element" is selected, when you press
the Pause button in a message dialog, GoldSim displays the Container in which
the Interrupt element resides. The drop list also contains any elements that are
directly referenced in the trigger dialog for the element. If one of these elements
is selected, when you press the Pause button in a message dialog, GoldSim
displays the Container in which that element resides.
If you choose to Abort the simulation using the Run Controller, GoldSim will
give you a choice of keeping results or discarding results (and returning to Edit
Mode). If you are running multiple realizations and have paused after the first
realization, a checkbox will be provided to give you the option of excluding the
current (partially complete) realization, or including it. If you choose to include
it, GoldSim will skip to the end of the realization (i.e., skip all further
calculations for the realization, keeping the values of all elements constant at
their last computed value).
Note: If you have aborted in the first realization and choose to save results,
GoldSim will automatically skip to the end of the realization (i.e., skip all
further calculations for the realization, keeping the values of all elements
constant at their last computed value).
Read more: The Causality Sequence and Element Updating (page 311).
Warning: If you abort a simulation and include the results from the last
(partially complete) realization, you should be careful with how you interpret the
results. In particular, because the last realization was not complete, it may be
inappropriate to combine it with or compare it to other (full) realizations.
Writing the Interrupt In some cases, in addition to (or instead of) displaying a message when an
Message to the Run interrupt occurs, you may want to also write a message to the run log.
Log Read more: The Run Log (page 506).
This is controlled by the Add to Run Log field in the Interrupt property dialog:
Note: If you choose to both display a message and write to the run log, the Add
to Run Log field has a small impact on the message dialog displayed when a
simulation is interrupted. In particular, if the message is written to the run log as
a warning, the message dialog box displays a Warning symbol in the upper left-
hand corner of the message dialog. Otherwise, it displays an Information
symbol.
Processing an Interrupt In some cases, you may choose not to show a message when an Interrupt is
When the Message is triggered. As discussed below, this is useful, for example, if you are using the
Off or Cannot be Interrupt to terminate a realization and skip to the end when a certain condition
Displayed occurs (e.g., a project completes). In other cases, it may not be possible to
display the message (e.g., when carrying out a distributed processing simulation,
a sensitivity analysis, or an optimization).
You must specify how you want GoldSim to handle the Interrupt when the
message is turned off or cannot be displayed. This is done via the Specify
Action When Message is off or cannot be shown field at the bottom of the
Interrupt property dialog.
The drop list contains five options:
"Continue Simulation". This is the default. The simulation continues.
"Skip remainder of current Realization and Continue". GoldSim skips
to the end of the realization (i.e., it skips all further calculations for the
realization, keeping the values of all elements constant at their last
compute value), and continues on to the next realization.
Note: This option is what you should select if you are using the Interrupt to
terminate a realization and skip to the end when a certain condition occurs (e.g.,
a project completes).
Note: Even if the message is turned off (or cannot be displayed), you can still
specify that the message is to be added to the run log. Note, however, that a run
log is not produced for sensitivity analyses and optimizations.
Read more: Writing the Interrupt Message to the Run Log (page 377).
In this case, four discrete change signals would be emitted by the element.
Discrete change signals emitted by a Time Series element always carry an
“Add” instruction.
Time Series elements that generate discrete change signals have the ability to
influence when a model is updated. Typically, a model is updated at every
“scheduled” timestep. That is, all the elements are computed at every timestep.
However, a Time Series element can force a model to be updated between
“scheduled” timesteps. For example, suppose that you have specified a 10 day
timestep. If a Time Series element has a discrete change that was specified to
occur at, say 23 days, GoldSim would insert an update (an unscheduled update)
between timesteps (i.e., at 23 days) in order to more accurately represent the
event.
Read more: Understanding Timestepping in GoldSim (page 415).
Warning: Time Series elements are designed to interupt the clock and insert a
new update when the discrete change is released. If you choose to disable
unscheduled updates, a discrete change that falls between scheduled updates will
be deferred to the next scheduled update. If multiple discrete changes occur
between scheduled updates, they will be summed and released at he next
scheduled update.
this is to use the Occurs function in the Required Condition field for each
element.
The Trigger dialog that captures this behavior would look like this:
Note: If you try to plot an Expression defined using the occurs operator, the
Expression will always show False (unless the event occurs exactly at a
scheduled update point), since by default, GoldSim only records results at the
scheduled plot points, and not at the unscheduled timesteps inserted by events
(which are the only points at which the Expression would be evaluate to True).
Note, however, that GoldSim provides an option to include unscheduled updates
in time history displays (under a specified set of conditions) in the Advanced
Time settings..
W i l l i a m S h a ke s p e a re
Chapter Overview
GoldSim allows you to customize the user interface in a variety of ways in order
to best match the way that you use the program. For example, you can modify
and create custom toolbars, change the appearance of the graphics pane, and
modify the appearance of elements and links. You can also create your own
custom units. This chapter describes how you can control and customize these
user interface components.
In this Chapter The following topics are discussed in this chapter:
Customizing Toolbars
Customizing the Appearance of the Graphics Pane
Editing the Appearance of Elements
Viewing and Creating Units
Customizing Toolbars
GoldSim has a number of toolbars that you can use to carry out common
functions. The available toolbars are as follows:
Standard toolbar: provides buttons for common actions (e.g., save a
file, run a model, copy, paste)
Drawing Tools toolbar: provides buttons for adding graphical objects
to your models
Zoom toolbar: provides buttons for zooming in and out within the
graphics pane
Graphical Tools toolbar: provides buttons for grouping, aligning,
rotating, and layering objects
Layout toolbar: provides buttons for spacing and resizing objects
You can turn these toolbars off and on, edit existing toolbars, create new
(custom) toolbars, and move them around the screen.
Activating and When you open GoldSim for the first time, the Standard toolbar and the
Deactivating Toolbars Drawing Tools toolbar are visible. The Standard toolbar is originally docked at
the top of the screen, and the Drawing Tools toolbar is originally docked to the
right of the graphics pane:
These tool bars can be hidden (deactivated), and other specialized toolbars can
be activated. To activate or deactivate a toolbar, right-click anywhere within a
toolbar (or the main menu). The following context menu is displayed:
You can also access this menu from the main menu via View|Toolbars.
Activated toolbars have a check mark next to them. To activate or deactivate one
of the toolbars, click on it.
Creating and You can edit existing toolbars and menu bars (i.e., add and/or delete items) or
Modifying Toolbars create new custom toolbars and menu bars by selecting Customize… from the
toolbar context menu (or View|Toolbars). This will display the following
and Menu Bars dialog:
This dialog has two tabs. The first (Toolbars) lists all of the available toolbars
(and whether they are currently active). You can create a new toolbar by
pressing New…, which will prompt you for a name. You can later change this
name by selecting the toolbar from the list and editing the Toolbar name field.
(You can only change the name of user-defined toolbars). When you create a
new toolbar, it will be activated (but will not contain any items).
You add and delete items on a toolbar using the Commands tab:
When you select a category from the list, all the buttons (or menu items) in that
category are shown. Clicking on one of these items displays its description. You
can add the button (or menu item) to a toolbar by dragging it and dropping it on
the toolbar. To remove an item from a toolbar (while this dialog is open) drag
the item from the toolbar to any other location on the screen (other than another
toolbar).
Note: When this dialog is not open, you can move items between toolbars (or
remove them from toolbars) by pressing the Alt key while dragging.
If you have modified one of the default toolbars, and wish to reset it to its
original configuration, open the Customize dialog, select the Toolbars tab, select
the toolbar, and press the Reset button.
Moving and Docking The toolbars (and any menu bars) are originally docked. You can undock them
Toolbars and Menu and move them to another location on the screen (e.g., the bottom, or to the right
of the graphics pane) by grabbing the docking grab bar at the left (or top) of
Bars the toolbar/menu bar and dragging it to the desired location:
If you drag it near the edge of the window it will dock itself at that edge. If you
press the Ctrl key while you drag, the toolbar or menu bar will become a
floating window.
You can also undock a toolbar or menu bar (and turn it into a floating window)
by double-clicking on the docking grab bar.
Saving Your Toolbar Whenever you customize a toolbar, the settings are saved in the Windows
Settings Registry (as opposed to with the GoldSim file). Therefore, the changes are
applied to all GoldSim files that you open on your machine. If someone else
uses your file, their own toolbar settings are applied.
Checking the Show Grid checkbox (which is cleared by default) adds a grid to
the graphics pane:
The grid spacing is fixed (it is a function of the size of the graphics pane) and
cannot be modified.
Checking Snap to Grid when dragging components (which is checked by
default) causes the upper left-hand corner of objects (elements and graphic
objects) to snap to the grid when they are moved in the graphics pane.
The Color button provides a list of colors that can be applied to the background
for the Container’s graphics pane.
Note: When you insert a new Container into a model, it inherits the properties
(e.g., grid setting and background color) of its parent Container. However, this
inheritance is only applied when the new Container is created, and the properties
of the new Container are not linked to the properties of the parent (e.g., if you
subsequently change the parent’s background color, it will not change the
background color of any existing child).
Adjusting the Size of If you scroll far enough horizontally or vertically within the graphics pane you
the Graphics Pane will eventually reach the "edge" of the graphics pane. That is, the graphics pane
represents a document of fixed size.
By default the graphics pane has a width of 17 inches and a length of 22 inches
(i.e., for any Container, if you view the graphics pane at a 100% scale, it will
appear to be 17 inches wide and 22 inches long, although you will have to scroll
to view the entire document).
If you would like to change the size of the graphics pane, you can do so from the
Graphics tab of the Container dialog.
At the top of this tab are several options related to adjusting the size of the
graphics pane:
The Width and Height fields can be used to change the size of the graphics
pane. These dimensions can be specified in inches, centimeters or millimeters
(as defined in the Units field). If Show Printer Page Boundaries is checked,
the boundaries of the printed pages in the graphics pane (as determined by your
printer settings) will also be shown in the graphics pane.
Note: When you insert a new Container into a model, it inherits the properties
(e.g., size of graphics pane) of its parent Container. However, this inheritance is
only applied when the new Container is created, and the properties of the new
Container are not linked to the properties of the parent (e.g., if you subsequently
change the graphics pane size in the parent, it will not change the graphics pane
size in any existing child).
Saving the Graphics Whenever you leave one Container in the graphics pane and enter (i.e., view the
Pane's Position and contents of) another, GoldSim remembers the position and scale for the previous
Container, and this information is written to the file when you save it. Hence,
Scale when you (or someone else to whom you have given the file) enter a Container,
it is automatically displayed at the same position and scale that it was last
viewed.
Note: If you clear the Use saved container scale and position checkbox in the
Graphic tab of the Options dialog (accessed via Model|Options…), this
information will be ignored, and all Containers will be displayed at 100% scale
in the upper left-hand corner of the page. This setting is saved to the Windows
Registry and is therefore applied to all GoldSim files that you open on your
machine.
Editing the GoldSim allows you change a number of the graphical properties of an
Appearance of influence. You can change its shape, thickness and color, and add text to the
influence. In addition to editing each influence separately, you can also modify
Influences the appearance of all influences in a Container from the Container dialog.
The details of how you can edit the appearance of influences is described in the
sections below.
Changing the Shape, By default, all links are initially drawn as curves (but are drawn with no
Thickness and Color of curvature). You can add curvature to the link by selecting it and dragging the
an Influence control point with your cursor:
You can further modify the appearance of influences by changing their color and
thickness, and changing their shape (straight lines or orthogonal lines). You can
do so by right-clicking on an influences, which will cause the following menu to
be displayed:
The Shape selection provides three options: Straight, Orthogonal and Curved.
Orthogonal influences consist only of vertical and horizontal lines:
The Color selection allows you to choose from a variety of colors. The Width
selection allows you to choose from 1 point (the default) to 6 points.
Note: You can globally modify the appearance of all influences in a Container
(or your entire model) based on the type of link they represent (e.g., values or
conditions). This includes changing the default for all new influences that are
drawn.
You add a node to an influence by clicking on it while holding the Ctrl key.
You can add as many nodes as desired. When you select the influence, the nodes
will be shown.
Once a node has been added, you can move a segment of the influence (between
two nodes) by dragging. When you move an influence segment, all nodes on the
influence will be moved the same distance as the segment.
You can move a single node (without moving the other nodes) by dragging the
node itself. To delete a node, click on it while holding the Ctrl key.
Note: If Snap to Grid when dragging components is selected for the graphics
pane, the segment or node will snap to the grid as you drag it.
Read more: The Graphics Pane Grid and Background (page 386).
Adding Text to an You can add text to an influence by right-clicking on the influence and selecting
Influence Add Label from the context menu, or Shft+double-clicking on the influence
(double-clicking on the influence while pressing the Shft key). This will add a
textbox to the influence with the word "Text" inside (which you can
subsequently replace with your own text).
You can edit the properties of the label (e.g., font, color, outline) by right-
clicking on the influence and selecting Properties…. This dialog is similar to
that used to edit the properties of text objects in the graphics pane.
Read more: Changing the Appearance of Text Objects (page 702).
To delete the text associated with an influence, select the text box, and press the
Delete key.
Controlling the The Graphics tab of the Container dialog provides access to options for
Appearance of All controlling the default appearance of all influences in the Container:
Influences in a
Container
The section of the dialog labeled “Influences” allows you to adjust the Influence
Shape, Color and Width of all influences in the Container. The appearance of
the influences can be specified differently depending on the type of output(s) in
the link(s) represented by the influence. By default, there are four types of
outputs that can be represented in a link: Values (the most common type of
output); Conditions (i.e., True/False); Transactions (discrete event and discrete
change signals); and Multiple Types (for an influence that contains more than
one type of output).
If you change the Influence Shape, or the Color or the Width for an Output
Type, and then press OK, GoldSim will modify all of the influences in the
Container, with the following exceptions:
GoldSim will not modify the appearance of influences inside any
Containers within the Container being edited.
Note: When you insert a new Container into a model, it inherits the properties
(e.g., Influence Shape, Colors and Widths) defined for its parent Container.
However, this inheritance is only applied when the new Container is created,
and the properties of the new Container are not linked to the properties of the
parent (e.g., if you subsequently change the parent’s Influence Shape, it will not
change the Influence Shape of any existing child Container).
Filtering Influences In some situations, you may wish to temporarily "hide" or "filter" some types of
influences in order to simplify the graphics pane. When you filter an influence,
the link(s) within the influence still exist, but the influence is not shown on the
graphics pane.
Influence filters are defined separately for each Container from the Graphics
tab of the Container dialog:
The section of the dialog labeled “Influences” allows you to Filter (Hide) all of
the influences in the Container. The filter can be specified differently depending
on the type of output(s) in the link(s) represented by the influence. By default,
there are four types of outputs that can be represented in a link: Values (the most
common type of output); Conditions (i.e., True/False); Transactions (discrete
event and discrete change signals); and Multiple Types (for an influence that
contains more than one type of output).
For example, if the Filter (Hide) checkbox was checked for “Conditions”, any
influences in the Container that just represented Condition outputs would be
hidden. GoldSim will not hide influences inside any Containers within the
Container being edited.
When you press OK to close the dialog, the filter is applied. You can toggle the
filter off (or on) by pressing Ctrl+H, by selecting View|Filter from the main
Filter on / Filter off menu or pressing the Filter button in the Standard toolbar. Note that turning the
filter off does not delete the filter definition.
Whenever filtering is activated, GoldSim indicates this in the filter button (it
looks depressed) and in the bottom right hand corner of the screen:
Note: When you insert a new Container into a model, it inherits the properties
(including the filter settings) defined for its parent Container. However, this
inheritance is only applied when the new Container is created, and the properties
of the new Container are not linked to the properties of the parent (e.g., if you
subsequently change the parent’s filter settings, it will not change the filter
settings of any existing child Container).
In some cases, however, you may wish to apply (copy) one or more of the
graphical properties that you have defined for one Container to another existing
Container in your model. GoldSim provides the ability to do this.
At the bottom of the Graphics tab of the Container dialog , GoldSim provides a
text button allowing you to Click to apply these settings to other containers
or subcontainers:
In the top part of the dialog, you specify the Container to which you wish to
copy the graphical settings. If you click the Apply to nested containers
checkbox, the settings will also be copied to all of the nested subcontainers
within the selected Container.
Note: If you wish to copy the settings to all the Containers in your model, select
the root Container (called “Model”), and check the Apply to nested containers
button.
The “Update Attributes” section of the dialog allows you to select which settings
you would like to apply. This is a tree that expands. If you want to apply all of
the attributes at a particular level, check the box at the branch (e.g., Update All
Influence Styles) and it will select all the items below it. Alternatively, you
could open a branch, and clear some of the checkboxes so only certain attributes
are copied:
After selecting the Container(s) to copy the attributes to, and the attributes to be
copied, click the OK button to copy the settings.
The dialog is tabbed. The first tab (General) controls the types of changes that
can be made to the appearance of the element:
Lock Appearance: If you check this box and then close the dialog, you can
no longer move or scale the element in any way. To unlock appearance
editing, you must select Unlock Appearance from the context menu for the
element.
Allow Move: If this box is checked (the default), you can move the element
around within the graphics pane. Otherwise, its position remains fixed.
Allow Label Move: If this box is checked you can select and move the
element's label (separately from the element). If the box is cleared (the
default), the label can only be moved with the element symbol 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). Pressing the Shft key while scaling the
object keeps the same aspect ratio; pressing the Ctrl key while scaling
keeps the center of the object at the same location.
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.
The remaining tabs are used to implement the various types of changes. These
tabs are discussed below.
The Image tab of an element’s Appearance dialog allows you to change the
Changing the image used for the element in the graphics pane.
Element's Symbol
If you select the User-defined symbol radio button in this tab of the dialog, 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). Select a file and press
OK. If the new image is a different size than the old image (which will typically
be the case), you will be asked whether you want to adjust the size of the new
image to match the size of the existing element or to adjust the size of the
element to match the size of the new image.
GoldSim utilizes enhanced metafiles (emf) for element 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 using a vector format (i.e., 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 Graphics | Export… from the main menu
(or press Ctrl+E);
3. Specify that you wish to save the file as an enhanced metafile.
Read more: Adding Images (page 707).
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 also change or reset the images for multiple elements in a model (e.g.,
all elements of one type) by selecting Graphics|Change Symbols… from the
main menu.
Two additional buttons are also present 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 symbol’s height).
In some situations, you may wish to reset the images for all elements in a model
Globally Resetting the (or in a particular Container) back to the default symbol. You can accomplish
Images of Multiple this by selecting Graphics|Change Symbols… from the main menu, which
Elements will display a dialog for globally changing and resizing symbols.
Within this dialog, you first select whether you wish to Change Symbol and/or
Change Symbol Size for the selected elements. When changing a symbol, you
can either revert the selected elements to the original (default) symbol (assuming
you have previously modified the symbols in some manner), or you can select a
user-defined symbol.
If you wish to change the symbol to a user-defined symbol, the file must be an
enhanced Windows metafile (.emf). GoldSim utilizes enhanced metafiles for
element 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.
When changing the symbol size, you can choose to either scale the image to a
Percent of Default (a fraction of the element’s default image size) or directly
specify the Pixel Width (the width of the image in pixels).
After specifying the type of change you wish to make, you must specify the
scope of the changes (i.e., what elements the changes will be applied to). The
Scope of changes drop-down list has up to four options:
Selected elements only: Only the elements that have been selected
(prior to opening the dialog) are modified. This option is only available
if one or more elements have actually been selected.
Current container only: Only the elements in the current Container
(but not any elements in any child Containers) are modified.
Current container only + children: Only the elements in the current
Container (and any elements in child Containers) are modified. This
option is only available if you are inside a Container that contains other
Containers.
You can choose one of nine positions for the label. Note that if one of these nine
positions is not sufficient, you can manually move the label by selecting just the
label and dragging it. Note, however, that in order to manually move the label in
this way, the Allow Label Move box must be checked in the General Tab.
Changing the Two tabs within the Appearance dialog of an element control the appearance of
Element's the element's background and outline. The Line tab allows you to draw a line (a
box) around the symbol and label.
Background and
Outline
By default, the line is transparent. You can, however, turn off the transparency
and then edit the line's color, style (e.g., solid, dashed, etc.) and width (number
of points or pixels). 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 GoldSim Units The GoldSim Units Manager allows you to view all of the units that GoldSim
Manager recognizes. You can also use the Units Manager to add new units if necessary.
You can access the Units Manager by selecting Model|Units… from the main
menu, which will display the following dialog:
Clicking the Plus sign next to a category expands the category to show its units.
This dialog initially displays the unit categories in the model. A unit category
has a name and a specific set of dimensions (displayed in the Description
column). The abbreviations for the dimensions are as follows:
Dimension Abbreviation
Mass M
Length L
Time T
Temperature t
Current C
Amount* A
Luminosity l
Angle <
Currency $
*Used for a quantity of matter (i.e., moles)
If you expand a category (by clicking on the category folder's "+"), the units in
that category are displayed:
When a category is expanded to show units, the first column contains the unit's
abbreviation, the second contains its description, and the third contains the
conversion factor between the unit and the "internal units" for that category
(e.g., SI units).
By default, GoldSim only shows the primary SI unit (e.g., m for length).
However, GoldSim recognizes all of the SI unit prefixes. If you check the Show
all SI unit prefixes box, they will also be displayed:
Note: The Remove button on the dialog is for deleting units. However, you
cannot delete the built-in units (and the button is greyed out when these units are
selected). Only custom units that you have created can be removed.
Creating New Units Occasionally, the internal units supplied by GoldSim may not be sufficient, and
you will want to create your own custom unit. You can do this by pressing the
Add button in the Units Manager dialog (accessed via Model|Units… from the
main menu). This will display the following wizard for creating a new unit:
To create a new unit, enter the alphanumeric Abbreviation for your new unit,
along with a brief Description string. Pressing Next> will bring up the second
page of the wizard:
In this dialog, you must enter an expression that defines the new unit in terms of
existing units. For example, if you were defining a new unit for length that was
equal to 5 feet and 7 inches, you would type in 5 ft +7 in.
After defining the unit, pressing Next> will bring up the third (and final) page of
the wizard:
All units are placed into Categories, which are used to group the units within the
Units Manager (and in context menus for units in element dialogs). When you
define a new unit, GoldSim will display existing categories that have the
appropriate dimension.
Note: The dimensions for a Category do not have to be unique. For example, the
Categories Displacement, Length and Wavelength could all have dimensions of
L (length).
If you select “New Category” (the only option if there are no existing Categories
with the appropriate dimensions), the dialog prompts you for the name of the
Category:
You may want to add a new unit if you wish to use a different abbreviation in
your expressions. For example, if you wished to use the unit “year” to denote a
year of time, you could create a new unit with an abbreviation of "year" (the
built-in abbreviations for a year of time in GoldSim are yr and a).
Note: Due to the special nature of currency units (unique, constant conversion
rates cannot be assigned), GoldSim provides a special mechanism for creating
and editing currency units. In particular, a special dialog for specifying and
editing currency units can be accessed by pressing Model | Currencies… from
the main menu. You cannot edit conversion rates in the Units Manager.
Specifying and editing currency units is described in detail in Chapter 3 of the
GoldSim Financial Module User's Guide.
The Remove button allows you to delete user-defined units (you can only delete
user-defined units; built-in units cannot be deleted). Note that if you try to delete
a user-defined unit that is being used in an expression somewhere in your model,
GoldSim will not allow you to do so, and will provide the following message:
Pressing the Show References… button displays a list of all of the elements
which reference the unit.
Creating New Units for In some cases, you may want to create a new unit to track particular items (such
Items (Such as as widgets, boxes, patients, etc.). Such a unit actually represents an amount of
Widgets) something. You could leave objects like these dimensionless, but for the
purpose of viewing and plotting results, it may often be useful to assign units
(e.g., 10 boxes instead of simply 10).
To do this, you can create a new dimensionless, as follows:
1. Create a new unit (e.g., widgets, with the abbreviation wdg)
2. When defining a value for the unit, define it as: 1 item.
3. Assign your new unit to the “Items” category.
Item is a built-in unit with no dimensions assigned to the “Items” category. The
“Items” category also has several other built-in commonly required
dimensionless units (pers for persons, kpers for thousands of persons, and Mpers
for millions of persons).
You can repeat this process for other items (e.g., bolts, nuts, cars, etc.).
Warning: If you define two “item units” like this, they can be added together
and their resulting units would be dimensionless. For example, if a bolt was
defined as 1 item, and a nut was defined as 1 item, you could add 100 bolts to
200 nuts, and express the result in any dimensionless unit (e.g., pers).
That is, these units are stored separately on your computer (i.e., not just
in the model file itself). These are highlighted in bold red font in the
Units Manager, and are referred to here as system units.
Units that are only stored within the model file itself, and are not
available to any other models that you edit on your computer. These are
highlighted in red (but not bold) in the Units Manager, and are referred
to here as model units.
Any unit that you create on your computer automatically becomes a system unit
(i.e., it is stored in the system units file, and hence is subsequently available to
any other model you open on your computer.
Whenever a file is saved, any user-defined units that it uses are saved with the
file. Therefore, if you open a file that contains user-defined units created by
someone else, these units will be available in the file (as model units). They will
not, however, become part of your system units file. That is, they do not
become system units and are only local to that model. Hence, they would
appear in the Units Manager when viewing that file, but would not be bold.
Note: If you open a model with a user-defined model unit, and the same unit is
defined as a system unit on your computer (but has a different definition),
GoldSim will display a warning message. The model unit will be ignored and
the system unit will be applied for that model (which could cause some
expressions to become invalid).
If you have opened a file with a model unit, and you would like to convert this
to a system unit (so it is available to other models that you open or create), you
can do so as follows:
1. Open the Units Manager.
2. Find the unit and click on it.
3. Click through the Wizard until you press Finish.
4. The unit will then become a system unit.
If you want to delete a system unit from you computer (so it is no longer
available to other models you open or create), you can do so as follows:
1. Open the Units Manager.
2. Find the unit and select it.
3. Press the Remove button.
4. If the unit does not exist in the current file, it will immediately be
removed from the Units Manager (and hence will no longer be a system
unit). If the unit does exist in the current file, it will be converted from
a system unit to a model unit (and hence will no longer be bold in the
Units Manager).
When managing user-defined units, you must take care when copying portions
of a model that utilize user-defined units between files:
If you copy a portion of one model which references a user-defined unit
to a second model which does not have that unit, you will need to
create the unit in the second model (since otherwise it will not
recognize the unit).
Using the Percentage GoldSim provides a special percentage unit (%). You can enter a number as a
Unit Symbol percentage, and GoldSim will automatically treat this as a fraction:
You can also use this as a display unit, so that fractions are displayed as
percentages:
Read more: Defining Upper and Lower Bounds for a Reservoir (page
239).
Conditional Container activations and deactivations: This option
records the times of activation and deactivation for all Conditional
Containers, and in the case of deactivation events, indicates whether the
Container’s Completion status was true when it was deactivated.
Read more: Activating a Container (page 846); Deactivating a
Container (page 847).
The Graphic Tab of The Graphic tab of the Options dialog provides a number of options for
the Options Dialog controlling the way that graphics behave in GoldSim. These options are listed
below.
Use saved container position and scale: If this checkbox is checked (the
default), GoldSim remembers the scale and the location of a Container
when you leave it. When you reenter the Container, it is displayed at the
same scale and at the same position. Otherwise, once you leave the
Container, all position and scale information is lost (it is reset back to the
default – 100% and upper left-hand corner).
Use default line and polyline head: This is the default line head used when
you add a line or polyline to the graphics pane.
Specify font used for new and pasted text: This is the font used when you
add a text object to the graphics pane (by inserting a text object or pasting
text from the clipboard).
Tabs in pasted text: These options allow you to control how text with tabs
that is pasted into the graphics pane is treated. You can instruct GoldSim to
delete the tabs, or replace them with spaces.
The Results Tab of The Results tab of the Options dialog provides a number of options for
the Options Dialog controlling the way that Results are displayed. The first two options control how
numeric values are displayed in charts, tables and tool-tips:
Mininum number of signficant figures to display: This allows you to
control the number of significant figures displayed in result displays and
tool-tips (as described below). This setting can be changed dynamically
from within most result displays using Alt-Left and Alt-Right.
Use scientific notation if absolute value is >=: This allows you to control
when scientific notation is used in result displays and tool-tips (as described
below). This setting can be changed dynamically from within most result
displays using Alt-Up and Alt-Down.
When displaying numeric values (other than dates), GoldSim respects the two
settings noted above. Several points related to how these are applied should be
noted:
If the magnitude of the value is less than 0.0001 or greater than 1e10,
GoldSim will always use scientic notation (rounding it at the prescribed
number of significant figures). Otherwise, it will use the specified
setting.
If the magnitude of the value is below the threshold for scientific
notation, GoldSim rounds off any decimal places beyond the prescribed
number of significant figures and displays the value conventionally,
with a decimal point if it has a fractional part. For example, to display
123.456 with four signficant figures, GoldSim would show 123.5.
Pa bl o P i c a s s o
Chapter Overview
After you have created a model, you need to run the model in order to produce
results. This chapter describes how to control your simulation (e.g., specify its
duration), specify the types of results you wish to save, and run the model.
In this Chapter The following topics are discussed in this chapter:
Simulation Settings
Understanding and Referencing Run Properties
Saving Outputs as Results
Using the Run Controller
Creating, Running and Comparing Scenarios
Running an Optimization
Running Sensitivity Analyses
The Run Log
Running GoldSim from the Command Line
Simulation Settings
GoldSim is a dynamic simulator, which means that your model can evolve and
change with time. In order to carry out a dynamic simulation, GoldSim steps
through time in discrete intervals (referred to as timesteps).
Calculations are carried out every timestep, with the values at the current
timestep computed as a function of the values at the previous timestep. In
GoldSim, you specify the duration of the simulation (e.g., 1 year) and the length
of the timestep (e.g., 1 day).
The appropriate timestep length is a function of how rapidly the system
represented by your model is changing: the more rapidly it is changing, the
shorter the timestep required to accurately model the system. GoldSim allows
you to change the timestep during a simulation (e.g., use short timesteps at early
times when things are changing rapidly, and larger timesteps at later times).
To run a model, you must first specify its simulation settings. When you create
a new model, GoldSim will dispay the Simualtion Settings dialog If you
Simulation Settings button choose not to define the settings immediately, or if you wish to modify the
settings subsequently, they can be accessed directly from the main menu under
Run | Simulation Settings…, by pressing F2, or by clicking on the Simulation
Settings button in the standard toolbar.
The simulation settings dialog is shown below:
The Monte Carlo tab is used to specify Monte Carlo options (how
probabilistic simulations will be carried out), such as the number of
realizations, and whether Latin Hypercube sampling is to be used.
The Globals tab is used to define global properties that can be referenced
throughout your model.
The Information tab is used to specify the model author and a description
for the simulation. This tab also provides some summary information
regarding the model (e.g., the number of elements and the number of levels
of containment).
Setting the Basic The Time tab of the Simulation Settings dialog is used to specify the time
Time Options options for the simulation:
There are four primary things that you specify from this dialog:
The time basis and simulation duration;
The timestep length and how the timesteps are aligned;
Special reporting periods over which results can be accumulated and/or
averaged; and
When results will be saved.
This dialog also includes a button to Show Scheduled Updates…, which
displays all of the model timesteps, and an Advanced button, for specifying a
number of advanced time settings.
These items are discussed in detail in the sections below.
The top portion of the Time tab of the Simulation Settings dialog is used to
Defining the Time Basis specify the time basis for the simulation, as well as the simulation duration:
and Simulation
Duration
There are three ways in which you can represent time in GoldSim (controlled by
Time Basis drop list):
Elapsed Time
Calendar Time
Static Model
In an Elapsed Time simulation (the default), you must specify a simulation
Duration. The Duration must be entered as a number (it cannot be defined as a
link from an element). The simulation is then tracked in terms of elapsed time
(e.g., when plotting time history results, the X-axis is plotted as elapsed time).
In a Calendar Time simulation (also referred to as a date-time simulation), you
enter a Start Time and an End Time, and the simulation is then tracked in
terms of the calendar time (e.g., when plotting time history results, the X-axis is
plotted as dates/times).
If you select a Calendar Time simulation, you can click on the arrow in the box
to view a calendar to assist you in selecting a start or end date:
You can select part of the date (month, day, year) in the input field and then enter a value
or use the arrow keys to increment or decrement the value. Arrow buttons on the calendar
move forward or backward one calendar month. Clicking the month on the calendar
activates a menu with the twelve months. Clicking the year on the calendar activates a
control for changing the year.
Note: The format in which the dates are displayed is determined by the
Windows settings for your machine. To change these settings (e.g., to display
dates in European format with the day before the month), go to Control Panel
and edit the Regional Options.
Note: When running a Calendar Time simulation, you can also specify the
Duration. When you do so, GoldSim will use the specified Start Time, and
automatically update the End Time accordingly.
Note: Specifying the Start Time for Elapsed Time simulations also allows you
to enter time series data in terms of either elapsed time or calendar time;
GoldSim uses the Start Time to convert between the two formats.
Read more: Entering Time Series Data as Dates or Elapsed Times (page 198).
The third option for carrying out your simulation is to run a Static Model. In a
Static Model, the model does not step through time. This can be useful if you
simply wish to carry out a static calculation using Monte Carlo simulation. A
Static Model effectively sets the Duration to zero.
The Time Display Units provide the default time unit that is used in several
parts of GoldSim. For example, for an Elapsed Time simulation, these are the
units in which results (e.g., time history plots) will be displayed for all elements.
Another example of where the default time unit is used is the Reservoir element.
In this element, you specify a Display Unit, but several input fields require a
rate. The default units for the rate are determined by the Time Display Units.
Example files which illustrate Elapsed and Calendar Time simulations
(Elapsed.gsm and Calendar.gsm) can be found in the General Examples/
Timestepping folder in your GoldSim directory.
Understanding In order to carry out a dynamic simulation, GoldSim steps through time in
Timestepping in discrete intervals (referred to as timesteps). Calculations (referred to as updates
GoldSim of the model) are carried out at end of every timestep, with the values at the end
of the current timestep computed as a function of the values at the end of the
previous timestep. Although the term timestep actually refers to an interval of
time, it is often used interchangeably with the term update (indicating a
calculation at a point in time).
In GoldSim, there are two kinds of updates/timesteps: scheduled updates (or
timesteps) and unscheduled updates (or timesteps).
Scheduled Updates
Scheduled updates are specified directly prior to running the model. That is,
you tell GoldSim when you want these updates to occur.
There are four ways to specify scheduled updates:
You define a Basic Step of a specified length;
You define Reporting Periods (e.g., monthly, annual) which are used to
accumulate or average results, and which force a scheduled timestep at
the end of each period;
You define Capture Points, which represent specific times during the
simulation where “snapshots” of statistical values can be viewed. A
scheduled timestep is created for each Capture Point. By default, there
is only a single Capture Point (the end of the simulation), but you can
add as many as desired; and
You define Period Timesteps for specific time intervals in which even
smaller timesteps are desired.
Read more: Specifying the Basic Step Length and Alignment (page 419);
Defining Reporting Periods (page 421); Adding Shorter Timesteps Over
Defined Periods (page 426); Creating Capture Points for Final Value Results
(page 428).
The most common way to create scheduled updates will be by specifying some
combination of Basic Steps and/or Reporting Periods:
Basic Steps only. In many cases, you will simply create a Basic Step
(and this is the default). This is the simplest way to create scheduled
updates (but is not necessarily the most effective way, depending on
your application). You specify a Basic Step at which results are
computed. You can subsequently choose to save results at each Basic
Step, or at only some Basic Steps (e.g., every other Step, or every tenth
Step).
Read more: Specifying When Time History Results Will Be Saved
(page 423).
Reporting Periods only. In many cases, you will not use a Basic Step
at all, but will simply define your scheduled updates using Reporting
Periods. Why would you do so? Whereas results saved at Basic Steps
always represent instantaneous values, results saved at Reporting
Periods can not only be displayed as instantaneous results, but can also
report accumulated or averaged vaues over a specified period (e.g.,
monthly). Hence, if you needed average or accumulated flows over
each step (e.g., over the last day or the last month), you can do so by
defining your steps using Reporting Periods.
Reporting Periods and Basic Steps. In some cases, you may want to
create Reporting Periods in order to report accumulated or averaged
vaues over a specified period, but you may also need a shorter
computational step in order to ensure accuracy. For example, you may
require a daily timestep to ensure accuracy, but only need to view
monthly averages or accumulated values in terms of results. In this
case, you would create a Basic Step as well as Reporting Periods. You
could choose to save results only for Reporting Periods, or could also
save results for the Basic Steps. When defining both Basic Steps and
Reporting Periods, Reporting periods can be defined to coincide with
Basic Steps (e.g., a 1 day Basic Step and a monthly reporting period),
but they do not have to. However, if a Basic Step is specified,
Reporting periods must always be at least twice as large as the Basic
Step.
In some cases, you may also want to create Capture Points, which are typically
used to capture and view statistical results at specified points in your simulation.
In particular, Capture Points allow you to save and view “Final Value” type
results at specified times during a simulation (rather than just at the final time
point). Final Value results are associated with multiple realizations (or items in
an array), and allow you to display distributions, multi-variate results (e.g.,
scatter plots) and array plots.
Read more: Viewing the Four Basic Result Types (page 513).
When you define a Capture Point, a scheduled timestep is added at that time (if
one does not already exist).
Finally, in rare cases, you may want to create smaller timesteps over a defined
period of your simulation (e.g., if you know that early in your simulation,
variables will change rapidly, and hence a small timestep is required).
Note: You can also specify a shorter timestep for different parts (i.e.,
Containers) of your model.
This provides a summary of the scheduled timesteps you have defined (with the
final column listing the type of each time point).
Unscheduled Updates
In some cases, events or other changes in the model may not fall exactly on a
scheduled update. That is, some events or changes may actually occur between
scheduled updates of the model. These trigger an “unscheduled update” of the
model. Unscheduled updates are timesteps that are dynamically inserted by
GoldSim during the simulation in order to more accurately simulate the system.
That is, they are not specified directly prior to running the model. GoldSim
inserts them automatically (and, generally, without you needing to be aware of
it).
“Unscheduled updates” can be generated in the following ways:
When events are ouput by a Timed Event, Event Delay, Discrete
Change Delay or Time Series element;
By manually specifying a dynamic timestep (i.e., dynamically
controlling the time between updates);
When a Reservoir element reaches an upper or lower bound;
When a Resource becomes exhausted;
When any element is triggered by an At Stock Test, At Date, At Etime
or At Duration triggering event; and
By some specialized elements in GoldSim extension modules (Action
and Function elements in the Reliability Module, Fund elements in the
Financial Module, and Cell elements in the Contaminant Transport
Module).
Read more: Understanding Event Triggering (page 323); Timed Event
Elements (page 333); Event Delay Elements (page 345); Delaying a Discrete
Change Signal (page 357); Generating Discrete Changes Using Time Series
Elements (page 379); Dynamically Controlling the Timestep (page 431);
Defining Upper and Lower Bounds for a Reservoir (page 239); Using Resources
(page 781).
When any of these events occur, GoldSim automatically inserts an unscheduled
update at the exact time that the event or change occurs. For example, if you
had specified a one day timestep, and aTimed Event occurs at 33.65 days (i.e.,
between the scheduled one-day updates), GoldSim would insert an unscheduled
update at 33.65 days.
Note: In some cases, it may be of interest to see the values of selected outputs at
unscheduled updates. To facilitate this, GoldSim provides an option to do so
(under a specified set of conditions) in the Advanced Time settings.
For many models, you will simply create a Basic Step of a specified length, and
these will be the only scheduled timesteps you will need to define.
Read more: Understanding Timestepping in GoldSim (page 415).
The Basic Step field defines the length of the timestep. The Alignment field
determines how the steps are aligned.
The manner in which these are specified differs based on whether the Time
Basis is Elapsed Time or Calendar time.
Read more: Defining the Time Basis and Simulation Duration (page 414).
For an Elapsed Time simulation, the Basic Step is either “User-specified” or
“No basic step”. If the latter is selected, you will need to specify Reporting
Periods in order to step through the model (i.e., if no Basic Step is defined,
Reporting Periods must be defined).
Read more: Defining Reporting Periods (page 421).
If “User-specified” is selected, you define a timestep length using any time unit.
This can be specified as a number or an equation (but you cannot link to another
element). For Elapsed Time simulations, the Alignment is not applicable (it is
always “Start-time aligned” indicating that the steps start at an elapsed time of
zero).
For a Calendar Time simulation, there are multiple options for the Basic Step:
As is the case for an Elapsed Time simulation, if “No basic step” is selected, you
will need to specify Reporting Periods in order to step through the model (i.e., if
no Basic Step is defined, Reporting Periods must be defined).
If “User-specified” is selected, you define a timestep length using any time unit.
This can be specified as a number or an equation (but you cannot link to another
element).
“Calendar years”, “Calendar quarters” and “Calendar months” represent the
duration of the actual underlying calendar, and hence define a variable-length
timestep. A spin-control can be used to specify the number of calendar units
pers step. For example, if you selected “Calendar months” and specified a value
of 1, then the length of the timestep would vary between 28 and 31 days,
depending on the month.
“Weeks”, “Days”, “Hours” and “Seconds” provide a simple way to define a
fixed-length timestep. A spin-control can be used to specify the number of
fixed-length units per step.
For Calendar time simulations, the Alignment determines how the timesteps are
aligned relative to the Start Time of the simulation. There are two options:
“Calendar aligned” and “Start Time aligned”. If “Start Time aligned” is
selected, all timesteps are aligned with the start of the simulation. If “Calendar
aligned” is selected, GoldSim uses the start of the selected calendar period to
align the timesteps. To understand this, it is easiest to consider an example.
If you specified a Basic Step of “Calendar months” (and set it to 1), specified an
Alignment of “Start Time aligned”, and a Start Time of January 15, then
GoldSim would create timesteps at January 15, February 15, March 15, April
15, etc. On the other hand, if you specified a Basic Step of “Calendar months”
(and set it to 1), specifed an Alignment of “Calendar aligned”, and a Start Time
of January 15, then GoldSim would create timesteps at January 15, February 1,
March 1, April 1, etc.
Several points should be noted for Calendar Time simulations:
The Start Time and the End Time are always included as scheduled
timesteps, regardless of the Basic Step or Alignment.
When using “Weeks” as the Basic Step, the first day of the week can be
specified by the user. This is controlled via the Advanced… button at
the bottom of the Time tab.
Read more: Controlling When Weeks and Years Start (page 437).
Note: If you are unsure how a particular combination of Basic Step, Alignment and
Start Time will affect the scheduled timesteps, simply press the Show
Scheduled Updates… button at the top of the Time tab. This will display all of
the scheduled timesteps prior to actually running the model. By experimenting
with the various options and viewing the resulting scheduled timesteps, you
should be able to quickly create the timestepping schedule that you require.
Note: The maximum number of Basic Steps that GoldSim will support is one
million.
If you are saving a large number of time history results and have a large number
of Basic Steps, you may not wish to save values at every Basic Step (as this
could require a large amount of disk space). In fact, if you have defined
Reporting Periods, you may only want to save results at those times (and may
not need to save results at Basic Steps at all). To facilitate this, at the bottom of
the Time tab of the Simulation Settings dialog, GoldSim allows you to specify
when results are to be saved (e.g., every other Basic Step, every Basic Step,
Reporting Periods only).
Read more: Specifying When Time History Results Will Be Saved (page 423).
Example files which illustrate Elapsed and Calendar Time simulations
(Elapsed.gsm and Calendar.gsm) can be found in the General Examples/
Timestepping folder in your GoldSim directory.
Defining Reporting In some cases, you need to compute and report accumulated, average, the
Periods change or the rate of change of values over specified periods (e.g., monthly,
annually). For example, you may need to report the cumulative amount of
money or water that moved from one point to another each month.
To support this, GoldSim allows you to define Reporting Periods. Scheduled
updates (timesteps) are created at the end of each Reporting Period. Hence,
these can also be thought of as “Reporting Steps”. Whereas results saved at
Basic Steps always represent instantaneous values, results saved at Reporting
Periods can not only be displayed as instantaneous results, but can also report
accumulated, averaged, the change or the rate of change of values over a
specified period (e.g., monthly).
Read more: Understanding Timestepping in GoldSim (page 415).
Reporting Periods are defined toward the bottom of the Time tab of the
Simulation Settings dialog:
There are three options for Reporting Periods (referred to in the dialog explicity
as Reporting Steps to remind you that these actually create scheduled updates):
“None” (the default), “Major” (in which your define a single Reporting Period),
and “Major & Minor” (in which you define two Reporting Periods).
The manner in which Reporting Periods are specified differs based on whether
the Time Basis is Elapsed Time or Calendar time.
Read more: Defining the Time Basis and Simulation Duration (page 414).
For an Elapsed Time simulation, you simply specify the length of the Reporting
Period for the Major and Minor Period:
In this example, a Major Period would be created every 100 days from the start of the
simulation; a Minor Period would be created every 10 days from the start of the simulation.
You define the length using any time unit. This can be specified as a number or
an equation (but you cannot link to another element).
You must also define a Period Label for each type of period (which defaults to
Major and Minor). These IDs are referenced when displaying Reporting Period
results.
For a Calendar Time simulation, there are five options for the Major Period:
These create Reporting Periods every year, quarter, month, week or day,
respectively.
Depending on what you select for the Major Period, limited options will be valid
for the Minor Period, since the Major Period must be a multiple of the Minor
Period. For example, if you select “annual” for the Major Period, only three
options are valid for the Minor Period (quarterly, monthly and daily). If you
were to pick “monthly” for the Major Period, there is only one valid option for
the Minor Period: daily. Weekly is never a valid option (and is not provided in
the drop-list) for the Minor Period, because it does not divide evenly into any of
the possible Major Periods.
Calendar Periods are placed according to the following rules:
Monthly Periods are added on start of the first day of the calendar
month (at midnight).
Daily Periods are added at midnight on each day.
Where Annual and Quarterly Periods are added is controlled by how
you define the “Start of reporting year” which is controlled via the
Advanced… button at the bottom of the Time tab. Annual Periods are
added on the first day of the month selected as the “Start of the
reporting year”. Quarterly Periods are added on the first day of the
month selected as the “Start of the reporting year”, and the first days of
the months 3, 6 and 9 months after the selected month.
Where Weekly Periods are added is controlled by how you define the
“First day of model week” which is controlled via the Advanced…
button at the bottom of the Time tab. Weekly Periods are added at
midnight of the start of the specified first day of the week.
Read more: Controlling When Weeks and Years Start (page 437).
It is important to understand that in many cases, you should define your
scheduled updates using Reporting Periods (and not bother to use a Basic Step at
all). Recall that whereas results saved at Basic Steps always represent
instantaneous values, results saved at Reporting Periods can not only be
displayed as instantaneous results, but can also report the change, rate of change,
accumulated or averaged values over a specified period (e.g., monthly). Hence,
if you needed the change, rate of change, average or accumulated flows over
steps (e.g., over the last day or the last month), you can do so by defining your
steps using Reporting Periods.
Of course, in some cases, you may want to create Reporting Periods in order to
report accumulated or averaged vaues over a specified period, but you also may
need a shorter computational step in order to ensure accuracy. For example, you
may require a daily timestep to ensure accuracy, but only need to view monthly
averages or accumulated values in terms of results. In this case, you would
create a Basic Step as well as Reporting Periods.
When defining both Basic Steps and Reporting Periods, Reporting periods can
be defined to coincide with Basic Steps (e.g., a 1 day Basic Step and a monthly
reporting period), but they do not have to. However, if a Basic Step is specified,
Reporting periods must always be at least twice as large as the Basic Step.
Once you have defined Reporting Periods, how can they be used? Reporting
Periods impact your model in three ways:
1. Reporting Periods automatically create a scheduled timestep for your
model (regardless of how you have defined your Basic Step).
Read more: Understanding Timestepping in GoldSim (page 415).
Note: If you press the Show Scheduled Updates… button at the top of the
Time tab, all of the scheduled timesteps in the model will be displayed.
Because Reporting Periods add scheduled timesteps, you can use this to see
exactly where they will be added. Updates associated with Major and/or
Minor Periods are specifically identified (since Minor Periods must divide
evenly into Major Periods, any Major Period listed automatically also
represents a Minor Period).
Note, however, that if you are using Basic Steps, you may not need to save
values at every Basic Step (as this could require a large amount of disk space).
To address this, GoldSim allows you to save only selected plot points.
At the bottom of the Time tab of the Simulation Settings dialog, GoldSim
allows you to specify when time history results will be saved. If you only have
defined Reporting Periods (and have not defined a Basic Step), this section of
the dialog looks like this:
If you have only defined a Basic Step (and have not defined Reporting Periods),
it looks like this:
If you have defined both a Basic Step and Reporting Periods, it looks like this:
Whenever Reporting Periods are defined (as in the first and third cases), results
will automatically be saved at the end of every Reporting Period (as well as at
the beginning and end of the simulation). In fact, in the first case (only
Reporting Periods), you have no options for specifying when results are to be
saved.
Whenever a Basic Step is defined, however, you have the option of specifying
how often you want to save Basic Steps. If Save Every is entered as 1, every
Basic timestep is saved; if it is specified as 2, every other timestep is saved; if it
is specified as 5, every fifth timestep is saved, and so on. If it is specified as 0
(the default), no Basic Steps are saved.
Note: The discussion above is only associated with when time history results are
saved. It does not control which time history results are saved. Whether or not
time history results are saved for a specific element is a function of 1) whether
the simulation has multiple realizations, 2) the status of the check box for the
element defining if Time History results are to be saved; and 3) whether or not
the element is referenced by a Time History Result element.
Read more: Adding Shorter Timesteps Over Defined Periods (page 426).
Based on the number of Basic Steps (and how often they are to be saved), the
number of Reporting Periods, the number of elements for which time histories
are being saved, the number of realizations, and several other settings (e.g.,
whether or not some advanced timestepping options are being used), GoldSim
reports the amount of disk space required to store the results at the bottom of
the Time tab. This is also provided in the Information tab of the Simulation
Settings dialog and the Information tab of each Container.
Read more: Viewing and Editing Model Summary Information (page 444);
Summary Information for a Container (page 144).
If you press the Show Scheduled Updates… button at the top of the Time tab,
all of the scheduled timesteps in the model will be displayed:
The dialog not only indicates when the scheduled timesteps will occur, but it
also indicates which of these steps will be saved for time history display. In the
example above, it indicates that every fifth Basic Step is being saved for display.
The Advanced… button in the Time tab of the Simulation Settings dialog
Advanced Timestep provides access to a dialog for specifying a number of advanced timestepping
Options features:
Adding Shorter In some cases, you may want to create smaller timesteps over a defined period
Timesteps Over Defined of your simulation. For example, if you know that early in your simulation,
Periods variables will change rapidly, you may want to use a small timestep initially. To
support this, GoldSim allows you to select periods during your simulation in
which the timestep is decreased for a specified duration, before returning to the
timestep defined via the Basic Step (or Reporting Period).
These periods during which the timestep is shorter are defined at the top of the
Advanced Time Settings page (accessed via the Advanced… button on the
Time tab of the Simulation Settings dialog):
You can add a new time period with a shorter timestep by pressing the Add…
button. When you do so, a dialog for specifying the period will be displayed.
The dialog differs based on whether the Time Basis is Elapsed Time or Calendar
time.
Read more: Defining the Time Basis and Simulation Duration (page 414).
If you are carrying out an Elapsed Time simulation, the dialog looks like this:
The elapsed Start Time and End cannot overlap with another defined period.
The Period Timestep must divide evenly into the Basic Step (if one is defined),
or the shortest Reporting Period (if there is no Basic Step). It must be smaller
than the period it is dividing. The Start Time, End Time and Period Timestep
can be defined using any time unit. This can be specified as a number or an
equation (but you cannot link to an element).
If you are carrying out a Calendar Time simulation, the dialog looks like this:
The Start Time and End Time are specified as dates/times cannot overlap with
another defined period. The Period Timestep must divide evenly into the Basic
Step (if one is defined), or the shortest Reporting Period (if there is no Basic
Step). If the Basic Step is defined as a calendar duration (e.g., Calendar months),
then the Period Timestep must divide evenly into a day. The Period Timestep
must be smaller than the period it is dividing. It can be defined using any time
unit. This can be specified as a number or an equation (but you cannot link to an
element).
Note: If you press the Show Scheduled Updates… button at the top of the
Time tab, all of the scheduled timesteps in the model will be displayed. Because
Period Timesteps add scheduled timesteps, you can use this to see exactly where
they will be added.
When would the updates occur? In this case, they would occur at 0, 20, 28, 32,
36, 40, 60, 80 and 100 days. Note that there is not a step at 25 days. The first
shortened step occurs at 28 days. GoldSim simply adds timesteps at all
multiples of the Period Timestep (in this case 4 days) that fall within the Period
(in this case 25 to 40 days). The first multiple of 4 that falls within the Period is
28.
By default, Period Timesteps are not saved as part of time history results.
However, if you check Include in Time Histories, these scheduled timesteps
will be saved. In this case, the Save Every option on the main Time tab applies
to these shorter steps. For example, if you have a 100 day simulation, a 5 day
basic step, a 1 day step applied for the first 10 days, and Save Every is set to 2,
then GoldSim would save time history results at 0, 2, 4, 6, 8, 10, 20, 30, 40, 50,
60, 70, 80 90, and 100 days.
Read more: Specifying When Time History Results Will Be Saved (page 423).
Once you have added a Period Timestep, you can edit it by pressing the Edit
button, or delete it by pressing the Remove button.
associated with multiple realizations (or items in an array), and allow you to
display distributions, multi-variate results (e.g., scatter plots) and array plots.
Read more: Viewing the Four Basic Result Types (page 513).
By default, “Final Value” type results are only available at the final time point in
the simulation. In some cases, however, you may also want to capture these
results at other times in the simulation. This can be useful, for example, if you
wanted to view a result distribution for an output at various times during a
simulation. GoldSim facilitates this by allowing you to create Capture Points at
which these results are also made available.
Capture Points are defined toward the top of the Advanced Time Settings page
(accessed via the Advanced… button on the Time tab of the Simulation
Settings dialog):
Note that there is always a Capture Point at the end of the simulation (which
cannot be deleted). You can add a new Capture Point by pressing the Add…
button. When you do so, a dialog for specifying the Capture Point will be
displayed. The dialog differs based on whether the Time Basis is Elapsed Time
or Calendar time.
Read more: Defining the Time Basis and Simulation Duration (page 414).
If you are carrying out an Elapsed Time simulation, the dialog looks like this:
The elapsed Capture Time should be within the specified simulation duration,
and can be defined using any time unit. This can be specified as a number or an
equation (but you cannot link to an element).
If you are carrying out a Calendar Time simulation, the dialog looks like this:
Note: If you press the Show Scheduled Updates… button at the top of the
Time tab, all of the scheduled timesteps in the model will be displayed. Because
Capture Points add scheduled timesteps, you can use this to see exactly where
they will be added.
Read more: How a Reservoir Computes the Overflow Rate (page 241).
Dynamically Controlling GoldSim allows you to decrease the timestep length according to a specified
the Timestep schedule during a simulation (e.g., start with a small timestep, and then
telescope out to a larger timestep) by defining time periods which have different
timestep lengths.
Read more: Adding Shorter Timesteps Over Defined Periods (page 426).
Although defining such time periods can be very useful, you must fully specify
them prior to running the simulation. That is, you must know how you would
like to alter your timesteps prior to running the model. In some cases, however,
it may 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 unscheduled updates) based on the values of specified parameters in
your model. For example, you could instruct GoldSim to use a maximum
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.
This feature can be accessed in the Advanced Time Settings dialog (accessed
from the Advanced… button on the Time tab of the Simulation Settings
dialog). Within this dialog is a checkbox labeled Dynamically control time
between updates:
Note: In order to access this checkbox, Allow unscheduled updates must also
be checked (the default).
After GoldSim completes all the calculations for a timestep, it must decide when
to insert the next timstep. Normally, the next timestep is specified by the Basic
Step (or Reporting Periods or Period Timesteps, if defined).
GoldSim uses the value in the Maximum time between updates field (referred
to as DTmax below) to override the normally scheduled timestep according to the
following rules:
1. If DTmax is greater than or equal to DTsched (the length of time until the
next scheduled timestep), the field is ignored and the next timestep is
simply the regularly scheduled timestep (Tcurr + DTsched), where Tcurr is
the current time.
2. If DTmax is less than or equal to (DTsched /2), the next timestep is Tcurr +
DTmax.
3. If DTmax is greater than (DTsched /2), but less than DTsched, the next
timestep is Tcurr + (DTsched /2) – that is, DTsched is divided into two equal
halves.
These rules can be best understood by considering several simple examples:
Example 1: Assume that the next scheduled timestep length is 10 days, and
you have specified a Maximum time between updates (DTmax) of 4 days.
GoldSim would compute timesteps at the following points in the first 10
days:
When time = 0 day, DTsched = 10 days, so DTmax is less than (DTsched
/2), and according to rule 2, the next step would be computed at 4 days.
At time = 4 days, DTsched = 6 days, so DTmax is greater than (DTsched /2),
but less than DTsched, and according to rule 3, the next step would be
computed at 7 days.
At time = 7 days, DTsched = 3 days, so DTmax is greater than DTsched, and
according to rule 1, the next step would be computed at 10 days.
Example 2: Assume that the next scheduled timestep length is 10 days, and
you have specified a Maximum time between updates (DTmax) of 6 days.
GoldSim would compute timesteps at the following points in the first 10
days:
When time = 0 day, DTsched = 10 days, so DTmax is greater than (DTsched
/2), but less than DTsched, and according to rule 3, the next step would
be computed at 5 days.
At time = 5 days, DTsched = 5 days, so DTmax is greater than DTsched, and
according to rule 1, the next step would be computed at 10 days.
Example 3: Assume that the next scheduled timestep length is 10 days, and
you have specified a Maximum time between updates of 1 day. GoldSim
would compute timesteps at the following points in the first 10 days:
When time is equal to 0 through 8 days, rule 2 applies, and a timestep
of 1 day is used (steps occur at 1, 2 ,3 ,4 ,5 ,6 ,7, 8, and 9 days).
At time =9 days, DTsched = 1 day, so DTmax is equal to DTsched, and
according to rule 1, the next step would be computed at 10 days.
In all three of these examples, the actual timestep length is always less than or
equal to the specified Maximum time between updates. Moreover, the
scheduled timesteps defined by the Basic Step, Reporting Periods or Period
Timesteps are always observed.
Note: If the Maximum time between updates is less than or equal to zero, a
warning message will be written to the Run Log, and it will be ignored (which is
equivalent to clearing the Dynamically control time between updates
checkbox).
Note: By default, time history displays only include scheduled timesteps, and
will not capture unscheduled updates. However, GoldSim provides an option
(under a specified set of conditions) in the Advanced Time settings that allows
you to include both scheduled and unscheduled updates in a time history
diplays. This provides a mechanism to display and view the exact times at which
unscheduled updates are inserted.
Containers with internal clocks are represented in the graphics pane as follows:
Note: When you specify a Container as having an Internal Clock, you cannot
also define it as having Looping Capability (these two options are mutually
exclusive).
Note: By default, time history displays only include scheduled updates, and will
not capture unscheduled updates. However, GoldSim provides an option to do
so (under a specified set of conditions) in the Advanced Time settings. This
provides a mechanism to display and view the exact times at which unscheduled
updates are inserted within a Container with an Internal Clock.
An example file which illustrates the use of Internal Clocks for Containers
(InternalClocks.gsm) can be found in the Containers subfolder of the General
Examples folder in your GoldSim directory.
Read more: Treating a Container as a SubSystem (page 139).
Including Unscheduled In some cases, events or other changes in the model may not fall exactly on a
Updates in Time History scheduled update. That is, some events or changes may actually occur between
Results scheduled updates of the model. These trigger an “unscheduled update” of the
model. Unscheduled updates are timesteps that are dynamically inserted by
GoldSim during the simulation in order to more accurately simulate the system.
Read more: Understanding Timestepping in GoldSim (page 415).
Unlike scheduled updates, unscheduled updates do not normally appear in time
history plots and tables. That is, although these timesteps may affect the results
(e.g., by making them more accurate at the scheduled timesteps), unscheduled
updates of the model are not saved and displayed. Only the scheduled updates
are actually saved and displayed.
Controlling When In some situations, you may wish to directly specify what GoldSim considers to
Weeks and Years Start be the first day of the week (First day of model week) and the first month of
the year (Start of reporting year).
These can be specified at the bottom of the Advanced Time Settings dialog
(accessed from the Advanced… button on the Time tab of the Simulation
Settings dialog):
There are two basic types of simulations that you can carry out with GoldSim:
You must then select the number of realizations (# Realizations), which defaults
to 1.
If you check the Run the following Realization only checkbox, GoldSim runs
only a single realization (specified in the Realization field immediately to the
right). In this case, the random number sequence that is used is based on the
Realization specified and the total number of realizations (# Realizations).
Hence, if you first run a 100 realization simulation, and then run a second
simulation with Run the following Realization only checked (and, for example,
Realization set to 14), the result of the second simulation will be identical to the
14th realization of the first simulation.
This is used in cases where you first run a large number of realizations (but only
save a limited number of time histories) and then want to examine the details
(i.e., the time history) for a particular realization for which you did not save time
histories, but which exhibited some interesting behavior.
GoldSim provides two primary ways in which you can control the manner in
which the Monte Carlo sampling of Stochastic elements takes place:
implementing Latin Hypercube sampling; and
Note: Importance sampling changes the weight of realizations so they are not all
equal. If using importance sampling and specifyng realization weights, the
relative realization weights are applied after the importance sampling is applied.
Note: Each element that exhibits random behavior (e.g., Stochastics, Delays) is
assigned an “internal” random number when it is first created and this is stored
with the element. The random number used for that element is then a function of
both its “internal” random number, the number specified in the Random Seed
field, and the realization number. Hence, if you create a file and then copy it to
another person, when they run it, they will produce the same random numbers as
you (as long as you both have the same number specified for the Random
Seed). However, if that person builds the exact same model independently, you
will always produce different random numbers, since the “internal” seeds for the
Stochastics will be different.
Controlling Monte Carlo The Monte Carlo Result Display Properties dialog allows you to control how
Result Options Monte Carlo results (simulations with multiple realizations) are saved and
displayed:
This dialog can be accessed from the Monte Carlo tab of the Simulation Settings
dialog (via the Result Options… button), and is also accessible from result
properties dialogs.
Read more: Viewing and Editing Result Properties (page 520).
The top section of the dialog (History Statistics) is used to specify how time
history results with multiple realizations will be displayed. In particular, it
allows you to define the percentiles of a particular presentation option for Monte
Carlo time histories (referred to as probability histories), and also allows you to
define a default statistic (Default Display Statistic) that is the default when
viewing statistics for multiple realization simulations.
Read more: Viewing Probability Histories for Multiple Realizations (page
555); Viewing Time Histories of Multiple Realizations (page 552).
The bottom portion of the dialog (Realization Classification and Screening)
allows you to define “categories” of realizations (e.g., “realizations in which X >
10”). You can then choose to show these categories on charts in different colors
and/or choose to screen certain categories entirely from result displays.
Read more: Classifying and Screening Realizations (page 533).
Note: During a deterministic simulation, delays with dispersion always use the
mean delay time, and random timed events occur regularly, not randomly.
Defining and In some cases, you may want to define global properties that can be referenced
Referencing Global throughout your model. Of course, one way to do this is to simply define Data
elements at the global level of the model (i.e., outside of any localized
Properties Containers).
GoldSim also provides a more convenient way to do this via the Globals tab of
the Simulation Settings dialog:
This dialog allows you to add Global variables (referred to as Global properties)
to your model. This is done by pressing the Add… button. When you do so,
the following dialog is displayed:
The Name (ID) is the name by which the Global variable can be referenced
throughout your model. 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
variable. Typically, this will be a single value However, it can also be an
equation (involving constant values). This field, cannot, however, reference any
other outputs in the model.
Once you have added a Global property, you can subsequently reference the
variable by using the specified Name that you defined previously, preceded by a
~. For example, if you create a Global called X, you could reference it in input
fields anywhere within the model as ~X.
Global properties are special instances of what are referred to as locally
available properties in GoldSim. Locally available properties are accessed by
using a ~. Global properties are available in the Insert Link dialog within the
Available Properties folder:
Note: The Global properties tab is also used to "hold" the input interface for a
SubModel that has been exported as a standalone model.
Read more: Using SubModels to Embed Models Within Models (page 914).
Viewing and Editing The Information tab of the Simulation Settings dialog displays some summary
Model Summary information regarding your simulation:
Information
The top part of the dialog provides two fields (Author and Analysis
description) which allow you to identify the author and provide a brief
description for your run. These fields have two uses:
They are written to the Run Log; and
They can be inserted into result charts using keywords.
Read more: The Run Log (page 506); Using Keywords in Styles (page 676).
The bottom part of the dialog provides some useful summary statistics for the
model, including the number of model elements and graphical components, and
the degree of subcontainment. The number of levels of subcontainment does not
refer to the number of Containers; it refers to the number of hierarchical levels
of Containers. For example, if the model contained Containers B and C (in
parallel), the model would have 1 level of subcontainment; if B contained
another Container named C, the model would have 2 levels of subcontainment.
The dialog also indicates the total size of the results being saved for all elements
within the model. This information can be very useful in helping you to manage
the size of the model file.
As can be seen above, at the top of the dialog is a folder labeled “Run
Properties”. If you expand this folder, you will see that all of the Run Properties
are organized into four categories (Calendar Time, Elapsed Time, Simulation
and Reporting Periods):
Expanding any particular category folder lists all of the Run Properties in that
category:
As can be seen, the icon for the various Run Properties is different than that used
for element outputs. This is because the Run Properties don’t actually represent
the output of any particular element. They are special model properties that are
“broadcast” throughout the model and can be referenced anywhere.
Note: All the Run Properties are protected names, so, for example, you cannot
create an element named “ETime” or “DateTime”.
Note: You cannot directly save a time history of a Run Property, or reference it
in a Result element. If you wish to do so, link it to an Expression and save or
reference the Expression element in the Result element.
The four categories of Run Properties are discussed in the sections below.
Run Properties: GoldSim provides a number of special reserved names, referred to as Run
Calendar Time Properties, that can be directly referenced in expressions. Some Run Properties
are associated with Calendar Time. That is, they return information regarding
the simulated date and time of a simulation.
These can be found under the “Calendar Time” folder:
Note: Because even Elapsed Time simulations have a specified Start Time,
Calendar Time Run Properties are available for both Elapsed Time and Calendar
Time simulations.
Note: You can compare the DateTime Run Property to an actual calendar
date by enclosing the date in quotation marks within an expression. For
example, this if statement would compare the simulated date to the
specified date of 15 April 2012: if(DateTime > “15 April 2012”, 1, 2).
hence WeekOf Year changes) on the “first day of model week” specified in
the Advanced Time Settings dialog.
Read more: Controlling When Weeks and Years Start (page 437).
YearOfWeek: This is the nominal year for the current WeekOfYear (see
above). It is a unitless integer. YearOfWeek is incremented at the start of
the first week that has the majority of its days in the next calendar year.
Thus at the beginning of the first week that starts after December 28,
YearOfWeek is incremented to the next calendar year, and WeekOfYear is
reset to 1.
DayOfYear: This is the calendar day of the year (an integer number
between 1 and 366). It is unitless.
DayOfMonth: This is the calendar day of the month (an integer between 1
and 31). It is unitless.
DayOfWeek: This is the calendar day (an integer between 1 and 7). It is
unitless. The weekday corresponding to the value 1 is determined by the
specified “First day of model week” specified in the Advanced Settings of
the Time tab of the Simulation Settings dialog.
Hour: This is the calendar hour (an integer between 0 and 23). It is unitless.
Minute: This is the calendar minute (an integer between 0 and 59). It is
unitless.
Second: This is the calendar second (an integer between 0 and 59). It is
unitless.
DaysInMonth: This is the number of days in the current calendar month
(an integer between 28 and 31). It is unitless.
DaysInYear: This is the number of days in the current calendar year (either
365 or 366). It is unitless.
StartTime: This is the simulated Start Time for the simulation (expressed
relative to December 30, 1899 at 00:00:00). It has units of time and is
generally viewed as a date. It can be compared to other dates in
expressions.
Note: An example file which illustrates the use of Calender Time Run
Properties (CalendarRunProperties.gsm) can be found in the General
Examples/ RunProperties folder in your GoldSim directory.
ESecond: This is the integer number of seconds that have elapsed since the
start of the simulation (hence, at the start of the simulation, it is zero). It is
unitless.
Note: An example file which illustrates the use of Elapsed Time Run
Properties (ElapsedRunProperties.gsm) can be found in the General
Examples/ RunProperties folder in your GoldSim directory.
Run Properties: GoldSim provides a number of special reserved names, referred to as Run
Simulation Properties, that can be directly referenced in expressions. Some Run Properties
return basic information about the simulation.
These can be found under the “Simulation” folder:
SimDuration: This is the total duration (i.e., the amount of simulated time)
represented by the simulation.
Run Properties: GoldSim provides a number of special reserved names, referred to as Run
Reporting Periods Properties, that can be directly referenced in expressions. Some Run Properties
are associated with Reporting Periods that you have defined in the Simulation
Settings dialog.
Read more: Defining Reporting Periods (page 421).
These can be found under the “Reporting Periods” folder:
Note: An example file which illustrates the use of Reporting Period Run
Properties (ReportingPeriond Properties.gsm) can be found in the General
Examples/ RunProperties folder in your GoldSim directory.
default, “Final Value” type results are only available at the final time point
in the simulation. In some cases, however, you may also want to view
distributions or scatter plots at other points in time (other than the end of the
simulation). GoldSim facilitates this by allowing you to create Capture
Points at which these results are also made available.
Read more: Creating Capture Points for Final Value Results (page 428).
Time History Results: These are saved at selected timesteps, and allow
you to display how an output changes as a function of time.
All element property dialogs have check boxes (at the bottom of the dialog) to
specify whether output(s) of the element are to be saved. You can save the Final
Values (the values at the end of each realization in the simulation) and/or Time
History (the value at selected timesteps throughout the simulation):
In general, by default when you create a new scalar element, the Save Results
checkboxes will be checked on. For array elements, the Time History checkbox
defaults off.
Note: For some GoldSim extension modules, the default for some elements is
not to save Time History (or Final Value) results.
The Final Values checkbox always controls whether Final Value results are
saved. However, the Time History checkbox can be overridden. In particular, it
is always applied for single realization runs, but is overridden for multiple
realization runs. Time History results for multiple realization runs are only saved
for outputs that are connected to Result elements.
Read more: Creating and Using Result Elements (page 526); Viewing Time
Histories of Multiple Realizations (page 552).
That is, regardless of the setting of the Time History checkbox, if you are
running multiple realizations, the Time History box is ignored, and unless an
output of the element is connected to a Time History Result element, no time
history results will be saved at all for the element.
In fact, in such a case, the Save Results section would look like this:
In this example, multiple realizations are being run, and none of the outputs are referenced
by a Time History Result element
In this particular case, because the simulation involves multiple realizations, the
“Time History” checkbox is replaced by a “Monte Carlo Histories” checkbox.
This checkbox is grayed out, since it is only used for information purposes. You
cannot edit it directly, and its appearance is completely determined by whether
or not the element’s outputs are connected to a Time History Result element.
If no outputs of the element are connected to a Time History Result element, the
box is cleared (as above). If all the outputs of the element are connected to a
Time History Result element, the box will be checked:
In this example, multiple realizations are being run, and all of the element’s outputs are
referenced by a Time History Result element
Some elements have multiple outputs. For these elements, you can control
which outputs you wish to save. A check indicates that all of the outputs of the
element are being saved.
If you wish to save some of the element’s results (but not all), and you are not
running multiple realizations, you can use the context menu of the output
interface (or the browser) to turn one or more of the outputs on or off:
In this example, only a single realization is being run, and some, but not all, of the outputs
are referenced by a Time History Result element
Similarly, if you wish to save some of the element’s results (but not all), and you
are running multiple realizations, you can do so by connecting some (but not all)
of the outputs to Time History Result elements:
In this example, multiple realizations are being run, and some, but not all, of the outputs are
referenced by a Time History Result element
You can globally deactivate all of the result flags for the elements inside a
Container (that are not connected to active Result elements) from the Container
dialog.
Read more: Controlling Result Flags for Elements in the Container (page 145).
The Information tab on the properties dialog for a Container displays the total
amount of disk space required to store the results for the elements within the
Container. The total amount of disk space required to save the results for the
entire model is displayed in the Information tab of the Simulation Settings
dialog.
Note: When Time History results for specific outputs are saved (either because
you are running a single realization and have checked the Time History box, or
because you have referenced an output in a Time History Result element), by
default GoldSim saves the values of outputs at the beginning and end of the
simulation, and at every Basic Step (and Reporting Period). You can instruct
GoldSim to only save results at selected timesteps (e.g., every tenth Basic Step)
when defining timestepping options in the Simulation Settings dialog.
Note: By default, only elements are displayed in the browser. If you also wish
to view all of the elements’ inputs and outputs in the browser, right-click
anywhere in the browser window and select Show Element Subitems. You can
also do this directly from the main menu by selecting View | Show Element
Subitems.
Archiving a File with GoldSim provides a utility that allows you to archive a file. Archiving a file
Results saves a copy of it under a different filename (which you provide) while keeping
the current file open. This can be useful if you want to save the current file (with
results), and then edit the model and rerun it. You archive a file by selecting
File|Save Copy As… from the main menu.
The Run Controller is the “control panel” which allows you to run, monitor,
pause, and step through your simulation in a controlled manner.
The topics below discuss the details of how you can use the Run Controller to
control your simulations.
Understanding In order to fully understand the use of the Run Controller, it is necessary to first
Simulation Modes understand the various simulation modes (model states) that a GoldSim model
can be in at any given time.
The mode is indicated in the right side of the status bar. Other information about the mode
(e.g., how to change it) is indicated on the left side of the status bar.
One of the ways that the various modes can be distinguished is by whether or
not you can edit your model while in that mode, and whether the Run Controller
is present.
As pointed out above, elements can only be edited while in Edit Mode (and
under special circumstances, in Scenario Mode). In the other two modes,
element editing is completely disabled.
The Run Controller is never shown in Edit Mode or Scenario Mode, is always
shown in Run Mode, and is optionally shown in Result Mode.
The key features of the four modes are summarized below:
in the toolbar. This causes GoldSim to check the model for errors (to see if it can
be run).
If an error is found in the model such that it cannot be run, GoldSim will display a
fatal error message describing the problem. The error message will identify the
element that is causing the problem:
Run button
Pressing the Edit… button from this dialog returns the model to Edit Mode and
immediately opens the properties dialog of the element which prevented the
model from running.
If GoldSim does not detect any errors, the model will be placed into Run Mode.
In Run Mode, the GoldSim Run Controller is displayed:
In addition, “Run Mode” will be displayed in red on the right side of the status
bar.
When GoldSim is in Run Mode, it can have one of four states (the state or status
is displayed on the right side of the Run Controller):
Ready
Running
Paused
Error
Run Mode States When GoldSim is in Run Mode, it can have one of four states (the state or status
is displayed on the right side of the Run Controller).
Ready
In the “Ready” state, all elements have been checked, and the simulation is
ready to begin.
By default, when you press the Run button (or F5), the model skips through the
“Ready” state and immediately starts the simulation. However, you can set an
option (in the Options dialog accessed via Model|Options… from the main
menu) to instruct GoldSim to pause and wait in the “Ready” state after you press
F5. You must then press F5 again to start the simulation. This is only of value if
you wish to setp through a simulation.
Read more: Customizing the Behavior of the Run Controller (page 462).
If you want to return to Edit Mode when you are paused in the “Ready” state (to
edit the model), press the Edit button on the Run Controller (.../, the first button
from the left), or press F4. The Run Controller is no longer shown when you
return to Edit Mode.
Note: A model can not be opened in Run Mode. It can only be opened in Edit
Mode, Result Mode or Scenario Mode. Hence, if you save and close a model
while it is in the “Ready” state (Run Mode), the next time it opens it will be
placed in Edit Mode.
Running
Once the simulation is started, the Run Controller changes its appearance
slightly:
The status indicator on the right side of the Run Controller changes to
“Running”. The top portion of the Run Controller displays the progress of the
simulation in terms of the number of realizations that have been completed, the
number of timesteps for the current realization that have been completed, and
the total elapsed (real) time. The bottom portion of the Run Controller displays
the simulated time (in terms of either elapsed time or calendar time) for the
current realization.
At the bottom of the Run Controller are several buttons. The Abort (first button
from the left) and Pause button (second button from the left) can be used to
abort and pause the simulation, respectively. The other two buttons are not
active in this state. The slider in the lower right hand corner of the Run
Controller can be used to adjust the speed of a simulation.
Read more: Aborting a Simulation (page 461); Pausing and Stepping through a
Simulation (page 460).
Note: While the model status is “Running”, the Run Controller is modal. That is,
all other GoldSim functions are locked. Only the buttons on the Run Controller
are active. You can minimize the application by pressing the minimize button in
the upper right hand corner of the Run Controller (or by using Alt-Tab to toggle
to another application).
Paused
If you press the Pause button while a simulation is running, the status will
change to “Paused”, and the Run Controller will indicate this:
Pausing and Stepping If you press the Pause button on the Run Controller while a simulation is
through a Simulation running, the model will be paused, and this will be indicated in the Run
Controller.
Note: GoldSim also provides a Run Controller option to pause the model
immediately (in the “Ready” state, before the simulation begins).
Read more: Customizing the Behavior of the Run Controller (page 462).
Once a model is paused, you can browse the model and view results in the same
manner you would if you were in Result Mode.
Read more: Viewing Results (Result Mode) (page 461).
When a model is paused, tool-tips displayed when you hold the cursor over an
element or output show the Last Value calculated prior to pausing the model.
Since a model can be paused in the middle of a timestep (such that some of the
elements have been updated for the timestep and others have not), the tool-tip
indicates whether or not the value has been updated for the current timestep.
If you are viewing a Time History Result element while running the simulation,
GoldSim will plot a update the time history of the current realization whenever
you pause the model.
Read more: Viewing a Result Element (page 529).
While a model is paused, you can navigate it, open property dialogs, and view
result plots. You cannot, however, edit the model in any way that would change
its behavior (e.g., you cannot change values in property dialogs or add or delete
elements). You also cannot close or save a model while it is paused.
Note: You can change values for some elements (Data elements) while a model
is paused if and only if the element is linked to a Dashboard control. Dashboard
controls are discussed in the GoldSim Dashboard Authoring Module
User’s Guide.
Pressing the Resume button (second button from the left) on the Run Controller
resumes the simulation (changes the status from “Paused” to “Running”).
Pressing the Abort button (first button from the left) aborts the simulation.
Read more: Aborting a Simulation (page 461).
The slider in the lower right hand corner of the Run Controller can be used to
artificially slow down a simulation. This is useful if you want to pause the
simulation at a certain point, and the simulation time is very short.
Warning: By default, the slider is all the way to the right (Fast). If you want the
simulation to run as quickly as possible, make sure that the slider stays in this
position. If you move it to the left, the simulation will take longer!
The two buttons to the immediate left of the speed control slider allow you to
step through a simulation one realization or one timestep at a time:
If you press the button for simulating one realization, GoldSim will complete the
next realization and then pause. If you press the button for simulating one
timestep, GoldSim will complete the next timestep and then pause.
Aborting a Simulation If you press the Abort button (first button from the left) while a model is
running (or paused), the following dialog will be displayed:
Warning: When you abort a simulation and include the results from the last
(partially complete) realization, you should be careful as to how you interpret
the results. In particular, because the last realization was not complete, it may
be inappropriate to combine it with or compare it to other (full) realizations.
Viewing Results After a simulation is complete, the model will be placed in Result Mode. “Result
(Result Mode) Mode” will be displayed in green in the right hand side of the status bar. More
importantly, editing the model will be disabled. This is also indicated in the
status bar:
The Run Controller checkboxes can be found in the General tab of the Options dialog.
By default, the first time you run GoldSim, the first option is checked off (i.e.,
the Run Controller is not shown in Result Mode), and the second option is
checked on (i.e., the simulation skips the “Ready” state and immediately runs).
These options are saved to your Registry and are therefore applied to all models.
Warning: Because scenario modeling is somewhat complex (as your model will
be storing multiple sets of inputs and results), it is strongly recommended that
you read the documentation below before using this feature. The first section
(Introduction to Scenarios) is of particular importance. It provides an overview
of how the scenario modeling capability works. This is required reading prior to
using this capability.
Introduction to GoldSim’s scenario modeling capability allows you to directly compare results
Scenarios generated by different sets of input parameters. In effect, when you use this
capability, your model can store (and subsequently compare) multiple sets of
results (and inputs):
Because scenario modeling is somewhat complex (as your model will be storing
multiple sets of inputs and results), it is strongly recommended that you read the
introductory sections below before using this feature. Note that these sections
do not provide details on how to create and edit scenarios (that is provided
subseqently). Rather, they introduce key concepts and provide an overview of
GoldSim’s scenario modeling capability that must be understood before
attempting to use this powerful feature.
What Are Scenarios? A scenario is a model with a specific set of input parameters. In particular,
different scenarios have different values for one or more Data elements.
Specifically, a particular scenario is defined by the following:
A unique Scenario ID (an alphanumeric name);
An optional description; and
A set of values for the Data elements in the model for that scenario.
Note that the only elements that can differ between scenarios are Data elements.
Of course, not all Data elements in a model will actually differ between
scenarios. You typically define a subset of the model’s Data elements as being
Scenario Data.
Read more: Scenario Data: Defining Inputs for Different Scenarios (page 465).
Once you have defined multiple scenarios, GoldSim allows you to run the model
for each scenario and directly compare results generated by each scenario. That
is, when you use this capability, your model can store (and subsequently
compare) multiple sets of inputs and results.
Read more: Running Scenarios and Comparing Scenario Results (page 469).
Read more: Creating and Editing Scenarios Using the Scenario Manager (page
471).
The Scenario Manager dialog looks like this:
Using this dialog, you can create new scenarios, and delete existing ones. When
you add a new scenario, you are prompted for a Scenario Name and Description.
In the example shown above, three scenarios have been defined.
Of course, simply creating and naming a scenario is of no value if you do not
specify the Scenario Data for each scenario (i.e., the specific Data elements that
differentiate the scenarios). As discussed below,this can also be done via the
Scenario Manager.
In addition to using the Scenario Manager to create scenarios, once you are
experienced with modeling scenarios, you will likely also create scenarios “on
the fly” outside of the Scenario Manager using other methods provided by
GoldSim. You can even create scenarios via a Dashboard.
Read more: Creating and Editing Scenarios in Dashboards (page 485).
Scenario Data: Defining Scenario Data are the Data elements that differentiate the various scenarios in
Inputs for Different your model. GoldSim provides several ways to specify Scenario Data.
Scenarios The most straightforward way to specify Scenario Data is to use the Scenario
Manager. The Scenario Manager can be accessed from the main menu (Run |
Scenario Manager… ) or by pressing F7. Within this dialog, you will find a
button labeled Scenario Data…. Pressing this button displays the following
dialog:
Each row in this dialog represents a Scenario Data element. Each column
represents a scenario. You can add new Scenario Data using the Add
Element… button. You can subsequently edit the value for any Scenario Data
element in any defined scenario. This table is very convenient because it
displays all Scenario Data values for all defined scenarios side-by-side.
Read more: Creating and Editing Scenario Data Using the Scenario Manager
(page 473).
You can also edit Scenario Data directly in your model. Once you have defined
at least one Scenario in your model, the dialog for Data elements is modified
slightly. In particular, the dialog provides an option to define a Data element as
a Scenario Data element:
In this particular example, we are viewing a Data element that has not yet been
defined as being Scenario Data (and hence it has the same value for all
Scenarios). As can be seen, a Scenario Data checkbox is available (and in this
case, unchecked). Checking this box would add this to the list of Scenario Data
elements displayed in the Scenario Data dialog accessed via the Scenario
Manager.
Here is the dialog for a Data element that has already been defined as Scenario
Data:
Note that in this case, the Scenario Data box is checked. Like all Data
elements, a Scenario Data element has a single value. That is, it cannot display
the value for all scenarios; it can only show you the value for one scenario at a
time. The dialog indicates which scenario is being displayed (in this example,
the “Base Case Scenario” is being displayed).
As discussed below, you can control which scenario you are viewing in your
model by selecting the Active Scenario.
Viewing the Active After you have defined scenarios in your model, you can browse the model and
Scenario view Data elements that have been defined as Scenario Data. Note, however,
that like all Data elements, a Scenario Data element has a single value. That is, it
cannot display the value for all scenarios; it can only show you the value for one
scenario at a time. The dialog indicates which scenario is being displayed (in
the example below, the “Base Case Scenario” is being displayed):
Because this is a Scenario Data element, some of the editing is locked (e.g., you
cannot change the Type or dimensions). However, in Edit Mode you can
change the value itself. If you were to do so, it would change the value of this
Data element only for the Active Scenario (in this case, “Base Case Scenario”).
The Active Scenario is the scenario that is being viewed when you are browsing
a model (and hence is only applicable if the model has scenarios defined). That
is, whenever a model has scenarios, one of the scenarios is the Active Scenario.
The Active Scenario is indicated in the lower right-hand corner of the GoldSim
status bar:
If you click on this portion of the status bar, GoldSim will display all of the
scenarios (and you can select one to become the Active Scenario):
If you change the Active Scenario and then view a Scenario Data element, it will
display the value for the selected scenario.
Note that one of the options here is always the “Live Model”. Live Model can
be thought of as a “scratch” model, or a temporary placeholder model where you
can experiment before saving something as a scenario. As will be discussed
below, when comparing scenario results, only defined scenarios are shown (the
Live Model is not included in the comparison).
You can also select the Active Scenario directly from within the Scenario
Manager:
Running Scenarios and The real power of GoldSim’s scenarios capability is being able to run and view
Comparing Scenario the results of different scenarios in a single plot or table. In order to do this, after
Results defining scenarios, you need to run the different scenarios and compare their
results.
It is important to understand two key concepts:
Scenario results can only be compared when the model is in Scenario
Mode. Scenario Mode is a special model state (that is different from
Result Mode) that allows scenario results to be displayed and
compared.
Read more: Understanding Simulation Modes (page 456).
You will note that from this dialog, you can run a single scenario (via one of the
Run Scenario buttons) or run all scenarios (via the Run All button). In either
case, GoldSim will run the model for the single scenario (or all scenarios), and
place the model in Scenario Mode.
Here is the same dialog after pressing the Run All button:
Doing so actually runs the model three times (once for each scenario). The
dialog indicates that all three scenarios now contain scenario results (the Action
column provides the option to Delete Results, which would delete the scenario
results for that scenario).
After running these scenarios, the status bar would indicate that the model was
in Scenario Mode:
Clicking on that portion of the status bar shows all three scenarios (and the Live
Model):
Note that all the scenarios have an asterisk (*) next to them. An asterisk
indicates that the scenario has scenario results available to be viewed.
If you were then to browse the model, you would note the following:
If you browse to a Scenario Data element, it will display the value for
the Active Scenario.
There is no option to right-click on an element and view its results.
Elements do not store results in Scenario Mode.
If you double-click on a Time History Result element or a Distribution
Result element, GoldSim will display results for all scenarios for which
scenario results have been generated (as indicated by the asterisk
mentioned above).
For example, a Time History Result would look like this:
Note: All scenario results are deleted when you return to Edit Mode. However,
any scenario results that exist prior to entering Result Mode are retained while in
Result Mode (and can be viewed again if you return to Scenario Mode).
Creating and Editing A scenario is a model with a specific set of input parameters. In particular,
Scenarios Using the different scenarios have different values for one or more Data elements.
GoldSim’s scenario modeling capability allows you to directly compare results
Scenario Manager generated by different sets of input parameters. In effect, when you use this
capability, your model can store (and subsequently compare) multiple sets of
results (and inputs).
Warning: Because scenario modeling is somewhat complex (as your model will
be storing multiple sets of inputs and results), it is strongly recommended that
you read the introductory section “Introduction to Scenarios”before using this
feature. It provides an overview of how the scenario modeling capability works,
and should be considered required reading prior to using this capability.
Using this dialog, you can create new scenarios, and delete existing ones. In the
example shown above, three scenarios have been defined.
Of course, simply creating and naming a scenario is of no value if you do not
specify the Scenario Data for each scenario (i.e., the specific Data elements that
differentiate the scenarios). This can also be done via the Scenario Manager.
The sections below discuss the Scenario Manager in detail.
Adding Scenarios From within the Scenario Manager (accessed from the main menu (Run |
Using the Scenario Scenario Manager…) or by pressing F7) you can add a new scenario by
Manager pressing the New… button. When you do so, you are prompted for a Scenario
Name and Description:
Read more: Viewing and Editing Model Summary Information (page 444).
Note: After creating a scenario, you can edit its Name and/or Description by
simply clicking in the field.
You can delete existing scenarios using the Delete button, and move the
scenarios up and down in the list using the Move Up and Move Down buttons.
(Holding the Ctrl key down switches the Delete button to a Delete All button
which can be then used to delete all scenarios).
Of course, simply creating and naming a scenario is of no value if you do not
specify the Scenario Data for each scenario (i.e., the specific Data elements that
differentiate the scenarios). As discussed below,this can also be done via the
Scenario Manager.
Note: In addition to using the Scenario Manager to create scenarios, once you
are experienced with modeling scenarios, you will likely also create scenarios
“on the fly” outside of the Scenario Manager using other methods provided by
GoldSim. You can even create scenarios via a Dashboard..
Creating and Editing Scenario Data are the Data elements that differentiate the various scenarios in
Scenario Data Using your model. Although GoldSim provides several ways to specify Scenario Data,
the Scenario Manager the most straightforward way to do so is to use the Scenario Manager (accessed
from the main menu by selecting Run | Scenario Manager… or by pressing
F7). Within this dialog, you will find a button labeled Scenario Data….
Pressing this button displays the following dialog:
Each row in this dialog represents a Scenario Data element. Each column
represents a scenario. You can add new Scenario Data using the Add
Element… button. When you do so, GoldSim will display a browser showing
all Data elements in the model. After selecting one, it will add it to the list.
Selecting one of these options copies all of the Data values from the selected
scenario to the selected column. This provides a convenient way to rapidly
change the values for a scenario (e.g., if you want to define a new scenario in
which many of the values are the same as in an existing scenario, with a small
number of differences).
Note: The Copy From button is only available if the scenario defined by that
column does not have scenario results. If scenario results have been generated
for that scenario, a Delete Results button is available.
Read more: Running Scenarios and Displaying Scenario Results (page 478).
As discussed below, you can also browse into the model and edit Scenario Data
directly. Moreover, you can also link Scenario Data elements to Dashboard
controls and edit (and create) Scenarios via a Dashboard.
Read more: Creating and Editing Scenarios in Dashboards (page 485).
Browsing and Editing After you have defined scenarios in your model, you can browse the model and
the Active Scenario edit existing Data elements that have been defined as Scenario Data, or specify
additonal Data elements as being Scenario Data.
In particular, once you have defined at least one Scenario in your model, the
dialog for Data elements is modified slightly. Specifically, the dialog provides
an option to define a Data element as a Scenario Data element:
In this particular example, we are viewing a Data element that has not yet been
defined as being Scenario Data (and hence it has the same value for all
Scenarios). As can be seen, a Scenario Data checkbox is available (and in this
case, unchecked). In fact, if you click on Scenario Data (the label, not the
checkbox itself) a dialog will be displayed to indicate that this Data element
provides the same value for all scenarios:
Checking the Scenario Data box would add this to the list of Scenario Data
elements displayed in the Scenario Data dialog accessed via the Scenario
Manager.
Note: Cloned Data elements cannot provide Scenario Data (i.e., you cannot
check the Scenario Data box for a cloned element).
If you click on Scenario Data (the label, not the checkbox itself) a dialog will
be displayed indicating the values used for each scenario:
Moreover, if you hold your cursor over a Scenario Data element, it indicates that
it provides scenario data:
Like all Data elements, within the Data Definition field, a Scenario Data element
displays a single value. That is, it cannot display the value for all scenarios; it
can only show you the value for one scenario at a time. The dialog indicates
which scenario is being displayed (in the example above, the “Base Case
Scenario” is being displayed).
In this case, the “Base Case Scenario” is the one referred to as the Active
Scenario. The Active Scenario is the scenario that is being viewed when you are
browsing a model (and hence is only applicable if the model has scenarios
defined). That is, whenever a model has scenarios, one of the scenarios is the
Active Scenario. The Active Scenario is indicated in the lower right-hand
corner of the GoldSim status bar:
If you click on this portion of the status bar, GoldSim will display all of the
scenarios (and you can select one to become the Active Scenario):
If you change the Active Scenario and then view a Scenario Data element, it will
display the value for the selected scenario. Note that one of the options here is
always the “Live Model”. Live Model can be thought of as a “scratch” model,
or a temporary placeholder model where you can experiment before saving
something as a scenario.
You can also select the Active Scenario directly from within the Scenario
Manager:
In addition, when viewing Scenario Data via the Scenario Manager (by pressing
the Scenario Data… button), the Active Scenario will be marked in bold.
When viewing a Scenario Data element, you will note that some of the editing is
locked (e.g., you cannot change the Type or dimensions). However, in Edit
Mode you can change the value itself. You cannot, however, enter links (entries
must be values, expressions containing only values, or, if the Data is a
Condition, True or False).
If you were to change the value, it would change the value of this Data element
only for the Active Scenario.
Note: You can also change the value of a Scenario Data element while in
Scenario Mode if and only if the Active Scenario has no scenario results.
Read more: Running Scenarios and Displaying Scenario Results (page 478).
Running Scenarios The real power of GoldSim’s scenarios capability is being able to run and view
and Displaying the results of different scenarios in a single plot or table. In order to do this, after
defining scenarios, you need to run the different scenarios and compare their
Scenario Results results.
The details of how to run and compare scenarios are presented in the sections
below.
Understanding the In models in which scenarios are not being used, there are three modes that the
Difference Between model can be in: Edit Mode, Run Mode, and Result Mode. The model is in Edit
Result Mode and Mode while it is being edited, the model is in Run Mode while the simulation is
Scenario Mode actually running, and the model is placed in Result Mode after results have been
generated.
Read more: Understanding Simulation Modes (page 456).
When using scenarios in GoldSim, a fourth mode is introduced: Scenario Mode.
Scenario Mode is a special model state that allows scenario results to be
displayed and compared. Scenario results can only be compared when the
model is in Scenario Mode.
Although Scenario Mode is similar in some respects to Result Mode (in that
both modes are used to view results), there are several key differences:
When in Scenario Mode, scenario results can only be viewed in Time
History Result elements and Distribution Result elements. No other
results are available. Hence, if your model does not contain any Time
History or Distribution Result elements, you will not be able to
compare scenario results.
Read more: Creating and Using Result Elements (page 526).
A model in Scenario Mode has at least one scenario with results.
However, when in Scenario Mode, not all scenarios necessarily have
results (since the scenarios can be run independently).
Models cannot be edited in Result Mode. However, in Scenario Mode,
you can edit Scenario Data elements for scenarios that do not have
scenario results (i.e., if the Active Scenario does not have results,
Scenario Data for that scenario can be edited).
Note: Although you can edit Scenario Data elements for an Active Scenario
that does not have results while in Scenario Mode, you can never edit non-Data
elements in Scenario Mode, since these are common to all scenarios, and doing
so would invalidate scenario results that existed for other scenarios.
From this dialog, you can run a single scenario by pressing one of the Run
Scenario buttons, or run all scenarios via the Run All button. In either case,
GoldSim will run the model for the single scenario (or all scenarios), and place
the model in Scenario Mode.
Here is the same dialog after pressing the Run All button:
In this case, pressing the button actually ran the model three times (once for
each scenario). The dialog indicates that all three scenarios contain scenario
results (the Action column provides the option to Delete Results, which would
delete the scenario results for that scenario).
After running these scenarios, the status bar would indicate that the model was
in Scenario Mode:
Clicking on that portion of the status bar shows all three scenarios (and the Live
Model):
Note that all the scenarios have an asterisk (*) next to them. An asterisk
indicates that the scenario has scenario results available to be viewed.
Note: A model in Scenario Mode has at least one scenario with results.
However, when in Scenario Mode, not all scenarios necessarily have results
(since the scenarios can be run and results can be deleted independently). Only
those scenarios with results are marked with an asterisk (*).
Once you have generated scenario results, there are a number of ways to delete
them. From the Scenario Manager dialog itself, you can delete individual
scenario results (using the Delete Results button for a particular scenario). In
addition, when viewing Scenario Data from within the Scenario Manager (via
the Scenario Data… button), a Delete Results button is available for each
scenario:
Finally, if you press F4 while in Scenario Mode (and the Active Scenario and at
least one other scenario have results), you will be presented with this dialog:
The default option is to delete the results for the Active Scenario, but remain in
Scenario Mode. Otherwise, you can return directly to Edit Mode (and all
scenario results are deleted).
If you press F4 in Scenario Mode (and the Active Scenario and at least one other
scenario do not have results), the only option presented is to delete all results
and return to Edit Mode.
You can also exit Scenario Mode by running the Active Scenario and going
directly to Result Mode. In this case, all existing scenario results are retained.
Read more: Viewing Detailed Scenario Outputs in Result Mode (page 483).
Comparing Scenario Once a model is in Scenario Mode, if you were to browse the model, you would
Results in Scenario note the following:
Mode If you browse to a Scenario Data element, it will display the value for
the Active Scenario.
There is no option to right-click on an element and view its results.
Elements do not store results in Scenario Mode.
If you double-click on a Time History Result element or a Distribution
Result element, GoldSim displays results for all scenarios for which
scenario results have been generated (and the Show button has been
checked).
Read more: Viewing Scenario Results in Time History Result Elements (page
578); Viewing Scenario Results in Distribution Result Elements (page 622).
For example, a Time History Result would look like this:
Note: Only Time History and Distribution Result elements display scenario
results. Scenario results cannot be displayed for other types of Result elements.
Note: Array results cannot be compared in Scenario Mode. Only scalar results
can be displayed. Hence, if an array is listed as one of the results in the Result
Properties page, it will not be available for selection in the display dialogs when
comparing scenarios (i.e., when the model is in Scenario Mode). If you wanted
to compare one or more items from an array in Scenario Mode, you would need
to add those scalar array items as separate results in the Result Properties dialog.
If you press F4 you can return to Edit Mode (by deleting all scenario results), or
you can choose to only delete the scenario results for the Active Scenario (while
keeping the others). In this latter case, you will remain in Scenario Mode.
Pressing F5 will run the Active Scenario and place the model in Result Mode.
As discussed below,this allows you to view detailed results for a particular
scenario.
Read more: Carrying Out a Simulation (Run Mode) (page 457); Viewing
Results (Result Mode) (page 461).
Note: All scenario results are deleted when you return to Edit Mode. However,
any scenario results that exist prior to entering Result Mode are retained in
Result Mode (and can be viewed again if you return to Scenario Mode).
Viewing Detailed In order to compare scenario results, you must be in Scenario Mode. Moreover,
Scenario Outputs in when in Scenario Mode, scenario results can only be viewed in Time History
Result Mode Result elements and Distribution Result elements (and to some extent, in
Dashboards). No other results are available.
Often, however, in addition to comparing scenario results, you will want to look
at the detailed results for a single scenario. To do so, you must select the
scenario of interest as the Active Scenario, and then run the model in the
standard way (e.g., by pressing F5). This places the model in Result Mode for
the Active Scenario. All results are available to view.
Read more: Carrying Out a Simulation (Run Mode) (page 457); Viewing
Results (Result Mode) (page 461).
Note that while in Result Mode, you cannot compare scenarios (e.g., Result
elements will only show results for the Active Scenario).
However, any scenario results that existed prior to entering Result Mode are still
saved in the file (they are not deleted if you transitioned from Scenario Mode to
Result Mode). You can view these again by returning to Scenario Mode. In
particular, when you press F4 from Result Mode, you will be presented with an
option to return to Scenario Mode (where you will have access to all scenario
results), or return to Edit Mode (which will delete all scenario results).
Read more: Transitioning Directly from Result Mode to Scenario Mode (page
484).
Transitioning Directly When you are in Result Mode, you can press F4 to delete the detailed output
from Result Mode to results and return to Edit Mode.
Scenario Mode Read more: Understanding Simulation Modes (page 456).
Note, however, that when you press F4, you will also be offered the opportunity
to enter Scenario Mode. The options available are a function of whether any
scenarios have been previously defined, whether the Active Scenario is the Live
Model, and whether any scenario results already exist.
If no scenarios have been previously defined (or if the Active Scenario is the
Live Model and no scenario results exist for other scenarios), the following
dialog will be displayed when you press F4:
The first option is to delete all results and return to Edit Mode. If you select the
second option, you will be prompted for a scenario name (and description), and
the model will be placed in Scenario Mode. Although detailed outputs are
deleted, the scenario results are saved.
If scenarios have been defined, no scenario results exist, and the Active Scenario
is not the Live Model, the dialog displayed is somewhat different when you
press F4:
The default option is to delete the full results, but enter Scenario Mode (and
keep the scenario results). The second option is to delete all results and return to
Edit Mode.
If scenario results already exist in your model, and the Active Scenario is not the
Live Model, the dialog displayed when you press F4 provides three options:
The default option is to delete the full results, but enter Scenario Mode (and
keep the scenario results). The second option is to delete the full results, as well
as the scenario results for the Active Scenario, and enter Scenario Mode. The
final option is to delete all results and return to Edit Mode.
Finally, if scenario results already exist in your model, and the Active Scenario
is the Live Model, the dialog displayed when you press F4 provides two options:
The first option is to delete all results, and switch to Scenario Mode. If you
select the second option, you will be prompted for a scenario name (and
description), and the model will also be placed in Scenario Mode. Although
detailed outputs are deleted, the scenario results are saved. If you wish to return
all the way to Edit Mode, you must first return to Scenario Mode, and then press
F4 again.
Creating and Editing You can create, edit and run scenarios from a Dashboard. In particular,
Scenarios in Dashboards provide a Scenario control that can be added that allows you to: 1)
select the Active Scenario, 2) run the scenario; and 3) add and delete scenarios:
Dashboards
When a Scenario control is added to a Dashboard, you can enter Scenario Mode
and compare scenario results directly from the Dashboard.
Dashboards and the Scenario control are discussed in detail in the GoldSim
Dashboard Authoring Module User’s Guide.
Running an Optimization
GoldSim provides the ability to carry out a special type of run to facilitate
optimization of your model. For this type of run, you specify an objective
function (a specific result that you would like to minimize or maximize), an
optional constraint (a condition that must be met), and one or more optimization
variables (variables in your model that you have control over).
GoldSim then runs the model multiple times, systematically selecting
combinations of values for each of the optimization variables. By doing so,
GoldSim can determine the values of the optimization variables that optimize
(minimize or maximize) the objective function while meeting the specified
constraint.
Typical uses of optimization include:
Finding the best input data values for a model, in order to match
observed historical data (i.e., calibration).
Selecting the “best” option from among alternatives. “Best” could
mean safest, cheapest, most reliable, or another appropriate measure.
Optimizing the timing of actions or policy changes during the course of
a simulation.
The details of how to set up and run an optimization are presented in the
sections below.
A simple example file which illustrates the use of optimization
(Optimization.gsm) can be found in the General Examples folder in your
GoldSim directory.
Overview of In order to run an optimization in GoldSim, you first need to select an objective
Optimization function that is to be maximized or minimized. The objective function can be
any output in your model. The optimization is carried out based on the final
value (the value at the end of the realization) of the objective function.
The objective function can be a simple computed measure (e.g., impact, cost) or
a complex expression (e.g. “stakeholder satisfaction” or “risk-weighted net
present value”). In most cases, it will represent either a cumulative value (e.g.,
total accumulated cost), a peak value (e.g., the highest water level observed
during the simulation), or a valley (e.g., the minimum amount of money in an
account during the simulation). Cumulative values can be computed using
Integrators and Reservoirs in GoldSim, while peaks and valleys can be
computed using Extrema elements. As a result, the objective function is often a
function of one or more of these types of elements.
Read more: Integrator Elements (page 228); Reservoir Elements (page 236);
Extrema Elements (page 249).
After you have defined the objective function, you need to identify one or more
optimization variables (Data or Stochastic elements in your model) that can be
adjusted by GoldSim to optimize the objective function. Optimization variables
often represent “decision variables” in your model – variables that you have
direct control over (e.g., how much money to spend, when to implement
something, the properties of a facility that you are simulating). GoldSim requires
you to specify an initial value (an initial guess) for each variable, as well as an
upper and lower bound between which the variable will be allowed to range.
You can also specify whether the variable is to be limited to integer values.
Obviously, the objective function should be dependent (either directly or
indirectly) on all of the optimization variables.
You can also define a constraint that must be met when selecting optimization
variables (such as not exceeding a regulatory limit, staying within a financial
budget, or never having a combination of optimization variables that would be
unacceptable for some reason). GoldSim will seek the optimal value of the
objective function by varying the optimization variables within their bounds and
will dismiss any solutions which do not meet the specified constraint condition.
Once the objective function and optimization variables have been defined, and
any required constraints specified, the optimizer can be run. The optimization is
based on Box’s complex method.
Note: Box’s complex method is described in: Box, M.J. (1965). “A new method
of constrained optimization and a comparison with other methods,” The
Computer Journal, Volume 8, Issue 1, pp. 42-52.
Note: You can only run an optimization from Edit Mode. You cannot run an
optimization if the model is in Result Mode.
You can delete the selected output by pressing the red X to the right, or you can
click on the item and select a different output.
The Objective Function must be be a scalar value.
The Goal drop-list allows you to select whether you want to maximize or
minimize the objective function. The Precision drop-list allows you to control
the precision of the optimization algorithm.
Read more: Setting the Optimization Precision (page 492).
You can specify a constraint by checking the Required Condition checkbox
and specifying a condition that must be true in order for a solution (i.e., a
combination of values of the optimization variables) to be valid. The constraint
must be a condition output or a conditional expression, and can be a function of
the objective function, the optimization variables, and/or any other outputs in
your model:
The Name, Description, Display Units and Type are automatically transferred
from the linked element (and cannot be edited here). If you’ve selected the
wrong element, you can reopen the browser for selecting optimization variables
by clicking on the Name.
For each optimization variable, you must specify the range over which the
variable will be varied during the optimization by defining a Lower Bound and
an Upper Bound. The bounds must be numbers and cannot be links to other
elements in the model.
You are also required to specify an Initial Value for each optimization variable.
This should be your “initial guess” for the optimal value of each variable. The
Initial Value is not critical, but if it is chosen well (i.e., if it is relatively close to
the true optimum), it could speed up the optimization. The Initial Value must be
a number and cannot be a link to other elements in the model.
If you check the Restrict this variable to integer values only, during the
optimization process, GoldSim will only use integer values for the variable.
Once you have specified bounds and an initial value, you can click Prev or Next
to view the other optimization variables, but the new optimization variable will
not be added until you click the OK button.
Optimization variables can be removed by highlighting them in the dialog and
pressing the Remove button.
You can edit the settings for an existing optimization variable by double clicking
on the optimization variable in the dialog, or by highlighting the optimization
variable and pressing the Edit… button.
The optimization algorithm can be controlled via the Precision setting in the
Setting the Define Optimization Settings tab:
Optimization Precision
You can set the Precision to Maximum, High, Medium or Low (the default
setting is Medium). The precision setting has two effects:
1. it determines the number of valid points used to generate the initial
complex of solutions; and
2. it determines the convergence criterion GoldSim uses to decide whether
or not it has obtained an “optimal” solution.
Box’s complex method begins by developing an initial “complex,” which is a
set of valid solutions that meet all of the requirements specified by the user.
This complex contains twice as many valid solutions as the number of
optimization variables. Once the initial complex has been developed, the
algorithm searches the solution space iteratively, replacing the least optimal
members of the complex with more optimal ones until the solution converges or
GoldSim determines that convergence cannot be achieved (in which case a
warning message will be displayed).
The way in which the initial complex is generated depends on the Precision
specified by the user:
For Low Precision, GoldSim generates only the minimum number of
valid solutions required to create the complex (i.e., two times the
number of optimization variables).
For Medium Precision, GoldSim generates twice as many valid
solutions as it needs (i.e., it generates 4N valid solutions, where N is
the number of optimization variables). It then uses the 2N most
optimal solutions to form the initial complex.
For High or Maximum Precision, GoldSim generates five times as
many valid solutions as it needs (i.e., it generates 10N valid solutions,
where N is the number of optimization variables). It then uses the 2N
most optimal solutions to form the initial complex.
Hence, the higher the Precision setting, the better the initial complex spans the
variable space (and the higher the likelihood that a global optimum, rather than a
local optimum, will be found).
GoldSim determines whether or not it has achieved an optimal solution by
comparing the range of objective function values in the current complex with the
range of objective function values in the initial complex. The convergence
criterion is also determined by the Precision specified by the user:
For Low Precision, convergence requires the range in objective
function values to be less than 0.01 of the initial range or 100 solutions
have been tried.
For Medium Precision, convergence requires the range in objective
function values to be less than 0.001 of the initial range or 1000
solutions have been tried.
Clicking the Optimize! button will immediately take you to the other tab in the
optimization dialog (Run Optimization) and begin the optimization. The Run
Optimization tab tracks the progress of the optimization:
Best Function Value vs. Iterations: This section of the dialog provides a
graph that plots the most optimal value of the objective function (on the y-
axis) versus the number of iterations that have been completed (on the x-
axis).
Top Results: This section displays the objective function and optimization
variable values from the ten most optimal iterations.
This tab is continuously updated during the course of an optimization.
While the optimization is running, a Pause button will be available. Pressing it
will temporarily stop the optimization (and switch the Pause button into a
Resume button, which can be clicked to restart the simulation). There is also an
Abort button, which immediately ends the optimization.
After the optimization is completed, the Pause and Abort buttons will switch
back to Optimize! and Close buttons.
When the optimization completes, a message will be displayed indicating that
the optimization has completed. The first row in the Top Ten Results section
will display the optimal values of the optimization variables and the optimized
value of the objective function. When you press Close to exit the optimization,
you will be presented with a dialog with options for saving these results.
Read more: Saving Optimization Settings and Results (page 495).
In some cases, the optimization may not converge. In this case, GoldSim will
provide a warning message.
Read more: Understanding Optimization Warning Messages (page 495).
Some types of models may have multiple local optima. In such a case, GoldSim
may not necessarily find the global optimum. There are, however, some steps
you can take to increase the likelihood of finding the global optimum.
Read more: Finding a Global Optimum in Complex Models with Multiple
Optima (page 494).
Finding a Global For a well-behaved problem with a single optimum solution, GoldSim can be
Optimum in Complex counted on to locate the optimum. For more complex problems with multiple
Models with Multiple local optima, however, the solution found by GoldSim may not necessarily be
Optima the true optimum (it could be a local optimum).
For complex models with local optima, the choice of bounds and initial values
for the optimization variables can be important, and can determine whether
GoldSim converges to a local optimum, rather than to the global optimum.
The best way to convince yourself that you have found a global, rather than a
local, optimum, is to run the optimization multiple times with different initial
complexes.
In order to ensure that GoldSim creates a different initial complex every time it
starts an optimization, the Randomize optimization sequence checkbox should
be checked (which is the default). If you then run multiple optimizations (by
pressing the Optimize! button repeatedly), GoldSim will rerun the optimization
with a different initial complex each time.
Saving Optimization When you close the Optimization dialog, you will see a dialog with a number of
Settings and Results options:
At the top of the dialog are two radio buttons that determine whether the
optimization settings (i.e., all of the settings on the Define Optimization
Settings tab) are saved. If the first radio button is selected (Save all
optimization variables and settings), all of these settings are saved. If the
second radio button is selected, all of these settings are deleted (and hence will
not be available the next time you want to run an optimization).
Even if you save the optimization settings, the optimization results in the Run
Optimization tab will be deleted and will not be available the next time you run
an optimization (you will need to re-run the optimization). Hence, before
exiting the Optimization dialog, you should record the optimal values of the
optimization variables and the optimized value of the objective function
displayed in the Top Ten Results section of the Run Optimization tab.
Note: GoldSim provides an easy way to extract and save the Top Results. Left-
click on a column and then drag the cursor to select the other columns you wish
to export. Alternatively, press Ctrl+A to select the entire Top Results table.
Pressing Ctrl+C copies it to the clipboard (with the column headers). It can
then be pasted into another application.
This information (the optimization results) can also be copied directly to other
parts of the model. The bottom portion of the dialog provides two options for
doing so (you can do neither, one or both).
The options are as follows:
Copy optimized values to initial values of variables for next
optimization: This option replaces the Initial Values that you specified for
each optimization variable with the values that resulted in the most optimal
value of the objective function. This is useful, for example, if you plan to
modify the model in the future, and think that the optimal values from the
original model would be a good initial guess for the modified model. Note
that this option is grayed out if optimization settings and variables are not
saved.
Copy optimized values to element definitions: This option replaces the
values of the optimization variable elements in the GoldSim model with the
values that resulted in the most optimal value of the objective function. For
optimization variables that are Data elements, the element definition is
replaced with the optimized value. For optimization variables that are
Stochastic elements, the “specified value” for deterministic simulations is
replaced with the optimized value.
Note: The sensitivity analyses discussed here produce graphical (and tabular)
outputs created by changing one variable at a time, while holding all other
variables constant. GoldSim also provides a second type of sensitivity analysis
in which statistical sensitivity measures are computed by analyzing the results of
multiple realizations of the model where all of the Stochastic variables are
simultaneously sampled each realization.
The details of how to set up, run and view such a sensitivity analysis are
presented in the sections below.
A simple example file which illustrates the use of sensitivity analysis
(Sensitivity.gsm) can be found in the General Examples folder in your GoldSim
directory.
Selecting the Result To prepare to carry out a sensitivity analysis, select Run | Sensitivity
and Independent Analysis… from the main menu. The following dialog will be displayed:
Variables for a
Sensitivity Analysis
Note: You can only run a sensitivity analysis from Edit Mode. You cannot run a
sensitivity analysis if the model is in Result Mode.
The first step required to set up a sensitivity analysis is to define which output
(i.e., result) you would like to analyze for sensitivity. The sensitivity analysis
will be used to determine the degree to which other variables impact this result.
You select this result by pressing “<Click to select>” immediately to the right of
Result to Analyze.
When you do so, a browser dialog will be displayed for selecting an output.
You can select any scalar, value output in your model (you cannot select arrays
or conditions). After you select the output and press OK, the selected output is
then shown in the dialog:
You can delete the selected output by pressing the red X to the right, or you can
click on the item and select a different output.
After selecting the result to analyze, you must then select the variables that will
be varied to determine the degree to which they impact the result. You add
these variables by pressing the Add… button.
When you do so, a browser dialog will be displayed for selecting an element.
The dialog will only list Stochastic elements and Data elements (no other
element types will be listed). You can select any Stochastic or Data element with
a scalar, value output (you cannot select arrays or conditions).
You can delete a variable that you have already added by selecting the variable
in the list and pressing the Delete button. Pressing the Add All Stochastics
button adds all valid Stochastic elements (i.e., Stochastics that are scalar values)
in your model to the variable list.
You can also delete one variable and replace it with another by selecting the
variable name. When you do so, a browser dialog will be displayed for selecting
a new element.
Defining the Once you have specified a result and added one or more independent variables,
Independent Variable the Sensitivity Analysis dialog will look similar to this:
Ranges for a
Sensitivity Analysis
100%
Lower Bound
# Points 2
Upper Bound = 100% - Lower Bound
For example, with 11 points, the Lower Bound is approximately 4.5% and the
Upper Bound is approximately 95.5%.
If Use quantiles for Stochastic elements is cleared, you must always specify
the Lower Bound, Central Value and Upper Bound directly for Stochastics,
just as you would for Data elements.
Warning: When defining the Lower Bound, Central Value and Upper Bound
directly for Stochastics or Data elements, these values do not have to be related
in any way to the actual definition for the elements. For example, you could
specify a Lower Bound, Central Value and/or an Upper Bound that were
outside the range of the actual defined distribution for a Stochastic. Similarly, a
Data element could be defined such that its actual defined value was different
from its Central Value when running Sensitivity Analyses. In general, this is
likely to lead to confusion, and it is strongly recommended that when defining
the ranges for your independent variables, the values should be consistent with
the actual defined values for the elements that are used when not running a
Sensitivity Analysis.
Viewing Sensitivity Once you have specified a result, added one or more independent variables, and
Analysis Results defined the ranges for the independent variables, you can carry out several
different types of sensitivity analysis.
GoldSim provides four types of analysis and display:
Central Value Result;
Tornado Chart;
X-Y Function Chart; and
Result Data Display.
These are discussed in the sections below.
Note: The sensitivity analyses discussed here produce graphical and tablular
outputs created by changing one variable at a time, while holding all other
variables constant. GoldSim also provides a second type of sensitivity analysis
in which statistical sensitivity measures are computed by analyzing the results of
multiple realizations of the model where all of the Stochastic variables are
simultaneously sampled each realization.
Sensitivity Analysis: The simplest type of sensitivity analysis within the Sensitivity Analysis dialog is
Central Value Result to compute the Central Value Result. This is a single deterministic simulation
in which the specified Central Value is used for all defined independent
variables. Pressing the Calculate button causes GoldSim to run a single
deterministic simulation, and display the value of the selected result in the
Central Value Result field.
This can be a useful way to quickly run a series of “what if” deterministic
analyses, by manually changing the Central Values for one or more of the
independent variables.
Sensitivity Analysis: A tornado chart is a type of sensitivity analysis that provides a graphical
Tornado Chart representation of the degree to which the Result is sensitive to the specified
Independent Variables.
A tornado chart can be produced by pressing the Tornado Chart… button in
the Sensitivity Analysis dialog. When you do so, GoldSim runs a series of
deterministic simulations, varying one independent variable at a time through a
range of values. In particular, it does the following:
1. While holding all other Independent Variables at their Central Value
and all other Stochastics (not identified as Independent Variables) at
their deterministic values, GoldSim runs 3 deterministic simulations
with three different values for the first dependent variable: the Lower
Bound, the Central Value, and the Upper Bound.
2. The process is repeated for each Independent Variable.
For example, if there were 10 Independent Variables specified, GoldSim would
carry out 30 deterministic simulations to produce the tornado chart.
Once it carries out these simulations, it uses the results to construct a tornado
chart such as this:
The x-axis of a tornado chart represents the values of the Result for different
values of the independent variables.
Each bar represents the range of Result values produced when each independent
variable is set to Lower Bound, Central Value, and Upper Bound (with the other
variables being held constant). A light blue bar indicates that the value was
produced by the Lower Bound (Low), and a dark blue bar indicates that the
value was produced by the Upper Bound (High). For example, this particular
chart indicates that the variable d produced a Result equal to about 1.25 when d
was at its Lower Bound, and a Result of about 0.2 when d was at its Upper
Bound.
The variables are organized from top to bottom according to the total range of
Results produced. That is, the variable that produces the largest range of the
Result between it Lower and Upper Bound is at the top of the chart. Hence, bars
become smaller toward the bottom of the chart, and the overall effect is to take
on the appearance of a “tornado”.
The solid vertical line represents the value of the Result when the Central
Values are used for all independent variables. In this example, the Result using
the Central Values is 1.3.
Note: If you have more than 20 independent variables, GoldSim will only plot
the top 20 variables in the tornado chart.
Sensitivity Analysis: X- An X-Y function chart is a type of sensitivity analysis that provides a graphical
Y Function Chart representation of the degree to which the Result is sensitive to the specified
Independent Variables.
An X-Y function chart can be produced by pressing the X-Y Function Chart…
button in the Sensitivity Analysis dialog. When you do so, GoldSim runs a
series of deterministic simulations, varying one independent variable at a time
through its range of values. In particular, it does the following:
1. While holding all other Independent Variables at their Central Value
and all other Stochastics (not identified as Independent Variables) at
The y-axis of an X-Y function chart represents the values of the Result for
different values of the independent variables.
There is one line for each variable. Each line illustrates how the Result changes
when that independent variable is varied from its Lower Bound to its Upper
Bound (with the other variables being held constant). The number of points used
to create each line is determined by the #Points field.
Note: One of the points is always the Central Value. Half of the remaining
points are spaced evenly (linearly) between the Lower Bound and Central Value,
and the other half of the remaining points are spaced evenly (linearly) between
the Central Value and the Upper Bound.
Because each variable likely will have different units and a different range, the
x-axis does not represent actual values; rather it represents normalized values
(and hence they all range from 0 to 1). The normalization differs depending on
whether the range of the independent variable was specified as quantiles or was
specified directly.
For Stochastic independent variables whose Bounds have been entered as
quantiles, the x-axis represents the actual quantile of each point. For Data
elements (and Stochastics) whose Bounds have been specified directly (as
Lower Bound, Central Value and Upper Bound), the x-axis represents the
following:
If you would like to plot a single independent variable (on the x-axis) against the
result (on the y-axis), using the actual value of the independent variable rather
than the normalized value, you can do so by pressing the appropriate button in
the column labeled Plot in the Independent Variable table. A chart like this will
be displayed:
In some cases, you may simply want to view the raw data used to produce the
X-Y function chart. You can do so by pressing the Result Data… button in the
Sensitivity Analysis dialog. When you do so, a table like this is displayed:
This table shows the actual value for the independent variables (rather than the
normalized values).
Note: You can copy the contents of this 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).
Note: The Run Log only becomes available after a model has been run. In
Result Mode, the Run Log contains information describing the current run. If a
model is in Edit Mode, the Run Log contains information describing the most
recent run (the results of which are no longer available).
Note: Although the Run Log is viewed in a text editor, it is saved internally
within the GoldSim file and cannot be edited. If you edit the Run Log using the
text editor, the changes will not be saved in the GoldSim file.
When you view a Run Log, GoldSim creates a text file from the information in
the GoldSim file. By default, this file is saved in the same location as the model
file. If it cannot be saved there (due to access issues), GoldSim will save it to
the user’s temporary folder (and provide the location of the file in a message).
By default, the name of the Run Log file is “GoldSim Run Log.txt”.
Note: On rare occasions, you may want to instruct GoldSim to insert the model
filename into the name of the Run Log filename. To do this, you must edit the
Windows Registry. In particular, add a DWORD registry key under
HKEY_CURRENT_USER\Software\GTG\Settings named
RunLogEmbedModelName and set it to a non-zero value. If you do so, the name
of the Run Log file will be “ModelFilename _Run Log.txt. For example, if the
model filename was called “Example.gsm”, the Run Log file would be named
“Example_RunLog.txt”.
You must enter the full path to the GoldSim executable (which may, of course,
be different than that shown above), followed by the GoldSim file that you want
to open. If no filename is specified, GoldSim opens a new file.
Note: If no path is specified for a filename, GoldSim looks in the last directory
from which a GoldSim file was opened. Hence, it is highly recommended that
you provide a full path for the filename.
The primary reason for running GoldSim from the command line is to take
advantage of a number of command line parameters that cause GoldSim to
execute in a specific manner.
The command line parameters are summarized in the following table. Note that
the parameters are entered after the executable and before the model file name.
Several points should be noted regarding the use of the –d (-data) command:
The argument to this command should be enclosed in quotes.
Units must be specified if the input has dimensions.
More than one input can be defined in a command line. Note, however,
that Windows limits the length of a command string (to 8191
characters).
If a Data element is connected to a Dashboard control, the Dashboard
will always take precedence. As a result, if you want to control an
element via a command line, it should not be connected to a Dashboard
control.
The –d parameter will only find global elements. If an element is
located within a localized Container, it will not be found.
Examples of the use of the –data command are provided below:
In most cases, it is likely that you will want to “stack” a number of GoldSim
runs by creating a batch file that you run from the command line. However, if
you simply stack command lines and then run a batch file, all GoldSim calls
would be launched in parallel (e.g., if you had 10 command lines that ran
GoldSim, 10 instances of GoldSim would open and run simultaneously).
To avoid this problem and force the commands to run in series, you can use the
Start/Wait command provided by Windows. An example batch file that utilizes
this is shown below:
W
Web site
GoldSim Resource Center 30
Weibull distribution 178, 1008
Withdrawal rates from Reservoirs
238, 244
Y
Yucca Mountain database
creating 1068
downloading from 978
Z
Zoom toolbar 109
Zooming