0% found this document useful (0 votes)
109 views557 pages

GoldSim Vol 1

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
109 views557 pages

GoldSim Vol 1

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 557

User's Guide

GoldSim

Probabilistic Simulation Environment

Volume 1 of 2
Copyright GoldSim Technology Group LLC, 1998-2014. All rights reserved.
GoldSim is a registered trademark of GoldSim Technology Group LLC.

Version 11.1 (May 2014)

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:

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS


IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

GoldSim Technology Group


22500 SE 64th Place, Suite 240
Issaquah, Washington 98027 USA

Visit us at our web site: www.goldsim.com


Email us at: software@goldsim.com
Contents
Chapter 1: Welcome to GoldSim! 1 
Chapter Overview ......................................................................................................................................... 1 
In this Chapter ................................................................................................................................... 1 
What is GoldSim?.......................................................................................................................................... 2 
What Can I Do With GoldSim? ........................................................................................................ 2 
What Kind of Problems Can I Apply It To? ..................................................................................... 2 
What Makes GoldSim Unique? ........................................................................................................ 3 
What Do I Need to Use GoldSim? .................................................................................................... 4 
How to Use this Manual ................................................................................................................................ 4 
Example Models ............................................................................................................................... 5 
How this Manual is Organized .......................................................................................................... 5 
Conventions Used in this Manual ................................................................................................................ 7 
Installing and Registering GoldSim ............................................................................................................. 7 
Registering GoldSim via the Internet ................................................................................................ 9 
Assisted Registration......................................................................................................................... 9 
Managing Your License .................................................................................................................. 10 
Registering and Using a Network (Floating) License ..................................................................... 14 
Testing the GoldSim Installation .................................................................................................... 25 
Activating and Deactivating Extension Modules ............................................................................ 26 
Uninstalling GoldSim ..................................................................................................................... 27 
Learning to Use GoldSim............................................................................................................................ 28 
Using Help and the GoldSim Tutorial ....................................................................................................... 29 
Getting Technical Support ......................................................................................................................... 29 

Chapter 2: GoldSim in a Nutshell 31 


Chapter Overview ....................................................................................................................................... 31 
In this Chapter ................................................................................................................................. 31 
Understanding Simulation .......................................................................................................................... 32 
Dynamic Simulation ....................................................................................................................... 32 
Probabilistic Simulation .................................................................................................................. 32 
Steps in Carrying Out a Simulation ................................................................................................ 33 
The Power of Simulation ................................................................................................................ 34 
What is GoldSim?........................................................................................................................................ 35 
A Powerful, Flexible Simulator ...................................................................................................... 36 
A System Integration Tool .............................................................................................................. 36 
A Visual Information Management System .................................................................................... 37 
Basic GoldSim Concepts ............................................................................................................................. 37 
The GoldSim Simulation Environment ........................................................................................... 37 
Elements: The Basic Building Blocks in GoldSim ......................................................................... 38 
Linking Elements ............................................................................................................................ 39 
A Simple Example .......................................................................................................................... 39 
Understanding Dynamic Simulation ............................................................................................... 42 
GoldSim is Dimensionally-Aware .................................................................................................. 43 
Representing Uncertainty ................................................................................................................ 44 
Representing Feedback Loops ........................................................................................................ 46 
Simulating Delays ........................................................................................................................... 47 
Building Hierarchical Top-Down Models....................................................................................... 48 
Additional Function Elements......................................................................................................... 48 

GoldSim User’s Guide Contents  i


Advanced Features ...................................................................................................................................... 49 
Manipulating Arrays (Vectors and Matrices).................................................................................. 49 
Modeling Discrete Events ............................................................................................................... 50 
Activating and Deactivating Portions of a Model ........................................................................... 52 
Controlling the Timestep in a Model .............................................................................................. 52 
Carrying Out Iterative (Looping) Calculations ............................................................................... 53 
Dynamically Linking to Spreadsheets............................................................................................. 53 
Importing and Exporting from a Database ...................................................................................... 54 
Building Custom Elements Using Scripts ....................................................................................... 54 
Dynamically Linking to External Models ....................................................................................... 54 
Building Large, Complex Models ................................................................................................... 55 
Modeling Scenarios......................................................................................................................... 55 
Optimizing a Model ........................................................................................................................ 56 
Carrying Out Sensitivity Analyses on a Model ............................................................................... 56 
Features for Documenting and Presenting Your Model .......................................................................... 57 
Creating Report Quality Result Graphics........................................................................................ 57 
Internally Documenting Your Model .............................................................................................. 58 
Using GoldSim as a Presentation Tool .......................................................................................... 60 
Specialized GoldSim Modules .................................................................................................................... 61 
Financial Module ............................................................................................................................ 61 
Contaminant Transport Module ...................................................................................................... 62 
Reliability Module .......................................................................................................................... 63 
Dashboard Authoring Module......................................................................................................... 64 
Distributed Processing Module ....................................................................................................... 64 
The GoldSim Player .................................................................................................................................... 65 

Chapter 3: Building a Model in GoldSim 67 


Chapter Overview ....................................................................................................................................... 67 
In this Chapter ................................................................................................................................. 67 
The GoldSim User Interface ....................................................................................................................... 68 
The GoldSim Start Dialog............................................................................................................... 68 
User Interface Components ............................................................................................................. 68 
Types of GoldSim Objects .............................................................................................................. 70 
Common Mouse Actions in GoldSim ............................................................................................. 70 
Saving, Opening, and Closing GoldSim Files................................................................................. 72 
Restoring Files After an Unexpected Failure Using Auto-Save...................................................... 73 
Password-Protecting a Model File .................................................................................................. 75 
Sending Your Model to Someone Via Email .................................................................................. 76 
Simulation Modes ........................................................................................................................... 76 
Creating Elements and Links ..................................................................................................................... 77 
GoldSim Element Types ................................................................................................................. 77 
Creating Elements ........................................................................................................................... 82 
Element Inputs and Outputs ............................................................................................................ 82 
Editing an Element's Properties and Creating Links ....................................................................... 84 
Understanding Output Attributes .................................................................................................... 93 
Using Dimensions and Units........................................................................................................... 94 
Error Checking in Input Fields ........................................................................................................ 98 
Creating Links Using the Link Cursor .......................................................................................... 100 
Understanding Containers ............................................................................................................. 100 
Understanding Influences ............................................................................................................. 102 
Referencing Time in GoldSim ...................................................................................................... 105 
Copying, Moving, and Deleting Elements .................................................................................... 106 
Navigating and Viewing a Model ............................................................................................................. 108 
Navigating Within the Graphics Pane ........................................................................................... 109 
Using the Browser......................................................................................................................... 110 

ii  Contents GoldSim User’s Guide


Using Tool-Tips ............................................................................................................................ 113 
Finding Elements .......................................................................................................................... 116 
Viewing Element Dependencies ................................................................................................... 117 
Running a Model and Viewing Results ................................................................................................... 119 
Specifying Simulation Settings ..................................................................................................... 120 
Saving Results ............................................................................................................................... 121 
Running a Model........................................................................................................................... 121 
Viewing Results ............................................................................................................................ 122 
Building and Running Your First Model ...................................................................................... 123 

Chapter 4: Using the GoldSim Elements 127 


Chapter Overview ..................................................................................................................................... 127 
In this Chapter ............................................................................................................................... 127 
Entering Mathematical Expressions into Element Input Fields............................................................ 128 
Built-in Functions ......................................................................................................................... 128 
Built-in Constants ......................................................................................................................... 133 
Creating Conditional Expressions ................................................................................................. 134 
Referencing Dates in Expressions ................................................................................................. 135 
Using Containers ....................................................................................................................................... 136 
The Container Properties Dialog ................................................................................................... 136 
Container Options and Features .................................................................................................... 137 
Controlling the Appearance of the Graphics Pane in a Container ................................................. 143 
Summary Information for a Container .......................................................................................... 144 
Controlling Result Flags for Elements in the Container ............................................................... 145 
Sealing and Locking Containers ................................................................................................... 147 
Overview of GoldSim Element Types ...................................................................................................... 150 
Input Elements .............................................................................................................................. 150 
Stock Elements.............................................................................................................................. 150 
Function Elements......................................................................................................................... 151 
Event Elements ............................................................................................................................. 151 
Delay Elements ............................................................................................................................. 152 
Result Elements ............................................................................................................................ 152 
Differentiating Between Material and Information Flow .............................................................. 153 
Using Basic Input Elements ...................................................................................................................... 154 
Data Elements ............................................................................................................................... 154 
Stochastic Elements ...................................................................................................................... 156 
Using Time Series Elements ..................................................................................................................... 187 
Defining the Data Type and Units for a Time Series .................................................................... 189 
Specifying the Source of the Input Data for a Time Series ........................................................... 189 
Specifying What the Input to a Time Series Represents ............................................................... 191 
Viewing and Editing Time Series Inputs ...................................................................................... 192 
Specifying Time Series Outputs.................................................................................................... 201 
Referencing a Time Series Using a Function ................................................................................ 203 
Time Series Examples ................................................................................................................... 205 
Advanced Time Series Options ..................................................................................................... 214 
Browser View of a Time Series Element ...................................................................................... 227 
Using Stock Elements ................................................................................................................................ 228 
Integrator Elements ....................................................................................................................... 228 
Reservoir Elements ....................................................................................................................... 236 
Using Basic Function Elements ................................................................................................................ 248 
Expression Elements ..................................................................................................................... 248 
Extrema Elements ......................................................................................................................... 249 
Selector Elements.......................................................................................................................... 252 
Splitter Elements ........................................................................................................................... 255 
Allocator Elements........................................................................................................................ 257 

GoldSim User’s Guide Contents  iii


Sum Elements ............................................................................................................................... 262 
Lookup Table Elements ................................................................................................................ 263 
Logical Elements........................................................................................................................... 288 
Using Delay Elements................................................................................................................................ 291 
Information Delay Elements ......................................................................................................... 292 
Material Delay Elements ............................................................................................................... 300 
How GoldSim Carries Out its Calculations ............................................................................................ 309 
Understanding State Variables in GoldSim .................................................................................. 309 
The Causality Sequence and Element Updating ........................................................................... 311 
Evaluating Feedback Loops .......................................................................................................... 314 
Invalid and Ambiguous Causality Sequences ............................................................................... 317 

Chapter 5: Simulating Discrete Events 319 


Chapter Overview ..................................................................................................................................... 319 
In this Chapter ............................................................................................................................... 319 
Basic Concepts of Discrete Event Modeling ............................................................................................ 320 
Propagating Discrete Signals Between Elements .......................................................................... 321 
Understanding Event Triggering ............................................................................................................. 323 
Specifying Triggering Events ....................................................................................................... 324 
Specifying a Precedence Condition for a Trigger ......................................................................... 328 
Specifying a Required Condition for a Trigger ............................................................................. 330 
Specifying a Resource Interaction for a Trigger ........................................................................... 332 
Generating Discrete Event Signals........................................................................................................... 332 
Timed Event Elements .................................................................................................................. 333 
Triggered Event Elements ............................................................................................................. 336 
Decision Elements......................................................................................................................... 338 
Random Choice Elements ............................................................................................................. 341 
Event Delay Elements ................................................................................................................... 345 
Responding to Events ................................................................................................................................ 352 
Discrete Change Elements ............................................................................................................ 352 
Delaying a Discrete Change Signal............................................................................................... 357 
Using Splitter Elements to Route Discrete Changes Based on Their Value ................................. 363 
Status Elements ............................................................................................................................. 364 
Milestone Elements ....................................................................................................................... 366 
Triggering a Stochastic ................................................................................................................. 370 
Interrupting a Simulation .............................................................................................................. 372 
Generating Discrete Changes Using Time Series Elements ................................................................... 379 
How GoldSim Inserts Events into a Simulation ..................................................................................... 380 
Determining if an Event Has Occurred ................................................................................................... 380 
Controlling the Calculation Sequence of Events..................................................................................... 381 

Chapter 6: Customizing the Interface 383 


Chapter Overview ..................................................................................................................................... 383 
In this Chapter ............................................................................................................................... 383 
Customizing Toolbars ............................................................................................................................... 384 
Activating and Deactivating Toolbars........................................................................................... 384 
Creating and Modifying Toolbars and Menu Bars ........................................................................ 385 
Moving and Docking Toolbars and Menu Bars ............................................................................ 386 
Saving Your Toolbar Settings ....................................................................................................... 386 
Customizing the Appearance of the Graphics Pane ............................................................................... 386 
The Graphics Pane Grid and Background ..................................................................................... 386 
Adjusting the Size of the Graphics Pane ....................................................................................... 388 
Saving the Graphics Pane's Position and Scale ............................................................................. 388 
Editing the Appearance of Influences ........................................................................................... 389 

iv  Contents GoldSim User’s Guide


Filtering Influences ....................................................................................................................... 392 
Copying Container Settings to Other Containers in a Model ........................................................ 393 
Editing the Appearance of Elements ....................................................................................................... 395 
Changing the Element's Symbol ................................................................................................... 396 
Changing the Element's Label....................................................................................................... 398 
Changing the Element's Background and Outline......................................................................... 398 
Viewing and Creating Units ..................................................................................................................... 399 
The GoldSim Units Manager ........................................................................................................ 400 
Creating New Units....................................................................................................................... 402 
Using Placeholders for Time Units ............................................................................................... 407 
Using the Percentage Unit Symbol ............................................................................................... 407 
The Options Dialog.................................................................................................................................... 408 
The General Tab of the Options Dialog ........................................................................................ 408 
The Graphic Tab of the Options Dialog ........................................................................................ 409 
The Results Tab of the Options Dialog ......................................................................................... 409 

Chapter 7: Running a Model 411 


Chapter Overview ..................................................................................................................................... 411 
In this Chapter ............................................................................................................................... 411 
Simulation Settings .................................................................................................................................... 412 
Setting the Basic Time Options..................................................................................................... 413 
Advanced Timestep Options ......................................................................................................... 426 
Setting the Monte Carlo Options................................................................................................... 438 
Defining and Referencing Global Properties ................................................................................ 443 
Viewing and Editing Model Summary Information...................................................................... 444 
Understanding and Referencing Run Properties.................................................................................... 445 
Run Properties: Calendar Time ..................................................................................................... 447 
Run Properties: Elapsed Time ....................................................................................................... 450 
Run Properties: Simulation ........................................................................................................... 451 
Run Properties: Reporting Periods ................................................................................................ 452 
Saving Outputs as Results ........................................................................................................................ 453 
Specifying Results to be Saved ..................................................................................................... 453 
Highlighting Outputs that Will be Saved ...................................................................................... 456 
Archiving a File with Results ........................................................................................................ 456 
Using the Run Controller.......................................................................................................................... 456 
Understanding Simulation Modes ................................................................................................. 456 
Carrying Out a Simulation (Run Mode) ........................................................................................ 457 
Viewing Results (Result Mode) .................................................................................................... 461 
Customizing the Behavior of the Run Controller .......................................................................... 462 
Creating, Running and Comparing Scenarios ........................................................................................ 463 
Introduction to Scenarios .............................................................................................................. 463 
Creating and Editing Scenarios Using the Scenario Manager....................................................... 471 
Browsing and Editing the Active Scenario ................................................................................... 475 
Running Scenarios and Displaying Scenario Results.................................................................... 478 
Creating and Editing Scenarios in Dashboards ............................................................................. 485 
Running an Optimization ......................................................................................................................... 486 
Overview of Optimization ............................................................................................................ 486 
Defining the Optimization Settings ............................................................................................... 487 
Running the Optimization ............................................................................................................. 493 
Optimizing a Probabilistic Model ................................................................................................. 495 
Saving Optimization Settings and Results .................................................................................... 495 
Running Sensitivity Analyses ................................................................................................................... 497 
Selecting the Result and Independent Variables for a Sensitivity Analysis .................................. 497 
Defining the Independent Variable Ranges for a Sensitivity Analysis ......................................... 499 
Viewing Sensitivity Analysis Results ........................................................................................... 501 

GoldSim User’s Guide Contents  v


The Run Log .............................................................................................................................................. 506 
Running GoldSim from the Command Line ........................................................................................... 507 

Chapter 8: Displaying Results in GoldSim 511 


Chapter Overview ..................................................................................................................................... 511 
In this Chapter ............................................................................................................................... 511 
Displaying Results: An Overview............................................................................................................. 512 
Understanding Result Mode.......................................................................................................... 512 
Viewing "Last Value" Results in Tool-Tips.................................................................................. 512 
Viewing the Four Basic Result Types ........................................................................................... 513 
Using Result Display Windows .................................................................................................... 520 
Creating and Using Result Elements ............................................................................................. 526 
Viewing Scenario Results ............................................................................................................. 532 
Classifying and Screening Realizations ........................................................................................ 533 
Creating Chart Styles .................................................................................................................... 536 
Viewing Time History Results .................................................................................................................. 536 
Viewing the Properties of a Time History Result ......................................................................... 537 
Viewing a Time History Chart ...................................................................................................... 540 
Viewing a Time History Table ...................................................................................................... 542 
Viewing Time Histories of Multiple Outputs................................................................................ 544 
Viewing Time Histories for Array Outputs................................................................................... 547 
Viewing Time Histories of Multiple Realizations ........................................................................ 552 
Viewing Reporting Period-Based Results in Time History Result Elements................................ 564 
Using Result Classification and Screening in Time History Results ............................................ 571 
Viewing SubModel Results in Time History Result Elements ..................................................... 573 
Viewing Scenario Results in Time History Result Elements ........................................................ 578 
Viewing Unscheduled Updates in Time History Result Elements ................................................ 586 
Disabling a Time History Result Element..................................................................................... 591 
Controlling the Chart Style in Time History Results .................................................................... 592 
Viewing Distribution Results .................................................................................................................... 596 
Viewing the Properties of a Distribution Result ........................................................................... 597 
Viewing a Distribution Summary ................................................................................................. 600 
Viewing a Distribution Chart ........................................................................................................ 604 
Viewing a Distribution Table ........................................................................................................ 608 
Viewing the Distribution Result Array ......................................................................................... 610 
Viewing Distributions of Multiple Outputs .................................................................................. 611 
Viewing Distribution Results for Single Realization Runs ........................................................... 614 
Using Result Classification and Screening in Distribution Results .............................................. 616 
Adding a Distribution Output to a Distribution Result ................................................................. 620 
Viewing Scenario Results in Distribution Result Elements .......................................................... 622 
Controlling the Chart Style in Distribution Results ...................................................................... 626 
Viewing Multi-Variate Results ................................................................................................................. 629 
Selecting Outputs for a Multi-Variate Result Display .................................................................. 630 
Viewing the Properties of a Multi-Variate Result ......................................................................... 633 
Viewing a 2D Scatter Plot ............................................................................................................. 635 
Viewing a 3D Scatter Plot ............................................................................................................. 637 
Viewing a Sensitivity Analysis Table ........................................................................................... 639 
Viewing a Correlation Matrix Table ............................................................................................. 641 
Viewing a Raw Multi-Variate Data Table .................................................................................... 642 
Using Result Classification and Screening in Multi-Variate Results ............................................ 643 
Controlling the Chart Style in Multi-Variate Results .................................................................... 647 
Viewing Array Results .............................................................................................................................. 648 
Viewing the Properties of an Array Result ................................................................................... 649 
Viewing a Vector Chart ................................................................................................................ 651 
Viewing a Matrix Chart ................................................................................................................ 653 

vi  Contents GoldSim User’s Guide


Plotting Condition Arrays ............................................................................................................. 656 
Viewing an Array Table ................................................................................................................ 656 
Viewing Multiple Realizations of Array Results .......................................................................... 658 
Using Result Screening in Array Results ...................................................................................... 658 
Controlling the Chart Style in Array Results ................................................................................ 659 
Editing the Appearance of a Chart .......................................................................................................... 661 
The Chart Style General Tab......................................................................................................... 662 
The Chart Style Header and Footer Tabs ...................................................................................... 663 
The Chart Style Axis Tabs ............................................................................................................ 664 
The Chart Style Legend Tab ......................................................................................................... 668 
The Chart Style Grid Tab .............................................................................................................. 669 
Editing Data Styles........................................................................................................................ 669 
Creating and Using Chart Styles.............................................................................................................. 671 
Saving and Applying Chart Styles ................................................................................................ 672 
Using the Style Manager ............................................................................................................... 673 
Using Keywords in Styles ............................................................................................................. 676 
Exporting Results ...................................................................................................................................... 678 
Exporting from a Time History Result Element to a Spreadsheet ................................................ 678 
Exporting from a Time History Result Element to a Text File ..................................................... 686 
Exporting Results Using a Spreadsheet Element .......................................................................... 691 
Copying and Exporting Result Displays.................................................................................................. 691 
Copying a Chart or Table .............................................................................................................. 691 
Exporting a Chart .......................................................................................................................... 691 

Chapter 9: Documenting and Presenting Your Model 693 


Chapter Overview ..................................................................................................................................... 693 
In this Chapter ............................................................................................................................... 693 
Step One: Organize Your Model! ............................................................................................................ 694 
Defining the Audiences for Your Model....................................................................................... 694 
Creating a Top-Down Model ........................................................................................................ 694 
Other Suggestions for Organizing Your Model ............................................................................ 695 
Displaying Your Model in a Presentation Using Full Screen View ....................................................... 696 
Adding Graphics and Text ....................................................................................................................... 696 
Adding Graphic Objects................................................................................................................ 697 
Changing the Appearance of Graphic Objects .............................................................................. 700 
Adding and Editing Text ............................................................................................................... 701 
Adding and Editing Text Boxes .................................................................................................... 704 
Adding Images .............................................................................................................................. 707 
Modifying the Appearance of Elements .................................................................................................. 708 
Creating, Editing and Viewing Notes ...................................................................................................... 709 
Opening the Note Pane ................................................................................................................. 709 
Creating and Displaying Notes ..................................................................................................... 709 
Editing and Formatting Notes ....................................................................................................... 710 
Inserting Hyperlinks into Notes .................................................................................................... 711 
Adding Hyperlinks to the Graphics Pane................................................................................................ 712 
Specifying Addresses for the Various Hyperlink Types ............................................................... 713 
Changing the Appearance of a Hyperlink Object ......................................................................... 715 
Manipulating Graphical Objects ............................................................................................................. 718 
Aligning and Ordering Objects ..................................................................................................... 718 
Spacing and Sizing Objects........................................................................................................... 719 
Precisely Moving Objects ............................................................................................................. 719 
Grouping Objects .......................................................................................................................... 719 
Rotating Objects............................................................................................................................ 720 
Copying, Pasting, Moving and Deleting Graphical Objects ......................................................... 720 
Using the Graphical Undo and Redo Functions ............................................................................ 721 

GoldSim User’s Guide Contents  vii


Creating Printed Documentation ............................................................................................................. 721 
Printing the Graphics Pane ............................................................................................................ 721 
Exporting the Graphics Pane......................................................................................................... 722 
Creating a GoldSim Player File ............................................................................................................... 722 
Creating a Player File Using the Dashboard Authoring Module................................................... 724 

Chapter 10: Advanced Modeling Concepts 725 


Chapter Overview ..................................................................................................................................... 725 
In this Chapter ............................................................................................................................... 725 
Using Vectors and Matrices...................................................................................................................... 726 
Understanding Array Labels ......................................................................................................... 727 
Defining Vectors and Matrices Using Data Elements................................................................... 733 
Defining Vectors Using Stochastic Elements ............................................................................... 737 
Defining Arrays in an Input Field Using Array Constructor Functions ........................................ 738 
Using a Vector as a Lookup Table ................................................................................................ 740 
Manipulating Vectors and Matrices with Other Elements ............................................................ 741 
Viewing Results for Arrays........................................................................................................... 749 
Copying Array Elements Between Models ................................................................................... 750 
Understanding Locally Available Properties .......................................................................................... 750 
Modeling Aging Chains............................................................................................................................. 752 
Modeling Aging Chains Using a Series of Reservoirs .................................................................. 753 
Modeling Aging Chains Using a Series of Material Delays ......................................................... 754 
Modeling Aging Chains Using Integrators with Discrete Pushes ................................................. 756 
Solving Convolution Integrals .................................................................................................................. 759 
What is a Convolution Integral? ................................................................................................... 759 
Using the Convolution Element .................................................................................................... 760 
Examples of the Use of the Convolution Element ........................................................................ 762 
Generating Stochastic Time Histories ..................................................................................................... 768 
Types of Stochastic Time Histories .............................................................................................. 769 
Generating Geometric Growth Histories....................................................................................... 772 
Generating Random Walk Histories ............................................................................................. 776 
Simulating Correlated Arrays of Stochastic Histories................................................................... 779 
Using Resources ......................................................................................................................................... 781 
Defining Resource Types and Creating Resource Stores .............................................................. 781 
Interacting with Resources ............................................................................................................ 790 
Summarizing Resource Locations and Users ................................................................................ 798 
Viewing Resource Results ............................................................................................................ 802 
Script Elements.......................................................................................................................................... 803 
Getting Started with the Script Element ........................................................................................ 805 
Controlling Program Flow in the Script Element .......................................................................... 816 
Understanding Variable Scope in a Script .................................................................................... 828 
Editing Scripts ............................................................................................................................... 829 
Documenting Scripts ..................................................................................................................... 832 
Debugging Scripts ......................................................................................................................... 833 
Logging Messages in Scripts ........................................................................................................ 834 
Printing Scripts.............................................................................................................................. 837 
Script Examples ............................................................................................................................ 837 
Browser View of a Script Element................................................................................................ 841 
Using Conditional Containers .................................................................................................................. 841 
Behavior of Elements in Conditional Containers .......................................................................... 842 
Enabling and Disabling Conditionality ......................................................................................... 844 
Outputs of a Conditional Container .............................................................................................. 845 
Activating a Container .................................................................................................................. 846 
Deactivating a Container ............................................................................................................... 847 
Using Auto Triggers in Conditional Containers............................................................................ 849 

viii  Contents GoldSim User’s Guide


Specifying Resources for a Conditional Container ....................................................................... 849 
Viewing a Conditional Container in the Browser ......................................................................... 851 
Using External Application Elements ...................................................................................................... 852 
Spreadsheet Elements ................................................................................................................... 852 
External (DLL) Elements .............................................................................................................. 873 
File Elements ................................................................................................................................ 884 
Localizing Containers ............................................................................................................................... 886 
Localizing a Container .................................................................................................................. 887 
Referencing the Contents of a Localized Container ...................................................................... 887 
Nesting Localized Containers ....................................................................................................... 890 
Defining an Alias for an Exposed Output ..................................................................................... 890 
Search Logic for Linking to an Output Present in Multiple Scopes .............................................. 892 
Globalizing a Container ................................................................................................................ 893 
Cloning Elements....................................................................................................................................... 893 
Creating Clones ............................................................................................................................. 894 
Freeing a Clone (Decloning) ......................................................................................................... 896 
Cloning Containers ....................................................................................................................... 896 
Referencing an Output's Previous Value ................................................................................................ 898 
Inputs and Outputs to a Previous Value Element .......................................................................... 899 
Creating Recursive Loops Using Previous Value Elements ......................................................... 901 
Using Looping Containers ........................................................................................................................ 904 
Controlling the Number of Loops in a Looping Container ........................................................... 905 
Understanding How Elements Inside a Looping Container are Updated ...................................... 907 
Viewing and Modifying the Causality Sequence..................................................................................... 908 
Viewing the Causality Sequence ................................................................................................... 909 
Addressing Ambiguous Causality Sequences ............................................................................... 911 
Using SubModels to Embed Models Within Models .............................................................................. 914 
What Can I Do With a SubModel? ............................................................................................... 914 
Creating a SubModel .................................................................................................................... 915 
Other SubModel Options .............................................................................................................. 932 
SubModel Examples ..................................................................................................................... 952 
Customized Importance Sampling Using User-Defined Realization Weights ..................................... 953 
Dynamically Revising Distributions Using Simulated Bayesian Updating........................................... 956 
Mathematics of Simulated Bayesian Updating ............................................................................. 962 
Tracking Model Changes.......................................................................................................................... 963 
Versioning Overview .................................................................................................................... 963 
Enabling Versioning ..................................................................................................................... 964 
Creating Versions.......................................................................................................................... 964 
The Version Manager.................................................................................................................... 965 
Changes Tracked Between Versions ............................................................................................. 966 
Displaying Version Differences .................................................................................................... 967 
Generating a Version Report ......................................................................................................... 971 
Linking Elements to a Database............................................................................................................... 972 
Creating a Compatible Database ................................................................................................... 972 
Adding Data Sources to Your Computer ...................................................................................... 973 
Downloading Element Definitions from a Database ..................................................................... 974 
Modifying Downloaded Data........................................................................................................ 981 
References .................................................................................................................................................. 981 

Appendix A: Introduction to Probabilistic Simulation 983 


Appendix Overview ................................................................................................................................... 983 
In this Appendix ............................................................................................................................ 983 
Types of Uncertainty ................................................................................................................................. 984 
Quantifying Uncertainty ........................................................................................................................... 984 
Understanding Probability Distributions....................................................................................... 984 

GoldSim User’s Guide Contents  ix


Characterizing Distributions ......................................................................................................... 986 
Specifying Probability Distributions ............................................................................................. 987 
Correlated Distributions ................................................................................................................ 988 
Variability and Ignorance.............................................................................................................. 988 
Propagating Uncertainty .......................................................................................................................... 989 
A Comparison of Probabilistic and Deterministic Simulation Approaches ......................................... 990 
References .................................................................................................................................................. 993 

Appendix B: Probabilistic Simulation Details 995 


Appendix Overview ................................................................................................................................... 995 
In this Appendix ............................................................................................................................ 995 
Mathematical Representation of Probability Distributions................................................................... 996 
Distributional Forms ..................................................................................................................... 996 
Representing Truncated Distributions......................................................................................... 1009 
Correlation Algorithms........................................................................................................................... 1009 
Sampling Techniques .............................................................................................................................. 1011 
Generating and Assigning Random Number Seeds .................................................................... 1012 
Latin Hypercube Sampling ......................................................................................................... 1013 
Importance Sampling .................................................................................................................. 1016 
Representing Random (Poisson) Events ................................................................................................ 1020 
Computing and Displaying Result Distributions .................................................................................. 1021 
Displaying a CDF ....................................................................................................................... 1021 
Displaying a PDF ........................................................................................................................ 1022 
Computing and Displaying Confidence Bounds on the Mean .................................................... 1022 
Computing and Displaying Confidence Bounds on CDFs and CCDFs ...................................... 1023 
Computing the Conditional Tail Expectation.............................................................................. 1025 
Computing Sensitivity Analysis Measures ............................................................................................ 1026 
References ................................................................................................................................................ 1031 

Appendix C: Implementing External (DLL) Elements 1033 


Appendix Overview ................................................................................................................................. 1033 
In this Appendix .......................................................................................................................... 1033 
Understanding External (DLL) Elements ............................................................................................. 1034 
Implementing an External Function ...................................................................................................... 1034 
Important Restrictions ................................................................................................................. 1034 
External Function Format ........................................................................................................... 1035 
The Input and Output Argument Arrays ..................................................................................... 1037 
External Function Examples .................................................................................................................. 1040 
External Function Calling Sequence ..................................................................................................... 1043 
Before the Simulation ................................................................................................................. 1043 
During Each Realization ............................................................................................................. 1044 
Before Each Realization.............................................................................................................. 1044 
After Each Realization ................................................................................................................ 1044 
After the Simulation .................................................................................................................... 1044 
DLL Calling Details ................................................................................................................................ 1044 
64-Bit DLL Support .................................................................................................................... 1045 
Returning Error Messages from External Functions ................................................................... 1045 

Appendix D: GoldSim Units Database 1047 


Appendix Overview ................................................................................................................................. 1047 
Built-in Units and Conversion Factors .................................................................................................. 1048 

Appendix E: Database Input File Formats 1059 

x  Contents GoldSim User’s Guide


Appendix Overview ................................................................................................................................. 1059 
In this Appendix .......................................................................................................................... 1059 
Creating a Generic Database.................................................................................................................. 1060 
Creating a Simple GoldSim Database ................................................................................................... 1060 
Parameter Table .......................................................................................................................... 1060 
Parameter Reference Table ......................................................................................................... 1064 
Array Values Table ..................................................................................................................... 1065 
Probability Value Pairs Table ..................................................................................................... 1065 
Example File and Database Template ......................................................................................... 1066 
Creating a Yucca Mountain Database ................................................................................................... 1066 
Parameter Table .......................................................................................................................... 1066 
Parameter Value Table ................................................................................................................ 1068 
Value Component Table ............................................................................................................. 1069 
Example File ............................................................................................................................... 1071 

Appendix F: Integration Methods and Timestepping Algorithm 1073 


Appendix Overview ................................................................................................................................. 1073 
In this Appendix .......................................................................................................................... 1073 
Factors Affecting the Accuracy of Simulation Models ......................................................................... 1074 
Primary Numerical Approximations in GoldSim................................................................................ 1075 
GoldSim Numerical Integration Algorithm ................................................................................ 1075 
Approximate Solutions to Coupled Equations ............................................................................ 1077 
Selecting the Proper Timestep .................................................................................................... 1078 
Summary of GoldSim’s Dynamic Timestepping Algorithm ................................................................ 1078 
Defining Specific Periods with Shorter Timesteps ..................................................................... 1078 
Dynamically Adjusting the Timestep .......................................................................................... 1079 
Assigning Different Timesteps to SubSystems ........................................................................... 1079 
Accurately Simulating Discrete Events that Occur Between Timesteps ..................................... 1079 
Using Advanced Algorithms to Solve Coupled Equations ......................................................... 1080 

Glossary of Terms 1081 

Index 1091 

GoldSim User’s Guide Contents  xi


Chapter 1: Welcome to GoldSim!
I f a m a n w i l l b eg i n w i t h c e r t a i n t i e s, h e
s h a l l e n d i n d o u b t s, b u t i f h e w i l l b e
c o n t e n t t o b e g i n w i t h d o u b t s, h e s h a l l e n d
i n c e r t a i n t i e s.

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

GoldSim User’s Guide Chapter 1: Welcome to GoldSim!  1


What is GoldSim?

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).

2  Chapter 1: Welcome to GoldSim! GoldSim User’s Guide


What is GoldSim?

Environment: You could simulate the performance of a hazardous waste


site by describing the initial conditions (e.g., the geometry of the system,
the amount of contaminants in the system) and the processes acting on the
system (e.g., degradation of the drums containing the waste, migration of
contaminants through the environment). The output of this kind of
simulation would be contaminant concentrations around the site as a
function of time. You could use the results to design remediation measures
which would minimize the environmental impacts at the site.
Reliability Engineering: The reliability of a proposed satellite system
could be simulated by describing the components of the system and the
processes and events which could compromise the system’s integrity and
lead to failure or downtime. The outputs of this kind of simulation would
include the predicted reliability of the system and the probability and
consequences of different types of failures. You could use the results to
modify the design so as to maximize the reliability and minimize the
probability and/or consequences of a failure.
Manufacturing: You could simulate the coupled dynamics of a
manufacturing supply chain by defining the “links” in the chain (Retailer,
Distributor, Manufacturer, Tier 1 supplier(s), Tier 2 suppliers, etc.) and how
these organizations interact with each other. The model would simulate the
movement of materials (parts to finished product) through the supply chain,
and could be used to identify ways in which the system could be modified
(e.g., via technology or improved decision rules) to operate more
efficiently.
What Makes GoldSim GoldSim is user-friendly and highly graphical, such that you can literally draw
Unique? and subsequently present a picture (or influence diagram) of the system you
wish to model in an intuitive way without having to learn a great deal of
symbols, notation and functions.
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 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
model, and the ability to assign version numbers to a model which is
constantly being modified and improved, further facilitate the construction
and management of large models.
GoldSim is dimensionally-aware. GoldSim has an extensive internal
database of units and conversion factors. You can enter data and display

GoldSim User’s Guide Chapter 1: Welcome to GoldSim!  3


How to Use this Manual

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.

How to Use this Manual


One way to learn a new program is to read the user's guide (if it exists and is
well-written) from front to back, while simultaneously experimenting with the
program. Although a few people may prefer this method (and in the end, it may
be the most efficient way to learn a complex program well), we realize that most
software users (including ourselves!) rarely have the time or patience to do this.
Instead, most of us prefer to read some introductory material, and then "dive in",
referring to the documentation when we are stuck or need to learn a new feature.
This document is designed to satisfy both types of users.
Because each chapter builds on concepts introduced in previous chapters, with
the earlier chapters describing basic features, and later chapters adding details
and describing more advanced features, it can comfortably be read from front to
back by those users who wish to do so.

4  Chapter 1: Welcome to GoldSim! GoldSim User’s Guide


How to Use this Manual

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.

How this Manual is This document is organized into ten chapters:


Organized Chapter 1: Welcome to GoldSim! The remainder of this chapter discusses
the information required for you to get started using GoldSim, including
conventions used in the manual, installing the program, using online help,
and obtaining technical support.
All users should read Chapter 2: GoldSim in a Nutshell. This chapter provides a broad
Chapters 2 and 3! These two overview of the features and capabilities of GoldSim. It is strongly
chapters will provide you with recommended that you read this chapter, as it will tell you what the program
enough information to start is capable of doing, and direct you to those portions of the manual where
using GoldSim. you can obtain further information.
Chapter 3: Building a Model in GoldSim. This chapter describes the
GoldSim user interface, and presents all of the techniques required for

GoldSim User’s Guide Chapter 1: Welcome to GoldSim!  5


How to Use this Manual

creating, editing, and navigating a GoldSim model. Before trying to


experiment with GoldSim, it is highly recommended that you read this
chapter in order to familiarize yourself with these basic techniques.
Chapter 4: Using the GoldSim Elements. GoldSim models are built using
a wide variety of model objects (referred to as elements). This chapter
describes the details of using the basic elements in GoldSim.
Chapter 5: Simulating Discrete Events. In many systems, processes occur
that are discrete as opposed to continuous. These discrete occurrences are
referred to within GoldSim as events. This chapter describes the GoldSim
elements that you can use to simulate the occurrence and consequences of
discrete events.
Chapter 6: Customizing the Interface. This chapter provides instructions
for customizing the appearance of the user interface to meet your specific
needs.
Chapter 7: Running a Model. After you have created a model, you need to
run the model in order to produce results. This chapter describes the details
of how to control your simulation (e.g., specify its duration), specify the
types of results you wish to save, and run the model.
Chapter 8: Displaying Results in GoldSim. This chapter describes how
you can view (via charts and tables), analyze, and present model results.
Chapter 9: Documenting and Presenting Your Model. GoldSim was
specifically designed to allow you to effectively document, explain and
present your model. This chapter describes how 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.
Chapter 10: Advanced Modeling Concepts. This chapter describes
advanced and powerful capabilities of GoldSim that you will want to take
advantage of once you become comfortable with the program, including
using and manipulating arrays (vectors and matrices) in your models,
simulating discrete events, and linking GoldSim to a database.
This manual also includes six appendices.
Appendix A: Introduction to Probabilistic Simulation. This appendix
provides an introduction to basic concepts of probabilistic simulation, and
provides suggestions for further reading.
Appendix B: Probabilistic Simulation Details. This appendix describes
the mathematical details of the manner in which uncertainty is represented,
propagated, and displayed in GoldSim.
Appendix C: Implementing External (DLL) Elements. This appendix
provides instructions for users who wish to directly link external programs
into a GoldSim model.
Appendix D: GoldSim Units Database. As mentioned above, GoldSim is
dimensionally aware and carries out all unit conversions internally. This
appendix lists all of the internal units and conversion factors provided by
GoldSim.
Appendix E: Database Input File Formats. GoldSim allows data to be
imported from an ODBC-compliant database directly into GoldSim. This
appendix describes the required database structures and formats to facilitate
such a data transfer.

6  Chapter 1: Welcome to GoldSim! GoldSim User’s Guide


Conventions Used in this Manual

Appendix F: Integration Methods and Timestepping Algorithm. This


appendix describes the methods used by GoldSim to numerically integrate
differential equations. It also discusses the unique timestepping algorithm
GoldSim uses to accurately represent discrete events.
The manual also includes a Glossary of Terms and an Index.

Conventions Used in this Manual


The following conventions are used in this manual:
Convention Description
Important Terms New and important terms are presented in bold italics. These
terms all appear in the Glossary of Terms at the end of the
document.
File | Open… Menus and menu selections are separated by a vertical bar. File |
Open… means "Access the File menu and choose Open"
CTRL+C Key combinations are shown using a "+" sign.. CTRL+C means
press the Control and C keys simultaneously.
Warning:
This means watch out! Warnings typically alert you to potential
pitfalls and problems that may occur if you perform (or fail to
perform) a certain action.
Note:
Notes highlight important information about a particular
concept, topic or procedure, such as limitations on how a
particular feature can be used, or alternative ways of carrying
out an action.

In describing various mouse actions, the following conventions are used:


Mouse Action Definition
Click Press and release the left mouse button once.
Double-click Press and release the left mouse button twice in rapid
succession.
Right-click Press and release the right mouse button once.
Drag Press the left mouse button, and while keeping it depressed,
move the cursor to another location, then release the button.

Installing and Registering GoldSim


To install GoldSim, double-click the GoldSim installation file and follow the
directions on the screen.

Note: In order to install GoldSim, you must have Administrator privileges on


the computer.

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.

GoldSim User’s Guide Chapter 1: Welcome to GoldSim!  7


Installing and Registering GoldSim

Warning: During the installation process, a service (crypserv.exe) is added to


the Windows Services applet. This service is not automatically removed when
you uninstall the software (you must do this manually). Note, however, that if
you remove or stop this service while GoldSim is installed, GoldSim will no
longer run.

Once the program is installed, it is necessary to register the software in order to


run it. Each machine on which GoldSim is installed must be registered
separately (i.e., each machine is licensed). As will be discussed below, a license
can be transferred from one machine to another, and floating licenses are
available that allow GoldSim to be installed on a server and run by clients over a
network.

Note: The GoldSim Player does not need to be registered. In addition,


unregistered copies of GoldSim can be run as Slaves in distributed processing
simulations.

Read more: The GoldSim Player (page 65).


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).
Note that a separate Registration Code is required for each installation (i.e., each
machine). You can, however, transfer a GoldSim registration from one machine
to another.
To register GoldSim, double-click the GoldSim program icon (on the desktop
or, using Windows Explorer, in the folder into which you installed GoldSim) to
start the program. You will be presented with the following dialog:

From this dialog, you can choose to register GoldSim or to use an existing
network (floating) license.

Warning: Once GoldSim is registered on your machine, GoldSim monitors the


system time. If the system time on the PC is changed by more than 75 minutes,
the registration will be canceled. Therefore, you should not change your system
time by more than 75 minutes. If for some reason you need to do this, you
should contact the GoldSim Technology Group to ensure that you do not lose
your license.

8  Chapter 1: Welcome to GoldSim! GoldSim User’s Guide


Installing and Registering GoldSim

Warning: Special procedures must be followed if you are registering a 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

GoldSim User’s Guide Chapter 1: Welcome to GoldSim!  9


Installing and Registering GoldSim

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 (if you have started an Assisted Registration and
then Cancel out of the process, the Assisted Registration dialog will appear the
next time you try to start GoldSim). You should then 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 and ready to use.
Managing Your Once you have registered GoldSim on your machine, for the most part, you will
License not need to worry about registration again (until the license needs to be renewed
or upgraded). Occasionally, however, you may need to take some action to
manage your license. The GoldSim License Manager allows you to do so. The
License Manager can be accessed by selecting Help|Licensing… from the
main menu:

This dialog allows you to do the following:


Upgrade a license. This is required if your license is expiring and you wish
to extend it and/or if you wish to upgrade to a newer GoldSim version or
access additional modules.
Connect to Floating License. If you also have access to a floating license,
this allows you to switch to the 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.
Transfer a license to another machine. Although GoldSim licenses are
not intended to be transferred frequently (e.g., weekly) between machines,
occasionally you may have a need to do so.
Cancel a license. Canceling a license produces a Cancellation Code that
can be used to verify that a license has been removed. Cancellation is one
of the steps required to transfer a license.
Show GoldSim License Agreement. You can view and print this
document.
If you are currently connected to a floating license, the following dialog will
appear when you select Help|Licensing… from the main menu:

10  Chapter 1: Welcome to GoldSim! GoldSim User’s Guide


Installing and Registering GoldSim

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).

GoldSim User’s Guide Chapter 1: Welcome to GoldSim!  11


Installing and Registering GoldSim

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.

Read more: Disconnecting a Client from a Network License (page 23).

12  Chapter 1: Welcome to GoldSim! GoldSim User’s Guide


Installing and Registering GoldSim

Although GoldSim licenses are not intended to be transferred frequently (e.g.,


Transferring a License weekly) between machines, occasionally you may have a need to do so.
The Transfer License… button in the 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 License Manager by selecting Help|Licensing… from the
main menu.
2. Cancel your existing license (by pressing the Cancel License button in
the License Manager). This will cause GoldSim to generate and
display a Cancellation Code.
3. Send the Cancellation Code to the GoldSim Technology Group via
email (preferable), fax or phone.
4. 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. You will be contacted via
email when your license is reactivated.
5. You must then install and register GoldSim on the new machine.

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:

GoldSim User’s Guide Chapter 1: Welcome to GoldSim!  13


Installing and Registering GoldSim

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.

Network licenses require specific installation and registration procedures.


There are two steps involved in installing and registering a floating license:
1. You must register the license on a server;
2. You must install GoldSim on the client machines and configure the
program so that it uses the network license.

14  Chapter 1: Welcome to GoldSim! GoldSim User’s Guide


Installing and Registering GoldSim

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:

GoldSim User’s Guide Chapter 1: Welcome to GoldSim!  15


Installing and Registering GoldSim

Sharing the License Folder in Windows Vista/Windows 7:


4. Right click the license folder and select the Properties item from the
context menu. Select the Sharing tab:

5. Click the Advanced Sharing… button.


6. Choose the “Share this folder” option and specify the share name:

16  Chapter 1: Welcome to GoldSim! GoldSim User’s Guide


Installing and Registering GoldSim

7. Click on the Permissions button.


8. Allow Full Control for Everyone. If you are limiting access to just a
group of users, add the group and allow full control to this group.

9. Click OK to exit the dialog.


After completing this step, you can find the UNC (Network) path to this folder
in the Sharing tab. It should be specified as “\\computer name\share name”.

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.

GoldSim User’s Guide Chapter 1: Welcome to GoldSim!  17


Installing and Registering GoldSim

(The GoldSim Floating License Manager installation file is available from


within the GoldSim website).
Once you do so, when you first run the Floating License Manager, you will be
prompted to select a location (a drive and a folder) for the license:

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.

After selecting a location, the following dialog will appear:

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:

18  Chapter 1: Welcome to GoldSim! GoldSim User’s Guide


Installing and Registering GoldSim

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.

GoldSim User’s Guide Chapter 1: Welcome to GoldSim!  19


Installing and Registering GoldSim

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:

20  Chapter 1: Welcome to GoldSim! GoldSim User’s Guide


Installing and Registering GoldSim

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:

GoldSim User’s Guide Chapter 1: Welcome to GoldSim!  21


Installing and Registering 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.

22  Chapter 1: Welcome to GoldSim! GoldSim User’s Guide


Installing and Registering GoldSim

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:

Press the Connect to Standalone License button. If a valid standalone license


already exists on the machine, it will automatically connect to it. If you do not
have a valid standalone license, you will be be presented with the standard
registration dialog allowing you to either register a new standalone license or
connect to a different floating license.
In some circumstances, a floating license that you were previously connected to
may no longer be available (e.g., the license folder can no longer be accessed).
In this situation, GoldSim will automatically provide you with an opportunity to
disconnect from the license so that you can either register a standalone license,
or connect to a different floating license:

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:

GoldSim User’s Guide Chapter 1: Welcome to GoldSim!  23


Installing and Registering GoldSim

This dialog allows you to do the following:


Extend or upgrade a license. This is required if your license is expiring and
you wish to extend it and/or if you wish to upgrade to a newer GoldSim version.
Cancel a license. Canceling a license produces a Cancellation Code that can be
used to verify that a license has been removed. Cancellation is one of the steps
required to transfer a license.
Transfer a license to another machine or another folder. Although GoldSim
licenses are not intended to be transferred frequently (e.g., weekly) between
machines or folders, occasionally you may have a need to do so.
Upgrading a license:
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 a confirmation and 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.
Cancelling 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 or folder to another.
A license can be canceled by opening the Floating License Manager and
pressing the Cancel License button.
After a warning message, GoldSim will cancel the license and display a
Cancellation Code. This 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 the Floating License Manager, the registration
dialog is displayed (indicating that your installation of GoldSim is not currently
registered).

24  Chapter 1: Welcome to GoldSim! GoldSim User’s Guide


Installing and Registering GoldSim

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.

GoldSim User’s Guide Chapter 1: Welcome to GoldSim!  25


Installing and Registering GoldSim

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:

26  Chapter 1: Welcome to GoldSim! GoldSim User’s Guide


Installing and Registering GoldSim

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.

Note: During the installation process, a service (crypserv.exe) is added to the


Windows Services applet. This service is not automatically removed when you
uninstall the software, and you must do this manually.

GoldSim User’s Guide Chapter 1: Welcome to GoldSim!  27


Learning to Use GoldSim

Learning to Use GoldSim


Although GoldSim’s intuitive interface will tempt you to simply dive in and
start playing with the software, you are strongly discouraged from doing so,
even if you are an experienced modeler. Spending several hours up front (by
following the steps outlined below) is the quickest and most effective way to
understand the software’s features and capabilities and start building models in
GoldSim.
1. Take the GoldSim Tutorial. The GoldSim Tutorial is available via
the Tutorial button on the Start dialog (displayed whenever GoldSim is
run), or by selecting Help | Tutorial from the main GoldSim menu.
The GoldSim Tutorial presents the basic concepts on which GoldSim is
based and provides an overview of GoldSim’s key features and
capabilities. After taking the Tutorial (which takes about 2 hours), you
will have sufficient understanding to start using the software, and will
get more out of the information presented in the Help topics.
2. Request your free one hour web-based training session. When you
purchase GoldSim, you are entitled to a free one hour, live web-based
training session in which one of our analysts provides an interactive
training session via the Internet and telephone. You are strongly
encouraged to take advantage of this free training.
3. Read “Building a Model in GoldSim”. This section of GoldSim Help
(equivalent to Chapter 3 of the GoldSim User’s Guide) describes the
GoldSim user interface and presents all of the basic techniques required
to build a model. Reading it will reinforce the concepts that were
introduced in the Tutorial and provide you with the procedural
knowledge required to navigate the interface and utilize GoldSim's
basic features.
4. Open and explore the Example Files. When you install GoldSim, a
folder labeled "General Examples" is installed in the same directory as
the program. (You can quickly access these files by selecting
File|Open Example… from the main GoldSim menu). This directory
contains example model files showing how to use each of the elements
(the examples are referenced in the Help system and User’s Guide
where the element is introduced). These example model files are an
excellent way to begin to experiment with GoldSim. While exploring
the files, use GoldSim’s context-sensitive Help (i.e., the Help button in
each dialog) to access a detailed discussion of the element.
5. Download Example Files from the Model Libaray. The GoldSim
website contains a model library with a number of models illustrating
how GoldSim can be used for particular applications. These models
tend to be more complex than the simple example files found in the
General Examples folder, but still relatively simple. Again, while
exploring the files, use GoldSim’s context-sensitive Help (i.e., the Help
button in each dialog) to learn more about particular elements or
features utilized in the model.
6. Browse the User’s Guide or Help System. GoldSim has a large
number of features, and you will not discover all of them by
experimenting with simple example models. To fully utilize
GoldSim’s powerful features, browse through the User’s Guide, using
the index and table of contents as your guide. Each section of the
User’s Guide is heavily cross-referenced, so it is easy to just jump

28  Chapter 1: Welcome to GoldSim! GoldSim User’s Guide


Using Help and the GoldSim Tutorial

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.

Using Help and the GoldSim Tutorial


GoldSim has an extensive in-product help facility, which can be used to
supplement this manual. The Help system can be accessed by selecting Help |
Help Topics from the main GoldSim menu, pressing the F1 key, or clicking on
the Help button (the question mark) on the standard toolbar. Pressing the Help
button (or F1) within any of the dialogs also provides access to Help (in a
context-sensitive manner). All of the information in this document (with the
exception of the appendices) is accessible via GoldSim Help.
A GoldSim tutorial is also available via the Tutorial button on the Start dialog
(displayed whenever GoldSim is run), or by selecting Help | Tutorial from the
main GoldSim menu. Although the tutorial is not intended as a replacement to
the documentation, it does provide an excellent way to rapidly get started with
GoldSim.

Getting Technical Support


Technical support for GoldSim is available via email (support@goldsim.com).
The GoldSim Technology Group provides free Basic Support to all users with a
current membership to the GoldSim Subscription Program. Basic Support
includes the following:
 Installation and registration questions
 Basic questions about GoldSim features
When you purchase GoldSim, you automatically have a one year membership.
After the first year, membership in the GoldSim Subscription Program can be
extended with payment of an annual membership fee.
Advanced Technical Support for GoldSim is not included in the GoldSim
Subscription Program. Advanced Technical support includes the following:
 Questions about modeling a particular problem
 Problems with a model
 Techniques for modeling, troubleshooting, testing, etc.
Users may obtain advanced technical support via a technical support contract.
Details regarding the GoldSim Subscription Program and Advanced Technical
Support can be found at
http://www.goldsim.com/Web/Resources/TechnicalSupport/.
When seeking support, please include the following information:

GoldSim User’s Guide Chapter 1: Welcome to GoldSim!  29


Getting Technical Support

 GoldSim version (determined by selecting Help|About GoldSim from


the main menu).
 Extension modules which are enabled (determined by selecting
Model|Options… from the main menu and selecting the Modules tab).
 Operating system (including service packs).
 CPU, processor speed, and memory.
 Does the problem occur when loading, saving, running or
browsing/viewing the model?
 Detailed description of the problem or question (with attached model
file if appropriate).
Note also that the GoldSim web site includes a User Forum a Knowledge Base
(with answers to common questions, work-arounds for known bugs, and tips for
applying GoldSim), a Model Library, and a wide variety of topics of interest to
GoldSim modelers.

30  Chapter 1: Welcome to GoldSim! GoldSim User’s Guide


Chapter 2: GoldSim in a Nutshell
The purpose of computing is insight, not
n u m b e r s.

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

GoldSim User’s Guide Chapter 2: GoldSim in a Nutshell  31


Understanding Simulation

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

32  Chapter 2: GoldSim in a Nutshell GoldSim User’s Guide


Understanding Simulation

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:

If the inputs describing a system are uncertain, the prediction of future


performance is necessarily uncertain. That is, the result of any analysis based on
inputs represented by probability distributions is itself a probability distribution.

Hence, whereas the result of a deterministic simulation of an uncertain system is


a qualified statement ("if we build the dam, the salmon population could go
extinct"), the result of a probabilistic simulation of such a system is a quantified
probability ("if we build the dam, there is a 20% chance that the salmon
population will go extinct"). Such a result is typically much more useful to
decision-makers who might utilize the simulation results.
A more detailed description of probabilistic simulation concepts, including a
discussion of the advantages and disadvantages of probabilistic simulation, is
provided in Appendix A, "Introduction to Probabilistic Simulation".
Steps in Carrying Out In order to illustrate what is involved in simulating a system, the steps necessary
a Simulation to carry out any kind of simulation are briefly summarized below:
1. Define your objectives and measures of performance. Before
attempting to simulate a system, it is important to clearly identify what
types of questions you are trying to answer with the model. The
objectives of the model define the performance measures for the
system. A performance measure is a model output by which you can
judge the performance of the system (e.g., the salmon population in a
river, or the net present value of a project).
2. Develop the conceptual model. The most important step in simulating
any system is developing a conceptual model of the system. A
conceptual model is a representation of the significant features, events
and processes controlling the behavior of the system. It is essentially a
body of ideas, based on available information, that summarizes the
current understanding of the system.

GoldSim User’s Guide Chapter 2: GoldSim in a Nutshell  33


Understanding Simulation

3. Create the mathematical model. Once a conceptual model of the


system is developed, it is necessary to represent it quantitatively within
a mathematical model. A mathematical model consists of a set of
input assumptions, equations and algorithms describing the system.
4. Quantify the input parameters. The mathematical model identifies
specific inputs (e.g., the flow rate for a river, the financial discount
rate) which are required in order to simulate the system. These must be
quantified by specifying their values or probability distributions.
5. Implement and solve the mathematical model using a
computational tool. After developing the mathematical model and
quantifying all of the input parameters, the model must be implemented
within a computational tool capable of solving the equations
representing the system. This implementation of the mathematical
model within a computational tool is referred to as the simulation
model. For simple systems, the computational tool might be your brain
(if you can solve the equations in your head), a calculator, or perhaps a
spreadsheet program. For more complex systems, a specialized
computer program (such as GoldSim) is required.
6. Evaluate, explain and present the results. The final step in the
simulation process is to produce results, evaluate and draw conclusions
from these results, and present them to interested parties.
For very simple simulations, the steps described above could be carried out in
order, proceeding from step 1 to step 6. For most real-world simulations,
however, these steps should be carried out in an iterative manner. That is, as
new data and/or new insights into the behavior of the system are obtained, the
model is refined and reanalyzed.
Models which are constructed and continuously updated in such a manner can
provide a systematic framework for organizing and evaluating the available
information related to a complex system, and can act as management tools to aid
in ongoing decision-making.
As will be discussed below, GoldSim was specifically designed to make the
construction of such models as easy and intuitive as possible.
The Power of Simulation is a powerful and important tool because it provides a way in which
Simulation 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, it allows you to ask “What if?”
questions about a system without having to experiment on the actual system
itself (and hence incur the costs of field tests, prototypes, etc.).
A few wide-ranging examples of how simulation can be used to ask such "What
if?" questions in order to solve real-world problems in science, engineering and
business are listed below:
Wildlife management: By simulating an animal population (such as
salmon or elk), you can determine which combination of management
practices is most likely to be successful at maintaining a stable population.
Strategic planning: By simulating the development, regulatory approval,
and marketing of a new drug, you can determine a strategy that will
maximize profits.
Reliability and Systems Engineering: By simulating the components,
processes, failure modes and events controlling a complex engineering
system (such as a space system, a machine, or a large industrial facility),

34  Chapter 2: GoldSim in a Nutshell GoldSim User’s Guide


What is GoldSim?

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

GoldSim User’s Guide Chapter 2: GoldSim in a Nutshell  35


What is GoldSim?

model, and the ability to assign versions to a model which is constantly


being modified and improved, further facilitate the construction and
management of large models.
GoldSim 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.
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.
These features allow GoldSim to be applied at multiple levels, depending on the
nature of the application:
 as a powerful, flexible simulator;
 as a system integrator; and
 as a visual information management system.
A Powerful, Flexible At the most fundamental level, GoldSim can be used as a powerful, flexible
Simulator simulator. That is, you may only wish to apply it to a very specific problem in a
technical discipline such as finance, industrial engineering, environmental
science, or chemistry.
GoldSim's graphical interface and powerful computational features facilitate a
wide range of simulations, ranging from a simple homework assignment put
together in less than an hour, to a complex professional application built over a
period of several months.
A System Integration Most real-world problems are multi-disciplinary in nature. That is, the system
Tool being simulated actually consists of many subsystems, and the sub-models for
each subsystem must typically be built by people from a wide variety of
disciplines. For example, a model intended to help manage an ecological system
(e.g., a river) in order to support management decisions to protect an endangered
species (e.g., salmon) likely would include sub-models that are developed by
biologists, urban planners, hydrologists, civil engineers, economists, forestry
professionals, and social and political scientists (among others).
Unfortunately, in many such cases, the model builders get caught up in the
details of their sub-models, and lose sight of the "big picture". The end result is
typically separate sub-models which are unnecessarily complex. More
importantly, the complex interactions and interdependencies between
subsystems are often ignored or poorly represented. Such an approach not only
wastes resources, but is often too complex to be explained (and hence used)
effectively, and too poorly integrated to represent the entire system in a cohesive
and realistic way.

36  Chapter 2: GoldSim in a Nutshell GoldSim User’s Guide


Basic GoldSim Concepts

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.

Basic GoldSim Concepts


The GoldSim The GoldSim simulation environment is highly-graphical and completely object-
Simulation oriented. That is, you create, document, and present models by creating and
manipulating graphical objects representing the components of your system,
Environment data and relationships between the data:

GoldSim User’s Guide Chapter 2: GoldSim in a Nutshell  37


Basic GoldSim Concepts

In a sense, GoldSim is like a "visual spreadsheet" allowing you to visually create


and manipulate data and equations. As can be seen in the simple example shown
above, based on how the various objects in your model are related, GoldSim
automatically indicates their influences and interdependencies by visually
connecting them in an appropriate manner. GoldSim also sets up and solves the
equations represented by the objects and their interdependencies.
Elements: The Basic The various objects with which a GoldSim model is constructed are referred to
Building Blocks in as elements. Each element represents a building block of the model, and has a
particular symbol or graphical image (which you can subsequently customize)
GoldSim by which it is represented on the screen. Typically, you give each element a
unique name by which it is referenced (e.g., X, Revenue, Rainfall,
Discount_Rate). Most elements accepts inputs, and in turn produce outputs.
GoldSim provides a wide variety of elements. Some of these elements provide a
mechanism for the user to enter input data into the model. Other elements
represent functions which operate on one or more inputs and produce one or
more outputs. A special class of elements (stocks and delays) is critical for
generating the dynamics in your models.
Input Elements Input elements define the basic inputs to your model. There are three basic
types of input elements: Data, Time Series and Stochastics. 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). Time Series elements
allow you to specify a time series of a value (e.g., monthly rainfall rates,
quarterly cashflows). Stochastic elements allow you to specify that a particular
value is uncertain by defining it as a probability distribution.

38  Chapter 2: GoldSim in a Nutshell GoldSim User’s Guide


Basic GoldSim Concepts

Function elements instantaneously compute outputs based on defined inputs.


Function Elements That is, they require one or more inputs, carry out a specified calculation on
those inputs, and produce one or more outputs.
The simplest and most general function element is an Expression element.
Expressions produce a single output by calculating user-specified formulas, such
as 2 + 3, A*B, or sqrt(55). Similar to a cell in a spreadsheet, when defining an
expression, you can use a wide variety of mathematical operators and functions.
You can even use conditional operators (e.g., >,<, =) and if, then logic to define
Expressions.
Other function elements have predefined functionality. For example, a Lookup
Table element defines a response surface specifying how an output varies as a
function of up to three inputs (i.e., the response surface can be 1, 2, or 3-
dimensional). The response surface is defined by a discrete number of points,
and GoldSim interpolates into the table to compute the output for any
combination of input values.
Stock and Delay Stock and Delay Elements are specialized function elements with the unique
Elements property that their outputs are influenced by what has happened in the past. That
is, unlike standard function elements, whose outputs at any given time are
computed based solely on the current (instantaneous) values of their inputs, the
outputs of these elements are determined by the previous values of their inputs.
Such elements accumulate past events and provide systems with inertia and
memory, and hence are responsible for internally generating the dynamic
behavior of a system.
An example of a Stock element is the Reservoir. A Reservoir accumulates
materials, and is useful for representing things like bank accounts and quantities
of materials or items (e.g., water, soil, salmon). In its simplest form, a Reservoir
requires as inputs an Initial Value, a Rate of Addition and a Rate of Withdrawal,
and outputs a Current Value using the following equation:


Current Value  Initial Value  (Rate of Addition - Rate of Withdrawal)dt

An example of a Delay element is the Material Delay. Delays allow you to


represent processes in which the output lags the input. The Material Delay
accepts as input a flow of material (e.g., gal/day, $/yr, widgets/hr), moves it
through a “conveyor” or “pipeline” (while optionally dispersing it), and then
outputs the flow. Such an element can be used to represent such processes as the
movement of water through soils or the movement of parts in a conveyor.
Linking Elements GoldSim models are built by connecting the outputs of one (or more) elements
to the inputs of other elements. These connections are referred to as links:

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

GoldSim User’s Guide Chapter 2: GoldSim in a Nutshell  39


Basic GoldSim Concepts

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":

Next, we define the properties of the Data element "Inflow" by double-clicking


on the element, which causes its editing dialog to be displayed:

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.

40  Chapter 2: GoldSim in a Nutshell GoldSim User’s Guide


Basic GoldSim Concepts

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).

GoldSim User’s Guide Chapter 2: GoldSim in a Nutshell  41


Basic GoldSim Concepts

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

42  Chapter 2: GoldSim in a Nutshell GoldSim User’s Guide


Basic GoldSim Concepts

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

where t is the length of the timestep.


Hence, the value of V at time τ is computed based on the value of the Leakage
(which is in turn a function of V) at the previous timestep. This particular
numerical integration method (referred to as Euler integration) is discussed
further in Appendix G.
In order to dynamically simulate a system in GoldSim, you must specify the
duration of the simulation (e.g., 1 year) and the number of timesteps to use (e.g.,
365). This information determines 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.
For this simple example, we choose to run the model for a duration of 50 days
using 50 timesteps (resulting in a timestep length of 1 day). The result, in the
form of the volume of water in the pond as a function of time, is shown below:

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

GoldSim User’s Guide Chapter 2: GoldSim in a Nutshell  43


Basic GoldSim Concepts

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”.

The model would then look like this:

44  Chapter 2: GoldSim in a Nutshell GoldSim User’s Guide


Basic GoldSim Concepts

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):

GoldSim User’s Guide Chapter 2: GoldSim in a Nutshell  45


Basic GoldSim Concepts

This plot (presented as a cumulative distribution function) indicates that the


median final volume is about 65,000 m3, and there is a probability that the final
volume could be as high as about 95,000 m3.
Probabilistic simulations are particularly useful because you can often use them
to obtain a better understanding of the factors controlling the system.
For example, by plotting the final volume in the pond as a function of the
leakage fraction, we can better understand and quantify the sensitivity of the
system to this key factor:

A primer on probabilistic simulation is presented in Appendix A.


Representing Many models have a direct chain of causality: input data affect some elements,
Feedback Loops which affect other elements, and so on, until eventually the elements which
calculate the desired results of the model are reached:

46  Chapter 2: GoldSim in a Nutshell GoldSim User’s Guide


Basic GoldSim Concepts

GoldSim automatically analyzes your entire model to identify "who affects


who", and ensures that the "upstream" elements are calculated prior to the
"downstream" elements. At each time-step the elements are updated in this
causality-based sequence.
Many systems, however, contain elements whose output can, directly or
indirectly, affect one of their own inputs. This creates a looping or circular
system (i.e., a "feedback loop").

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 User’s Guide Chapter 2: GoldSim in a Nutshell  47


Basic GoldSim Concepts

Complex models can have hundreds (or thousands) of elements. In order to


Building Hierarchical manage, organize and view such a model it is useful (in fact, essential) to group
Top-Down Models the elements into subsystems. A subsystem is simply a collection of elements.
Subsystems 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. 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 that has been divided into a number of
distinct subsystems:

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 "+".

The ability to create hierarchical, top-down models, coupled with GoldSim's


powerful documentation and presentation abilities, allows you to effectively
describe and explain your model at different (and appropriate) levels of detail to
different audiences.

Read more: Understanding Containers (page 100).

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

48  Chapter 2: GoldSim in a Nutshell GoldSim User’s Guide


Advanced Features

 An Extrema, which dynamically computes the highest or lowest values


achieved by a specified parameter throughout a simulation (e.g., peak
concentration in a river, minimum water level in a reservoir, minimum
balance in a checking account).
Read more: Chapter 4: Using the GoldSim Elements (page 127).

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.

GoldSim User’s Guide Chapter 2: GoldSim in a Nutshell  49


Advanced Features

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

50  Chapter 2: GoldSim in a Nutshell GoldSim User’s Guide


Advanced Features

is now complete”), achieving a specified milestone, or making a discrete change


to some quantity in your model (“add $1000 to the account”).
To provide an indication of how you can use this feature, let's add a simple event
to the example involving the pond presented above in “A Simple Example”.
Suppose that water in the pond is used for fire suppression, and if a brush or
forest fire occurs nearby, firefighters withdraw 10,000 m3 from the pond. Let’s
assume that it is summer, and there is a small fire nearby about once every 25
days.
We could simulate this using GoldSim's Timed Event and Discrete Change
elements:

The Event “Fire” triggers the Discrete Change “Withdrawal” which modifies the Reservoir
element representing the volume in the pond.

The result of such a simulation would look like this:

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).

GoldSim User’s Guide Chapter 2: GoldSim in a Nutshell  51


Advanced Features

GoldSim provides the ability to make subsystems of your model (i.e.,


Activating and Containers) conditional. Conditionality allows you to make a Container and all
Deactivating Portions of its contents inactive unless specific events occur and/or conditions are met.
of a Model Elements in an inactive container are “dormant”. That is, they are not updated or
recalculated each timestep, and while they are inactive their output values never
change. When other specific events occur and/or conditions are met, the
Container (and its contents) can become active (and hence carry out their normal
calculations). A conditional Container can activate and deactivate multiple times
during a simulation.
Conditionality is a very powerful feature, and can be used to 1) temporarily
“turn off” certain parts of your model (e.g., during a testing phase); or 2)
simulate processes or features which themselves only exist or are active during
certain parts of your simulation. This feature is particularly useful when using
GoldSim to simulate projects.
Read more: Using Conditional Containers (page 841).

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.

52  Chapter 2: GoldSim in a Nutshell GoldSim User’s Guide


Advanced Features

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.

In addition to importing data from a spreadsheet, you can use a spreadsheet as a


custom element (with specific functionality). That is, you can dynamically send
data from GoldSim to a spreadsheet, force the spreadsheet to recalculate, and
then retrieve (updated) data from the spreadsheet back into GoldSim during a
simulation (e.g., every timestep).
GoldSim also provides powerful capabilities to easily import lookup tables and
time series data from spreadsheets to GoldSim. You can also readily export
GoldSim results to a spreadsheet.

GoldSim User’s Guide Chapter 2: GoldSim in a Nutshell  53


Advanced Features

Read more: Spreadsheet Elements (page 852); Linking a Lookup Table to a


Spreadsheet (page 274); Importing Data into a Time Series from a Spreadsheet
(page 194); Exporting from a Time History Result Element to a Spreadsheet
(page 678).
Importing and In simulations which require a great deal of input, it may be desirable (or even
Exporting from a mandated) that the simulation model can access the various data sources directly
to facilitate and ensure the quality of the data transfer.
Database
As discussed above, one way to accomplish this in GoldSim is to import data
from spreadsheets. GoldSim also provides a more powerful method. In
particular, GoldSim input elements can be linked directly to an ODBC-
compliant database. After defining the linkage, you can then instruct GoldSim to
download the data at any time. When it does this, GoldSim internally records
the time and date at which the download occurred, and this information is stored
with the model results. This mechanism provides very strong and defensible
quality control over your model input data.
You can also export model results into a database.
Read more: Linking Elements to a Database (page 972); Exporting Results
(page 678).
Building Custom In some situations, you may wish to define a complex function which cannot be
Elements Using readily implemented using the expression editing features supplied by GoldSim.
For example, calculation of an output may require very complex logic which
Scripts would be cumbersome to represent using a Selector element, or it may require a
numerical solution technique (e.g., iteration); or perhaps you need to construct
an array using complex logic.
To deal with such situations, you can specify a sequence of statements directly
within the GoldSim interface using a Script element; in effect, building a custom
element.
Scripts are created by inserting and editing statements or statement blocks,
which may be variable definition statements, variable assignment statements,
statements controlling the sequence of execution in the script (e.g., loops and if
statements), or statements used for writing messages to the Run Log. The Script
element sequentially evaluates the specified sequence of locally defined
statements to determine its output(s).

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.

Read more: Script Elements (page 803).

Dynamically Linking If GoldSim's built-in elements, the Script element or a dynamically-linked


to External Models spreadsheet are not sufficient for representing a particular aspect of your model,
you can dynamically link an external computer program directly to GoldSim.
You must specify the parameters (outputs of existing GoldSim elements) which
you wish to send to the external program, and the parameters that the external
program will return to, and make available within, GoldSim.

54  Chapter 2: GoldSim in a Nutshell GoldSim User’s Guide


Advanced Features

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:

GoldSim User’s Guide Chapter 2: GoldSim in a Nutshell  55


Advanced Features

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.

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.
Read more: Running an Optimization (page 486).

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

56  Chapter 2: GoldSim in a Nutshell GoldSim User’s Guide


Features for Documenting and Presenting Your Model

X-Y function charts) to assist you in graphically identifying the variables in your
model to which the result is most sensitive.

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:

Read more: Running Sensitivity Analyses (page 497); Viewing a Sensitivity


Analysis Table (page 639).

Features for Documenting and


Presenting Your Model
A model which cannot be easily explained is a model that will not be used or
believed. As a result, GoldSim was specifically designed to allow you to
effectively document, explain and present your model.
You can add graphics, explanatory text, notes and hyperlinks to your model, and
organize it in a hierarchical manner such that it can be presented at an
appropriate level of detail to multiple target audiences.
Creating Report GoldSim has powerful charting and display functions that allow you to plot and
Quality Result view your data in a variety of ways. You can plot time histories of your data,
view probability distributions, create scatter plots and bar charts, and view tables
Graphics of results. You can also combine multiple results on a single plot, and view
multiple plots simultaneously. Using Result elements, result charts and tables
can be easily collected into one place for easy access within a model.

GoldSim User’s Guide Chapter 2: GoldSim in a Nutshell  57


Features for Documenting and Presenting Your Model

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.

58  Chapter 2: GoldSim in a Nutshell GoldSim User’s Guide


Features for Documenting and Presenting Your Model

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.

Note: To further facilitate documentation and presentation of your model, the


default graphic images for a GoldSim element can be replaced by a custom
image of your choice. For example, if a Reservoir element was being used to
represent a bank account, you could replace the default Reservoir image (a dam)
with a monetary image.

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.

GoldSim User’s Guide Chapter 2: GoldSim in a Nutshell  59


Features for Documenting and Presenting Your Model

Notes can include hyperlinks to other documents.

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:

60  Chapter 2: GoldSim in a Nutshell GoldSim User’s Guide


Specialized GoldSim Modules

Read more: Chapter 9: Documenting and Presenting Your Model (page 693).

Specialized GoldSim Modules


Although the standard elements incorporated within GoldSim can be used to
build powerful and complex models, it was realized from the outset of the
development of GoldSim that in some situations specialized elements and
features may be required in order to efficiently model some kinds of systems. As
a result, GoldSim was designed to readily facilitate the incorporation of
additional modules (program extensions) to enable the program to address
specialized problems.
Because extension modules can be highly specialized, they are described in
separate documents.
The existing GoldSim extensions are briefly described below.
Financial Module The Financial Module allows you to probabilistically simulate financial systems
that include components such as accounts and funds, investments, options,
projects or undertakings with specified cash flows, and insurance policies:

GoldSim User’s Guide Chapter 2: GoldSim in a Nutshell  61


Specialized GoldSim Modules

By combining the specialized financial elements in the Financial Module with


GoldSim's underlying probabilistic, dynamic simulation framework, you can
quickly simulate and analyze complex financial systems, as well as complex
engineering and business systems that have a financial component.
The Financial Module is described in detail in the GoldSim Financial
Module User's Guide.
Contaminant The Contaminant Transport Module consists of specialized elements for
Transport Module representing contaminant species, transport media, transport pathways,
contaminant sources, and receptors, and the coupled sets of differential
equations underlying these systems:

The Contaminant Transport Module adds these ten specialized elements to GoldSim.

By linking these environmental elements together (and integrating them with


GoldSim's basic elements), you can build simple and complex contaminant
transport simulations:

62  Chapter 2: GoldSim in a Nutshell GoldSim User’s Guide


Specialized GoldSim Modules

Two versions of the Contaminant Transport Module are available (called CT


and RT). RT is a premium version of the Contaminant Transport Module, and
contains some specialized features not included in the CT version.
The Contaminant Transport Module is described in detail in the GoldSim
Contaminant Transport Module User's Guide.
Reliability Module The GoldSim Reliability Module allows you to probabilistically simulate the
reliability of complex engineered systems over time. GoldSim provides the
ability to model the interdependence of components through requirements and
fault trees, as well as the capability to define multiple independent failure modes
for each component.
The fundamental outputs produced by the Reliability Module consist of
predicted reliability metrics (e.g., reliability, maintainability and availability) for
the overall system, and for individual components within that system. In
addition, GoldSim catalogs failure scenarios, which allows for key sources of
unreliability to be identified.

The Reliability Module can be used to:


 evaluate the reliability performance of systems and ascertain their
compliance with customer or regulatory requirements;

GoldSim User’s Guide Chapter 2: GoldSim in a Nutshell  63


Specialized GoldSim Modules

 investigate the impact of the operational environment on system


reliability; and
 simulate the effects of reliability on system throughput, or on other
user-defined metrics.
The Reliability Module is described in detail in the GoldSim Reliability
Module User's Guide.
Dashboard Authoring GoldSim provides a set of tools that allow a GoldSim modeler to design and
Module construct "dashboard" interfaces for models. The interfaces can be designed to
look like "dashboards" or "control panels", with buttons, gauges, sliders and
display panels, and the author can imbed instructions, tool-tips and graphics to
provide instructions on the use of the model. Such an interface allows a model to
be easily used by someone without requiring them to be familiar with either the
GoldSim modeling environment or the details of the specific model:

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).

64  Chapter 2: GoldSim in a Nutshell GoldSim User’s Guide


The GoldSim Player

The Distributed Processing Module is described in detail in the GoldSim


Distributed Processing Module Users Guide.

The GoldSim Player


The GoldSim Player is a special version of GoldSim that allows you to "play" or
“read” an existing GoldSim model without having to license the GoldSim
software:

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).

GoldSim User’s Guide Chapter 2: GoldSim in a Nutshell  65


Chapter 3: Building a Model in
GoldSim
Th e great su c cess ful m en of th e worl d
h av e u s e d t h e i r i m a g i n at i o n s, t h ey t h i n k
a h e a d a n d c re at e t h e i r m e n t a l p i c t u r e, a n d
t h e n go t o w o rk m at e r i a l i z i n g t h at p i c t u re
i n a l l i t s d e t a i l s, f i l l i n g i n h e re, a d d i n g a
l i t t l e t h e re, a l t e r i n g t h i s a b i t a n d t h a t a
b i t , bu t s t e a d i l y bu i l d i n g, s t e a d i l y
b u i l d i n g.

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.

In this Chapter The following topics are discussed in this chapter:


 The GoldSim User Interface
 Creating Elements and Links
 Navigating and Viewing a Model
 Running a Model and Viewing Results

GoldSim User’s Guide Chapter 3: Building a Model in GoldSim  67


The GoldSim User Interface

The GoldSim User Interface


The GoldSim Start Whenever you start GoldSim, the following dialog is displayed:
Dialog

Pressing Tutorial on the Start dialog launches the interactive tutorial.


The choices on the Start dialog are as follows:
New Model: This opens a new (blank) model.
Open Model: This displays a dialog for opening an existing model.
Recent Models: The four most recently opened models are displayed here.
Holding your cursor over a filename displays information (path, date
modified, and size) regarding the file. Clicking on the filename opens the
model.
By default, if you select New Model from the Start Dialog, the Simulation
Settings dialog will open to allow you define the basic settings for the model (if
you do not want to do so, simply press Cancel).
Read more: Simulation Settings (page 412).
You can also close the Start dialog and open a new model (without displaying
the Simulation Settings dialog) by pressing the Esc key.
User Interface When you open a new model in GoldSim, you see the following screen:
Components

68  Chapter 3: Building a Model in GoldSim GoldSim User’s Guide


The GoldSim User Interface

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.

GoldSim User’s Guide Chapter 3: Building a Model in GoldSim  69


The GoldSim User Interface

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):

The appearance of the user interface components can be configured and


customized to match the way that you like to use GoldSim. For example, you
can customize toolbars, change the appearance of the graphics pane, and modify
the appearance of objects in the interface.
Read more: Chapter 6: Customizing the Interface (page 383).

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.

70  Chapter 3: Building a Model in GoldSim GoldSim User’s Guide


The GoldSim User Interface

Note how the selected element (Data2) is highlighted in both the graphics pane and
the browser.

A double-click on an element displays a dialog for editing its properties.


(Pressing Esc, or the OK or Cancel button in the dialog, subsequently closes
the dialog.)
A right-click anywhere in the interface displays a context-sensitive menu
(also referred to as a context menu). The contents of a context menu depend
on the position of the cursor when you click.

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!

Moving an object: You can move an object in the graphics pane by


dragging it from one location to another. Note, however, that you cannot
move an element from or to the browser.
Displaying a tool-tip: You can display a tool-tip for a model object in the
graphics pane and browser by holding the cursor over the object (without
clicking).

GoldSim User’s Guide Chapter 3: Building a Model in GoldSim  71


The GoldSim User Interface

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).

72  Chapter 3: Building a Model in GoldSim GoldSim User’s Guide


The GoldSim User Interface

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

Note: Obviously, GoldSim should not terminate unexpectedly. If it ever does,


please contact the GoldSim Technology Group at support@goldsim.com.

The feature works by saving a copy of your model at a user-specified frequency


(by default, every 10 minutes) to a separate location. In particular, the recovery
file is saved temporarily in the local AppData directory of your computer (i.e., it
does not overwrite the original file). If GoldSim encounters a problem and
closes abruptly (i.e., the software crashes), Windows will automatically restart
GoldSim, and you will be given an opportunity to view the auto-saved recovery
file. If you had made a number of changes and had not saved your original file
for some time prior to the crash, the recovery file may represent a “newer”
version of the file than the original file. When GoldSim restarts, you will be
given the opportunity to replace your original file with the recovery file. If you
choose not to use the recovery file, it will be automatically deleted (until it is
regenerated with the next auto-save).
To understand how the auto-save feature works, it is useful to walk through the
dialogs generated by GoldSim during this process.
If GoldSim unexpectantly terminates, Windows will automatically restart the
software, and you will be presented with the following screen:

GoldSim User’s Guide Chapter 3: Building a Model in GoldSim  73


The GoldSim User Interface

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.

74  Chapter 3: Building a Model in GoldSim GoldSim User’s Guide


The GoldSim User Interface

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):

By default, the Save crash recovery information every X minutes is checked


on and set to 10 minutes.
Several points should be noted regarding the auto-save feature:
 Auto-save files are deleted whenever a file is saved or closed.
 This feature is only available on systems using Windows Vista and
higher.
 This feature is not available for the GoldSim Player.
 The file will only be auto-saved if the file is in Edit mode and the
application is in an idle state (e.g., a dialog is not open). Otherwise the
save will be queued.
Password-Protecting In some instances, you may wish to protect a model file with a password, such
a Model File that in order for someone to open it, they must provide a password.
You can do this by selecting File|Protect… from the main menu. When you
do this, the following dialog will appear:

The password must have a length of 4 to 20 characters.


After you do this, anyone who tries to subsequently open the model will be
presented with the following dialog:

GoldSim User’s Guide Chapter 3: Building a Model in GoldSim  75


The GoldSim User Interface

Once a file is opened, you can remove the password by selecting


File|Protect… from the main menu. If the file is protected, it will prompt you
for the password again. Once you enter it, the Protect Model File dialog will be
displayed (this time with the password):

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

76  Chapter 3: Building a Model in GoldSim GoldSim User’s Guide


Creating Elements and Links

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).

Creating Elements and Links


Elements are the basic building blocks of a GoldSim model. GoldSim models
are built by connecting the outputs of one (or more) elements to the inputs of
other elements. These connections are referred to as links. A complex model can
have thousands of elements and links.
GoldSim Element GoldSim provides a wide variety of built-in elements for entering data and
Types manipulating variables. Each element represents a building block of the model,
and has a default symbol by which it is represented in the graphics pane and an
icon by which it is represented in browsers and menus.
The basic GoldSim elements can be divided into the following categories:
 Input elements
 Stock elements
 Function elements
 Event elements
 Delay elements
 Result elements
An additional type of element, the Container, is used to hierarchically organize
other elements.
The basic element types, their functions, and their default graphic symbols and
icons are summarized in the following sections.

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.

GoldSim User’s Guide Chapter 3: Building a Model in GoldSim  77


Creating Elements and Links

Input elements are used to create inputs (exogenous data) that subsequently
Overview of Input define the properties of other elements.
Elements

Element Default Browser Function


Symbol Icon
Data Defines scalar, vector or matrix data.

Stochastic Defines uncertain data as probability


distributions.

Time Series Accepts time histories of data and


converts them to an appropriate form
f(t) for use in the model.

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.

Element Default Browser Function


Symbol Icon
Reservoir Integrates (and conserves) flows of
materials, allowing for upper and lower
bounds to be specified.

Integrator Integrates values. Also can compute


moving average of a specified input.

Read more: Using Stock Elements (page 228).

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.

Element Default Browser Function


Symbol Icon
Expression Defines mathematical or logical
expressions.

Script Allows you to create your own custom


element using a simple procedural
language.

78  Chapter 3: Building a Model in GoldSim GoldSim User’s Guide


Creating Elements and Links

Element Default Browser Function


Symbol Icon
Previous Value Returns the value of its input from the
previous model update.

T

Extrema Computes the highest (peak) or lowest


(valley) value achieved by its input.

Selector Defines expressions with nested


if…then logic.

Splitter Splits an incoming signal into multiple


outputs based on specified fractions.

Allocator Allocates an incoming signal into


multiple outputs given specified
demands and priorities.

Sum Facilities the addition of multiple


values.

Lookup Table Defines a one, two or three dimensional


lookup table (response surface).

Convolution Solves a convolution integral.

History Generator Generates stochastic time histories


based on specified statistics.

And Combines multiple conditions using


logical AND.

Or Combines multiple conditions using


logical OR.

Not Logical NOT.

GoldSim User’s Guide Chapter 3: Building a Model in GoldSim  79


Creating Elements and Links

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:

Element Default Browser Function


Symbol Icon
External (DLL) Dynamically links to a user-specified
external function (compiled as a DLL).

Spreadsheet Dynamically links to an Excel


spreadsheet.

File
Dynamically copies a file to a
specified directory (for use by
External elements).

Read more: Using External Application Elements (page 852).

Overview of Event Another category of elements allows you to superimpose the occurrence and
Elements effects of discrete events onto continuously varying systems:

Element Default Browser Function


Symbol Icon
Timed Event Generates discrete event signals based
on a specified rate of occurrence,
regularly or according to a specified
distribution (i.e., randomly).
Triggered Event Generates discrete event signals based
on one or more specified conditions.

Decision Generates one of up to three defined


discrete event signals based on specified
conditions.

Random Choice Generates a user defined discrete event


signal based on specified probabilities.

Milestone Records the time at which a particular


event or specified condition(s) occurs.

Status Generates a condition (True/False) in


response to particular events or
specified conditions.

Discrete Change Generates a discrete change signal (a


value) that can subsequently discretely
modify the values of other elements (e.g.,
Integrators and Reservoirs).

80  Chapter 3: Building a Model in GoldSim GoldSim User’s Guide


Creating Elements and Links

Element Default Browser Function


Symbol Icon
Interrupt Interrupts a simulation when a specified
! event or condition occurs and displays a
user-defined message and/or writes a
message to the run log.
Read more: Chapter 5: Simulating Discrete Events (page 319).

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.

Element Default Browser Function


Symbol Icon
Material Delay Delays (and optionally disperses)
material flows.

Information Delay Delays (and optionally disperses) a


signal.

Event Delay Delays a discrete event signal. Can also


be used to simulate queues.

Discrete Change Delays a discrete change signal. Can


Delay also be used to simulate queues.

Read more: Using Delay Elements (page 291).

Overview of Result Result elements provide a convenient and powerful mechanism to collect,
Elements analyze and display simulation results.

Element Default Browser Function


Symbol Icon
Time History Displays time history results.
Result

Distribution Displays probability


Result distributions.

Multi-Variate Displays multi-variate results


Result (scatter plots, correlation
tables, raw data).

Array Result Displays vectors and matrices


of results.

GoldSim User’s Guide Chapter 3: Building a Model in GoldSim  81


Creating Elements and Links

Read more: Creating and Using Result Elements (page 526).

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.

3. Click on the element type that you wish to insert.


4. The editing dialog for the element is displayed.
5. Enter the properties for the element and press OK.
6. The element will be inserted in the graphics pane with its upper-left
corner at the location of the cursor when you right-clicked.
Inserting an Element Although the most common way to insert a new element is to use the context
Using a Container or menu in the graphics pane, you can also insert an element by using the context
the Main Menu menu of a Container element or by selecting Model | Insert Element from the
main menu. In both cases, you will be presented with a menu from which you
can select an element to insert.
When using these two methods, you cannot control where on the graphics pane
the element is inserted. It will always be inserted in the upper left-hand corner of
the graphics pane.
If the context menu of a Container is used, the element will be inserted in the
selected Container. If the main menu is used, the element will be inserted in the
current Container.
Read more: Understanding Containers (page 100).

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

82  Chapter 3: Building a Model in GoldSim GoldSim User’s Guide


Creating Elements and Links

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 and output objects have distinct icons 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:

GoldSim User’s Guide Chapter 3: Building a Model in GoldSim  83


Creating Elements and Links

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.

84  Chapter 3: Building a Model in GoldSim GoldSim User’s Guide


Creating Elements and Links

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).

GoldSim User’s Guide Chapter 3: Building a Model in GoldSim  85


Creating Elements and Links

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:

86  Chapter 3: Building a Model in GoldSim GoldSim User’s Guide


Creating Elements and Links

These arrows are referred to as influences.


Read more: Understanding Influences (page 102).

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.

Read more: Displaying Link Suggestions in Input Fields (page 89).


When you first place the focus in (i.e., click into) an input field (or if you stop
typing within an input field), a tool-tip is displayed. If the expression is invalid,
the tool-tip will explain why; if the expression is valid, it will display its current
value. 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. You can also view the
tool-tip for an input field by simply holding the cursor over the field (while the
focus is elsewhere). The tool-tip disappears when you move the cursor away.
The table below summarizes the mathematical and relational operators that are
supported by GoldSim for use within expressions in input fields, along with
their precedence:

GoldSim User’s Guide Chapter 3: Building a Model in GoldSim  87


Creating Elements and Links

Precedence Type Operators


Highest parentheses ()
exponentiation **,^
unary minus -
multiplication, division *, /
addition, subtraction +, -
relational test >, <, >=, <=
Lowest equality test =, ==, <>,!=

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.

In addition to the operators listed above, GoldSim also provides a number of


built-in functions (e.g., sin, cos, log) and constants (e.g., π, e, the gravitational
constant, Avogadro’s number) which can be used to build expressions.
GoldSim also provides three logical operators (And, Or, Not) which only
operate on conditions.
Read more: Understanding Output Attributes (page 93); Creating Conditional
Expressions (page 134); Entering Mathematical Expressions into Element Input
Fields (page 128).
When creating expressions, spaces are ignored. For example, the expressions
“4*5” and “4 * 5” would both be interpreted as 20. You should feel free to
add spaces to your expressions in order to improve their readability. The two
exceptions to this rule are 1) when you are adding unit strings to expressions
(e.g., m/sec, $/day) spaces within the unit string are not allowed; and 2) when
you are using a unary minus with a number (e.g., -3C), spaces between the
minus sign and the number are not allowed.

88  Chapter 3: Building a Model in GoldSim GoldSim User’s Guide


Creating Elements and Links

Read more: Using Units in Element Input Fields (page 96).


GoldSim color-codes expressions to make them easier to read. The colors used
are:

Black: Numbers and functions


Green: Output names (links) and functions
Gray: Operators
Blue: Units
Underlined Invalid
and Red:
Light Gray Not yet evaluated

In addition, if you use nested sets of parentheses in an expression, when you


click inside the expression, GoldSim will highlight the nearest matching pair.
If the expression that you type into an input field is longer than the field in the
dialog, the field will automatically expand when it has the focus such that the
entire expression can be viewed.

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

GoldSim User’s Guide Chapter 3: Building a Model in GoldSim  89


Creating Elements and Links

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 ~):

Read more: Understanding Locally Available Properties (page 750).

90  Chapter 3: Building a Model in GoldSim GoldSim User’s Guide


Creating Elements and Links

 If you wish to link to a secondary output, you can do so by typing a


period after the element name in the input field. The suggestion box
will then list any secondary outputs that exist for that element:

Read more: Referencing Outputs of Other Elements (Creating Links)


(page 86).
 Similarly, if you wish to link to an exposed output of a localized
Container, you can do so by typing a period after the name of the
Container in the input field. The suggestion box will then list any
exposed outputs that exist for that Container.
Read more: Localizing Containers (page 886).
 Pressing Ctrl+Space causes the suggestion box to be displayed. If the
cursor is to the immediate right of a character, then the list that is
consistent with the preceding character string is shown. If the cursor is
not to the immediate right of a character (e.g., if there is a space or
operator before the cursor), then a list of ALL available outputs is
provided.

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.

GoldSim User’s Guide Chapter 3: Building a Model in GoldSim  91


Creating Elements and Links

This shows all of the elements in the current 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).

This tree is organized by containment (and in alphabetical order) in the same


manner as the 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 (or
simply double-click on the output). The output name will be inserted into the
expression.

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).

92  Chapter 3: Building a Model in GoldSim GoldSim User’s Guide


Creating Elements and Links

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.

Read more: Element Inputs and Outputs (page 82).


For some types of elements (e.g., an Expression), you can specify all three
output attributes. For others, some output attributes are fixed and cannot be
changed by the user. For example, the output of a Reservoir is always a value

GoldSim User’s Guide Chapter 3: Building a Model in GoldSim  93


Creating Elements and Links

(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

94  Chapter 3: Building a Model in GoldSim GoldSim User’s Guide


Creating Elements and Links

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

GoldSim User’s Guide Chapter 3: Building a Model in GoldSim  95


Creating Elements and Links

the slash is assumed to be in the denominator. For example, "1/m/m"


and "1/m-m" would both be interpreted as inverse square meters.
 Units are raised to a power by either following the unit with a number
or with "^". For example, square meters could be entered as "m2" or
"m^2". Inverse seconds could be entered as "sec-1", "sec^-1" or
"1/sec". When units are raised to a power, the power must be an
integer.
 Metric (SI) units are case-sensitive. For example, Mm and mm
represent Megameters and millimeters, respectively.
 If you are referring to a temperature, use C (Celsius), F (Fahrenheit), K
(Kelvin), or R (Rankine). If you are referring to a difference in
temperature, use Cdeg (Celsius degrees), Fdeg (Fahrenheit degrees), K
or R.
 If you are using US units pound or ounce for force or mass, you must
distinguish between force and mass by appending an ‘f’ for force (e.g.,
lbf) and an ‘m’ for mass (e.g., lbm).
 When entering a unit abbreviation in an input field, GoldSim allows
you to add an "s" to the end of the abbreviation, and in most cases will
recognize it, even if the abbreviation has not been defined. For
example, GoldSim will interpret yrs as yr. The rule GoldSim uses is as
follows: if GoldSim does not recognize a unit that ends with an "s", it
removes the "s" and again tries to recognize it. Note that not all such
cases will necessarily work as intended. For example, ms would be
interpreted as milliseconds (not meters).
A simple example file illustrating the use of dimension and units (Units.gsm)
can be found in the General Examples folder in your GoldSim directory
Using Units in Element When you enter units within an input field for an element, you can do so by
Input Fields simply inserting them after the values in your expression:

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.

96  Chapter 3: Building a Model in GoldSim GoldSim User’s Guide


Creating Elements and Links

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:

A m + 4 ft OK if and only if A is dimensionless


(A*B) ft OK if and only if (A*B) 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.

Note: Specifying and editing currency units is described in detail in Chapter 3 of


the GoldSim Financial Module User's Guide.

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.

GoldSim User’s Guide Chapter 3: Building a Model in GoldSim  97


Creating Elements and Links

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 |m3| + 5 OK if and only if A has dimensions of volume


(A*B) |ft| OK if and only if (A*B) has dimensions of length
Ctime |yr| OK if and only if Ctime has dimensions of time

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:

98  Chapter 3: Building a Model in GoldSim GoldSim User’s Guide


Creating Elements and Links

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:

It is important to understand that a model with an invalid input cannot be run. If


you attempt to run such a model, GoldSim will display an error message.

GoldSim User’s Guide Chapter 3: Building a Model in GoldSim  99


Creating Elements and Links

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 :

Click the plus sign (+) to "enter" a Container.

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).

100  Chapter 3: Building a Model in GoldSim GoldSim User’s Guide


Creating Elements and Links

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:

You can also navigate Containers using the following hot-keys:

GoldSim User’s Guide Chapter 3: Building a Model in GoldSim  101


Creating Elements and Links

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.

This arrow is referred to as an influence. If an element in one Container is linked


to an element in another Container, an influence will be drawn between the
Containers. If multiple elements in one Container are linked to one (or more)
elements in another Container, then the influence represents multiple links.
Placing your cursor over the link displays a tool-tip indicating the links the
influence represents:

102  Chapter 3: Building a Model in GoldSim GoldSim User’s Guide


Creating Elements and Links

Influences have properties, which you can view by double-clicking on the


influence arrow (or right-clicking on the influence and selecting Show
Links…):

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).

Read more: Element Inputs and Outputs (page 82).


You can jump to the element associated with a particular input or output by
clicking on the path in the Link Details section.
The details also describe the Output Type (e.g., value, condition), Units, and
Order (e.g., Scalar, Vector or Matrix). The Link Type is also indicated. Most
links in a model will be “normal” links. Other types of links (e.g., coupled links
and Previous-value links) can only be created by using one of the extension
modules to GoldSim (e.g., the Contaminant Transport Module).

GoldSim User’s Guide Chapter 3: Building a Model in GoldSim  103


Creating Elements and Links

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:

Right-clicking an outlined port accesses a context menu with the option to


“Show Links from Element” (for output ports) or “Show Links to Element” (for
input ports). Selecting this option will open a dialog showing all the links from
or to the element, respectively:

104  Chapter 3: Building a Model in GoldSim GoldSim User’s Guide


Creating Elements and Links

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).

Read more: Element Inputs and Outputs (page 82).


You can jump to the element associated with a particular input or output by
clicking on the path in the Link Details section.
The details also describe the Output Type (e.g., value, condition), Units, and
Order (e.g., Scalar, Vector or Matrix). The Link Type is also indicated. Most
links in a model will be “normal” links. Other types of links (e.g., coupled links
and Previous-value links) can only be created by using one of the extension
modules to GoldSim (e.g., the Contaminant Transport Module).
Referencing Time in In a dynamic simulation, it is often necessary for you to explicitly reference time
GoldSim in a mathematical expression that you enter as an input to an element (i.e., you
might want an input to take on different values at different times).
Within GoldSim, you can reference the elapsed time since the simulation began
as Etime. For example, the input to the following Expression element takes on a
value of 10 for times less than 1 year, and 20 afterward:

GoldSim User’s Guide Chapter 3: Building a Model in GoldSim  105


Creating Elements and Links

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:

If(A then B else C) or If(A,B,C)

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):

Read more: Referencing Dates in Expressions (page 135).


Both Etime and DateTime are actually special model outputs referred to as Run
Properties.
Read more: Understanding and Referencing Run Properties (page 445).

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.

Read more: Localizing Containers (page 886).

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

106  Chapter 3: Building a Model in GoldSim GoldSim User’s Guide


Creating Elements and Links

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.

Select a Container and press OK to move the objects(s).


Alternatively, you can drag the selected element(s) within the graphics pane to a
Container present in the graphics pane. When you do this, the Container will be
outlined in blue. When you then release the left mouse button, the element(s)
will be moved into the Container. (Note that you cannot drag elements out of the
graphics pane onto the browser or onto a different model.)

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.

GoldSim User’s Guide Chapter 3: Building a Model in GoldSim  107


Navigating and Viewing a Model

Read more: Exposing an Output on a Localized Container (page 888).

Warning: Whenever you paste or move an element, GoldSim automatically


updates all input expressions in the model to ensure that the pasted/moved
element is properly linked to other elements in the model. For large models
(many hundreds of elements) this process could take a noticeable amount of
time (10 seconds or more). You can disable this automatic updating by clearing
the "Update expressions automatically after all moves and pastes" checkbox in
the Options dialog (accessed via Model | Options…). If the option is cleared,
you can still manually force an update by pressing F9 or selecting Model |
Update Expressions. Note that even if this option is checked, GoldSim will
not automatically update the model if it contains more than 500 elements. In this
case, you must manually force an update after a paste or move (using F9).
Regardless of the number of elements or whether this option is checked,
however, GoldSim always carries out an update prior to running a model.

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).

Navigating and Viewing a Model


GoldSim's graphical user interface provides a number of powerful tools to make
it easy for you to navigate and view both simple and complex models. While
the graphics pane represents the "canvas" on which you graphically build a
GoldSim model, the browser represents the "road map" allowing you to quickly
navigate through your model. Tool-tips within both the graphics pane and the
browser allow you to quickly obtain an overview of a model without constantly
opening property dialogs. Powerful search capabilities allow you to find any
element in your model. And perhaps most importantly, the ability to easily view
model dependencies (who affects who?) allows you to better understand and
interpret the behavior of complex models.

108  Chapter 3: Building a Model in GoldSim GoldSim User’s Guide


Navigating and Viewing a Model

Each of these features is discussed in detail below.


Navigating Within the The graphics pane shows the contents of a single Container. You can move
Graphics Pane around within the graphics pane using the vertical and horizontal scroll bars and
scroll arrows at the right and at the bottom of the pane.
Read more: Understanding Containers (page 100).
You can also move around the graphics pane using the pan cursor. In order to
use the pan cursor, the Zoom toolbar must be active:

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.

If you check Apply to all containers, the specified magnification will


be applied to all Containers in the model. Note that the current scale is
always listed in the status bar.
 Clicking the Zoom button activates the Zoom cursor (a magnifying
glass). The Zoom cursor can be used in three different ways. Left-

GoldSim User’s Guide Chapter 3: Building a Model in GoldSim  109


Navigating and Viewing a Model

clicking this cursor in the graphics pane zooms in (in increments of


25%). Right-clicking zooms out (in increments of 25%). Dragging a
box around a portion of the graphics pane with the Zoom cursor zooms
in such that the selected objects fill the graphics pane. Clicking on the
Selection button in the toolbar deactivates the Zoom cursor.
 Clicking the Zoom to Fit button adjusts the scale so that all objects in
the container are visible.
 Clicking the Zoom to Selection button adjusts the scale so that all
selected objects are visible.
If your mouse has a wheel, you can also use this for zooming. Rolling the wheel
toward you while holding down the Ctrl key zooms out. Rolling the wheel away
from you while holding down the Ctrl key zooms in.

Note: By default, GoldSim remembers the position and scale of a Container


when you leave it, so that when you return to it, it is displayed at the same scale
and in the same position. You can disable this feature via a checkbox in the
Graphic tab of the Options dialog.

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.

110  Chapter 3: Building a Model in GoldSim GoldSim User’s Guide


Navigating and Viewing a Model

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.

GoldSim User’s Guide Chapter 3: Building a Model in GoldSim  111


Navigating and Viewing a Model

Expanding a folder shows all of the elements of that type.

All the elements of a particular type are listed together (alphabetically) in a


folder labeled with the element type. This provides a very convenient way to
find elements of a specific type.
The browser and the graphics pane are synchronized. This means that if you
click on an object in the browser, the Container in which the object resides will
be opened and its contents will be shown in the graphics pane. Similarly, if you
click on an element in the graphics pane, the Container in which the element
resides will be expanded and that element will be selected in the browser. This
synchronization facilitates navigation through the subsystems in your model.
At the top of the browser is a search field to assist you in finding elements.
Read more: Finding Elements (page 116).
By default, GoldSim will only display the element names in the browser. If you
select Show element subitems from the context menu (or press Ctrl+I) for the
browser, the element inputs and outputs will also be displayed:

112  Chapter 3: Building a Model in GoldSim GoldSim User’s Guide


Navigating and Viewing a Model

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:

Element tool-tips display three types of information:


 Basic information
 State
 Properties
All elements display basic information regarding the element consisting of the
element’s name, an icon (identifying the element type), and the Description (if
one is specified).

GoldSim User’s Guide Chapter 3: Building a Model in GoldSim  113


Navigating and Viewing a Model

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).

Note: By default, the current or initial value calculation shown in a tool-tip


assumes an elapsed time of 0. You can modify the value used in this calculation
by editing "Time to use for expected value updates" in the Options dialog
(accessed via Model | Options…).

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).

114  Chapter 3: Building a Model in GoldSim GoldSim User’s Guide


Navigating and Viewing a Model

Tool tips for inputs display the following information:


 Input name (display units)
 Current or Last Value
 The equation or value defining the input.
If the input requires a vector or matrix, the Array Labels are identified:
Tool-tips for outputs show the output name, and the current or last value.
Read more: Using Vectors and Matrices (page 726).

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:

Information regarding GoldSim’s built-in constants is also displayed in


expressions via tool-tips:

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).

GoldSim User’s Guide Chapter 3: Building a Model in GoldSim  115


Navigating and Viewing a Model

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).

116  Chapter 3: Building a Model in GoldSim GoldSim User’s Guide


Navigating and Viewing a Model

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:

GoldSim User’s Guide Chapter 3: Building a Model in GoldSim  117


Navigating and Viewing a Model

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:

118  Chapter 3: Building a Model in GoldSim GoldSim User’s Guide


Running a Model and Viewing Results

Read more: Evaluating Feedback Loops (page 314).


If an element is a function of a Run Property, the Function Of view will indicate
that it is a function of the Container that "owns" the Run Property (typically the
Model Container):

Read more: Understanding and Referencing Run Properties (page 445).


Similarly, if an element is a function of a locally available property of a
Container (e.g., the LoopCount within a looping Container), the Function Of
view will indicate that it is a function of the Container that "owns" the locally
available property:

Read more: Understanding Locally Available Properties (page 750); Using


Looping Containers (page 904).

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).

Running a Model and Viewing


Results
This section provides a very brief overview of running a model and viewing
results. These topics are discussed in detail in Chapters 7 and 8. The objective of
this section is to provide you with enough basic information to run and view the
results of simple models.

GoldSim User’s Guide Chapter 3: Building a Model in GoldSim  119


Running a Model and Viewing Results

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:

Simulation Settings button

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.

120  Chapter 3: Building a Model in GoldSim GoldSim User’s Guide


Running a Model and Viewing Results

Note: Appendix A provides an introduction to probabilistic simulation


techniques, and introduces the basic terminology required to understand the
Monte Carlo options presented in this dialog.

Read more: Simulation Settings (page 412).

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

GoldSim User’s Guide Chapter 3: Building a Model in GoldSim  121


Running a Model and Viewing Results

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.

122  Chapter 3: Building a Model in GoldSim GoldSim User’s Guide


Running a Model and Viewing 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.

Read more: Chapter 8: Displaying Results in GoldSim (page 511).

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:

GoldSim User’s Guide Chapter 3: Building a Model in GoldSim  123


Running a Model and Viewing Results

11. Press OK to close the dialog.


12. Insert an Expression element at a point below the Data element using
the context menu of the graphics pane (right-click in the graphics pane,
select Insert Basic Element, go to the Functions category, and click on
Expression).
13. The element will be named Expression1 by default. Change the name
to Inflow_Rate.
14. Specify the Display Units as cubic meters per day (m3/day).
15. We will make the input for the expression a function of time, utilizing
GoldSim's if..then function. In particular, we will specify that for the
first 10 days, the rate is equal to 5 m3/day, and it is equal to 2 m3/day
afterward. To do this, enter the following into the input field for the
Expression:

16. Press OK to close the dialog.


17. Insert a Reservoir element to the right of the Data and Expression
elements using the context menu of the graphics pane (right-click in the

124  Chapter 3: Building a Model in GoldSim GoldSim User’s Guide


Running a Model and Viewing Results

graphics pane, select Insert Basic Element, go to the Stocks category,


and click on Reservoir).
18. The element will be named Reservoir1 by default. Change the name to
Volume.
19. Specify the Display Units as cubic meters (m3).
20. For the Initial Value input, type Initial_Volume. For the Rate of
Addition field, type Inflow_Rate. For the Rate of Withdrawal field,
type 0 m3/day. The dialog will then 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.

GoldSim User’s Guide Chapter 3: Building a Model in GoldSim  125


Running a Model and Viewing Results

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:

Press the Run button (or press F5 again).


25. You will be presented with a dialog stating that the simulation has
completed. Press OK to close the dialog.
26. You can now view results. To do so, right-click on Volume (the
Reservoir element) and select Time History Result… . The following
result will be shown:

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.

126  Chapter 3: Building a Model in GoldSim GoldSim User’s Guide


Chapter 4: Using the GoldSim
Elements
“ T h e t i m e h a s c o m e, ” t h e Wa l ru s s a i d ,
“ To t a l k o f m a n y t h i n g s :
O f s h o e s, a n d s h i p s, a n d s e a l i n g w a x
O f c abb age s a n d ki n g s
And why the sea is boiling hot
A n d w h e t h e r p i g s h av e w i n g s. ”

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

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  127


Entering Mathematical Expressions into Element Input Fields

Entering Mathematical Expressions


into Element Input Fields
GoldSim provides a number of features that enable you to enter mathematical
expressions into input fields. This section provides information on the use of
these features. This includes a discussion of GoldSim's built-in functions and
constants, and guidance with regard to creating conditional (logical) expressions
and using dates in expressions.
Built-in Functions GoldSim provides a wide variety of built-in functions that can be used in
expressions. These functions can be typed in directly, or inserted using the
context menu of an input field:

The functions are divided into five categories:


1. Trigonometry functions, such as sine and cosine;
2. Math functions, such as square root and logarithm;
3. Special functions, such as the Bessel function and "if,then,else";
4. Financial functions, such as present value and future value; and
5. Array operators, which are specialized functions that operate only on
vectors and matrices.
An example of the use of a built-in function is shown below:

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

128  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Entering Mathematical Expressions into Element Input Fields

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.

Math Functions GoldSim provides the following standard mathematical functions:

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.

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  129


Entering Mathematical Expressions into Element Input Fields

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.

Special Functions GoldSim provides the following specialized mathematical functions:

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.

130  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Entering Mathematical Expressions into Element Input Fields

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.

Read more: Manipulating Arrays in Expressions Using Mathematical


Operators (page 742); Specialized Functions That Operate on Distributions
(page 183).

Note: If the argument to the changed() function 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 (since the fact that it remains
unchanged is simply an artifact of timestepping).

Read more: Understanding and Referencing Run Properties (page 445);


Determining if an Event has Occurred (page 380).

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  131


Entering Mathematical Expressions into Element Input Fields

Note: The three importance sampling functions (ImpProb, ImpWeight and


ImpOld) are used to carry out customized importance sampling of Stochastic
elements.

Read more: Customized Importance Sampling Using User-Defined Realization


Weights (page 953).
Financial Functions GoldSim provides a number of built-in financial functions.
The functions below are simple compounding functions that account for the time
value of money and convert between present value, future value and annuities.
These are dimensionless functions that act as multiplying factors on a currency
amount (e.g., $) or currency rate (e.g., $/yr).
In these functions the first argument (int. rate) is the fractional interest per
period (expressed as either a fraction or a percentage), and the second argument
(#periods) is the number of periods:

Function Description Definition


ftop(int. rate, #periods) Factor that when multiplied (1  i ) -n
by a future amount returns
the present value of that
future amount.
ptof(int. rate, #periods) Factor that when multiplied (1  i ) n
by a present amount returns
the future value of that
present amount.
atop(int. rate, #periods) Factor that when multiplied (1  i ) n - 1
by an annuity amount
returns the present value of i (1  i ) n
that annuity.
atof(int. rate, #periods) Factor that when multiplied (1  i ) n - 1
by an annuity amount
returns the future value of i
that annuity.
ptoa(int. rate, #periods) Factor that when multiplied i (1  i ) n
by a present amount returns
the annuity of that present (1  i ) n - 1
amount.
int. rate (i): Must be greater than zero. Can be a scalar or an array
#periods (n): Must be a positive scalar.

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.

132  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Entering Mathematical Expressions into Element Input Fields

GoldSim provides a number of constants that can be used in equations. The


Built-in Constants built-in constants are:

Abbreviation Definition Units Value


amu Atomic mass unit kg 1.6605402e-027
c Speed of light m/s 299792458
e Base of natural 2.71828182845905
logarithms

ec Elementary charge s-amp 1.60217733e-019


(electron)
Eps0 Permittivity of s4-amp2/kg-m3 8.85418781762039
vacuum e-12
ev Electron-volt kg-m2/s2 1.60217733e-019
G Gravitational m3/kg-s2 6.67259e-011
constant
gee Acceleration of m/s2 9.80665
gravity
h Planck’s constant kg-m2/s 6.6260755e-34
HgDens Density of mercury kg/m3 13595.08
k Boltzman constant kg-m2/s2-K 1.380658e-23
me Electron mass kg 9.1093897e-31
mn Neutron mass kg 1.6749286e-27
mp Proton mass kg 1.6726231e-27
Mu0 Permeability of kg-m/s2-amp2 1.25663706143592
vacuum e-06
N Avogadro’s 1/mol 6.0221367e+23
constant
pi Pi 3.14159265358979
R Gas constant kg-m2/s2-K-mol 8.31451
sigma Stefan-Boltzmann kg/s3-K4 5.67051e-008
constant
Stemp Standard K 273.15
temperature
Vmol Molar gas volume m3 0.02241409727609
at STP 18
WatDens Density of water at kg/m3 999.95
STP
WatWt Unit weight of kg/m2/s2 9806.16
water at STP

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).

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  133


Entering Mathematical Expressions into Element Input Fields

GoldSim provides a number of operators and functions which allow you to


Creating Conditional create conditional expressions. As used here, a conditional expression is an
Expressions expression (or part of an expression) which evaluates to (produces) a condition
(rather than a value). A condition has two states: True or False.
The following expressions are all conditional expressions:

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:

Precedence Type Operators


Level
Highest parentheses ()
logical NOT !, NOT
relational >, <, >=, <=
equality, inequality = (or ==), <>
logical AND &&, AND
Lowest logical OR ||, OR

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).

Warning: The equality operator (= or ==) should be used with caution. In


particular, you should generally not use this operator when comparing calculated
values in your model (which could be affected by small round-off errors). Note
that both ETime and Time are calculated values (since they are always
represented internally in seconds) and hence they are also potentially susceptible
to small roundoff errors if used in conjunction with the equality operator.

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…)

134  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Entering Mathematical Expressions into Element Input Fields

GoldSim allows you to reference dates in expressions by enclosing the date in


Referencing Dates in quotation marks within an expression. The format for referencing a date is
Expressions determined by the Regional and Language time/date settings specified by the
operating system. For example, for a computer in the US, the following formats
would all be valid ways for referencing October 1, 2009:
“10/1/2009”
“10-1-2009”
“October 1, 2009”
“1 October 2009”
However, if you entered the same expressions on an Australian or European
computer, although the last two examples would be interpreted as the 1st day in
October, the first two examples (“10/1/2009” and “10-1-2009”) would be
interpreted as the 10th day in January. Similarly, on a German computer, “1
October 2009” would not even be recognized (GoldSim would display an error),
but “1 Oktober 2009” would be correctly recognized and interpreted.
A date is internally converted and stored as a Julian time (in particular, the time
since December 30, 1899 00:00:00). Hence, a date has dimensions of time.
Because dates are stored in this way, an expression could appear differently
depending on the regional settings on the computer on which GoldSim is
running. For example, if you entered a date (say October 1, 2009) into GoldSim
on a computer with US settings like this:

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:

In both cases, GoldSim would interpret the date as October 1, 2010.


You would typically reference a date in conjunction with DateTime, as shown
below:

DateTime is a Run Property, and represents the simulated calendar time.


Read more: Understanding and Referencing Run Properties (page 445).

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.

Read more: Exchanging Date Information with a Spreadsheet (page 872).

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  135


Using Containers

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.

Read more: Setting the Basic Time Options (page 413).

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:

By default, a Container has three tabs: General, Graphics, and Information.

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.

136  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Containers

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:

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. Each of the available features is
discussed in more detail in the sections below.
The default appearance of the Container changes depending on its features:

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  137


Using Containers

Image Features
Simple (global) Container

Localized Container

SubSystem Container

Conditional Container

Container with Internal Clock

Looping Container

Conditional Container with Internal Clock

Conditional 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):

138  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Containers

This symbol is only used for simple Containers. Localized SubSystems use a
different symbol but retain the red "+".

 The tool-tip for the Container shows that it is Localized.


Read more: Localizing Containers (page 886).

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).

SubSystems are specialized Containers that are completely “self-contained” so


that from the outside, they behave like a single element. What is meant by “self-
contained” requires a somewhat detailed understanding of the order in which
GoldSim carries out its calculations, and such an understanding is not required
for the majority of users.
Read more: How GoldSim Carries Out Its Calculations (page 309).
For most users, it is sufficient to note that being “self-contained” enables a
Subsystem to take on some useful features and properties (e.g., conditionality,
having an internal clock, and being able to loop). However, it also imposes
some limitations with regard to how the SubSystem can be incorporated into
certain types of systems (i.e., feedback loops).
Read more: Limitations on the Use of SubSystems in Feedback Loops (page
316).
For most users, there will be no need to treat a Container as a SubSystem.
Experienced users who would like to utilize advanced features such as
Conditionality, Internal Clocks and Looping, or to more directly control the
order in which GoldSim carries out its calculations, should make sure they
clearly understand the limitations that SubSystems impose.
Conditional Containers Conditionality is an advanced feature of GoldSim which allows parts of your
model to dynamically activate and deactivate. By default, Containers are not
conditional.
Containers can be made conditional by selecting the Conditionality feature in
the Container dialog.

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  139


Using Containers

Warning: When you make a Container conditional, the Treat as SubSystem


feature is also automatically selected (and cannot be deselected unless you first
turn off Conditionality). That is, a Conditional Container, by definition, is
treated as a SubSystem. Because a Conditional Container is treated as a
SubSystem, this puts certain limitations on how Conditional Containers can be
used.

Read more: Treating a Container as a SubSystem (page 139).


When you make a Container conditional, a Conditionality tab is added to the
Container dialog:

In addition, when a Container is made conditional, a number of inputs and


outputs are added to the Container element itself. As a result, the Save Results
checkboxes for the Container are no longer grayed out in the General tab (since
a conditional Container has its own specific outputs).
Read more: Using Conditional Containers (page 841).

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.

140  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Containers

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).

Warning: When you assign an internal clock to a Container, the Treat as


SubSystem feature is also automatically selected (and cannot be deselected
unless you first turn off Internal Clock). That is, a Container with an internal
clock, by definition, is treated as a SubSystem. Because a Container with an
internal clock is treated as a SubSystem, this puts certain limitations on how
these Containers can be used.

Read more: Treating a Container as a SubSystem (page 139).


When you assign an internal clock to a Container, an Internal Clock tab is
added to the Container dialog, and the field in this tab is used to define the
manner in which GoldSim timesteps within the Container:

Read more: Specifying Containers with Internal Clocks (page 434).

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).

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  141


Using Containers

Warning: When you specify a Container as a looping Container, the Treat as


SubSystem feature is also automatically selected (and cannot be deselected
unless you first turn off Looping Capability). That is, a looping Container, by
definition, is treated as a Subsystem. Because a looping Container is treated as a
SubSystem, this puts certain limitations on how these Containers can be used.

Read more: Treating a Container as a SubSystem (page 139).


When you specify a Container as a looping Container, a Looping tab is added to
the Container dialog, and the fields in this tab are used to control how the
Container carries out its loops:

Read more: Using Looping Containers (page 904).

Providing Resources Providing Resources within a Container is an advanced feature of GoldSim. A


for Containers Resource is something that has a limited supply (e.g., spare parts, fuel, skilled
personnel, money) and is required in order for specified elements within the
Container to carry out certain actions.
Read more: Using Resources (page 781).
Resources can be provided to a Container by selecting the Provide Resources
feature in the Container dialog.

Warning: When you provide Resources for a Container, the Treat as


SubSystem feature is also automatically selected (and cannot be deselected
unless you first turn off Provide Resources). That is, a Container with
Resources, by definition, is treated as a SubSystem. Because a Container with
Resources is treated as a SubSystem, this puts certain limitations on how the
Containers behave.

Read more: Treating a Container as a SubSystem (page 139).

142  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Containers

When you provide Resources to a Container, a Resources tab is added to the


Container dialog:

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:

Read more: Sealing and Locking Containers (page 147).

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

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  143


Using Containers

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:

144  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Containers

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:

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  145


Using Containers

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.

Read more: Specifying Results to be Saved (page 453).


To globally turn off saving of all of the results of a particular type in a
Container, simply press the button. A dialog will be displayed asking you to
confirm that you wish to turn off the results.
Of course, once you turn off results in a Container, you can subsequently enter
the Container and set some of the elements’ results flags back on.

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).

146  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Containers

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.,

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  147


Using Containers

changing the inputs to an element, adding an element) GoldSim will provide a


message warning you (twice!) that the seal will be “broken” if you continue.
Once a seal is broken, this new status (along with who broke the seal and when
it was broken) is also displayed in the Details section of the dialog for the
Container.
Once a seal is broken, you can choose to seal the Container again (by pressing
the Protection checkbox again).
You can remove (as opposed to break) the seal from a Container by pressing the
Protection checkbox.

Warning: If a seal is removed (rather than broken), no record of this is written


to the Details section of the dialog for the Container.

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).

148  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Containers

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.

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  149


Overview of GoldSim Element Types

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).

Overview of GoldSim Element Types


GoldSim provides a wide variety of elements from which you can build your
models. These elements can be divided into a number of categories. When you
choose to insert an element into GoldSim, the Insert menu sorts the elements
into these categories.

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.

150  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Overview of GoldSim Element Types

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.

Reservoirs are intended to accumulate flows of materials (e.g., cash, water,


widgets). Integrators simply integrate signals (e.g., the height of a thrown ball
could be computed by integrating the velocity of the ball).
Read more: Using Stock Elements (page 228).

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.

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  151


Overview of GoldSim Element Types

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.

Read more: Chapter 5: Simulating Discrete Events (page 319).

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.

152  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Overview of GoldSim Element Types

Read more: Creating and Using Result Elements (page 526).

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

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  153


Using Basic Input Elements

general rule, if it is tangible (i.e., can be quantified in terms of mass, volume, or


number of items), it is a material.

Note: Energy, although it is not tangible, should also be treated as a material,


since it is always conserved. An example is a model that simulates heat transport
through a system. In this case, the transport of heat is analogous to the transport
of mass, and hence heat (energy) should be treated as a material within
GoldSim. The dimensions of energy are ML2 T-2.

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.

Using Basic Input Elements


This section describes the two basic elements that are used to enter data into a
GoldSim model: Data elements and Stochastic elements. A third type of input
element, the Time Series, is described separately.
Read more: Using Time Series Elements (page 187).

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.

The properties dialog for a Data element looks like this:

154  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Basic Input Elements

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:

Read more: Using Vectors and Matrices (page 726).

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:

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  155


Using Basic Input Elements

Read more: Creating, Running and Comparing Scenarios (page 463).


You can save the results for a Data element by clicking Final Values and/or
Time Histories.
As shown below, the browser view of a Data 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).

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:

156  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Basic Input Elements

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:

The advanced options include correlating one Stochastic to another, directly


specifying a percentile level to use (rather than random sampling), modifying
the sampling algorithm (importance sampling), linking the element to a
database, and specifying how the Stochastic is to be evaluated when running
deterministic simulations.
Read more: Linking Elements to a Database (page 972).

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.

Stochastic elements have four outputs:


 the realized (sampled) value, which is the primary output (and hence
has the same name as the element);
 the probability density of the realized value (Probability_Density);
 the cumulative probability of the realized value
(Cumulative_Probability); and
 a complex output representing all the distribution information
(Distribution).

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  157


Using Basic Input Elements

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

158  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Basic Input Elements

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.

Note: Calculation of the Conditional Tail Expectation is discussed in detail in


Appendix B.

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).

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  159


Using Basic Input Elements

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.

Display the preview as a PDF (probability density function):

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).

Display the preview as a CDF (cumulative distribution function):

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.

160  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Basic Input Elements

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

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  161


Using Basic Input Elements

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

162  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Basic Input Elements

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).

Note: The Beta distribution must always be dimensionless, as it represents a


frequency (otherwise GoldSim will display an error). However, GoldSim also
provides a generalized form of the Beta (described below) that allows you to
specify a distribution’s dimensions (e.g., time). Such a distribution is defined in
a different way (using a mean, standard deviation, minimum and maximum).
The Generalized Beta distribution therefore provides a flexible way to specify a
probability distribution over a particular range.

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.

Read more: Cumulative Distribution (page 165).

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  163


Using Basic Input Elements

The BetaPERT distribution is a specialized version of the Beta distribution and


BetaPERT Distribution is often used for project risk analysis. Mathematically, it is a Beta distribution.
While a Generalized Beta Distribution requires four parameters, a BetaPERT
requires only three. A particular formula (inherent to the BetaPERT) determines
the mean of the distribution (and hence its shape).
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.
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.

164  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Basic Input Elements

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:

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  165


Using Basic Input Elements

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.

166  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Basic Input Elements

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:

In this example, the probability of the value being equal to 3 is 50%.

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

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  167


Using Basic Input Elements

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).

Exponential The Exponential distribution is a continuous distribution, typically used to


Distribution model the time to complete a task or reach a milestone.
It is defined by a single parameter: the Mean of the distribution (which must be
positive).

Externally-Defined The Externally-defined distribution is a specialized distribution that is defined


Distribution externally by a Distribution output:

168  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Basic Input Elements

The External Definition field only accepts a Distribution output. Distribution


outputs are complex outputs that represent all the statistical information
necessary to define a probability distribution. They can only be produced by
another Stochastic element, a Spreadsheet element, or a SubModel.
The primary purpose of this distribution type is to connect a Stochastic to a
distribution that has been imported via a Spreadsheet element.
Read more: Importing Stochastic Element Definitions from a Spreadsheet
(page 860).
However, there are also several other specialized uses, such as exchanging
distribution information with a SubModel, and to support dynamically revising
distributions using simulated Bayesian updating.
Read more: Creating the Input Interface to a SubModel (page 921); Creating
the Output Interface to a SubModel (page 925); Dynamically Revising
Distributions Using Simulated Bayesian Updating (page 956).
Extreme Probability The Extreme Probability distribution is a continuous distribution used to
Distribution represent the uncertainty in the highest or lowest probability level if any given
distribution is sampled N times. As such, the Extreme Probability distribution
represents the probability distribution of a probability level, and therefore
always ranges between 0 and 1.
It is defined by specifying the Number of samples, and whether you are
interested in the probability level for the Maximum value or the Minimum
value:

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  169


Using Basic Input Elements

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.

Note: The Extreme Probability distribution must always be dimensionless, as it


represents a probability level (otherwise GoldSim will display an error).

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:

170  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Basic Input Elements

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:

If desired, a Gamma distribution can be Truncated, in which case you must


specify a Minimum and Maximum value. Note that in this case, the Mean and
Standard Deviation inputs refer to the statistics prior to truncation.

Note: If the Mean and Standard Deviation are identical, the Gamma distribution
collapses to an exponential distribution.

Log-Normal The Log-Normal distribution is used to describe quantities in which the


Distribution logarithm of the value is normally distributed. The Log-Normal is typically used

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  171


Using Basic Input Elements

to represent physical quantities which must be non-negative and are positively


skewed. This distribution is often used to represent quantities with large (order-
of-magnitude) uncertainties.
Log-Normal distributions can be entered in two ways: 1) by entering the
Geometric Mean and the Geometric S.D.; or 2) by entering the True Mean
and the True S.D. If Geometric Value is checked, the former method is used.
When one option is chosen, the other set of parameters are computed internally
by GoldSim and are grayed out.
With regard to a set of data points, the Geometric Mean is equal to the
exponentiated mean of the logs (i.e., 10X, where X is equal to the mean value of
the logarithms of the data points). With regard to a set of data points, the
Geometric S.D. is the exponentiated standard deviation of the logs (i.e., 10Y,
where Y is equal to the standard deviation of the logarithms of the data points).
Note that the Geometric S.D. is always dimensionless, and must be greater than
1.
The True Mean and the True S.D. refer to the true (arithmetic) mean and S.D.
(i.e., in linear space).
A Log-Normal distribution can be Truncated. Note that in this case, the inputs
(i.e., Mean and Standard Deviation) refer to the statistics prior to truncation.

All inputs for a Log-Normal must be positive values.

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.

172  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Basic Input Elements

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 User’s Guide Chapter 4: Using the GoldSim Elements  173


Using Basic Input Elements

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):

174  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Basic Input Elements

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:

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  175


Using Basic Input Elements

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):

176  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Basic Input Elements

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.

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  177


Using Basic Input Elements

The Weibull distribution is often used to represent the distribution of failure


Weibull Distribution times in reliability models (e.g., the distribution of lifetimes for light bulbs). It is
defined by a Minimum, a Slope, and Mean-Minimum. If desired, it can be
Truncated at its upper end by defining a Maximum:

Note: The Slope of the Weibull is always dimensionless. If it is specified as 1,


the distribution collapses to an exponential distribution.

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:

The default is for the Stochastic to be Sampled once. However, if Resampled


is selected, the Resample… button in the dialog becomes available, and this
allows you to force the Stochastic to be resampled (triggered) at other points in
the simulation.
Read more: Triggering a Stochastic (page 370).

178  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Basic Input Elements

Note: You cannot specify triggers to resample a Stochastic if it is correlated to a


second Stochastic (see below). However, if a Stochastic is correlated to a
second Stochastic, and that second Stochastic is resampled, the correlated
Stochastic will also automatically be resampled (even though no resampling
triggers are specifically defined, and the Mode is set to Sampled once).

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:

None. This is the default. The Stochastic is not correlated.


Correlated to: This allows you to correlate one Stochastic to another
Stochastic. You must specify the Element (it must be a Stochastic element),
and the Value (the correlation factor). The Value represents a rank
correlation coefficient. It must be a value between –1 and 1, inclusive (1
being a perfect positive correlation, and –1 being a perfect negative
correlation). It can be entered as a number, a link or an expression.

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  179


Using Basic Input Elements

The algorithm used to implement the correlations is described in Appendix


B.

Note: If a Stochastic is correlated to a second Stochastic, and that second


Stochastic is resampled, the correlated Stochastic will also automatically be
resampled.

Read more: Controlling When a Stochastic Element is Sampled (page


178).
Percentile. This allows you to specify a percentile of the distribution. For
example, specifying 0.95 would return the 95% percentile. Among other
applications, by using this with multiple elements, you could force a
particular correlation scheme. An important point should be noted: when the
Correlation is specified in this way, the Stochastic is automatically
resampled whenever the specified Percentile or any other input parameter
for the distribution is changed.
GoldSim also allows you to autocorrelate a Stochastic element (i.e., correlate a
Stochastic to its previously realized value). This is useful, for example, when
you are sampling a Stochastic multiple times in a realization (e.g., once a
month), and this month's value is correlated to last month's value.
In order to autocorrelate a Stochastic, you must first instruct GoldSim to
resample the Stochastic (since autocorrelation only has meaning if a Stochastic
is resampled).
Read more: Controlling When a Stochastic Element is Sampled (page 178).
After you do so, you will note that in the Correlation section of the Stochastic
dialog, GoldSim provides two options for correlation:

None. This is the default. The Stochastic is not autocorrelated.


Autocorrelated. In this case, the Element is autocorrelated (correlated to its
previous value). You must specify the Value (the correlation factor). The
Value represents a rank correlation coefficient. It must be a value between –
1 and 1, inclusive (1 being a perfect positive correlation, and –1 being a
perfect negative correlation). It can be entered as a number, a link or an
expression.
If you specify autocorrelation, GoldSim will correlate the next update (sample)
of the Stochastic to the previous update of the Stochastic. Hence, if you trigger
the Stochastic to be sampled every day, it will correlate today’s value to
yesterday’s value.
When using autocorrelation, it is important to remember that the correlation
factor (Value) should actually be a function of the resampling period. That is, if
you resample every 1 minute, the Value should obviously be larger (closer to 1)
than if you resample every day. Therefore, when you define a correlation factor
for autocorrelation, you should define it with the resampling period in mind.
If you know the autocorrelation coefficient for one resampling period, you can
compute it for a different sampling period using the following equation:

180  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Basic Input Elements

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:

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  181


Using Basic Input Elements

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”):

182  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Basic Input Elements

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: Importance sampling cannot be applied if the Stochastic is resampled


during a realization.

Read more: Controlling When a Stochastic Element is Sampled (page 178).

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.

Read more: Customized Importance Sampling Using User-Defined Realization


Weights (page 953).
Specialized Functions GoldSim provides several specialized functions that can be used to reference the
That Operate on Distribution output type and return properties of the distribution. The
Distributions Distribution output is a complex output representing all the distribution
information. It can be produced by a Stochastic element, a Spreadsheet element,
or a SubModel.
These functions all require as the first argument a Distribution output. Some
require an additional output:
PDF_Value(Distribution, P): The value of the distribution at the specified
cumulative probability level P. The output has the same dimensions as the
distribution being referenced.
PDF_CumProb(Distribution, V): The cumultive probability of the
distribution at the specified value V. The output is dimensionless.
PDF_Mean(Distribution): The mean of the distribution. The output has
the same dimensions as the distribution being referenced.
PDF_SD(Distribution): The standard deviation of the distribution. The
output has the same dimensions as the distribution being referenced.
PDF_CTE(Distribution, P): The conditional tail expectation of cumulative
probability P (i.e., the expected value of the output given that it lies above a
specified cumulative probability P). This result represents the mean of the

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  183


Using Basic Input Elements

greatest 100(1 - P)% of outcomes. The output has the same dimensions as
the distribution being referenced.

Note: Calculation of the Conditional Tail Expectation is discussed in detail in


Appendix B.

PDF_Density(Distribution, V): The probability density or discrete


probability of the distribution at the specified value V. If the distribution is
continuous, the result is the probability density of the specified value. The
dimensions are the inverse of the distribution itself. If the distribution is
discrete, ther result is the discrete probability of the specified value, in
which case it is dimensionless.

Note: For Boolean distributions, the value argument V must be a condition.


Note, however, that if a condition-type result is passed out through a SubModel
interface, it must be either 1 or 0.

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.

Since these functions simply return the key properties of a probability


distribution, in most cases, there would be no value in using these functions
directly on Stochastic elements. However, there are two primary applications for
these functions:
 When the definition of a Stochastic distribution is changing
dynamically during a simulation (either by making the defining
parameters functions of time, or via simulated Bayesian updating),
these functions can be used to query the current shape and
characteristics of the distribution.
Read more: Dynamically Revising Distributions Using Simulated Bayesian
Updating (page 956).
 When exporting a distribution result from a Monte Carlo SubModel,
these functions can be used to query the current shape and
characteristics of the distribution in the parent model.
Read more: Creating the Output Interface to a SubModel (page 925).

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:

184  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Basic Input Elements

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).

Note: If the distribution type is Cumulative, Discrete or Sampled Results, you


cannot enter vectors into the grids defining the distribution. That is, the grids
only accept numbers. As a result, all items of the vector would be identical. If
you want to create a vector of Stochastics that consists of Cumulative, Discrete
or Sampled Results distributions, you can do so by creating a separate Stochastic
for each item, and then using a Data element (defined as a vector) to reference
each separate item.

A Stochastic vector cannot be autocorrelated. It can, however, be correlated to


another Stochastic. If the other Stochastic is a vector, the correlation is term-by-

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  185


Using Basic Input Elements

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:

Note that by definition, a correlation matrix is symmetric around its diagonal


(since the cross diagonal terms define the same correlation coefficient).
If you specify that a Stochastic is a vector, then the drop-list in the Correlation
section of the dialog provides an option called “Matrix”. If this option is
selected, a button is provided (Define…) to define the correlation matrix:

This button provides access to a dialog for specifying the correlation matrix:

By default, all off-diagonal correlation coefficients are zero. The matrix is


symmetrical, so you need only define one of the cross-diagonal terms. The
value represents a rank correlation coefficient, and must vary between -1 and 1.
It must be a number (i.e., you cannot specify a link).

Note: When you define a correlation matrix, it is important to ensure that it is


internally consistent. For example, if you specified that A was positively
correlated to B, and B was positively correlated to C, but that A was negatively
correlated to C, the correlation matrix would be inconsistent (since in this case,
A should also be positively correlated to C). When this occurs, GoldSim will
produce a fatal error message.

186  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Time Series Elements

GoldSim provides several different algorithms for correlating the members of


the vector. These are selected from the Correlation Algorithm drop-list at the
top of the dialog. The various correlations algorithms are discussed in detail in
Appendix B.
Browser View of a The browser view of a Stochastic element is shown below:
Stochastic Element

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).

All Stochastic elements have four outputs.


Note that the Distribution output has a different icon than the other outputs. This
is because the Distribution output 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.
The number of inputs is a function of the distribution type. If the Stochastic is
correlated, it has a Correlated To input, as well as a Factor input (the
correlation factor).

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.

Using Time Series Elements


Time Series elements provide a very flexible and powerful way to input external
time histories of data into GoldSim (i.e., a table showing how a variable changes
as a function of time).
You can use a Time Series element to input the predefined histories of things
like interest rates, commodity prices, temperature, rainfall rates, sales rates, cash
f(t) flows, or the condition (reliability, strength) of a machine or a material. A Time
Series element represents an exogenous (external) “driver” that can directly or
indirectly influence the dynamic behavior of the system being modeled.

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.

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  187


Using Time Series Elements

Read more: Generating Stochastic Time Histories (page 768).


To define a Time Series element, you input a set of time series records (i.e., a
table of times and values) and specify what the data represent (e.g.,
instantaneously measured values at specified times). Note that the time values in
the input time series do not have to coincide with the model’s timesteps.
You then specify what the output of the element should be (e.g., the average
value of the variable over each timestep). GoldSim then carries out the
appropriate calculations in order to convert the input data into the specified
output.
For example, if the input data is specified as a series of instantaneous values and
the output is specified as the average value over each model timestep, GoldSim
interpolates between the time series records, and then averages the interpolated
values over each timestep to produce the output time series.
The dialog for a Time Series element looks like this:

Note: A number of advanced options are initially hidden by the More button.

There are five steps involved in defining a Time Series element:


1. Define the type (scalar, vector, or matrix; value or discrete change) and
units for the time series;
2. Specify the source for the input data (e.g., defined directly, imported
from spreadsheet);
3. Specify what the time series input represents (e.g., instantaneous values
at specific times, constant values over specified intervals);
4. Define the time series itself (if specified directly) or the location of the
data source (if imported); and
5. Specify the output types to be computed for the element (e.g.,
instantaneous values at each timestep, average values over a timestep).

188  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Time Series Elements

Each of these steps, as well as some example files and advanced options, are
described below.

Note: In addition to inputting pre-defined histores, one of the advanced options


for a Time Series element is to use it to record (and subsequently play back) a
history computed by another GoldSim element.

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.

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  189


Using Time Series Elements

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.

190  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Time Series Elements

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

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  191


Using Time Series Elements

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:

192  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Time Series Elements

Shortcut Key Action


Ctrl+A Selects all rows
Arrow keys Move active cell up, down, left or right
Ctrl+Left arrow Move active cell to first column
Ctrl+Right arrow Move active cell to last column
Ctrl+Up arrow Move active cell to first row
Ctrl+Down arrow Move active cell to last row
Insert N new rows below active cell
Ctrl+
Delete all rows from active cell (or first selected
Shift+ row) to bottom
Ctrl+Tab Insert new row below active cell

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:

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  193


Using Time Series Elements

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:

194  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Time Series Elements

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.

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  195


Using Time Series Elements

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.

196  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Time Series Elements

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).

Note: The time column must increase monotonically in the spreadsheet. If it


does not, GoldSim will stop the import just prior to the first time data point that
is not monotonically increasing.

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,

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  197


Using Time Series Elements

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:

198  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Time Series Elements

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.

Read more: Referencing Dates in Expressions (page 135).

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  199


Using 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.

Note: Even when running an Elapsed Time simulation, the Start-time is


available for editing 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.

200  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Time Series Elements

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:

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  201


Using Time Series Elements

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:

If Instantaneous value is selected (the default), GoldSim computes the


instantaneous value of the output at each point in time (i.e., at each
timestep).
If Average value over the next timestep is selected, GoldSim averages the
output over the projected timestep length. This option should be selected
when your time series represents flows or fluxes, as by doing so, you ensure
that the flow or flux is properly conserved.

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).

202  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Time Series Elements

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:

If this box is checked, the element computes a secondary output (called


Rate_of_Change). It represents the rate of change of the variable over the next
projected timestep. The display units for this output are the display units for the
Time Series divided by the Time Display Unit defined in the Simulation Settings
dialog.
The Rate_of_Change output is valuable when the data you have collected
represents changes in the cumulative value of a variable (e.g., cumulative sales,
cumulative rainfall) over specified intervals, and you are interested in computing
average rates between the measurement points (e.g., sales rates, rainfall rates).
In these cases, you enter changes in the cumulative value of a variable between
the measurement points (e.g., every week or every month, or at irregular
intervals), and specify that the data represents a "Change over the next time
interval". You then specify that you want to "Enable the Rate of Change
output". The Rate_of_Change output then represents the average rate (e.g.,
rainfall or sales rate) for each interval (e.g., month).

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:

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  203


Using Time Series Elements

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.

Warning: To utilize this function properly, it is important to understand how


dates and elapsed times are represented in GoldSim. In particular, note that dates
are represented internally in GoldSim as times. In particular, a date is stored as
the amount of time since 30 December 1899. As a result, if you specify a first
argument of 90 days, but indicate that this is a date (e.g., by specifying the
second argument as 1), it will be interpreted as the calendar date 30 March 1900.
Similarly, if you specify a first argument of “16 October 2011” and indicate that
this is an elapsed time (e.g., by specifying the second argument as 2), it will be
interpreted as the elapsed time of 40832 days (the number of days since 30
December 1899).

Read more: Referencing Dates in Expressions (page 135).


Note that if the first argument represents a time that precedes the earliest entry in
the Time Series, the function returns the value associated with the first entry.
Similarly, if the first argument represents a time that is later than the last entry in
the Time Series, the function returns the value associated with the last entry.

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).

204  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Time Series Elements

Read more: Array Functions (page 743).

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:

The actual data set looks like this:

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  205


Using Time Series Elements

The Primary Output is computed by linearly interpolating between the specified


points at every update (i.e., timestep).
For example, at Time = 250 days, the Value output would be $274.50 (halfway
between 279 and 270). The Rate_of_Change output is computed by
differentiating the specified values.
Hence, between 200 and 300 days, the Rate is -$9/100 days = -0.09 $/day. The
Primary Output and Rate_of_Change outputs for this particular example are
shown below:

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.

206  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Time Series Elements

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 actual data set looks like this:

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  207


Using Time Series Elements

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:

208  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Time Series Elements

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.

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  209


Using Time Series Elements

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:

The actual data set looks like this:

210  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Time Series Elements

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:

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  211


Using Time Series Elements

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).

Note: If the data is specified to represent a "Change over an interval" (either


next or previous), then the first data point must be at or before the beginning of
the simulation, and 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 first
data point must be less than or equal to zero, and the last data point must be
greater than or equal to the simulation duration. If you have specified time
entries as dates, the first date must be at or before the start time for the
simulation, and 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 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):

The actual data set looks like this:

212  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Time Series Elements

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:

The output of the Integrator therefore looks like this:

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  213


Using Time Series Elements

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:

214  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Time Series Elements

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.

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  215


Using Time Series Elements

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.

 If the Data periodicity is “diurnal”, GoldSim ensures that the random


starting point for each realization is sampled such that all starting points
are a multiple of 1 day apart. In particular,
o If data is entered as elapsed time, random starting points for
successive realizations are always multiples of 1 day apart. That is,
the random starting point is either 0d, 1d, 2d, 3d, etc.).
o If data is entered as dates (Calendar Time), random starting points
for successive realizations respect the hour, minute and second of
the Simulation Start time.

216  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Time Series Elements

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:

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  217


Using Time Series Elements

Specified Data point Comment


“Data year used to
to start in” represent 1
January 2013
1990 1 January 1990

1995 1 January 1995

1989 Fatal error There is no data point for 1 January


1989 (since the data set starts on 1
July 1989).

2012 Fatal error There is no data point for 1 January


2012 (since the data set ends on 31
December 2011).

Several points should be noted regarding the use of this option:


 The Data year to start in must be specified such that the data set
contains data (directly or via interpolation) in the specified year for the
month and day defined by the Simulation Start Date. Otherwise, as
shown in the table above, GoldSim will display a fatal error.
 The value entered for Data year to start in is always rounded to the
nearest integer.
 Data year to start in can be specified as a function. One way this can
be used is to specify a different year for every realization. For
example, if Data year to start in was defined as “1990 + Realization -
1”, data would be used starting from 1990 for the first realization, 1991
for the second realization, and so on.
 When you use this option, you are implicitly stating that the data has
annual periodicity. This has implications for how GoldSim wraps data
(as pointed out in the second bullet below).
When you choose to Enable Time Shifting of Time Series Data, GoldSim
automatically wraps around to the start of the data set if the end of the data set is
reached during a simulation. The manner in which this is done depends on the
periodicity of the data:
 If using a random starting point with no periodicity, when the end of
the data set is reached, the data set is effectively replicated and shifted
foward by a period of time equal to the span of the data set. For
example, if the last data point was at 1000 days, and the simulation
extended beyond 1000 days, the data set would be shifted forward by
1000 days, so that the initial starting value (e.g., elapsed time = 0)
would correspond to 1000 days.
 If using a random starting point with annual periodicity or if aligning
data years with simulation dates, when the end of the data set is
reached, the data set is effectively replicated and shifted foward by N
years, where N is the number of whole years in the data set. For
example, if there were 3.5 years of data in the data set, the last data
point was on December 31, and the simulation extended beyond 3.5
years, the data set would be shifted forward by 3 years, so that the first
occurrence of January 1 in the data set would follow the last point in
the data set.

218  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Time Series Elements

 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:

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  219


Using Time Series Elements

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

220  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Time Series Elements

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.

Note: Currently, spreadsheets cannot be used to automatically 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. As a result, if
you needed to import a large number of separate time series records
into a Time Series element, you would need to manually copy and paste
the series into each element.

Read more: Importing Data into a Time Series from a Spreadsheet


(page 194).
2. To use the probabilistic results of one model as the input for a
completely different model. For example, the first model might
represent one part of the system whose only impact on the rest of the
system (represented by a second model) was the time history output of
a single element in the first model. If there was no feedback from
second model back to the first, the two models could be run separately
in series. Importing the multiple time history realizations of the
connecting element into a Time Series element in the second model
provides the linkage between the two models.
To support this second application, GoldSim provides a mechanism to import
time history realizations into a Time Series as multiple series. In particular, you
can read the output of any other element in a GoldSim model, and "record" the
results, and then "play them back" in a subsequent run of the model.
Read more: Using a Time Series Element to Record and Play Back a History
(page 222).
This feature is described in detail in the section below.

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  221


Using Time Series Elements

The example file (TimeSeries_MultipleSeries.gsm) in the TimeSeries subfolder


of the General Examples folder of your GoldSim directory includes examples of
Time Series elements with multiple series.
Using a Time Series Time Series elements provide an advanced option in which you can read the
Element to Record and output of another element in GoldSim, and "record" the results.
Play Back a History To access this capability, the Data Source should be set to "Recording output
history". 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:

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:

Time Series Trigger Default Recording


Represents recording Logic Used by
GoldSim
Instantaneous value On Records the value at start
and end of simulation, and
whenever triggered.
Instantaneous value Off Records the value at start
and end of simulation, and
at all scheduled timesteps if
value has changed.
Constant value over the Not applicable Records the average value
next (or previous) time (always On) over the intervals at the
interval start and end of simulation,
and when triggered.

222  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Time Series Elements

Time Series Trigger Default Recording


Represents recording Logic Used by
GoldSim
Change over the next Not applicable Records the change in the
time (or previous) (always On) value over the intervals at
interval the start and end of
simulation, and when
triggered.
Discrete change Not applicable Records every discrete
(always Off) change.

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.

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  223


Using Time Series Elements

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.

224  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Time Series Elements

Read more: Understanding Timestepping in GoldSim (page 415).


A recording Time Series element, however, provides a way to actually see when
these "unscheduled" timesteps occur. To use the Time Series in this way, you
would need to do the following:
1. Insert a Time Series element into your model, set the Represents field
to “Instantaneous value”, set the Data Source to "Recording output
history", and specify an output. If you are only interested in the time of
the "unscheduled" timesteps themselves, the output that you specify is
not important (e.g., you could simply choose Etime).
2. Make sure that Record at unscheduled timesteps (inserted by
events) is checked on.
3. After the simulation is over, by pressing the View Data button, you
will be able to view a table of times for all of the scheduled and
unscheduled timesteps.

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.

Read more: Including Unscheduled Updates in Time History Results (page


436).
Transferring a Time History Out of a SubModel
In some situations, you may want to run a SubModel in GoldSim, and then pass
the entire time history of one or more outputs to a location outside of the
SubModel (e.g., to another SubModel).
Read more: Using SubModels to Embed Models Within Models (page 914).
To take advantage of this feature, you must use the Time History Definition
output of the element. This is a complex output that contains the complete
definition for the element and can be passed from the element (through a
SubModel interface) to another Time Series element.
Read more: Browser View of a Time Series Element (page 227); Referencing a
Time Series Definition Output (page 226).
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 "play back" 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.
4. The output of these Time Series elements will directly reflect the time
histories generated by the Time Series elements inside the SubModel.

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  225


Using Time Series Elements

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.

Read more: Including Unscheduled Updates in Time History Results (page


436).
The example file (TimeSeries_OtherDataSource.gsm) in the TimeSeries
subfolder of the General Examples folder of your GoldSim directory includes
examples of recording Time Series elements.
Referencing a Time Time series elements provide an advanced option in which you can read a "Time
Series Definition Output Series Definition" output from another Time Series element or from an external
function (a DLL).
To access this capability, the Data Source should be set to "Linked to external
Time Series Definition". When you select this option, a new tab appears
(Linked) from which you specify the link from the other element:

The Linked to field only accepts Time Series Definition outputs.


Read more: Browser View of a Time Series Element (page 227).
This is a complex output that can only be produced by another Time Series
element, by an external function, or by a 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).

226  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Time Series Elements

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):

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  227


Using Stock Elements

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).

Read more: Using the Browser (page 110).


The Time Series Definition output is always present, and is a complex output
that can be used to transfer time series data between SubModels (or External
elements).
Read more: Referencing a Time Series Definition Output (page 226).
The next output is the Primary Output for the Time Series. If the user has
selected to Enable Rate of Change output, a Rate_of_Change output is also
available.
Because the entries to the table defining the data records must be numbers, they
are not shown in the browser (since they cannot be linked to). Hence, within the
browser, a Time Series element has no inputs.

Using Stock Elements


Stock Elements are perhaps the most important elements in GoldSim. Stock
elements are important because they have the property that they accumulate past
events and provide systems with inertia and memory, and hence are responsible
for internally generating the dynamic behavior of a system. Without such
elements, your models could respond to outside (exogenous) drivers, but could
not generate any dynamics of their own. While there are other elements that
behave in this way that are not Stocks (i.e., Delay elements), most (if not all)
real-world dynamic systems will involve at least one Stock.
Stock elements have the special property that their outputs are influenced by
what has happened in the past. That is, their outputs are determined by the
previous values of their inputs.
GoldSim provides two Stock elements: Integrators and Reservoirs. Both
elements accumulate (integrate) values. Integrators are intended to integrate
information. For example, integrating a time series of the velocity of a
projectile using an Integrator would yield the height of the projectile.
Reservoirs are intended to integrate/accumulate material flows and represent
things such as reservoirs of water, financial account balances, and inventories.
Integrator Elements Integrator elements are elements that integrate rates. You use them to integrate
and track information, such the distance traveled by a car, interest rates,
commodity prices, temperature, rainfall totals, consumer confidence, or the
condition (reliability, strength) of a machine or a material. You can also use an
Integrator element to calculate moving averages of the input signal (the Rate of
Change).

228  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Stock Elements

Their default symbol is an integration sign because, mathematically, they


represent integrals. An Integrator requires an Initial Value and a Rate of
Change, and computes a single output (its Value) as follows:


Value  Initial Value  (Rate of Change) dt

The Rate of Change, of course, can be a function of time.


The properties dialog for an Integrator looks like this:

An example model which illustrates the use of Integrator elements


(Integrator.gsm) can be found in the General Examples folder in your GoldSim
directory.
How an Integrator Numerically, GoldSim approximates the integral represented by an Integrator as
Element Computes its a sum:
Output n
Value(t n )  Initial Value   Rate of Change(t
i 1
i  t i )t i

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:

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  229


Using Stock Elements

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):

(This example model, named Integrator.gsm, can be found in the General


Examples folder in your GoldSim directory.)
The manner in which GoldSim computed these results is summarized in the
following table:

230  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Stock Elements

i ti Velocity Distance Traveled Cumulative


During Next During Previous Distance
timestep (min)
Step Step Traveled at
time = ti
Velocity(ti) Velocity(ti-t) * t
- 0 0 km/hr -
1 1 20 km/hr 0 km/hr * 1 min = 0 km 0
2 2 60 km/hr 20 km/hr * 1 min = 0.333 0.333 km
km
3 3 20 km/hr 60 km/hr * 1 min = 1 km 1.333 km
4 4 60 km/hr 20 km/hr * 1 min = 0.333 1.666 km
km
5 5 - 60 km/hr * 1 min = 1 km 2.666 km

Note that the Value (cumulative distance traveled) at time ti is independent of


the Rate of Change (velocity) at time ti. It is only a function of the Rates
(velocities) at previous timesteps.
This particular numerical integration method is referred to as Euler integration,
and is discussed further in Appendix F. For the present purposes, it is sufficient
to note that Euler integration assumes that the Rate of Change is constant over a
timestep. Hence, if you specify that the Rate of Change to an Integrator varies
linearly from 0 km/hr to 10 km/hr over 10 minutes, and simulate the system with
a 1 minute timestep, GoldSim will approximate the velocity curve internally as a
stair-step function:

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).

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  231


Using Stock Elements

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)”.

Note: If the output of an Integrator is specified as being an array (a vector or a


matrix), the inputs (Initial Value and Rate of Change) must, by definition,
themselves be arrays. Since you often may wish to enter a zero array (a vector
or matrix of zeros) for the Initial Value or the Rate of Change, GoldSim allows
you to leave one or both of these input fields blank, in which case it interprets
the field as a zero array.

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:

232  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Stock Elements

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:

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  233


Using Stock Elements

By default, the checkbox labeled Rate of change applies to the PREVIOUS


time step is cleared. If you check this checkbox, the Integrator element will treat
the Rate of Change as if it represented the rate of change over the previous
timestep.
Using an Integrator to In some cases you may want to represent a moving average in your model. For
Compute Moving example, at any given time, you might want to know what the average value was
Averages over the previous 30 days.
You can use an Integrator to compute a moving average of the Rate of Change
input.
A moving average is a uniformly-weighted average of the Rate of Change over a
specified averaging time (ATime). It is calculated as the change in the value of
the Integrator over the averaging time divided by the averaging time:
t  Etime

 (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.

GoldSim provides an option to compute up to three different moving averages.


To activate it, you must press the More button to expand the dialog:

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).

234  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Stock Elements

Read more: Simulation Settings (page 412).

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).

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  235


Using Stock Elements

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

The Rates of Addition and Withdrawal can, of course, be functions of time.


The properties dialog for a Reservoir element looks like this:

By default, when you create a new Reservoir element, a Lower Bound of 0 is


assumed. You can subsequently remove the Lower Bound, or modify it.

236  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Stock Elements

An example model which illustrates the use of Reservoir elements


(Reservoir.gsm) can be found in the General Examples folder in your GoldSim
directory.
How a Reservoir Numerically, GoldSim approximates the integral represented by a Reservoir as a
Element Computes its sum:
Primary Output n
Value(t n )  Initial Value   Rate of Change(t
i 1
i  t i )t i

where

Rate of Change(t i  t i )  Rate of Addition(t i  t i )  Rate of Withdrawal(t i  t i )

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.

Read more: Specifying Containers with Internal Clocks (page 434).

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).

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  237


Using Stock Elements

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)”.

Note: If the output of a Reservoir is specified as being an array (a vector or a


matrix), the Initial Value, Addition Rate and Withdrawal Rate must, by
definition, themselves be arrays. Since you often may wish to enter a zero array
(a vector or matrix of zeros) for one or more of these inputs, GoldSim allows
you to leave any of these input fields blank, in which case it interprets the field
as a zero array.

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:

238  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Stock Elements

By using the Withdrawal_Rate output, however, this model can become more
transparent:

As can be seen, by linking the Withdrawal_Rate output from Reservoir1 to the


Addition Rate input of Reservoir2, it becomes visually much clearer that
Reservoir1 flows into Reservoir2.
When a Lower Bound is specified, the Withdrawal_Rate output is not
necessarily identical to the Withdrawal Rate input, and hence becomes even
more useful.
Defining Upper and One of the most powerful features of a Reservoir is that you can specify a Lower
Lower Bounds for a and/or Upper Bound. If the Lower Bound and Upper Bound boxes are cleared
Reservoir for a Reservoir, the Value is not constrained and is unbounded (as is the case for
an Integrator).
Checking one or both of these boxes, however, provides additional functionality.
In particular:
 If the Lower Bound is checked, GoldSim enforces that limitation on
the Value. As a result, the Withdrawal_Rate output is not necessarily
equal to the Withdrawal Rate input. In this case, the 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). For

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  239


Using Stock Elements

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).

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).

 If the Upper Bound is checked, GoldSim enforces that limitation on


the Value. GoldSim also adds two new (secondary) outputs:
Overflow_Rate (a value) and Is_Full (a condition). If the Value is
below the Upper Bound, the Overflow_Rate output is equal to zero and
the Is_Full output is False. If the Value is at the Upper Bound, the
Overflow_Rate output is equal to the difference between the specified
Addition Rate and the specified Withdrawal Rate and the Is_Full output
is True.
Read more: Using the Is_Full Output of a Reservoir (page 246).

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.

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.

The Reservoir element is particularly powerful because it enforces the bounds


while properly conserving the material being tracked. That is, if a Reservoir’s
Addition Rate causes it to reach its upper bound, GoldSim produces an overflow

240  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Stock Elements

rate (which can be routed to a downstream Reservoir). Similarly, if you specify


a Withdrawal Rate that exceeds what can actually be delivered, GoldSim
accurately reports the actual withdrawal rate.
Furthermore, as is discussed below, the Upper and Lower Bounds can be
specified as functions of time. This allows you to simulate systems such as a
pond which is filling up with silt and sand (and hence decreasing its capacity),
and a warehouse whose capacity is being expanded (via construction)
throughout a simulation.
The Lower Bound and the Upper Bound inputs to the Reservoir must have the
same attributes (order and dimensions) as the Reservoir's output. In addition, the
following limitations imposed on the inputs should be specifically noted:
 The Upper Bound must be greater than or equal to the Lower Bound.
 The Initial Value must be greater than or equal to the Lower Bound and
less than or equal to the Upper Bound.

Note: If the output of a Reservoir is specified as being an array (a vector or a


matrix), the Upper and Lower Bounds must, by definition, themselves be arrays.
Since you often may wish to enter a zero array (a vector or matrix of zeros) for
one of these inputs, GoldSim allows you to leave any of these input fields blank,
in which case it interprets the field as a zero array.

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

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  241


Using Stock Elements

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:

Time Reported Overflow Total Water


(days) Rate (m3/day) Overflowed (m3)
8 0 0
10 0 0
12 400 500
14 400 1300

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.

Read more: Including Unscheduled Updates in Time History Results (page


436).

Note: Most spreadsheet models implicitly compute accumulated values (e.g.,


flows) over a step (or the change from one step to the next). Hence, if you want
to compare or integrate GoldSim with a spreadsheet model, you should use
Reporting Periods to define your steps.

Read more: Defining Reporting Periods (page 421).

Note: As noted above, by default, GoldSim inserts an unscheduled update when


the Reservoir reaches an upper bound. However, if desired, you can disable
unscheduled updates (although it is generally not recommended). If you do so,
the reported overflow rates are the average rates over the next scheduled
timestep and can be assumed to be constant. . (This option is accessed via the
Advanced… button in the Time tab of the Simulation Setting dialog).

Read more: Controlling Unscheduled Updates (page 430).

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).

242  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Stock Elements

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:

The dashed line represents the Specified Upper Bound


The solid line represents the Upper Bound as simulated by GoldSim, assuming a 10 day
timestep

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.

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  243


Using Stock Elements

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.

244  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Stock Elements

Hence, it is important to understand that the Withdrawal_Rate represents


the instantaneous withdrawal 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 withdrwal rate was 300 m3/day between 10 and
12 days. In fact, at 10 days, the overflow rate was indeed 300 m3/day, but it
changed to 100 m3/day at 11 days (between the scheduled updates). Because 11
days is an unscheduled timestep, you would not see this in a time history plot.
However, if the Withdrwal_Rate was integrated (using an Integrator or another
Reservoir that represented the total amount of water that has been withdrawn),
the following results would be obtained:

Time Reported Withdrawal Rate Total Water


(days) (m3/day) Withdrawn (m3)
10 300 0
12 100 400
14 100 600

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.

Read more: Including Unscheduled Updates in Time History Results (page


436).

Note: Most spreadsheet models implicitly compute accumulated values (e.g.,


flows) over a step (or the change from one step to the next). Hence, if you want
to compare or integrate GoldSim with a spreadsheet model, you should use
Reporting Periods to define your steps.

Read more: Defining Reporting Periods (page 421).

Note: As noted above, by default, GoldSim inserts an unscheduled update when


the Reservoir reaches a lower bound. However, if desired, you can disable
unscheduled updates (although it is generally not recommended). If you do so,
the reported withdrawal rates are the average rates over the next scheduled
timestep and can be assumed to be constant. . (This option is accessed via the
Advanced… button in the Time tab of the Simulation Setting dialog).

Read more: Controlling Unscheduled Updates (page 430).

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  245


Using Stock Elements

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).

Note: Although GoldSim conserves mass when computing the actual


withdrawal rate, it 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.

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:

246  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Stock Elements

Unfortunately, because the Overflow_Rate is not a state variable, if you then


tried to link this Expression into the Addition Rate input for the Reservoir, you
would get this error:

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

 Rate of Change(t  t )t


Value(t n )  Initial Value 
i 1
i i i

  Discrete Additions   Discrete Withdrawals

Discrete Additions and Withdrawals are specified by checking the Additions


and Withdrawals fields and by specifying a link to a discrete change signal
with an Add instruction. Note that if you check a Discrete Addition or Discrete
Withdrawal checkbox, GoldSim will add new outputs to the element
(Discrete_Overflow and Discrete_Withdrawals, respectively).
Read more: Basic Concepts of Discrete Event Modeling (page 320); Modeling
Discrete Changes to a Reservoir (page 355).
Instantaneously In some cases, you may want to instantaneously replace the current value of a
Replacing the Current Reservoir with a specified value.
Value of a Reservoir This can be accomplished by checking the Additions field and specifying a link
to a discrete change signal with a Replace instruction
Read more: Basic Concepts of Discrete Event Modeling (page 320); Modeling
Discrete Changes to a Reservoir (page 355).

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:

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  247


Using Basic Function Elements

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.

Using Basic Function Elements


There are ten basic function elements that are used to manipulate data in a
GoldSim model:
 Expression elements;
 Extrema elements;
 Selector elements;
 Splitter elements;
 Allocator elements;
 Sum elements;
 Lookup Table elements; and
 Logical elements (And, Or, Not).
These elements are described in detail in the topics listed below.
Expression Elements Expression elements are probably the most common function element that you
will use in your models.
The properties dialog for an Expression element looks like this:

248  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Basic Function Elements

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).

An example model which uses Expression elements (Expression.gsm) can be


found in the General Examples folder in your GoldSim directory.
Extrema Elements An Extrema element computes the maximum value (peak) or minimum value
(valley) achieved by its input during a simulation. For example, in the figure

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  249


Using Basic Function Elements

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:

250  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Basic Function Elements

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:

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  251


Using Basic Function Elements

“TofExtreme” is the (optional) time of extreme 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).

A simple example model which uses an Extrema element (Extrema.gsm) can be


found in the General Examples folder in your GoldSim directory.
Selector Elements In many simulations, you will want to use if..then logic in your model to specify
how a particular parameter changes as a function of some state of the system
(e.g., time).
For example, you might want to use if…then logic to define how a particular
variable changes with time: if(Etime < 10 yr, 5, 6). Simple relationships such as
these can readily be entered into an Expression element. In some situations,
however, you will need to define complex, nested if..then logic to represent your
system. Consider, for example, the following complex nested if..then statement:

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:

Needless to say, a nested if…then statement such as this is cumbersome to enter


(and difficult to interpret once it has been entered). The Selector element was
specifically designed to facilitate the representation of such logic
The properties dialog for a Selector element looks like this:

252  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Basic Function Elements

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:

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  253


Using Basic Function Elements

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):

254  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Basic Function Elements

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 Selector element (Selector.gsm) can be found


in the General Examples folder in your GoldSim directory.
Splitter Elements Splitter elements split an incoming signal between a number of outputs based on
specified fractions or amounts. Typically, the signal will be a flow of material
(e.g., water), but it could also be a resource, or a discrete transaction.
The properties dialog for a Splitter element looks like this:

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.

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  255


Using Basic Function Elements

By default, output amounts are entered as fractions of the input amount.


However, you can also specify the output amounts directly (as values). The
drop-list directly above the list of outputs specifies how outputs are entered:

If output amounts are defined as fractions of the input amount, then:


 For each output, you specify the Fraction of the incoming Amount
that is assigned to that output. The Fractions can be specified as
constants or expressions and/or links, and may change with time.
 If the Sum of Fractions must equal one checkbox is checked (the
default), then the total amount of the input will be conserved, and:
o Each Fraction must always be greater than or equal to zero.
o You cannot specify the Fraction for the last output. GoldSim
automatically assigns the remainder to this output such that the
fractions add to one.
o If the specified Fractions exceed one at any time during a
simulation, GoldSim issues a fatal error.
 If the Sum of Fractions must equal one checkbox is cleared, then:
o There are no constraints on the values for the Fractions (they can
be negative or can exceed one).
o You must specify the Fraction for the last output (GoldSim does
not automatically assign the remainder to this output such that the
fractions add to one).
o The specified Fractions do not need to sum to one.
If output amounts are defined directly as amounts, then:
 For each output, you specify the Amount that is assigned to that
output. The output Amounts can be specified as constants or
expressions and/or links, and may change with time.
 If the Sum of Outputs must equal input amount checkbox is checked
(the default), then the total amount of the input will be conserved, and:
o You cannot specify the output Amount for the last output.
GoldSim automatically assigns the remainder to this output such
that the outputs add to input amount.
o If the specified output Amounts exceed the input amount at any
time during a simulation, GoldSim issues a fatal error.
 If the Sum of Outputs must equal input amount checkbox is cleared,
then:
o There are no constraints on the values for the Amounts (they can
be negative or can exceed the input Amount).
o You must specify the output Amount for the last output (GoldSim
does not automatically assign the remainder to this output such that
the output Amounts add to the input amount).

256  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Basic Function Elements

o The specified output Amounts do not need to sum to the input


amount.
Under some circumstances, you may want to specify the outputs as some
function of the input amount. GoldSim facilitates this by providing a locally
available property called "Amount". This represents the current value in the
Amount field. You would reference this value as "~Amount". This can be
particularly useful for routing discrete change signals based on their value.
Read more: Using Splitter Elements to Route Discrete Changes Based on Their
Value (page 363).

Note: Amount is an example of a locally available property. As such, it only


has meaning inside the Fraction field, and cannot be referenced anywhere else.

Read more: Understanding Locally Available Properties (page 750).


As shown below in the browser view of a Splitter element, a Splitter has an
output for each item in the Outputs list:

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 outputs of a Splitter can be either values or discrete change signals


(depending on how the Type field was defined).

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.

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  257


Using Basic Function Elements

The properties dialog for an Allocator element looks like this:

The incoming signal to an Allocator 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.
An Allocator 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 Allocator element are specified in the "Outputs" section of
the dialog. By default, an Allocator element initially has one output (named
Output1). 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.
For each output, you specify the Demand for that output. The Demand has the
same type and dimensions as the incoming Amount. Demands can be specified
as constants or expressions and/or links, and may change with time. Each output
receives its requested Demand according to the specified Priority. Outputs with
lower valued Priorities are met first (i.e., Priority 1 is met before Priority 2).
To illustrate this, consider the following example:

258  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Basic Function Elements

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:

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  259


Using Basic Function Elements

 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):

Output Priority Demand Result Result with


(m3/day) with proportional
equal sharing
sharing (m3/day)
(m3/day)
Output1 1 75 75 75
Output2 2 20 10 14.3
Output3 2 10 10 7.1
Output4 2 5 5 3.6

Under some circumstances, you may want to define a Demand by referencing


the total amount available, or the remainder after the previous Priority has been
met. GoldSim facilitates this by providing two locally available properties:
 "Total". This represents the current value in the Amount field. You
would reference this value as "~Total".
 "Remainder". This represents the amount remaining (of the original
amount) after all senior priorities (i.e., Demands with lower-valued

260  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Basic Function Elements

Priorities) have been met. Hence, the Remainder takes on a different


value in each row. You would reference this value as "~Remainder".

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: Total and Remainder are examples of locally available properties. As


such, they only have meaning inside the Demand field, and cannot be
referenced anywhere else.

Read more: Understanding Locally Available Properties (page 750).


For example, if Output1 had a Demand of 100 m3/day, and Output2 had a
Demand that was half of what was remaining after Output1's demand was met,
you could define the Demands as follows:

As shown below in the browser view of an Allocator element, there is an output


for each item in the Outputs list. There is also an additional output (called
"Unused") that represents the portion of the incoming signal that was unused
(i.e., unallocated, or left over after the demands were met).

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 outputs of an Allocator can be either values or discrete change signals


(depending on how the Type field was defined).

Note: If an Allocator outputs discrete change signals, the outputs (including the
Unused output) preserve the Instruction of the input signal.

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  261


Using Basic Function Elements

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,

262  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Basic Function Elements

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.

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  263


Using Basic Function Elements

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

The following steps are required to define a Lookup Table:


1. You first specify its Dimensions. This is a list box that provides three
options: 1-D, 2-D or 3-D. This determines how many independent
variables the Lookup Table has.
2. You specify the Units in which the data in the table will be specified
for each independent variable. For a 1-D Table, you must specify the
Row Units. For a 2-D table, you must specify the Row and Column

264  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Basic Function Elements

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:

By default, the table is created with a single row of zeros.


You add rows to the table using the Add Row(s) button. If you hold down the
Ctrl key when you press this button, you will be prompted for the number of
rows to add (otherwise, a single row will be added). To delete one or more rows,
select them and press the Remove Row(s) button.
The first column of the table is where you enter the values for the independent
(row) variable; the second column 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 two variables on the main Lookup Table
dialog. These units are displayed in the column headers.
You can paste data from a spreadsheet, Word document or comma delimited
text file into a 1-D table. To paste data from the Windows clipboard into a table,

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  265


Using Basic Function Elements

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).

Note: When a Lookup Table is linked to a spreadsheet or database, you cannot


edit the data once it has been imported; you can only view it. If you wish to edit
the data, you must first remove the link to the spreadsheet or database (by
changing Data Source to “None”).

Read more: Using Time Series Elements (page 187).

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:

266  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Basic Function Elements

could be defined using the following text file:


! Example File
1
5
1, 2, 3, 4, 5
10, 20, 30, 40, 50
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 1-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.

Read more: Linking a Lookup Table to a Text File (page 278).

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  267


Using Basic Function Elements

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

268  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Basic Function Elements

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.

Note: When a Lookup Table is linked to a spreadsheet or database, you cannot


edit the data once it has been imported; you can only view it. If you wish to edit
the data, you must first remove the link to the spreadsheet or database (by
changing Data Source to “None”).

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:

could be defined using the following text file:


! Example File
2
3, 4
1, 3, 9
1, 2, 4, 8
1, 1.5, 2.5
1.5, 2, 4

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  269


Using Basic Function Elements

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.

Read more: Linking a Lookup Table to a Text File (page 278).

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:

270  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Basic Function Elements

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).

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  271


Using Basic Function Elements

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.

Note: When a Lookup Table is linked to a spreadsheet or database, you cannot


edit the data once it has been imported; you can only view it. If you wish to edit
the data, you must first remove the link to the spreadsheet or database (by
changing Data Source to “None”).

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)

272  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Basic Function Elements

 …
 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.

Read more: Linking a Lookup Table to a Text File (page 278).

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  273


Using Basic Function Elements

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:

274  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Basic Function Elements

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.

It is easiest to understand how to define the spreadsheet linkage by considering


1-D, 2-D and 3-D tables separately.
Defining 1-D Tables
 You must specify the Row Variable Starting Cell. This represents the
first value of the Row Variable. Row variable data must be contiguous
and proceed down in a column.
 You can specify the cell (e.g., A2) directly by typing it into the
Starting Cell field. In this case, you must also select the sheet from
the Starting Sheet drop-list. Alternatively, you can press the
Location… button, which opens the spreadsheet and provides a dialog
allowing you to directly select the desired cell.
 Dependent data are assumed to be in the column immediately to the
right of the Row Variable column.
 The import of data stops when a cell is encountered that is empty or
contains non-numeric data.

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  275


Using Basic Function Elements

Defining 2-D Tables


 You must specify the Row Variable Starting Cell and the Column
Variable Starting Cell. These represent the first value of the Row
Variable and Column Variable, respectively. Row variable data must be
contiguous and proceed down in a column. Column variable data must
be contiguous and proceed to the right across a column. The Column
Variable Starting Cell must be above the Row Variable Starting
Cell in the spreadsheet.
 You can specify a cell (e.g., B1) directly by typing it into the Starting
Cell fields. In this case, you must also select the sheet from the
Starting Sheet drop-list. Alternatively, you can press the Location…
button adjacent to either field, which opens the spreadsheet and
provides a dialog allowing you to directly select the desired cell.
 Dependent data for a particular Row and Column Variable 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 would never be used.

 The import of data stops when a cell is encountered that is empty or


contains non-numeric data.
Defining 3-D Tables
 You must specify the Row Variable Starting Cell, the Column
Variable Starting Cell and the Layer Variable Starting Cell. These
represent the first value of the Row Variable, Column Variable and
Layer Variable, respectively. Row variable data must be contiguous
and proceed down in a column. Column variable data must be
contiguous and proceed to the right across a column. The Column
Variable Starting Cell must be above the Row Variable Starting
Cell in the spreadsheet. Layers are represented in separate sheets. The
value for the Layer Variable for each sheet must always be in the same
cell.
 You can specify a cell (e.g., B1) directly by typing it into the Starting
Cell fields. Alternatively, you can press the Location… button
adjacent to either field, which opens the spreadsheet and provides a
dialog allowing you to directly select the desired cell.
 The Starting Sheet represents the location of the data for the first
Layer Variable. Additional Layers are assumed to be to the right of the
Starting Sheet.

276  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Basic Function Elements

 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.

 The import of data stops when a cell is encountered that is empty or


contains non-numeric data (where it expects to find a layer number)

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.

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: 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

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  277


Using Basic Function Elements

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).

278  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Basic Function Elements

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:

When you do so, a new tab (Database) is added to the dialog.


A Lookup Table is one of several types of elements that can be linked to a
database. All elements that can import data from a database use a common set
of structures and rules for doing so. Hence, in order to use this capability in
GoldSim, you must be familiar with these rules and database structures.
A Yucca Mountain Database is one of several available database structures
supported by GoldSim, and the only structure that supports Lookup Tables.

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.

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  279


Using Basic Function Elements

Read more: Linking Elements to a Database (page 972).

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 independent variables, GoldSim provides the following interpolation


options:
Linear: This is the default, and if selected, GoldSim will linearly
interpolate between table values to determine the appropriate value.
Next lower: This option results in a “stair-step” function, with no
interpolation at all. If this option is selected, given an input argument

280  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Basic Function Elements

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.

Note: If an independent variable appears to vary logarithmically, enter the logs


of the independent variable when defining points in the Lookup Table (and use
the log of the independent variable as an argument when referencing the table).

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).

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  281


Using Basic Function Elements

That is, once you define a table, you reference it in input expressions for other
elements as if it were a custom function:

This is referred to as a table function. This expression instructs GoldSim to use


the 2-D 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.
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 independent variables) in the same manner as you would
use the built-in functions provided by GoldSim multiple times. For example,
elsewhere in the model you could reference X_Table(10ft, 135kg).
The argument(s) to a table function must have dimensions that are the same as
those of the independent variables with which the Lookup Table was originally
defined. Hence, in the example above, if you referenced the table as X_Table(10
day, 150 kg), GoldSim would produce an error message, since based on the way
that X_Table was defined, the first argument (the Row Variable) must have
dimensions of length.
The dimensions of the table function are determined by the Result Units
specified when the Lookup Table was defined.
Table functions are always referenced as follows:
1-D Tables: Tablename(Row Variable)
2-D Tables: Tablename(Row Variable, Column Variable)
3-D Tables: Tablename(Row Variable, Column Variable, Layer Variable)
The arguments to a table function do not need to be numbers; they can be links
from other elements.
Table functions can also accept arrays as input arguments (and subsequently
produce arrays as outputs). For example, if ABC was a two-dimensional lookup
table, ABC(1,2) would return a scalar value. However, if X and Y were vectors
(e.g., of “Days”), then ABC(X,Y) would return a vector of days. The items
would be evaluated by the lookup table on a term-by-term basis.
Read more: Using Vectors and Matrices (page 726).
When you create a Lookup Table, GoldSim automatically lists the table function
in the Function menu that is accessible from the context menu within an input
field:

Read more: Built-in Functions (page 128).


There are two ways to add a Lookup Table to an expression:
1. You can use the context menu to insert a Table function (as shown
above).
2. You can use the Insert Link cursor to reference the table directly:

282  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Basic Function Elements

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:

and the following expression would return the volume corresponding to an


elevation of 10 m:

Several points should be noted:


 If the argument is outside of the range of the table, GoldSim issues a
fatal error (regardless of the Handling of Data Outside Bounds field
setting).
 If the table is non-monotonic, the function returns the first value of the
row variable that corresponds to the argument.
An example model which illustrates the inverse function
(LookupTable_Functions.gsm) can be found in the General
Examples/LookupTable folder in your GoldSim directory.

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  283


Using Basic Function Elements

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:

Computing the Derivative


The plot below shows how GoldSim would compute Volume(X,
TBL_Derivative) for different values of X:

Several points should be noted:

284  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Basic Function Elements

 For TBL_Derivative, the dimensions of the input argument must be


that of the Independent Variable. The dimensions of the output of the
function are Dependent Variable dimensions / Independent Variable
dimensions. In this example, since the Indepependent Variable was a
length and the Dependent Variable was a volume, the result of the
function has dimensions of an area.
 If the input is outside of the range of the table, the function returns the
value at the edge of the table (regardless of the Handling of Data
Outside Bounds field setting).
 The derivative function always returns a value of zero if the table’s
Interpolation is set to “Next lower”.
 The derivative function returns an error if the Interpolation is set to
“Exact only”.
Computing the Integral
The plot below shows how GoldSim would compute Volume(X, TBL_Integral)
for different values of X:

Several points should be noted:


 For TBL_Integral, the dimensions of the input argument must be that of
the Independent Variable. The dimensions of the output of the function
are Dependent Variable dimensions * Dependent Variable dimensions.
In this example, since the Indepependent Variable was a length and the
Dependent Variable was a volume, the result of the function has
dimensions of length4.
 The integral function integrates from the start of the table up to the
lesser of the given argument and the end of the table. If the argument is
less than the first row value for the table, the function returns zero.
 If the input is outside of the range of the table, the function returns the
value at the edge of the table (regardless of the Handling of Data
Outside Bounds field setting).
 The integral function returns an error if the Interpolation option is set to
“Exact only”.

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  285


Using Basic Function Elements

Computing the Inverse Integral


The plot below shows how GoldSim would compute Volume(X,
TBL_Inv_Integral) for different values of X:

Several points should be noted:


 For TBL_Inv_Integral, the dimensions of the input argument must be
Dependent Variable dimensions * Independent Variable dimensions.
In this example, since the Indepependent Variable was a length and the
Dependent Variable was a volume, the dimensions of the input
argument must be length4. The dimensions of the output of the function
are those of the Independent Variable.
 If the input (the integral) is outside of the range produced by the table’s
inputs, the function returns the value at the edge of the table (regardless
of the Handling of Data Outside Bounds field setting). For example,
in the example provided above, a value of 15m (the last data point in
the table) corresponds to an integral value of 395m4. As a result, if the
first argument to Table(X, Inv_Integral) was greater than 395m4, the
function would return 15m.
 If the integral of the table is non-monotonic, the inverse integral returns
the lowest value whose integral matches the argument.
 The inverse integral function returns an error if the Interpolation option
is set to “Exact only”.
One practical application of the use of these functions is when creating tables
that describe how the surface area, volume and water elevation in a pond or
reservoir are related. In these kinds of problems, you often would compute the
volume, and then use a table to output the surface area and elevation
corresponding to that volume. One way to do this in a consistent way using the
table functions would be to define a table (named, say, Area_from_Elevation)
that outputs the surface area as a function of the water elevation (i.e., the
independent variable would be elevation and the dependent variable would be
surface area). Given a volume (V), you could then use this table to compute the
elevation and surface area as follows:
Elevation = Area_from_Elevation(V, TBL_Inv_Integral)

286  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Basic Function Elements

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):

Read more: Using the Browser (page 110).

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).

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  287


Using Basic Function Elements

GoldSim provides a number of operators which allow you to create conditional


Logical Elements expressions (e.g., A>B, A>B and C < D, A==B). Conditional expressions are
powerful because they allow you to add conditional logic to your models.
Read more: Creating Conditional Expressions (page 134).
If the conditional expression is simple, you can create the expression directly in
the input field to an element. If, however, your conditional expression is very
complex and/or it is important to make your conditional logic very transparent,
GoldSim’s three logical elements (And, Or, Not) are very useful. You use these
three simple elements to visually display conditional logic:

Each of the three Logical elements is discussed below. An example model


which uses all three Logical elements (LogicalElements.gsm) can be found in
the General Examples folder in your GoldSim directory.
And Elements And elements perform a logical And operation on a list of conditions. Their
output is True if and only if all of their inputs are True. Although this can also
be done using an Expression, an And element provides a somewhat more
convenient and user-friendly way to do this, particularly if a large number of
items are involved. More importantly, the 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 an And element looks like this:

288  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Basic Function Elements

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 Or elements perform a logical Or operation on a list of conditions. Their output


is True if any of their inputs are True. Although this can also be done using an
Expression, an Or element provides a somewhat more convenient and user-
friendly way to do this, particularly if a large number of items are involved.
More importantly, the 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 an Or element looks like this:

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  289


Using Basic Function Elements

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).

290  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Delay Elements

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:

The input to a Not element must be a scalar condition. It can, however, be an


expression. Not elements have a single output, which is also a scalar condition.
If the input to a Not is True, the output is False; if the input is False, the output
is True. You can save the results for a Not element by clicking Final Values
and/or Time Histories.

Using 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 functions of prior values of their inputs. As a result, Delays impart inertia
and memory to a system, and can internally generate dynamic behavior within a
system. Without elements like Delays and Stocks, your models could respond to
outside (exogenous) drivers, but could not generate any dynamics of their own
internally.
Depending on the structure of your model, a Delay can lead to instability and
oscillation, or it can act to filter out unwanted noise.
GoldSim provides four Delay elements:
 Information Delays are intended to represent processes such as delays
in measuring or reporting variables (e.g., reporting the inventory in a
warehouse, or snow pack levels), and the gradual adjustment of
perceptions based on available information (e.g., sales forecasts).
 Material Delays are intended to represent delays in the physical
movement (flow) of material through a system (letters though the mail
system, parts on an assembly line, salmon in a river, water moving
through a pipe). Material is conserved as it moves through a Material
Delay. Information is not conserved in an Information Delay.

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  291


Using Delay Elements

 Event Delays provide a mechanism for delaying a discrete event signal


(i.e., a discrete signal that indicates that something, such as an accident
or a bank deposit, has occurred). Among other things, Event Delays can
be used to simulate queues.
 Discrete Change Delays provide a mechanism for delaying a discrete
change signal (i.e., a discrete signal that can instantaneously change the
value of a Stock element).
Information Delays and Materials Delays are used to delay continuous signals
and flows (and are discussed in the sections below).
Event Delays and Discrete Change Delays are used for representing delays in
discrete signals. Use of these two elements requires an understanding of how
GoldSim simulates discrete events.
Read more: Chapter 5: Simulating Discrete Events (page 319).

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.

Reporting yesterday’s rainfall total today is an example of an information delay,


with a delay time of one day. In the business world, a classic example of an
information delay is the delay in perceiving a change in a variable (e.g., the sales
rate). The figure below illustrates the information delay associated with a
manager’s perception of a change in the sales rate:

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

292  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Delay Elements

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:

An Information Delay requires an Input Signal and a Delay Time. If desired,


you can optionally define the degree of Dispersion. The single output of the
Information Delay is the delayed signal, which has the same dimensions and
order as the signal itself.
The best way to understand how to use Information Delays is to examine the
behavior of the element in a number of simple examples. A file containing these
examples (InformationDelay.gsm) can be found in the General Examples folder
in your GoldSim directory.
Specifying the Inputs to Within the Information Delay properties dialog, the Display Units determine the
an Information Delay dimensions of the Information Delay’s output. This 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 Information Delay is a scalar, vector or
matrix by pressing the Type… button. By default, the output of a new
Information Delay element is a scalar, dimensionless value. You can, however,
use Information Delay elements to operate on and create vectors and matrices.
Read more: Using Vectors and Matrices (page 726).
The Input Signal and the Initial Value inputs to the Information Delay 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 a Stochastic).

The Delay Time must have dimensions of time and must be positive.

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  293


Using Delay Elements

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:

294  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Delay Elements

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:

Modeling Information In many cases, an information signal is dispersed, “smoothed” or “smeared”


Delays with Dispersion such that 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 information 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 in the signal.

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  295


Using Delay Elements

Read more: Mathematics of Information Delays (page 298).


If “Erlang n” is selected, you must enter 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.
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. 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 
The figure below shows the response of an Information Delay to a step function
for various values of n:

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.

296  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Delay Elements

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):

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  297


Using Delay Elements

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

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. f(t) represents the probability density of the time of “release” from the
delay of an input at time 0:

t n -1e -t / β
f(t) 
β n (n )

where:

298  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Delay Elements

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 an Information Delay can be specified in terms of
either n or the standard deviation.
Read more: Modeling Information Delays with Dispersion (page 295).
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.
Simulating Forecasts Many business decisions use forecasts of future behavior (e.g., the sales rate for
Using Information a product) based on past observations. In order to simulate such systems using
Delays GoldSim, it is necessary to simulate the forecasting process itself. For example,
when modeling a supply chain, it is necessary to simulate how orders are placed.
In the real world, these orders are placed not based on the current demand
(which may not even be measurable), but on a forecast of future demand.
An Information Delay can be used to represent a very commonly used
forecasting method known as exponential smoothing. In exponential smoothing,
the forecast is based on an exponentially-weighted average of past observations.
Mathematically, this is equivalent to the output of an Information Delay with n
=1. An example of such a simulated forecast is presented below:

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  299


Using Delay Elements

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).

300  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Delay Elements

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.

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  301


Using Delay Elements

Read more: Differentiating Between Material and Information Flow (page


153).
The primary output (the Outflow) can only be specified as a value, but can be
specified as a scalar, a vector or a matrix. You can specify whether the Material
Delay is a scalar, vector or matrix by pressing the Type… button. By default,
the output of a new Material Delay element is a scalar, dimensionless value.
You can also use Material Delay elements to operate on and create vectors and
matrices.
Read more: Using Vectors and Matrices (page 726).
The Quantity Units determine the Display Units for the secondary output of the
element, the Amount in Transit. The dimensions of this output must be the same
as those of the Outflow multiplied by Time. For example, if the Outflow Units
have dimensions of Mass/Time, the Quantity Units must have dimensions of
Mass.
A Material Delay can have multiple Inflows. You add an Inflow to the element
by pressing the Add Material Inflow button (the green plus sign). 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 item. In either case, the dialog will close and
the item will be added to the list of Inflows in the properties dialog for the
element:.

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.

302  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Delay Elements

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:

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  303


Using Delay Elements

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:

304  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Delay Elements

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:

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  305


Using Delay Elements

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.

306  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


Using Delay Elements

These kinds of systems can be easily modeled by combining a Reservoir


element with a Material Delay. The Inflow Rate is specified as the Addition
Rate for the Reservoir. The maximum rate at which the Material Delay can
accept material is specified as the Withdrawal Rate from the Reservoir. The
Withdrawal Rate output of the Reservoir then becomes the Input Rate for the
Material Delay. In this case, the Reservoir element represents a “pile” at the start
of the Material Delay. If the Inflow Rate is greater than the rate at which the
Delay can accept material, the pile grows; otherwise it shrinks (and may
disappear completely).
As an example, consider a conveyor that moves dirt from one location 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. An example of how such a structure can be used to
more realistically model this simple system is included in the file
MaterialDelay.gsm which can be found in the General Examples folder of your
GoldSim directory.
The result looks like this:

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:

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  307


Using Delay Elements


Outflow(t)  Inflow( ) f(t -  )d
0

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. f(t) represents the probability density of the time of “release” from the
delay of an input at time 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:

308  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


How GoldSim Carries Out its Calculations

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.

How GoldSim Carries Out its


Calculations
When getting started with GoldSim and/or when building simple models it is not
necessary to understand the details of how GoldSim actually carries out its
calculations. Hence, if you are new to GoldSim, you probably don’t need to be
concerned with these details (and can skip the sections below).
However, to fully take advantage of all of the powerful features in GoldSim and
use them in an appropriate manner, all users should eventually obtain a basic
understanding of how GoldSim does these calculations. This knowledge not
only provides you with a better understanding of the basic assumptions (and
hence limitations) of GoldSim, but also allows you to design models that better
represent the system you are trying to simulate.
Understanding State Within a GoldSim model (actually, any dynamic model), there are
Variables in GoldSim fundamentally two types of outputs:
1. Outputs whose current value only depends on the current value of their
element’s inputs ((i.e., they have no “memory”). These outputs
themselves fall into one of two sub-categories:
o Those that represent unchanging input data (or direct functions of
input data) and are therefore static, in that they only need to be
computed at the beginning of the simulation and do not need to be
recalculated every timestep. Examples include the outputs of Data
elements and Stochastics (which are not being resampled).
o Those whose inputs change with time, and therefore need to be
recalculated every timestep. Examples include the outputs of
Expressions and Selectors whose inputs vary with time.
2. Outputs whose value is computed based on the historical value of the
element’s inputs (as opposed to only being a function of the current
value of the element’s inputs). These outputs can be thought of as
having “memory” of what has happened before. The primary output of
a Reservoir is a classic example.

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  309


How GoldSim Carries Out its Calculations

This second type of output is referred to as a state variable in GoldSim. State


variables are typically the key system variables that you are interested in
predicting. Together, the state variables define the predicted state of the system
at any time in the future. Examples of state variables include the volume of
water in a pond, the amount of money in an account, the status (on/off/failed) of
a piece of equipment, and the number of times a certain event has occurred.
All state variables have, by definition, an initial value (e.g., for Integrators and
Reservoirs, the initial value is explicitly specified). This allows the outputs to be
computed when there are no historical input values available (e.g., at the start of
simulation).
All state variables have “memory”; that is, their value at time t is a function of
their value at time t - t. Furthermore, state variables can change during a
simulation in two different ways:
 Some state variables are instrinsically a function of time. That is, every
timestep, they may change because they are inherently defined with
respect to time. An Integrator and a Reservoir are examples of this.
Since these elements fundamentally solve time integrals, whenever the
simulation time changes, by definition they must be updated.
 Some state variables can be triggered by or respond to other elements
in the model, and in turn, change their value. A Status element is a
good example of this.
Some state variables may change due to just one of these mechanisms, while
others may potentially change due to both. For example, Status elements can
only change by the second mechanism; Reservoirs can change due to both.
Read more: The Causality Sequence and Element Updating (page 311).
Note that based on whether or not a particular state variable can change due to
the second mechanism listed above, it falls into one of these two categories:
1. Its value at time t is completely determined by its value (and the inputs)
at time t - t.
2. Its value at time t is determined by its value (and the inputs) at time t -
t, but can also be further modified by its inputs at time t.
Most state variables fall into the second category.
The most common state variables are the primary outputs of stocks (Integrators
and Reservoirs). A number of other elements, however, also have outputs which
are state variables, and these are summarized in the table below.

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

310  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


How GoldSim Carries Out its Calculations

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):

Reservoir1 (the primary output) and Is_Full are state variables.

Note: In addition to the elements listed above, a number of elements in


GoldSim’s extension modules also have outputs that are state variables.

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

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  311


How GoldSim Carries Out its Calculations

was a function of B, and B was a function of C, then C would be sequenced first,


followed by B, and then followed by A. Although the sequence is obvious in
this trivial example, in complex models the correct causality sequence may not
be as obvious.
To better understand the causality sequence and how GoldSim actually updates
a model every timestep, let’s consider another example that is a bit more
complex:

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.

312  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


How GoldSim Carries Out its Calculations

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).

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  313


How GoldSim Carries Out its Calculations

 Looping systems obviously complicate the causality sequence. In some


cases, GoldSim can handle these systems automatically. In other cases,
you may need to take action in order to represent logic that is recursive.
Read more: Evaluating Feedback Loops (page 314).
 For some complex systems (particularly those involving events that
impact state variables), there may exist more than one way to sequence
that system (and these may produce different results). In these cases,
you can manually force a particular causality sequence to ensure that
the model accurately represents your system.
Read more: Invalid and Ambiguous Causality Sequences (page 317).

 When Discrete Changes are present in a Function Sequence, the


Discrete Changes are propagated to any affected stock elements
instantaneously when the Discrete Change is updated in the sequence
(regardless of where the affected stocks are in the sequence).
Read more: Discrete Change Elements (page 352).

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:

GoldSim automatically analyzes your entire model to identify "who affects


who", and ensures that the "upstream" elements are calculated prior to the
"downstream" elements. At each timestep the elements are updated in this
causality-based sequence.
Read more: The Causality Sequence and Element Updating (page 311).
Many models, however, contain elements whose output can, directly or
indirectly, affect one of their own inputs. This creates a looping or circular
system such as the one shown below:

These types of systems are referred to as feedback loops. Feedback loops


represent dynamic processes in which the variables in the loop do not respond
instantaneously to each other. It takes time for a signal to propagate through a
feedback loop (i.e., C affects A which affects B which gradually or eventually
affects C). That is, the response among the variables in a feedback loop
necessarily involves time lags.
GoldSim allows you to create looping systems like this. In order to do so,
however, the loop must meet one requirement: it must contain at least one state
variable. State variables provide inertia or “memory” to a system, and always
have an existing value prior to updating the model at a new time point. As a
result, they allow a looping model to properly initialize itself and subsequently
move from one timestep to the next.

314  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


How GoldSim Carries Out its Calculations

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).

Read more: Invalid and Ambiguous Causality Sequences (page 317).


Feedback loops are discussed in further detail below.
Types of Feedback Feedback loops are present in one form or another in most real-world systems.
Loops There are two basic kinds of feedback loops: positive feedback loops and
negative feedback loops.
 Positive feedback loops are self-reinforcing. The more adult rabbits
you have, the more baby rabbits that are produced; the more baby
rabbits that are produced, the more adult rabbits you have, and so on
until the world is full of rabbits (or this positive loop is counteracted by
a negative feedback loop).
 Negative feedback loops are self-correcting. The more rabbits you
have, the less food you have; the less food you have, the less rabbits
you have; the less rabbits you have, the more food you have. Positive

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  315


How GoldSim Carries Out its Calculations

feedback loops generate growth and amplify changes. Negative


feedback loops drive systems toward equilibrium and balance.
The dynamics of most systems are driven by the interactions of many such
loops.
The example below shows two simple feedback loops: the positive feedback
loop associated with earning interest on a bank account; and the negative
feedback loop associated with leakage from a pond. Note that both loops contain
a dynamic element (in this case, a Reservoir):

This model (Feedback.gsm) can be found in the General Examples folder of


your GoldSim directory.
Limitations on the Use SubSystems are treated by other elements as if they were a single element
of SubSystems in (analogous to a complex Expression element). This has an important
Feedback Loops implication for systems that include feedback loops. In particular, if a
SubSystem contains elements with state variable outputs, and these state
variable outputs are referenced outside of the SubSystem, they will not be
treated as state variables outside of the SubSystem.
Read more: Treating a Container as a SubSystem (page 139).
As a result, if you try to create a feedback loop by referencing a state variable
contained within the SubSystem outside of the SubSystem, GoldSim will not be
able to create the loop (and will provide an error message indicating that
creating such a link would result in a recursive system).
In this situation, in order to create a looping system, you must reference the state
variable from the SubSystem in a Previous Value element, and then use the
output of the Previous Value element to complete the loop.
Read more: Creating Recursive Loops Using Previous Value Elements (page
901).
Finding Feedback When using the Function Of or Affects View for an element that is within a
Loops feedback loop, GoldSim will stop building a branch of the dependency tree as
soon as an item is repeated (and it will mark this as a “loop”).
Read more: Viewing Element Dependencies (page 117).
For example, if Reservoir1 is a function of X, X is a function of Y, and Y is a
function of Reservoir1, the Function Of View for Reservoir1 would look like
this:

316  Chapter 4: Using the GoldSim Elements GoldSim User’s Guide


How GoldSim Carries Out its Calculations

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).

GoldSim User’s Guide Chapter 4: Using the GoldSim Elements  317


Chapter 5: Simulating Discrete
Events
We a re re a d y fo r a n y u n fo re s e e n eve n t
t h a t m a y o r m a y n o t o c c u r.

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

GoldSim User’s Guide Chapter 5: Simulating Discrete Events  319


Basic Concepts of Discrete Event Modeling

Basic Concepts of Discrete Event


Modeling
A discrete event is something that occurs instantaneously (as opposed to
continuously or gradually) in time. It represents a “spike”, a discontinuity, or a
discrete change of state for the system.
The flow of water out of a hole in a bucket is a continuous process (as long as
water remains in the bucket). Puncturing the bucket to create the hole is a
discrete event. Stopping the flow from the bucket (by plugging the hole or by
the bucket becoming empty) is also a discrete event. Similarly, through
continuous compounding of interest, the money in a bank account continuously
increases, but the account can also increase and decrease instantaneously due to
discrete events (i.e., deposits and withdrawals).
Of course, “instantaneous” and “gradual” are relative terms. That is, whether
something is treated as instantaneous or gradual is a function of the time scale of
interest, and hence you must differentiate between the two based on the context
of your model. Typically, the differentiation will be obvious. For example, if the
time scale of interest is 10 years, something happening over the span of a day
can be considered to be “instantaneous”. If the time scale of interest is several
days, however, something happening over the span of a day would in most cases
need to be treated in a continuous manner.
GoldSim handles “instantaneous” changes to a model by providing a mechanism
for you to recognize the occurrence of, and act upon, discrete events. This is
accomplished by providing the ability to instantaneously trigger an element to
take a particular action (e.g., instantaneously change its value) in response to an
event. Hence, in GoldSim, an event is specifically defined as an instantaneous
occurrence that subsequently triggers a particular action.
For example, suppose you were keeping track of two time varying outputs, X
and Y. Consider the point or points in time at which X becomes greater than the
Y. Given a specified degree of precision, this happens instantaneously, not
gradually; X is either greater than Y or it isn’t. X becoming greater than Y is a
discrete change of status. If, in addition, X becoming greater than Y triggered a
particular action in your model (e.g., instantly change the value of Z), then the
condition “X > Y” would be considered an event. Note that X becoming greater
than some other variable would also be an instantaneous occurrence, but if it
does not trigger a particular action, there is no reason to treat this as an event.
In GoldSim, the occurrence of an event can be specified in one of two ways:
 The event occurs when a condition (e.g., X > Y) becomes true; or
 The event is specifically scheduled to occur on a regular or random
basis ("occur exactly once a year on January 1" or "occur, on average,
once a year").

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.

320  Chapter 5: Simulating Discrete Events GoldSim User’s Guide


Basic Concepts of Discrete Event Modeling

Read more: Understanding Timestepping in GoldSim (page 415).


A variety of GoldSim elements can be triggered by an event, with each element
responding to the event (taking a particular action) in a different manner. For
example, the action taken by a Stochastic element when it is triggered by an
event is to resample itself. The action taken by a Status element when it is
triggered by an event is to instantaneously change its value (from True to False
or from False to True).
The manner in which events are specified to occur is discussed in detail in
“Understanding Event Triggering” and “Generating Discrete Event Signals”.
The elements that can respond to events, and the manner in which they do so,
are discussed in “Responding to Events”.
Read more: Understanding Event Triggering (page 323); Generating Discrete
Event Signals (page 332); Responding to Events (page 352).
Propagating Discrete In some cases, an event will occur (e.g., X becoming greater than Y) which
Signals Between triggers a particular action in a single element (e.g., change the output of a
Status element to True). In such a case, the event is internal to that element, and
Elements it does not directly impact other elements. In other cases, however, an event may
impact multiple elements, or one element may respond to an event by triggering
other elements to take a particular action. In these cases, it is necessary for
discrete signals to propagate between elements.
If you think carefully about this, you will realize that this is very different from
how information is typically passed between elements in GoldSim. In most
situations, information is transferred between elements (via links) 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 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) a discrete signal. Discrete signals are a special category
of outputs that emit information discretely, rather than continuously.
When you view an element that can emit or receive a discrete signal in the
browser, the symbols for the inputs and outputs that represent discrete signals
are identified by an exclamation point.

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.

GoldSim User’s Guide Chapter 5: Simulating Discrete Events  321


Basic Concepts of Discrete Event Modeling

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.

Read more: Using Conditional Containers (page 841).

322  Chapter 5: Simulating Discrete Events GoldSim User’s Guide


Understanding Event Triggering

Elements That Emit and Receive Discrete Change Signals


Element Emits Discrete Receives Discrete
Change Signals Change Signals
Discrete Change x -

Discrete Change Delay x x


Integrator - x
Reservoir x x
Time Series x -

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.

Understanding Event Triggering


All discrete event modeling involves triggering of one form or another. When
you trigger an element, you are telling it that a discrete event has occurred that
you want the element to respond to. Therefore, before describing the details of
the various elements associated with discrete event modeling, it is first necessary
to understand the concept of triggering.
The following element types can be triggered in GoldSim:
 Triggered Event
 Event Delay
 Stochastic
 Status
 Milestone
 Decision
 Random Choice
 Discrete Change
 Extrema
 Conditional Containers
(Specialized elements within some of the GoldSim extension modules, such as
the Reliability Module and the Financial Module, can also be triggered.)

GoldSim User’s Guide Chapter 5: Simulating Discrete Events  323


Understanding Event Triggering

Each of these elements responds to a trigger in a different way. They are,


however, all triggered in the same way. That is, these elements all share a
common Triggering dialog, which controls how they are triggered. The
Triggering dialog is accessed via a Trigger… button in the main dialog for each
element:

Note: Holding your cursor over the Trigger… button displays a tool-tip
summarizing the current trigger settings.

The Triggering dialog for every element looks like this:

Note that for some elements, an additional button (for specifying Resource
interactions) is available on the Trigger dialog:

The Triggering dialog is discussed in detail in the sections below.


Specifying Triggering The top part of the Triggering dialog (which is the only portion visible when you
Events first define a trigger) is where you define the triggering events (the discrete
occurrences) that you want the element to respond to:

324  Chapter 5: Simulating Discrete Events GoldSim User’s Guide


Understanding Event Triggering

The More button provides access to advanced triggering options: specifying


precedence conditions and required conditions.
Read more: Specifying a Precedence Condition for a Trigger (page 328);
Specifying a Required Condition for a Trigger (page 330).
By default, when you first create an element that can be triggered, no triggers
will exist, and therefore the element will never be triggered.

Note: There is one exception to this rule. The Deactivation trigger for
conditional Containers has a default defined trigger.

Read more: Using Conditional Containers (page 841).


To define a trigger for the element, you simply press the Add button to add a
row to the list of triggering events:

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:

GoldSim User’s Guide Chapter 5: Simulating Discrete Events  325


Understanding Event Triggering

There are eight types of events that can be added:


On Event: The Trigger Definition must be a discrete event or discrete
change signal from another element. The element is triggered whenever the
signal is received.
On Changed: The Trigger Definition can be any continuous output (it
cannot be an expression or a discrete signal). The element is triggered
whenever the value of Trigger Definition changes.
On True: The Trigger Definition can be any condition output or conditional
expression. The element is triggered whenever the Trigger Definition
becomes True.
On False: The Trigger Definition can be any condition output or
conditional expression. The element is triggered whenever the Trigger
Definition becomes False.
At Stock Test: The Trigger Definition must be a conditional expression of
of the form “A>B”, “A>= B”, “A<B”, “A<=B”, or “A=B” where A is a
Reservoir (or amount of medium or level in a Cell element). The element is
triggered whenever the Trigger Definition becomes True. As discussed
below, this triggering event interupts the clock and adds an unscheduled
update.
At Date: The Trigger Definition must be a date or date and time, enclosed
in quotations. (Alternatively, the date can also be expressed as the amount
of time since 30 December 1899). The element is triggered whenever the
simulated date reaches the specified date. As discussed below, this
triggering event interupts the clock and adds an unscheduled update.
Read more: Referencing Dates in Expressions (page 135).
At ETime: The Trigger Definition must be an elapsed time. The element is
triggered whenever the simulated elapsed time reaches the specified elapsed
time. As discussed below, this triggering event interupts the clock and adds
an unscheduled update.
Auto Trigger: An Auto Trigger requires no user-defined Trigger Definition
and its behavior is defined by its context (i.e., the type of element). Auto
Triggers can react to the activation or deactivation of their parent Container.
In some special cases (e.g., specialized Reliability elements), they can also
be used to respond to other types of actions impacting a parent Container
(e.g., preventive maintenance). Depending on the type of element, this
option may not always be available.

326  Chapter 5: Simulating Discrete Events GoldSim User’s Guide


Understanding Event Triggering

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.

Read more: Understanding Timestepping in GoldSim (page 415).

Warning: Care must be taken if you choose to disable insertion of unscheduled


updates while using At Stock Test, At Date or At Etime triggers. These triggers
are designed to interrupt the clock and insert a new update, and may not trigger
at all if you disable unscheduled updates.

Read more: Controlling Unscheduled Updates (page 430).


You can add as many triggering events as desired (with different event types).
The element is triggered when any one of the events occurs.
The following details should be noted regarding triggering:
 Unless you are using conditional Containers, you should generally
never use an Auto Trigger. If you do, the element will automatically be
triggered when its parent Container activates (which in the absence of
conditional Containers, is at the beginning of the realization). In most
cases, this is not how you will want elements to be triggered.
Read more: Using Conditional Containers (page 841).

 On Event triggers can have multiple triggering signals. These are


specified by separating the discrete event or discrete change signals
with semicolons. If an On Event trigger has multiple triggering signals,
the event is triggered after all of the event signals have occurred. For
example, if two triggering signals are specified, one which occurs at 10
days, and a second at 20 days, the event will be triggered at 20 days.
 On Changed, On True and On False events are triggered whenever the
element determines that the argument to the event has changed, become
true, or become false, respectively. If the element is in a conditional
Container, it does not evaluate these arguments while it is inactive, and
therefore some On Changed, On True and On False events that occur
while the Container is inactive can be “delayed” until the element

GoldSim User’s Guide Chapter 5: Simulating Discrete Events  327


Understanding Event Triggering

activates (rather than ignored). For example, if an On True trigger is


defined as “Etime > 15 days”, and the element is inactive until 20 days,
the event will actually be triggered at 20 days (since, from the
element’s viewpoint, this is first time that it is able to determine that the
condition has become true).
Read more: Using Conditional Containers (page 841).

 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

328  Chapter 5: Simulating Discrete Events GoldSim User’s Guide


Understanding Event Triggering

triggered. If the triggering event occurs before the precedence requirement is


met, the element is triggered as soon as the precedence requirement is met.
To facilitate these kind of triggers, GoldSim allows you to specify a Precedence
Condition for a triggering event.
You add a Precedence Condition by pressing the More button on the Trigger
dialog to expand it, and then selecting the Then wait for Precedence Condition
checkbox. When you do so, the Precedence Condition field becomes available.
The field accepts any condition output or conditional expression.

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:

GoldSim User’s Guide Chapter 5: Simulating Discrete Events  329


Understanding Event Triggering

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).

330  Chapter 5: Simulating Discrete Events GoldSim User’s Guide


Understanding Event Triggering

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).

Note: If you specify both a Precedence Condition and a Required Condition,


events are evaluated as follows: If the Precedence Conditions is True when the
triggering event occurs, the Required Condition is evaluated immediately. If the
Precedence Condition is False when the triggering event occurs, the Required
Condition is not evaluated until the Precedence Condition become True.

Required Conditions can be used to simulate the equivalent of an If True


triggering event (i.e., to trigger something when it is true rather than when it
becomes true). To do so, simply use an On Changed trigger with Etime as the
argument, and a Required Condition that is the actual If True condition:

GoldSim User’s Guide Chapter 5: Simulating Discrete Events  331


Generating Discrete Event Signals

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.

Resources are an advanced feature, and by default, an element has no Resource


Requirements.

Generating Discrete Event Signals


There are five elements that can generate discrete event signals:
 Timed Events;

332  Chapter 5: Simulating Discrete Events GoldSim User’s Guide


Generating Discrete Event Signals

 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:

GoldSim User’s Guide Chapter 5: Simulating Discrete Events  333


Generating Discrete Event Signals

Note: if the Stochastic is time-dependent, GoldSim uses the distribution from


the previous timestep to compute the occurrence of the next event.

Defined cumulative event count. This event requires as input a cumulative


Count. This represents the cumulative number of events to be emitted. It
is generally entered as an expression or a link from another element (e.g., a
Time Series). It must increase monotonically (it cannot decrease with
time). If the Count increases by more than one at any given time, the
element will release multiple events simultaneously.
Remaining time to event. This event requires as input a Remaining time.
This represents the time until the next event. This event type is designed to
provide a straightforward way to insert events at specific times in the
middle of a scheduled timestep. Every time the model is updated (e.g.,
every timestep), GoldSim recomputes Remaining time and reschedules the
event. That is, this event is reset every timestep. Hence, for the event to
occur, at some point the Remaining time value should be less than the
scheduled timestep length (If the Remaining time was defined as a constant
value that was greater than the timestep length, the event would never
occur.) As an example, you could use this type of event to accurately
represent when a vehicle reached a particular destination by defining the
Remaining time as Distance_Remaining/Velocity.
Importance sampling of events is frequently necessary to evaluate the
consequences of low-probability, high-consequence events (i.e., events that
occur with a very low frequency, but have a significant impact on the system).
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
events, 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 high-consequence, low-probability events are sampled with
an enhanced frequency. That is, importance sampling serves to increase the rate
of occurrence of the event. 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 (resulting from low-probability events), without paying a high
computational price.
Importance sampling for Timed Events is specified by selecting the checkbox
for Use Importance Sampling for this element. The algorithm that is used is
discussed in detail in Appendix B.
Five points regarding importance sampling of events should be noted:
 Importance sampling can only be applied if the Occurrence Type is
“Random time intervals (Poisson)” or “Stochastic element time
intervals”.
 Importance sampling is only applied to the first occurrence of the
event. The increased sampling frequency is not applied to subsequent
occurrences within the same realization.
 Importance sampling of events should only be used for events that are
rare. As used here, “rare” indicates an event that would not adequately
be represented without enhanced sampling. As a general rule of thumb,

334  Chapter 5: Simulating Discrete Events GoldSim User’s Guide


Generating Discrete Event Signals

an event will be adequately sampled if the product of the number of


realizations and the expected number of events over the course of a
single realization is at least 10 (this would indicate that the event would
be expected to occur at least 10 times if that many realizations were
executed). For example, if the rate of occurrence of an event was once
every thousand years, and the simulation was run for 10 years, one
could expect 0.01 events per realization. If 100 realizations were run,
the total expected number of events (over all realizations) would
therefore be 1. This is a rare event and importance sampling should be
applied (or more realizations should be run).
 There is a limit to the effectiveness of importance sampling for
extremely rare events, such that in some cases, it may become
necessary to increase the number of realizations in order to effectively
represent the event. In particular, the degree of biasing for low
probability events that GoldSim can provide is (at most) equal to the
number of realizations. For example, if the rate of occurrence of an
event was once every 100,000 hours, and the simulation was run for 10
hours, one could expect 1e-4 events per realization. If 100 realizations
were run, the total expected number of events (over all realizations)
would therefore be 0.01. This is a rare event and importance sampling
should be applied. However, importance sampling could only increase
the total number of events (over all realizations) by a factor of 100 (the
number of realizations) to 1 (which would still provide inadequate
representation). If 1000 realizations were run, the total expected
number of events (over all realizations) without importance sampling
would be 0.1, but importance sampling would improve it by a factor of
1000.
 You should use importance sampling sparingly (i.e., only for those
elements that really need it). This is because, as stated above, the
degree of biasing for low probability failures that GoldSim can provide
is at most equal to the number of realizations, and the actual biasing
provided decreases with the number of elements for which importance
sampling is applied.
The importance sampling algorithm is discussed in detail in Appendix B.
With the exception of the Defined cumulative event count event type, you can
specify a Maximum Number of Events to limit the total number of events that
are generated.
Timed Event 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. A Timed Event, however, can force a
model to be updated between “scheduled” timesteps.
For example, suppose that you have specified a 10 day timestep. If a Timed
Event occurred at, say 23 days, GoldSim would 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).

Note: Timed Event elements with a Defined cumulative event count do not
influence when the model is updated.

GoldSim User’s Guide Chapter 5: Simulating Discrete Events  335


Generating Discrete Event Signals

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.

Read more: Controlling Unscheduled Updates (page 430).


Timed Events have up to two inputs (a Rate, a Stochastic, a Count, or a
Remaining time, along with the Maximum Number of Events).
Timed Events have two outputs: 1) the discrete event signal itself (the primary
output); and 2) the cumulative number of events which have been emitted during
the realization.

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 example model Timed&Triggered.gsm in the General Examples/Events


folder of your GoldSim directory contains an example of the use of Timed Event
elements.
Triggered Event Triggered Event elements produce discrete event signals based on a specified
Elements trigger. You would use a Triggered Event if you needed to trigger a number of
other elements (e.g., Discrete Change elements or Stochastics) with a single
event
The dialog for a Triggered Event is quite simple, containing only the Trigger
button:

336  Chapter 5: Simulating Discrete Events GoldSim User’s Guide


Generating Discrete Event Signals

The Trigger… button in the Triggered Event dialog provides access to a


standard Trigger dialog.
Read more: Understanding Event Triggering (page 323).
The inputs to a Triggered Event are the trigger(s) and any associated Precedence
or Required Conditions.
Triggered Events have three outputs: 1) the discrete event signal itself (the
primary output); 2) the cumulative number of events that have been emitted
during the realization; and a special output (Follow_this) that can be used to
control the calculation sequence.
Read more: Controlling the Calculation Sequence of Events (page 381).
All of these outputs appear in the browser view of the element.

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 example model Timed&Triggered.gsm in the General Examples/Events


folder of your GoldSim directory contains an example of the use of Triggered
Event elements.
Specifying Resources Triggered Events can have specified Resource Requirements.
for a Triggered Event Read more: Using Resources (page 781).

GoldSim User’s Guide Chapter 5: Simulating Discrete Events  337


Generating Discrete Event Signals

To define a Resource Requirement for a Triggered Event, press the


Resources… button in the Trigger dialog for the element. The following dialog
will be displayed:

You can add a Resource Requirement by pressing the Add button.


Read more: Interacting with Resources (page 790).
A Triggered Event interacts with the specified Resource Stores when triggered,
and can only have two types of interactions (specified in the Usage column):
 Spend (discrete): A discrete quantity of the Resource is required in
order to pull the trigger. If triggered with a Spend Requirement and the
requested Resource quantity is not available, the trigger is held (it
waits) until the Resource becomes available. If the Resource becomes
available at a later time in the simulation, this creates a delay; if the
Resource never becomes available, the trigger is never pulled.
 Deposit (discrete): A discrete quantity of the Resource is created and
deposited with the Store when the element is triggered.
Resources are an advanced feature, and you should read the sections below
before attempting to use them.
Decision Elements Decision elements allow you to better represent decision or branching logic in
your model.
Decision elements have either two or three outputs which represent discrete
event signals. When the element is triggered, it emits a discrete event signal
? from one (and only one) of its outputs, depending on a set of user-specified
conditions.
The dialog for a Decision element looks like this:

338  Chapter 5: Simulating Discrete Events GoldSim User’s Guide


Generating Discrete Event Signals

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:

GoldSim User’s Guide Chapter 5: Simulating Discrete Events  339


Generating Discrete Event Signals

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.

In this case, whenever the element is triggered, if My_Condition I True, a


discrete event signal is emitted from the “Right” output of the element (in this
case, named Decision1.Right). If My_Condition is False, but A > B, then a

340  Chapter 5: Simulating Discrete Events GoldSim User’s Guide


Generating Discrete Event Signals

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.

Note: A Decision element could be triggered multiple times within a single


update (e.g., a timestep), in which case it would output multiple events. Note,
however, that these events would all be sent to the same output (since the
Condition to test fields are only evaluated once each update).

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.

The discrete event signal outputs themselves 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 example model Decisions.gsm in the General Examples/Events folder of


your GoldSim directory contains an example of the use of Decision elements.
Random Choice Random Choice elements allow you to better represent event trees (processes
Elements consisting of specified random event sequences).
Random Choice elements have an unlimited number of specified outputs which
represent discrete event signals. When the element is triggered, it emits a
discrete event signal from one (and only one) of its outputs, depending on a set
of user-specified probabilities.
The dialog for a Random Choice element looks like this:

GoldSim User’s Guide Chapter 5: Simulating Discrete Events  341


Generating Discrete Event Signals

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:

342  Chapter 5: Simulating Discrete Events GoldSim User’s Guide


Generating Discrete Event Signals

In this case, whenever the element is triggered, GoldSim evaluates the


Probabilities, and randomly selects an Output Event based on these
Probabilities. In this particular case, there is a 10% chance that it will emit a
discrete event signal from the Left output of the element (in this case, named
RandomChoice1.Left), a 60% chance that it will emit a discrete event signal
from the Right output of the element (in this case, named
RandomChoice1.Right), and a 30% chance (1 – 0.1 – 0.6) that it will emit a
discrete event signal from the Center output of the element (in this case, named
RandomChoice1.Center).
In addition to the discrete event signal outputs associated with a Random Choice
element (which you provide a name for), an additional output is produced called
Last_Choice. This is a value which takes on an integer value of between 0 and n,
where n is the number of Output Events defined. Prior to the Random Choice
being triggered, it takes on a value of 0. After the Random Choice is triggered, it
records which of the discrete event signal outputs emitted the signal (e.g., if the
third event in the list was emitted, Last_Choice would be 3).

Note: A Random Choice element could be triggered multiple times within a


single update (e.g., a timestep), in which case it would output multiple events.
For each event, it would internally resample the Output Event.

Importance sampling is frequently necessary to evaluate the consequences of


low-probability, high-consequence events (i.e., events that occur with a very low
frequency, but have a significant impact on the system). 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 events, as this may require
excessive numbers of realizations.

GoldSim User’s Guide Chapter 5: Simulating Discrete Events  343


Generating Discrete Event Signals

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 high-consequence, low-probability events are sampled with
an enhanced frequency. That is, importance sampling serves to increase the rate
of occurrence of the event. 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 (resulting from low-probability events), without paying a high
computational price.
Importance sampling for Random Choice elements is specified by selecting the
checkbox for Use Importance Sampling for this element. The algorithm that is
used is discussed in detail in Appendix B. For Random Choice elements, when
importance sampling is applied, the alternatives are sorted by their probabilities,
and the importance sampling serves to artificially bias (increase) the likelihood
of the low probability alternatives (such that the least probable choice has the
greatest magnification).
Three points regarding importance sampling for Random Choice elements
should be noted:
 Importance sampling is only applied to the element the first time it is
triggered. The increased sampling frequency for low probability
alternatives is not applied to subsequent times the element is triggered
in the realization.
 Importance sampling of Random Choice alternatives should only be
used if at least one of the alternatives is rare. As used here, “rare”
indicates that an alternative would not adequately be represented
without enhanced sampling. As a general rule of thumb, an alternative
will be adequately sampled if the product of the number of realizations
and the probability of occurrence is at least 10 (this would indicate that
the alternative would be expected to be selected at least 10 times if that
many realizations were executed). For example, if the probability of an
alternative was 0.01 and 100 realizations were run, the total expected
number of times the alternative would be selected (over all realizations)
would therefore be 1. This is a rare alternative and importance
sampling should be applied (or more realizations should be run).
 There is a limit to the effectiveness of importance sampling for
extremely rare alternatives, such that in some cases, it may become
necessary to increase the number of realizations in order to effectively
represent the alternative. In particular, the degree of biasing for low
probability alternatives that GoldSim can provide is (at most) equal to
the number of realizations. For example, if probability of an alternative
was 1e-4, and 100 realizations were run, the total expected number of
times that alternative would be selected (over all realizations) would
therefore be 0.01. This is a rare alternative and importance sampling
should be applied. However, importance sampling could only increase
the total number of occurrences (over all realizations) by a factor of
100 (the number of realizations) to 1 (which would still provide
inadequate representation). If 1000 realizations were run, the total
expected number of occurrences (over all realizations) without
importance sampling would be 0.1, but importance sampling would
improve it by a factor of 1000. As stated above, the degree of biasing
for low probability alternatives that GoldSim can provide is at most
equal to the number of realizations. The actual degree of biasing
provided decreases with the number of elements for which importance

344  Chapter 5: Simulating Discrete Events GoldSim User’s Guide


Generating Discrete Event Signals

sampling is applied (and the algorithm is discussed in detail in


Appendix B.
The inputs to a Random Choice are the trigger(s) and any associated Precedence
or Required Conditions, as well as the Probabilities. Random Choice elements
have at least two discrete event signal outputs, along with the Last_Choice
output.

The discrete event signal outputs themselves 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 example model RandomChoice.gsm in the General Examples/Events folder


of your GoldSim directory contains an example of the use of Random Choice
elements.
Event Delay Elements Event Delay elements provide a mechanism for delaying a discrete event signal.
Once an Event Delay receives a discrete event signal, it holds it for a specified
time period, and then emits it.
The dialog for an Event Delay looks like this:

GoldSim User’s Guide Chapter 5: Simulating Discrete Events  345


Generating Discrete Event Signals

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:

346  Chapter 5: Simulating Discrete Events GoldSim User’s Guide


Generating Discrete Event Signals

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).

Read more: Controlling Unscheduled Updates (page 430).


Event Delays have at least five, and as many as six outputs:
1. the discrete event signal itself (the primary output);
2. the cumulative number of discrete signals emitted (released) by the
Delay (Cum_Emitted);
3. the number of discrete signals currently in transit within the Delay
(Num_in_Transit);
4. the number of discrete signals currently in the queue (Num_in_Queue),
which is only present if a capacity or a Resource Requirement is
specified;
5. the mean time that emitted signals have spent in the delay
(Mean_Time); and
6. the current service time (Current_Service_Time). This represents the
expected time it will take a new item (event) to transit the system. If

GoldSim User’s Guide Chapter 5: Simulating Discrete Events  347


Generating Discrete Event Signals

there is no queue (no capacity or Resource requirements specified), or


if no events have transited the system, then the current service time is
simply reported as -1 (indicating no data). If there is a queue and at
least one event has transited the system, the current service time is
approximated as the time it took the most recent item to transit the
system.
Note that the discrete event signal output itself cannot be saved or viewed as a
result.
The example model EventDelay.gsm in the General Examples/Events folder of
your GoldSim directory contains an example of the use of Event Delay
elements.
Modeling Event Delays The simplest (and most common) use of an Event Delay element is to represent
without Dispersion the delay of a non-dispersed signal. 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 event signal.
Modeling Event Delays In some cases, there may be some variability in when a signal is emitted once
with Dispersion 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.
If we conceptualize the Delay as a conveyer belt for the signal, another way to
view event 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 three different ways:
 By specifying the dispersion in terms of an Erlang dispersion factor;
 By specifying the dispersion in terms of a standard deviation; or
 By specifying a custom distribution of delay times (by referencing a
Stochastic element).
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.
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 event, the Delay Time for that event is
sampled from the following distribution:

348  Chapter 5: Simulating Discrete Events GoldSim User’s Guide


Generating Discrete Event Signals

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

GoldSim User’s Guide Chapter 5: Simulating Discrete Events  349


Generating Discrete Event Signals

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.

Specifying Capacities By checking the Maximum number of signals simultaneously processed


and Modeling Queues checkbox within the Event Delay dialog, you can specify a capacity for the
for an Event Delay Delay in the input field directly below the checkbox.
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), the number of signals in the
queue (Num_in_Queue), the mean time that all emitted signals spent in the
Delay (Mean_Time), and the time it will take any newly arriving items to transit
the system (Current_Service_Time). These latter two outputs account for both
the time spent in the queue and the time spent in transit.
These features allow you to model things such as lines at the grocery store, calls
at a call center, traffic on a road, and a wide variety of other real-world queues.

Note: The specified capacity can be a number, a link or an expression. It must


be dimensionless and non-negative. GoldSim automatically truncates the value
to an integer.

Specifying Resources Event Delays can have specified Resource Requirements.


for an Event Delay Read more: Using Resources (page 781).
To define a Resource Requirement for an Event Delay, press the Resources…
button on the main dialog for the element. The following dialog will be
displayed:

350  Chapter 5: Simulating Discrete Events GoldSim User’s Guide


Generating Discrete Event Signals

You can add a Resource Requirement by pressing the Add button.


Read more: Interacting with Resources (page 790).
An Event Delay interacts with the specified Resource Stores when a Signal
arrives in the Delay (via the Trigger dialog), and can only have three types of
interactions (specified in the Usage column):
 Spend (discrete): A discrete quantity of the Resource is required in
order to begin to process the Signal. If the requested Resource quantity
is not available, the Signal is added to the element’s queue, where it
waits for the Resource to become available.
 Borrow (discrete): A discrete quantity of the Resource is required in
order to begin to process the Signal. If the requested Resource quantity
is not available, the Signal is added to the element’s queue, where it
waits for the Resource to become available. Once the Signal leaves the
Delay, the borrowed quantity is returned to the Resource Store.
 Deposit (discrete): A discrete quantity of the Resource is created and
deposited with the Store when the element begins to process the Signal.
Resources are an advanced feature, and you should read the sections below
before attempting to use them.
Browser View of an The browser view of an Event Delay includes all of its inputs (e.g., the Delay
Event Delay Element Time, Dispersion, and Trigger) and up to six outputs:

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).

GoldSim User’s Guide Chapter 5: Simulating Discrete Events  351


Responding to Events

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.

352  Chapter 5: Simulating Discrete Events GoldSim User’s Guide


Responding to Events

Read more: Understanding Event Triggering (page 323).


Once the element is triggered, it emits a discrete change signal. A discrete
change signal contains information regarding the response to an event and
consisting of two pieces of information: a Value (e.g., 10 dollars) and an
Instruction (e.g., Add).
The Value can be a number (e.g., 10 m3) or a link. The required order (scalar,
vector or matrix) of the Value is specified in a dialog accessed via the Type…
button. The required dimensions of the Value are specified in the Display Units
field. By default, the Value is a dimensionless scalar.
The Instruction drop-list contains three choices: "Add", "Replace" and “Push”.
This instructs the element(s) receiving the discrete change signal (an Integrator
or a Reservoir) how to act upon the value being received.
While Add and Replace have obvious implications for how they are handled by
the receiving element (and are the commonly used), a Push instruction is more
complex (and used less often), and is intended specifically to facilitate modeling
of aging chains.
Read more: Modeling Aging Chains (page 752).

Note: A discrete change signal can be used as an argument to an On Event


triggering event (in the same manner that a discrete event signal can).

Read more: Specifying Triggering Events (page 324).


Discrete Change elements have three outputs: 1) the discrete change signal itself
(the primary output); 2) the cumulative number of discrete change signals that
the element has emitted during the realization (Cum_Emitted); and a special
output (Follow_this) that can be used to control the calculation sequence.
Read more: Controlling the Calculation Sequence of Events (page 381).
All of these outputs appear in the browser view of the element:

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).

The example model DiscreteChange.gsm in the General Examples/Events folder


of your GoldSim directory contains an example of the use of Discrete Change
elements.

GoldSim User’s Guide Chapter 5: Simulating Discrete Events  353


Responding to Events

Integrator elements can be instantaneously impacted by a discrete change signal.


Modeling Discrete
Changes to an Read more: Integrator Elements (page 228).
Integrator The Integrator dialog has a special input field for accepting a discrete change
signal:

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

354  Chapter 5: Simulating Discrete Events GoldSim User’s Guide


Responding to Events

A simple (and fun) application of Discrete Change elements, simulating a


bouncing ball, is included in the General Examples folder of your GoldSim
directory (Bounce.gsm).
Modeling Discrete Reservoir elements can be instantaneously impacted by a discrete change signal.
Changes to a Reservoir Moreover, a Reservoir can also produce (emit) discrete change signals.
Read more: Reservoir Elements (page 236).
The Reservoir dialog has special input fields for accepting a discrete change
signal:

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.

GoldSim User’s Guide Chapter 5: Simulating Discrete Events  355


Responding to Events

When a Reservoir receives a discrete Addition with an Add instruction, it


instantaneously adds the value of the signal to the Current Value of the
Reservoir. When a Reservoir receives a discrete Addition with a Replace
instruction, it instantaneously replaces the Current Value of the Reservoir with
the value of the signal.
If the Reservoir has an Upper Bound and this is exceeded by the discrete
Addition, the Current Value is fixed at the Upper Bound, and the Reservoir
produces (emits) a discrete change signal (Discrete_Overflow) which represents
the amount of the Discrete Addition which "overflowed" the Reservoir.
Read more: Defining Upper and Lower Bounds for a Reservoir (page 239).

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

356  Chapter 5: Simulating Discrete Events GoldSim User’s Guide


Responding to Events

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).

GoldSim User’s Guide Chapter 5: Simulating Discrete Events  357


Responding to Events

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.

358  Chapter 5: Simulating Discrete Events GoldSim User’s Guide


Responding to Events

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).

Read more: Controlling Unscheduled Updates (page 430).


Discrete Change Delays have at least three, and as many as four outputs:
1. the discrete change signal itself (the primary output);
2. the cumulative number of discrete change signals emitted (released) by
the Delay (Cum_Emitted);
3. the number of discrete change signals currently in transit within the
Delay (Num_in_Transit);
4. the number of discrete change signals currently in the queue
(Num_in_Queue), which is only present if a capacity or a Resource
Requirement is specified;
Note that the discrete change signal output itself cannot be saved or viewed as a
result.
The browser view of the Discrete Change Delay element 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).

The example model DiscreteChange.gsm in the General Examples/Events folder


of your GoldSim directory contains examples of the use of Discrete Change
Delay elements.
Modeling Discrete The simplest (and most common) use of a Discrete Change Delay element is to
Change Delays without represent the delay of a non-dispersed signal.
Dispersion

GoldSim User’s Guide Chapter 5: Simulating Discrete Events  359


Responding to Events

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

360  Chapter 5: Simulating Discrete Events GoldSim User’s Guide


Responding to Events

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:

GoldSim User’s Guide Chapter 5: Simulating Discrete Events  361


Responding to Events

Read more: Understanding Locally Available Properties (page 750).


In this example, if the Value of the incoming signal is less than 10kg, it takes 30
minutes to process; otherwise it takes 60 minutes.

Note: The ~DC_Value property is not available if the Use conveyor-belt


approach option is selected. This is because when using the conveyor-belt
approach, all signals in the delay are impacted when the Delay Time changes,
and in almost all cases, it would therefore not make sense to adjust the Delay
Time based on the attribute of one particular signal.

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).

Note: The specified capacity can be a number, a link or an expression. It must


be dimensionless and non-negative. GoldSim automatically truncates the value
to an integer.

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:

362  Chapter 5: Simulating Discrete Events GoldSim User’s Guide


Responding to Events

You can add a Resource Requirement by pressing the Add button.


Read more: Interacting with Resources (page 790).
A Discrete Change Delay interacts with the specified Resource Stores when a
discrete change signal arrives in the Delay, and can only have three types of
interactions (specified in the Usage column):
 Spend (discrete): A discrete quantity of the Resource is required in
order to begin to process the Signal. If the requested Resource quantity
is not available, the Signal is added to the element’s queue, where it
waits for the Resource to become available.
 Borrow (discrete): A discrete quantity of the Resource is required in
order to begin to process the Signal. If the requested Resource quantity
is not available, the Signal is added to the element’s queue, where it
waits for the Resource to become available. Once the Signal leaves the
Delay, the borrowed quantity is returned to the Resource Store.
 Deposit (discrete): A discrete quantity of the Resource is created and
deposited with the Store when the element begins to process the Signal.

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).

GoldSim User’s Guide Chapter 5: Simulating Discrete Events  363


Responding to Events

To illustrate this, it is instructive to consider a simple example. This example


can be found in the file Splitter.gsm in the General Examples folder of your
GoldSim directory.
In this example, a discrete change signal with an “Add” instruction is generated.
If the value is less than 100, we want to send it to one set of processes; if it is
greater than 100, we want to send it to a different set of processes. The Splitter
is used to route it in the appropriate direction:

The Splitter accomplishes this by referencing "~Amount", which is a locally


available property within the Splitter dialog:

Read more: Understanding Locally Available Properties (page 750).


This technique works because a Splitter does not propagate a discrete change
signal with a value of zero and an “Add” instruction (“Replace” and “Push”
instructions with zero values would be propagated). Hence, given the logic
specified above, only one signal is propagated whenever a discrete change signal
is received by the Splitter.

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.

364  Chapter 5: Simulating Discrete Events GoldSim User’s Guide


Responding to Events

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.

Note: The Initial Condition cannot be a function of Time.

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.

To understand how a Status element works, consider the following simple


example. Assume that a Status element defaults to False. A triggering event is
defined which sets the element to True whenever Timed Event A occurs (every
13 days). Similarly, a triggering event is defined which sets the element to False
whenever Timed Event B occurs (every 15 days).
The output of this simulation would look like this (note that in a chart, 1
corresponds to True, and 0 corresponds to False):

GoldSim User’s Guide Chapter 5: Simulating Discrete Events  365


Responding to Events

The browser view of a Status element 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).

The example model Status&Milestone.gsm in the General Examples/Events


folder of your GoldSim directory contains an example of the use of Status
elements.
Milestone Elements Milestone elements record the time that an event occurs. The Milestone element
has three outputs: the Date (calendar time) that the triggering event occurred, the
Etime (elapsed time) in the simulation that the triggering event occurred, and a
Completion Status (which is False prior to the element being triggered, and True
afterward).
Read more: Setting the Basic Time Options (page 413).
You would use a Milestone element to record the time when a particular event
occurred or condition was achieved. You could also use the Completion Status
of the Milestone to trigger other events (e.g., when Milestone X is reached,
trigger event Y).
The dialog for a Milestone element looks like this:

366  Chapter 5: Simulating Discrete Events GoldSim User’s Guide


Responding to Events

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):

GoldSim User’s Guide Chapter 5: Simulating Discrete Events  367


Responding to Events

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

368  Chapter 5: Simulating Discrete Events GoldSim User’s Guide


Responding to Events

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.

GoldSim User’s Guide Chapter 5: Simulating Discrete Events  369


Responding to Events

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.

Read more: Creating, Running and Comparing Scenarios (page 463).


The upper portion of the Milestone’s Results tab shows additional results of
interest. Two of these results are defined with respect to a defined target time
that you define (in terms of either Elapsed Time or Date). The target time
defaults to the end of the simulation.
The results displayed directly below the target time are then defined as follows:
Probability milestone achieved: This is the probability that the Milestone
is achieved during the simulation. Hence, this represents the fraction of
realizations that are included in the Elapsed Time… or Date… plots
accessd via the buttons at the bottom of the page.
Probability milestone achieved by target time: This is the probability that
the Milestone is achieved by the specified target time.
Mean lag (for late achievement): For those realizations in which the
Milestone is achieved after the target time (but before the end of the
simulation), this is the mean time after the target time that the Milestone
was achieved.
The browser view of a Milestone 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).

The example model Status&Milestone.gsm in the General Examples/Events


folder of your GoldSim directory contains an example of the use of Milestone
elements.
Triggering a By default, Stochastic elements are sampled once per realization (when their
Stochastic parent Container is first activated, which is typically at the beginning of the
realization).
Stochastics can also be triggered to resample themselves by events. This may be
useful, for example, if you wanted to resample a parameter representing the
value of a discrete change (e.g., the magnitude of a storm) every time a
particular event occurred, or if you wished to generate stochastic time histories
(e.g., a precipitation record) by sampling a Stochastic on a regular basis (e.g.,
every day).
The Resample… button in the Stochastic dialog provides access to a standard
Trigger dialog for controlling when a Stochastic is sampled:

370  Chapter 5: Simulating Discrete Events GoldSim User’s Guide


Responding to Events

Read more: Understanding Event Triggering (page 323).


By default, Sampled once is selected and this button is grayed out. This implies
that the element will be sampled only at the beginning of the simulation.
If you select the Resampled radio button, the Resample... button becomes
available, and you can define one or more triggers.

Note: If the Stochastic is not contained within a conditional Container, or if it is


contained in a conditional Container but is static (i.e., no triggers are defined
and is not otherwise a function of time), it will automatically be sampled at the
start of the realization (and never again). If it is contained in a conditional
Container and is not static (i.e., has at least one trigger defined or is otherwise a
function of time), it is automatically sampled when its parent Container
activates, and is assigned a value of zero prior to activation of the Container

Read more: Using Conditional Containers (page 841).

Note: One common requirement in models which represent a time-variable or


stochastic process is to resample a Stochastic on a regular basis (e.g., every day
or every month). You can do this in an easy way by utilizing the various Run
Properties. For example, defining an On Changed trigger as “Day” would force
the Stochastic to be triggered every day.

Note: If Stochastic X is correlated to Stochastic Y, you cannot specify that X is


to be resampled (a Stochastic that is correlated can not be explicitly resampled).
However, if Stochastic Y is resampled, then Stochastic X will also automatically
be resampled (although this is not explicitly indicated in the dialog for X).

Read more: Understanding and Referencing Run Properties (page 445);


Correlating Stochastic Elements (page 179).

GoldSim User’s Guide Chapter 5: Simulating Discrete Events  371


Responding to Events

The Interrupt element is triggered by an event, and responds by interrupting the


Interrupting a simulation. The triggering event can be a discrete event signal or another type of
Simulation event (e.g., a condition, such as X becoming greater than Y).
When the simulation is interrupted, you can display a user-defined

! message dialog with options for continuing or pausing (and


subsequently aborting) the simulation and/or you can specify that the
message is written to the run log. You also specify how to treat the
interrupted realization if the simulation is resumed (e.g., continue
realization, or keep current realization results and move to the next).
The Interrupt element has a number of potential uses:
 To alert you to error conditions that indicate a logical problem in a
model. For example, if a certain variable should not go below 0 (if it
does, it indicates a logic error in the model), you could use an Interrupt
element to check for this condition. This could be used, for example, to
test for material balance in a model that was simulating movement of
material (e.g., water).
 To help you debug a model that is crashing or showing unusual
behavior. For example, if a model crashes (or starts behaving
unusually) when certain conditions are met or at a particular time in a
simulation, you could use an Interrupt element to pause the simulation
at that point so that you can browse the model and/or save the results
up to that point in time.
 To terminate (skip to the end) of a simulation when a certain set of
conditions are met. For example, if you were carrying out a Monte
Carlo simulation of a project, the project may actually complete at a
different time each realization. When the project completes, you could
use an Interrupt element to skip to the end of the realization.
 To display status information to a user. In some cases, you may
simply want to display status information to a user who is running
GoldSim interactively (e.g., using the GoldSim Player). The message
could, for example, prompt the user to pause the model, adjust some of
the input parameters in a Dashboard, and then continue the simulation.
The dialog for an Interrupt element looks like this:

372  Chapter 5: Simulating Discrete Events GoldSim User’s Guide


Responding to Events

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

Note: During a simulation, whenever a simulation is interrupted, you also have


the opportunity to disable the Interrupt (i.e., ignore any Interrupts) for the
remainder of the simulation.

GoldSim User’s Guide Chapter 5: Simulating Discrete Events  373


Responding to Events

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

When defining an Interrupt, you can specify whether or not a message is


displayed by selecting whether to Show Message. The default is Yes.
If you choose to show a message, you enter the message in the large input field
directly below the Show Message field. The message field accepts formatted
text (in Rich Text Format). Hence, you can cut and paste formatted text from
another application into this box. You can also use the context menu for the
input field to add formatting:

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:

In addition to displaying the user-defined message, basic information about the


simulation and element that caused the interruption is reported.

374  Chapter 5: Simulating Discrete Events GoldSim User’s Guide


Responding to Events

If the Add Element and Simulation Information to Message checkbox is


cleared, 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:

GoldSim User’s Guide Chapter 5: Simulating Discrete Events  375


Responding to Events

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: Aborting a Simulation (page 461).

376  Chapter 5: Simulating Discrete Events GoldSim User’s Guide


Responding to Events

Note: When debugging a model, it is often preferable to abort a simulation and


include the partially complete realization, rather than simply browse the paused
model. This is because although you can view time history plots while a model
is paused, you cannot view tables. Debugging of a model is often facilitated by
making tables of output values. Aborting the simulation and skipping to the end
of the partially complete realization produces a file with results that can be
explored and viewed in tables.

Warning: When a simulation is interrupted, in almost all cases it will be


interrupted in the middle of an update. That is, GoldSim elements are, by
necessity, computed in a specific order (referred to as the causality sequence).
When an Interrupt is triggered, it will be done in the middle of this sequence.
That means that some of the elements will have been updated for the current
timestep, and others will not have been updated yet. Hence, it may be necessary
to view the causality sequence when browsing a model to fully understand the
current values that are displayed.

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:

The drop list contains three options:


 "No". This is the default. The message is not written to the run log.
 "As Message". The message is written to the run log.
 "As Warning". The message is written to the run log as a Warning. As
a result, a dialog is displayed at the end of the simulation indicating that
the simulation triggered a warning.

GoldSim User’s Guide Chapter 5: Simulating Discrete Events  377


Responding to Events

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).

 "Skip remainder of current Realization and Abort". 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 then aborts (keeping results for all realizations up
to that point, including the partially completed realization).
 "Discard current Realization and Abort". GoldSim discards the current
(partially completed) realization, and then aborts (keeping results for all
realizations up to that point, excluding the partially completed
realization).
 "Abort and Return to Edit Mode". The simulation is aborted and the
model is returned to Edit Mode.

Warning: When running distributed processing, sensitivity analysis or an


optimization, Interrupt messages are never displayed. Moreover, unless the
Specify Action When Message is off or cannot be shown field is set to
"Continue" or "Skip remainder of current Realization and Continue", the
Interrupt will result in a fatal error.

378  Chapter 5: Simulating Discrete Events GoldSim User’s Guide


Generating Discrete Changes Using Time Series Elements

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).

Generating Discrete Changes Using


Time Series Elements
Time Series elements can be used to generate a series of discrete changes.
Read more: Using Time Series Elements (page 187).
In order to do so, you must specify that the data that you are entering represent a
series of discrete changes. Under these circumstances, the output produced by
the Time Series element is actually a discrete change signal. You specify the
value for each signal, as well as the time that the signal is to be emitted.
For example, assume that the data series for a Time Series was defined as
follows:

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.

GoldSim User’s Guide Chapter 5: Simulating Discrete Events  379


How GoldSim Inserts Events into a Simulation

Read more: Controlling Unscheduled Updates (page 430).


The example model TimeSeries_Basic.gsm in the General Examples/TimeSeries
folder of your GoldSim directory contains an example of the use of Time Series
elements to generate discrete change signals.

How GoldSim Inserts Events into a


Simulation
When a discrete event is generated in GoldSim by certain types of elements
(e.g., a Timed Event, an Event Delay, or a Discrete Change Delay), the events
may not fall exactly on a “scheduled” timestep (i.e., a timestep that was defined
in the Time tab of the Simulation Settings dialog). That is, the events may
actually occur between scheduled timesteps.
These events 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).
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.
Read more: Understanding Timestepping in GoldSim (page 415).
By default, scheduled updates are always dynamically inserted by GoldSim.
However, in some (rare) cases, you may want to prevent unscheduled updates
from being inserted. For example, if your model included a specialized
algorithm that was designed based on the assumption that the timestep was
constant, inserting unscheduled updates could invalidate the algorithm. To
support such situations, GoldSim allows you to disable unscheduled updates.

Warning: Because unscheduled updates are intended to more accurately


represent a complex dynamic system, disabling this feature should be done with
caution, and is generally not recommended.

Read more: Controlling Unscheduled Updates (page 430).

Determining if an Event Has


Occurred
GoldSim provides a special function that can be useful in discrete event
modeling: the "Occurs" function. The Occurs function accepts a single argument
which must be a discrete event signal.
The Occurs function returns a condition (True or False). If the argument (the
discrete event signal) has occurred during the current update, the value is True,
otherwise it is False.
This can be useful in situations where you need to reference whether or not two
events have occurred simultaneously. For example, suppose that there are two
events in your simulation (Event1 and Event2), and you want to trigger a
response if and only if Event1 occurs and Event2 does not (i.e., you do not want
to trigger the response if both events occur simultaneously). A good way to do

380  Chapter 5: Simulating Discrete Events GoldSim User’s Guide


Controlling the Calculation Sequence of Events

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..

Read more: Understanding Timestepping in GoldSim (page 415); Including


Unscheduled Updates in Time History Results (page 436).

Controlling the Calculation Sequence


of Events
When you build a model, GoldSim automatically sequences the elements in the
order that they must be computed. For example if A was a function of B, and B
was a function of C, C would be sequenced first, followed by B, followed by A.
This is referred to as the causality sequence. In this simple example, the
sequence is obvious, but for complex models with looping logic the causality
sequence may not be readily apparent.
In most cases, you do not need to be concerned with how GoldSim sequences
the elements. However, in some cases (particularly when simulating systems
that include discrete changes and looping logic), expert users may need to
understand or manipulate the causality sequence. (The causality sequence can
be viewed by selecting Model|Causality Sequence from the main menu.)
Read more: The Causality Sequence and Element Updating (page 311).
Problems arise when simulating looping systems and/or systems with discrete
changes because in these cases the appropriate order of the calculations can be
ambiguous. A simple example is shown below:

GoldSim User’s Guide Chapter 5: Simulating Discrete Events  381


Controlling the Calculation Sequence of Events

For this model, in what order should the elements be calculated?


For these situations, GoldSim provides some special tools to force the
sequencing to occur in a particular order.
Read more: Addressing Ambiguous Causality Sequences (page 911).

382  Chapter 5: Simulating Discrete Events GoldSim User’s Guide


Chapter 6: Customizing the
Interface
A s Yo u L i k e I t .

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

GoldSim User’s Guide Chapter 6: Customizing the Interface  383


Customizing Toolbars

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.

384  Chapter 6: Customizing the Interface GoldSim User’s Guide


Customizing 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).

GoldSim User’s Guide Chapter 6: Customizing the Interface  385


Customizing the Appearance of the Graphics Pane

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.

Customizing the Appearance of the


Graphics Pane
GoldSim provides a number of options for customizing the graphics pane:
 You can add a background color to each Container;
 You can add a grid to each Container;
 You can adjust the size of the graphics pane in each Container;
 You can edit the appearance (e.g., shape, color) of influences in the
Container; and
 You can filter (hide) influences of certain types.
In addition, you can copy the graphical settings (e.g., background color,
influence shape) for one Container to other Containers in your model.
These options are described in detail in the sections below.
The Graphics Pane The Container dialog can be accessed by right-clicking anywhere in the graphics
Grid and Background pane and selecting Properties… from the context menu, by right-clicking on a
Container and selecting Properties, or by double-clicking on a Container.
The Graphics tab of the Container dialog provides access to options for
controlling the appearance of the graphics pane for the Container, including
viewing a grid and adding a background color:

386  Chapter 6: Customizing the Interface GoldSim User’s Guide


Customizing the Appearance of the Graphics Pane

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.

GoldSim User’s Guide Chapter 6: Customizing the Interface  387


Customizing the Appearance of the 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.

Note: The Container dialog can be accessed by right-clicking anywhere in the


graphics pane and selecting Properties… from the context menu, by right-
clicking on a Container and selecting Properties, or by double-clicking on a
Container.

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.

388  Chapter 6: Customizing the Interface GoldSim User’s Guide


Customizing the Appearance of the Graphics Pane

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.

GoldSim User’s Guide Chapter 6: Customizing the Interface  389


Customizing the Appearance of the Graphics Pane

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.

Read more: Controlling the Appearance of All Influences in a Container (page


391).
Creating a Segmented The shape of an influence can be set to either Straight, Orthogonal or Curved.
Influence by Adding Read more: Changing the Shape, Thickness and Color of an Influence (page
Nodes 389).
If the shape of an influence is defined as Straight, GoldSim allows you to add
nodes to the influence, such that it is turned into a segmented line:

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.

Note: If you change the shape of an influence to Orthogonal or Curve, all


nodes are immediately deleted.

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).

390  Chapter 6: Customizing the Interface GoldSim User’s Guide


Customizing the Appearance of the Graphics Pane

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

Note: The Container dialog can be accessed by right-clicking anywhere in the


graphics pane and selecting Properties… from the context menu, by right-
clicking on a Container and selecting Properties, or by double-clicking on 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).

Note: Some GoldSim extension modules (e.g., the Contaminant Transport


Module) may add additional output types to this list.

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.

GoldSim User’s Guide Chapter 6: Customizing the Interface  391


Customizing the Appearance of the Graphics Pane

 If you have previously changed the appearance of an influence in the


Container manually (by right-clicking on it) such that it is different
from the default settings in the Container dialog, GoldSim will treat
these as “customized influences” and will not reset them to the new
defaults unless you first check the Reset customized influences
checkbox in the dialog before pressing OK.

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).

In addition to controlling the appearance of all the influences in a Container,


GoldSim also provides the ability to copy the influence appearance settings from
one Container to other Containers in your model.
Read more: Copying Container Settings to Other Containers in a Model (page
393).
Finally, GoldSim provides you with the ability to temporarily filter (hide)
influences in a Container
Read more: Filtering Influences (page 392).

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:

392  Chapter 6: Customizing the Interface GoldSim User’s Guide


Customizing the Appearance of the Graphics Pane

Note: The Container dialog can be accessed by right-clicking anywhere in the


graphics pane and selecting Properties… from the context menu, by right-
clicking on a Container and selecting Properties, or by double-clicking on a
Container.

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).

Note: Some GoldSim extension modules (e.g., the Contaminant Transport


Module) may add additional output types to this list.

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 addition to defining the manner in which influences are filtered in a


Container, GoldSim also provides the ability to copy the influence filter settings
from one Container to other Containers in your model.
Read more: Copying Container Settings to Other Containers in a Model (page
393).
Copying Container When you insert a new Container into a model, it inherits the properties (e.g.,
Settings to Other background color, influence appearance) of its parent Container. However, this
inheritance is only applied when the new Container is created, and the properties
Containers in a Model 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).

GoldSim User’s Guide Chapter 6: Customizing the Interface  393


Customizing the Appearance of the Graphics Pane

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:

Note: The Container dialog can be accessed by right-clicking anywhere in the


graphics pane and selecting Properties… from the context menu, by right-
clicking on a Container and selecting Properties, or by double-clicking on a
Container.

When you click on this text, the following dialog is displayed:

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

394  Chapter 6: Customizing the Interface GoldSim User’s Guide


Editing the Appearance of Elements

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.

Editing the Appearance of Elements


You can edit the appearance of an element by clicking on the Appearance…
button in the element's properties dialog, or selecting Appearance… from the
context menu for the element.
This provides access to the Element Symbol Properties dialog.

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.

GoldSim User’s Guide Chapter 6: Customizing the Interface  395


Editing the Appearance of Elements

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).

396  Chapter 6: Customizing the Interface GoldSim User’s Guide


Editing the Appearance of Elements

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.

GoldSim User’s Guide Chapter 6: Customizing the Interface  397


Editing the Appearance of Elements

 Entire model: All elements in the model are modified.


The scope of the changes can be further refined by specifying the specific
element types to which the modification will be applied. This is done by
checking or clearing the boxes next to each element type in the Element types
affected portion of the dialog.
Changing the Two tabs within the Appearance dialog of an element control the appearance of
Element's Label the element's label. The Font tab controls the label's font.

The options in this dialog are self-explanatory.


The Labels tab controls the position of the label relative to the symbol.

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

398  Chapter 6: Customizing the Interface GoldSim User’s Guide


Viewing and Creating Units

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 fill consists of a background and a foreground. The Foreground Color is


superimposed on top of a Background Color according to a selected Pattern.
By default, both are transparent.

Viewing and Creating Units


One of the more powerful features of GoldSim is that it is dimensionally-aware.
You enable this capability by assigning display units (and hence dimensions) to
the elements (and hence to the inputs and outputs) of your model. You can enter
data and display results in any units
GoldSim has an extensive internal database of units (all of these units are listed
in Appendix D). You can also 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.)

GoldSim User’s Guide Chapter 6: Customizing the Interface  399


Viewing and Creating Units

Read more: Using Dimensions and Units (page 94).

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)

Note: A category does not need to have dimesnions. It can be dimensionless.

400  Chapter 6: Customizing the Interface GoldSim User’s Guide


Viewing and Creating Units

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:

GoldSim User’s Guide Chapter 6: Customizing the Interface  401


Viewing and Creating Units

SI units are displayed in blue in the dialog.

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:

402  Chapter 6: Customizing the Interface GoldSim User’s Guide


Viewing and Creating Units

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:

GoldSim User’s Guide Chapter 6: Customizing the Interface  403


Viewing and Creating Units

After selecting an existing Category or defining a new Category, press Finish.


When you do so, the new unit (and the unit Category) will be marked in red to
indicate that a custom unit has been defined:

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).

404  Chapter 6: Customizing the Interface GoldSim User’s Guide


Viewing and Creating Units

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).

Managing User-Defined There are two kinds of user-defined units:


Units  Units that are stored in your system units file, and hence are available
to any model that you edit on your computer. The system units file
(units.dat) is located in an application data subfolder on your computer
(the location of this file differs depending on the operating system).

GoldSim User’s Guide Chapter 6: Customizing the Interface  405


Viewing and Creating Units

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).

406  Chapter 6: Customizing the Interface GoldSim User’s Guide


Viewing and Creating Units

 If you copy a portion of one model which has a user-defined unit to a


second model which has the same user-defined unit with a different
definition, the definition of the unit in the second (destination) model
will be used in the combined model, and this may result in an incorrect
calculation or an invalid expression.
Using Placeholders GoldSim provides two special units that act as “placeholders” or “keywords”
for Time Units when dealing with time units in elements. The keyword is replaced by an
appropriate unit at runtime. These units are particularly useful if you plan to
change the Time display units or are switching back and forth between Elapsed
Time and Calendar Time simulations.
Read more: Defining the Time Basis and Simulation Duration (page 414).
The two keywords are “datetime” and “date”. These can be entered as the
display units (instead of an actual time unit) for an element. They cannot,
however, be combined with other units in unit strings (e.g., to form strings like
m3/date).
When running an Elapsed Time simulation, if “date” or “datetime” are the
assigned display units for an element, the Time display units (specified in the
Simulation Settings dialog) are used.
When running a Calendar Time simulation, if “date” or “datetime” are the
assigned display units for an element, the value is displayed as a date (or a date
and a time).
Note that when running a Calendar Time simulation, “date” or “datetime”
should not be used to represent a duration or an amount of time. For example,
the difference between two dates (“17 October 2009” – “1 October 2009”)
represents an amount of time equal to 16 days. If such an expression was
assigned units of “date”, it would display a Julian date as shown below (Julian
dates are computed from 30 December 1899):

Obviously, this would not be appropriate. By specifying the Display Units as


days, the value is displayed as follows:

Read more: Referencing Dates in Expressions (page 135).

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:

GoldSim User’s Guide Chapter 6: Customizing the Interface  407


The Options Dialog

The Options Dialog


The Options dialog (accessed via Model|Options from the main menu) provides
access to a number of options for controlling how GoldSim behaves.
There are always at least three tabs on the Options dialogs (some extension
modules add additional tabs).
The General Tab of The General tab of the Options dialog provides a number of options for
the Options Dialog controlling the way that GoldSim behaves. These options are listed below.
Update expressions (F9) automatically after all moves and pastes: If
this checkbox is checked (the default), GoldSim automatically updates the
model (reconnecting links) whenever an element is moved or pasted.
Otherwise, you must press F9 to update a model.
Show Run Controller in Result Mode: If this checkbox is checked, the
Run Controller is displayed when a model is in Result mode. Otherwise,
the Run Controller is hidden. It is defaulted off.
Begin simulation immediately on entering Run Mode: If this checkbox
is checked, a simulation will begin immediately when it enters Run Mode.
Otherwise, the model will pause, and you will need to press F5 (or the Run
button) again in order to start the simulation. This is useful if you want to
step through a simulation. It is defaulted on (begin simulation immediately).
Show labels of elements with note attached in blue: If this checkbox is
checked (the default), whenever a note is attached to an element, the
element’s label (which acts as a hyperlink to accesses the note) will be blue.
Otherwise, it will use the specified label color (which defaults to black).
Read more: Creating, Editing and Viewing Notes (page 709).
Save crash recovery information every X minutes: If this checkbox is
checked (the default), GoldSim saves a copy of the model file periodically
in order to allow you to recover a copy of your model file should GoldSim
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 it.
Read more: Restoring Files After an Unexpected Failure Using Auto-Save
(page 73).
Simulation Events to record in Run Log: These checkboxes allow you to
capture information about key events that may affect the behavior of your
model. Their purpose is to help you to understand and diagnose your
model’s behavior. The logging information identifies the exact time and
nature of each of the selected events. The Run Log can be viewed via the
main menu (Run | View Run Log) following a simulation. Note that once
you have used the log information to identify elements of interest you may
want to add Time History elements to track their behavior more closely, by
monitoring all of their inputs and outputs.
Read more: The Run Log (page 506).
Reservoir element state changes: This option records when Reservoirs
reach or drop below their upper bounds, and when they drop down to or
rise above their lower bounds.

408  Chapter 6: Customizing the Interface GoldSim User’s Guide


The Options Dialog

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.

GoldSim User’s Guide Chapter 6: Customizing the Interface  409


The Options Dialog

 When displaying values conventionally (i.e., not using scientific


notation), GoldSim never rounds off left of the decimal point; hence the
setting represents the minimum number of significant figures, not
necessarily the actual number of significant figures (i.e., GoldSim may
show more). For example, For example, to display 123456.7 with four
signficant figures specified, GoldSim would show 123457.
 When labeling chart axes, GoldSim respects the specified scientific
notation setting, but ignores the signficant figures setting (significant
figures in chart axes are determined automatically and cannot be user-
controlled).
 Values displayed in Result elements are limited to single precision (7
significant figures). Values in tool-tips can show up to 16 siginficant
figures.
Other options on the Results tab are as follows:
Show condition result outputs as: This allows you to select how
condition outputs are displayed in tables, tool-tips and input fields (e.g., 1/0,
True/False, On/Off, etc.).
Avoid scientific notation for currencies. If this option is checked (the
default), any value that represents a currency will never be displayed in any
result using scientific notation. If it is cleared, the rules outlined above will
be used.
Automatic Export for Result Elements. This option allows you to control
how time histories are exported from Time History Result elements in your
model. The options in the drop-list affect all Time History Result elements
which are set to export automatically when the simulation completes. The
default is “Export results after simulation”. If “Prompt before exporting
results” is selected, at the end of the simulation, you will be prompted to
determine whether or not to carry out an automatic export. If “Do not
export result” is selected, no automatic export is carried out (i.e., this
overrides the selection for each individual Result element). Pressing the
Export Now button manually exports results from all Time History Result
elements which are set to export automatically when the simulation
completes.

410  Chapter 6: Customizing the Interface GoldSim User’s Guide


Chapter 7: Running a Model
C o m p u t e r s a r e u s e l e s s. T h e y c a n o n l y g i v e
y o u a n s w e rs.

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

GoldSim User’s Guide Chapter 7: Running a Model  411


Simulation Settings

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 dialog consists of four tabs.


The Time tab is used to specify the time options for the simulation, such as
the duration of the simulation, the length of the timestep, and the units in
which time will be displayed in results.

412  Chapter 7: Running a Model GoldSim User’s Guide


Simulation Settings

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.

GoldSim User’s Guide Chapter 7: Running a Model  413


Simulation Settings

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: GoldSim supports a date range from 1 January 1700 to 31 December


9999.

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.

414  Chapter 7: Running a Model GoldSim User’s Guide


Simulation Settings

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.

Whether you are running an Elapsed Time simulation, or a Calendar Time


simulation, by referencing GoldSim’s built-in Run Properties, you can reference
calendar-based information in your models (e.g., what day of the week is it?
What month is it?). This is possible in Elapsed Time simulations also, since you
can specify the Start Time for them.
Read more: Understanding and Referencing Run Properties (page 445).

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;

GoldSim User’s Guide Chapter 7: Running a Model  415


Simulation Settings

 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.

Note: Most spreadsheet models implicitly compute accumulated values (e.g.,


flows) over a step (or the change from one step to the next). Hence, if you want
to compare or integrate GoldSim with a spreadsheet model, you should use
Reporting Periods to define your steps.

 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.

416  Chapter 7: Running a Model GoldSim User’s Guide


Simulation Settings

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.

Read more: Specifying Containers with Internal Clocks (page 434).


When specifying scheduled timesteps, 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.
You can view all of the scheduled timesteps in your simulation by pressing the
Show Scheduled Updates… button at the top of the Time tab. The following
dialog will be displayed:

This provides a summary of the scheduled timesteps you have defined (with the
final column listing the type of each time point).

GoldSim User’s Guide Chapter 7: Running a Model  417


Simulation Settings

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: By default, GoldSim always inserts unscheduled updates. However,


although it is generally not recommended, you can override the default and
instruct GoldSim not to insert the unscheduled updates. (This option is accessed
via the Advanced… button in the Time tab of the Simulation Setting dialog).

Read more: Controlling Unscheduled Updates (page 430).


A key and important difference between scheduled updates and unscheduled
updates is that scheduled updates are included in time history plots and tables
(unless you choose to exclude them). Unscheduled updates, however, 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
plotted. Only the scheduled updates are actually saved and plotted.

418  Chapter 7: Running a Model GoldSim User’s Guide


Simulation Settings

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.

Read more: Including Unscheduled Updates in Time History Results (page


436).
A simple example file illustrating unscheduled updates
(UnscheduledTimeSteps.gsm) can be found in the Timestepping subfolder of the
the General Examples folder in your GoldSim directory.
The GoldSim timestepping algorithm is discussed in detail in Appendix F.
Specifying the Basic The middle portion of the Time tab of the Simulation Settings dialog is used to
Step Length and specify the Basic Step length and the manner in which the timesteps are aligned:
Alignment

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:

GoldSim User’s Guide Chapter 7: Running a Model  419


Simulation Settings

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

420  Chapter 7: Running a Model GoldSim User’s Guide


Simulation Settings

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).

Note: The Major Period must be a multiple of the Minor Period.

GoldSim User’s Guide Chapter 7: Running a Model  421


Simulation Settings

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.

422  Chapter 7: Running a Model GoldSim User’s Guide


Simulation Settings

Note: Most spreadsheet models implicitly compute accumulated values (e.g.,


flows) over a step (or the change from one step to the next). Hence, if you want
to compare or integrate GoldSim with a spreadsheet model, you should use
Reporting Periods to define your steps.

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).

2. Results based on Reporting Periods (e.g., cumulative values over each


period, average values over each period, etc.) can be accessed and
viewed via Time History Result elements.
Read more: Viewing Reporting Period-Based Results in Time History
Result Elements (page 564).
3. When Reporting Periods are defined, a number of additional Run
Properties are created that can be referenced in your model (e.g., the
elapsed time from the start of the last Reporting Period, the remaining
time to the start of the next Reporting Period).
Read more: Understanding and Referencing Run Properties (page
445).
A simple example file illustrating Reporting Periods (ReportingPeriods.gsm)
can be found in the Timestepping subfolder of the the General Examples folder
in your GoldSim directory.
Specifying When Time If you are using Reporting Periods, time history results are always saved at the
History Results Will Be end of each reporting period. (Results are also always saved at the beginning
Saved and end of the simulation).
Read more: Defining Reporting Periods (page 421).

GoldSim User’s Guide Chapter 7: Running a Model  423


Simulation Settings

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: Saving Outputs as Results (page 453).

Note: As an advanced timestepping option, GoldSim allows you to define


shorter timesteps over a defined period. For example, if you know that early in
your simulation, 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). When this is done, the Save Every option 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.

424  Chapter 7: Running a Model GoldSim User’s Guide


Simulation Settings

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.

Note: In some cases, it may be of interest to display the values of selected


outputs that were computed not only at scheduled updates (e.g., Basic Steps and
Reporting Periods), but also at unscheduled updates (e.g., when random events
occur). To facilitate this, GoldSim provides an option to do so (under a
specified set of conditions) in the Advanced Time settings. When you display
results that show unscheduled updates, all Basic Steps are also displayed (i.e.,
for these specific displays, the Save Every option does not apply).

Read more: Understanding Timestepping in GoldSim (page 415); Including


Unscheduled Updates in Time History Results (page 436).

GoldSim User’s Guide Chapter 7: Running a Model  425


Simulation Settings

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:

This dialog is used to specify several different things:


 Adding shorter (magnified) timesteps over specified periods;
 Adding Capture Points during a simulation, at which results are
captured in order to display distributions, multi-variate results (e.g.,
scatter plots) and arrays at specified points in time.
 Controlling unscheduled updates;
 Dynamically controlling the timestep during a simulation;
 Including unscheduled updates in time history results;
 Referencing and displaying Time when editing a model; and
 Defining the first day of the week and first month of the year.
These are discussed in detail in the sections below.
Note that the settings shown above are the default settings. If any of the default
settings are changed, GoldSim indicates this in the Time tab of the Simulation
Settings dialog by placing a check on the Advanced… button:

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

426  Chapter 7: Running a Model GoldSim User’s Guide


Simulation Settings

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).

GoldSim User’s Guide Chapter 7: Running a Model  427


Simulation Settings

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.

It is important to understand how GoldSim actually schedules these Period


Timesteps, and this can best be done by considering an example. Consider a 100
day simulation with a 20 day basic timestep. By default, scheduled updates
would then occur at 0, 20, 40, 60, 80 and 100 days. Now assume that we
schedule a Period Timestep that looks like this:

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.

Note: In addition to allowing you to create a predefined schedule of timestep


changes using Period Timesteps, you can also instruct GoldSim to dynamically
adjust the timestep during a simulation based on the values of specified
parameters in your model, or adjust the timestep locally within different portions
of your model.

Read more: Dynamically Controlling the Timestep (page 431); Specifying


Containers with Internal Clocks (page 434).
A simple example file illustrating adding shorter timesteps over defined periods
(PeriodsWithShorterSteps.gsm) can be found in the Timestepping subfolder of
the the General Examples folder in your GoldSim directory.
Creating Capture Points When viewing results at the end of a simulation, you can view two types of
for Final Value Results results: Time Histories or Final Values. Final Value results are usually

428  Chapter 7: Running a Model GoldSim User’s Guide


Simulation Settings

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:

GoldSim User’s Guide Chapter 7: Running a Model  429


Simulation Settings

The Capture Time is specified as a date/time, and should be within the


specified simulation period.
When creating a Capture Point, you must provide it with an ID (which can be up
to 20 characters long). This ID is used as a label when accessing Capture Point
results in various result displays.
Read more: Viewing Results at Capture Points (page 525).
Once you have added a Capture Point, you can edit it by pressing the Edit
button, or delete it by pressing the Remove button.
When you define a Capture Point, a scheduled timestep is added at that time (if
one does not already exist).

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.

A simple example file illustrating Capture Points (CapturePoints.gsm) can be


found in the Timestepping subfolder of the the General Examples folder in your
GoldSim directory.
Controlling In order to carry out a dynamic simulation, GoldSim steps through time in
Unscheduled Updates discrete intervals (referred to as timesteps). Calculations (referred to as updates
of the model) are carried out at end of every 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).
Read more: Understanding Timestepping in GoldSim (page 415).
Scheduled updates are specified directly prior to running the model. That is,
you tell GoldSim when you want these updates to occur. 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).
By default, scheduled updates are always dynamically inserted by GoldSim.
However, in some (rare) cases, you may want to prevent unscheduled updates
from being inserted. For example, if your model included a specialized
algorithm that was designed based on the assumption that the timestep was
constant, inserting unscheduled updates could invalidate the algorithm.
To support such situations, GoldSim allows you to disable unscheduled updates.
You can do so by clearing the checkbox labeled Allow unscheduled updates
(recommended):

430  Chapter 7: Running a Model GoldSim User’s Guide


Simulation Settings

Warning: Because unscheduled updates are intended to more accurately


represent a complex dynamic system, disabling this feature should be done with
caution, and is generally not recommended. In most cases, it will have the effect
of deferring events to the next scheduled update, which under some
circumstances could cause significant inaccuracies. In some cases (e.g., a
Reservoir hitting an upper bound), its effects can be somewhat more complex
(e.g., it changes how an Overflow_Rate is computed). Some advanced features
in GoldSim cannot function properly at all without using unscheduled updates.
In these situations, GoldSim will throw a fatal error during a simulation if you
have disabled unscheduled updates and are using such a feature.

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:

GoldSim User’s Guide Chapter 7: Running a Model  431


Simulation Settings

By default, this checkbox is cleared. Checking it allows you to edit the


Maximum time between updates field, which can be used to dynamically
control the timestep (by inserting unscheduled 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.

432  Chapter 7: Running a Model GoldSim User’s Guide


Simulation Settings

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: Because certain events (e.g, triggered by a Timed Event or a Reservoir


hitting an upper bound) are automatically represented by GoldSim with greater
accuracy by allowing them to fall between scheduled timesteps, any events that
occur could result in a smaller timestep than that computed using the rules
presented above. That is, after GoldSim computes the next timestep based on
the rules presented above, it then checks to see if an event would fall within that
interval. If an event does fall into that interval, the timestep could be shortened
in order to represent the event.

Read more: Understanding Timestepping in GoldSim (page 415).


In practice, you would not normally specify the Maximum time between
updates as a constant (as you could accomplish the same thing by simply
appropriately defining scheduled timesteps. Instead, you would specify it as a
variable (i.e., a function). For example:
 If you wanted to reduce the timestep of a model from 10 days to 1 day
whenever variable X was close to (say within 10% of) variable Y, you
would define your Basic Step as 10 days, and define Maximum time
between updates as the function: if(abs(X-Y)/Y < 10%, 1 day, 10
day).
 If you wanted to reduce the timestep to 1 day for a period of 20 days
after a particular event occurred, and then return the timestep to its
default (e.g., 10 days), you could do this by: 1) triggering an Event
Delay when the original Event occurs, with a delay time of 20 days;
and 2) defining Maximum time between updates as the function:
if(EventDelay.Num_in_Transit>0, 1 day, 10 day).
In addition to providing this dynamic timestepping algorithm on a global scale
(i.e., for the entire model), GoldSim also enables you to apply a Maximum time
between updates to specific Containers. As a result, you could apply a
maximum timestep length only to a portion of your model (represented by a
particular Container).
Read more: Specifying Containers with Internal Clocks (page 434).

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).

GoldSim User’s Guide Chapter 7: Running a Model  433


Simulation Settings

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.

Read more: Including Unscheduled Updates in Time History Results (page


436).
Specifying Containers In some situations, you may wish to use different timesteps in different portions
with Internal 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 short 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.
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. When you assign an internal
clock to a Container, an Internal Clock tab is added to the Container dialog:

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).

Certain events (e.g, triggered by a Timed Event or a Reservoir hitting an upper


bound) are automatically represented by GoldSim with greater accuracy by
allowing them to fall between scheduled timesteps.

434  Chapter 7: Running a Model GoldSim User’s Guide


Simulation Settings

Read more: Understanding Timestepping in GoldSim (page 415).


An important implication of an Internal Clock Container is that any unscheduled
timesteps generated inside the Container only interrupt the clock pertaining to
that Container (and hence cause the elements in the Container to update). They
do not cause elements outside the Container to be updated.
To understand this, consider the following simple example. Suppose that your
model had a 10 day timestep. Within an Internal Clock Container, you added a
Timed Event that occurred at 5 days. This Timed Event triggered two elements:
one inside the Container and one outside the Container. In this model, the
element inside the Container would be updated at 5 days. However, the element
outside the Container would not be updated until 10 days (the first scheduled
timestep after the event occurred). That is, the unscheduled update does not
interrupt the clock outside the Container. The element outside the Container is
still impacted by the event, but not until it is updated (e.g., due to a scheduled
update, or due to an unsceheduled update triggered outside of the Container).
It is also important to understand that while unscheduled updates within an
Internal Clock Container do not cause elements outside the Container to update,
unscheduled updates outside the Container do cause elements inside the
Container to update. That is, unscheduled updates within the Container cannot
“flow” outside the Container, but unscheduled updates outside the Container do
“flow” in.
While it is important to understand this behavior with regard to unscheduled
timesteps automatically inserted by GoldSim, perhaps the most common use of
an Internal Clock Container is to manually force a shorter timestep within the
Container.
By default, the Maximum time between updates is set to 0 (and if you leave it
unchanged or set it to a negative number, it will be ignored, as a non-positive
length has no meaning).
When GoldSim starts to carry out the calculations for a Container that has an
internal clock (or after GoldSim completes a timestep within the Container), and
it is at a time we will call Tcurr, it must decide when to insert the next timstep
inside the Container.
GoldSim uses the value in the Maximum time between updates field (referred
to as DTmax below) to compute the next timestep inside the Container according
to the following rules:
1. If DTmax is greater than DTglob (the length of time until the next global
timestep), the field is ignored and the next timestep is simply the
regularly scheduled timestep (Tcurr + DTglob). (As a result, a Container
with an internal clock can never have a timestep that is longer than the
global timestep.)
2. If DTmax is less than DTglob, GoldSim computes an internal timestep
length (an unscheduled update), DTint, equal to DTglob/N, where N is the
smallest integer such that DTglob/N <= DTmax. That is, GoldSim
subdivides DTglob such that the internal step is as large as possible, but
less than or equal to DTmax.

GoldSim User’s Guide Chapter 7: Running a Model  435


Simulation Settings

Note: Because certain events (e.g, triggered by a Timed Event or a Reservoir


hitting an upper bound) are automatically represented by GoldSim with greater
accuracy by allowing them to fall between scheduled timesteps, any events that
occur could result in a smaller timestep than that computed using the rules
presented above. That is, after GoldSim computes the next timestep based on
the rules presented above, it then checks to see if an event would fall within that
interval. If an event does fall into that interval, the timestep could be shortened
in order to represent the event.

Read more: Understanding Timestepping in GoldSim (page 415).


In most cases, you will specify the Maximum time between updates as a
constant in order to specify a shorter timestep for a portion of your model (e.g.,
assigning a Maximum time between updates of 1 day to a Container in which
the global timestep is 10 days). This variable can also be specified to vary
dynamically in response to parameter values inside the Container.

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.

Read more: Including Unscheduled Updates in Time History Results (page


436).

Warning: When you assign an internal clock to a Container, the Treat as


SubSystem feature is also automatically selected (and cannot be deselected
unless you first turn off Internal Clock). That is, a Container with an internal
clock, by definition, is treated as a SubSystem. Because a Container with an
internal clock is treated as a SubSystem, this puts certain limitations on how
these Containers can be used.

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.

436  Chapter 7: Running a Model GoldSim User’s Guide


Simulation Settings

In some cases, however, it may be of interest to see the values of selected


outputs at unscheduled updates. To facilitate this, GoldSim provides an option
in the Advanced Time settings to save results at unscheduled updates (referred
to as “high resolution” results). This option appears at the bottom of the
Advanced Time Settings dialog (accessed from the Advanced… button on the
Time tab of the Simulation Settings dialog):

By default, the checkbox labeled Include unscheduled updates (high


resolution results) in scalar time histories is cleared. If you check this box,
GoldSim will save unscheduled updates for time history results (referred to as
“high resolution” results) under the following conditions:
 High resolution results can only be viewed from within Time History
Result elements. If the output is not referenced by a Time History
Result element, high resolution results will not be displayed.
Read more: Viewing Unscheduled Updates in Time History Result
Elements (page 586).
 High resolution results are only available for single realization runs
(Deterministic simulations or probabilistic simulation with a single
realization).
 High resolution results are only available for scalar outputs.
Referencing Time in When you place the cursor over an element, an input or an output prior to
Edit Mode 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 0. You can modify the value used in such a calculation by
editing Time to use for Edit Mode updates at the bottom of the Advanced
Time Settings dialog (accessed from the Advanced… button on the Time tab of
the Simulation Settings dialog):

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):

GoldSim User’s Guide Chapter 7: Running a Model  437


Simulation Settings

This information is then used in the following ways:


First day of model week
 When using “Weeks” as the Basic Step, and selecting “Calendar
aligned” for the Alignment, the specified “First day of model week”
controls where each new timestep is placed.
Read more: Specifying the Basic Step Length and Alignment (page
419).
 If you define a “weekly” Reporting Period, where the Periods are added
is controlled by how you define the “First day of model week”. Weekly
Periods are added at midnight on the specified first day of the week.
Read more: Defining Reporting Periods (page 421).

 The “DayofWeek” Run Property (a number from 1 to 7) is controlled


by how you define the “First day of model week”. The value 1
corresponds to the specified first day.
 The “WeekofYear” and “YearOfWeek” Run Properties are used to
track the week of the year. When these are incremented is a function of
the “First day of model week”.
Read more: Understanding and Referencing Run Properties (page
445).
Start of reporting year
 If you define an “annual” or “quarterly” Reporting Period, where the
Periods are added is controlled by how you define the “Start of
reporting year”. 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.
Setting the Monte The Monte Carlo tab of the Simulation Settings dialog is used to specify the
Carlo Options Monte Carlo options for a simulation. This consists of those parameters which
control how probabilistic simulations will be carried out, such as the number of
realizations, and how the sampling of Stochastic variables is to be carried out
(e.g., whether Latin Hypercube sampling is to be used).

Note: Appendix A provides an introduction to probabilistic simulation


techniques, and introduces the basic terminology required to understand the
Monte Carlo options presented in this dialog. The discussion that follows
assumes that you are familiar with the concepts discussed in that appendix.

There are two basic types of simulations that you can carry out with GoldSim:

438  Chapter 7: Running a Model GoldSim User’s Guide


Simulation Settings

 In a Probabilistic Simulation, one or more input parameters are


represented as probability distributions (and/or some processes are
represented as being stochastic) and a simulation is carried out by
running the model multiple times.
 In a Deterministic Simulation, single values are used for each input
parameter, and a simulation is carried out by running the model a single
time.
These two types of simulation are discussed in detail in the sections below.
Probabilistic Simulation To run a probabilistic simulation in GoldSim, select the Probabilistic
Options Simulation radio button in the Monte Carlo tab of the Simulation Settings
dialog (which is the default):

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

GoldSim User’s Guide Chapter 7: Running a Model  439


Simulation Settings

 repeating sampling sequences.


If Use Latin Hypercube Sampling is checked (the default), GoldSim uses Latin
Hypercube sampling. This sampling method causes probability distributions
(i.e., Stochastic elements) to be divided into a number of equally likely "strata".
This has the effect of ensuring that the space of the parameter is uniformly
spanned. When using Latin Hypercube sampling, you can choose whether each
stratum is sampled randomly (“Use random points in strata”), or if the mid-point
of each stratum is used (“Use mid-points of strata”).
In addition to Latin hypercube sampling, you can also specify importance
sampling for individual Stochastic elements. Importance sampling allows you
to over-sample the tails of a distribution.
Read more: Applying Importance Sampling to a Stochastic Element (page
182).

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.

If Repeat Sampling Sequences is checked (the default), a repeatable random


number sequence is used (based on the specified Random Seed), allowing you
to repeat the simulation exactly. If this box is cleared, the random number is
based on the current date and time, such that the random number sequence will
be different every time you run the model.

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.

The Specify Realization Weights option is an advanced feature that provides


the ability to manually specify the relative weight for each realization.
Realization weights are used to compute statistics and create the CDF. If doing
simple Monte Carlo sampling, each realization, by definition, has an equal
weight (i.e., each realization is equally likely). The primary reason to manually
specify realization weights is to carry out customized importance sampling of
Stochastic elements.
Read more: Customized Importance Sampling Using User-Defined Realization
Weights (page 953).
If you select the Specify Realization Weights box, an Insert link dialog
appears, and you must select an element that defines the relative realization
weights (e.g., equally weighted realizations could all have weight of 1). It must
be a non-negative, dimensionless scalar, and GoldSim will use the value at the
end of the realization. Obviously, to be of any value, this must vary from

440  Chapter 7: Running a Model GoldSim User’s Guide


Simulation Settings

realization to realization. If you simply link to a value that is independent of the


realization (e.g., a constant), it will have no impact on the weights.
The manner in which GoldSim implements random seeds, as well as other
details of the sampling algorithm (such as Latin Hypercube sampling and
importance sampling) are discussed in Appendix B.
The Result Options… button provides access to a dialog for contolling how
various Monte Carlo results are saved and displayed.
Read more: Controlling Monte Carlo Result Options (page 441).

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 >

GoldSim User’s Guide Chapter 7: Running a Model  441


Simulation Settings

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).

Deterministic To run a deterministic simulation in GoldSim, select the Deterministic


Simulation Options Simulation radio button in the Monte Carlo tab of the Simulation Settings
dialog:

In a deterministic simulation, a single realization will be carried out using a


deterministic value for each Stochastic element. When you do so, it is necessary
to specify what deterministic values are to be used for each Stochastic element:
As can be seen, there are three options for running a deterministic simulation:
Element Deterministic Values: In this case, the deterministic value
explicitly specified in the Stochastic element property dialog is used for
each Stochastic element.
Element Mean Values: In this case, the mean value of each Stochastic is
used (overriding any deterministic value specified for each Stochastic).
Specified Quantile: In this case, the specified quantile (a number between
0 and 1) is used (overriding any deterministic value specified for each
Stochastic).
Read more: Specifying a Deterministic Value for a Stochastic (page 181).

Note: During a deterministic simulation, delays with dispersion always use the
mean delay time, and random timed events occur regularly, not randomly.

442  Chapter 7: Running a Model GoldSim User’s Guide


Simulation Settings

Note: If the deterministic value for a Stochastic is defined as a function of time,


as is the case for a probabilistic simulation, this will only impact the Stochastic
if it is triggered to be sampled multiple times.

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.

GoldSim User’s Guide Chapter 7: Running a Model  443


Simulation Settings

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:

Read more: Understanding Locally Available Properties (page 750).

Note: Because a Global property is always referenced using a ~, a Global


property can share a name with an element. For example, if a Global property
existed named X and a Data element also existed with the same name, there
would be no conflict. The Global property would be referenced as ~X, and the
Data element's output would be referenced as X.

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

444  Chapter 7: Running a Model GoldSim User’s Guide


Understanding and Referencing Run Properties

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.

Understanding and Referencing Run


Properties
Within a simulation model, you often need to reference within input expressions
internal model variables like the elapsed time, the date/time, and the realization
number. To facilitate this, GoldSim provides a number of special reserved
names, referred to as Run Properties, that can be directly referenced in
expressions. The most commonly used Run Properties are ETime (the simulated
elapsed time) and DateTime (the simulated calendar date-time).
Read more: Referencing Time in GoldSim (page 105).

GoldSim User’s Guide Chapter 7: Running a Model  445


Understanding and Referencing Run Properties

In addition to ETime and DateTime, GoldSim also provides many additional


Run Properties that can be referenced in your model.
You can enter the names of the Run Properties directly when creating
expressions (just as you would enter the name of an output), or you can insert
them into an expression using the Insert Link dialog (accessed by right-clicking
in an input field and selecting Insert Link… from the menu).

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:

446  Chapter 7: Running a Model GoldSim User’s Guide


Understanding and Referencing Run Properties

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: Run Properties are an instance of a class of variables called Locally


Available Properties. Locally Available Properties derive their name from the
fact that in specialized cases, they may only be available, or may take on
different values (i.e., be over-ridden), in “local” parts of your model (e.g., within
particular Containers). In the case of Run Properties, they are always available
throughout the model, but some of these properties are overridden locally if a
Container is defined to have an internal clock (a local timestep).

Read more: Understanding Locally Available Properties (page 750);


Specifying Containers with Internal Clocks (page 434).

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

GoldSim User’s Guide Chapter 7: Running a Model  447


Understanding and Referencing 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.

The Caldendar Time Run Properties are described below:


DateTime: This represents the elapsed time from a reference point
(December 30, 1899 at 00:00:00 – that is, one day before the beginning of
the twentieth century). It has units of time.

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).

Read more: Referencing Dates in Expressions (page 135).


Year: This is the calendar year. It is unitless.
Quarter: This is the calendar quarter (an integer between 1 and 4),
assuming the first quarter starts on January 1. It is unitless.
Month: This is the calendar month (an integer between 1 and 12). It is
unitless.
WeekOfYear: This is the week number for the current YearOfWeek (see
below). It is a unitless integer between 1 and 53. Each week starts (and

448  Chapter 7: Running a Model GoldSim User’s Guide


Understanding and Referencing Run Properties

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.

Note: The Run Properties Year, Quarter, Month, WeekofYear,


DayOfMonth, DayofWeek, DayofYear, Hour, Minute and Second can be
particularly useful for triggering events that must occur exactly every year,
quarter, month, week, day, hour, minute or second. For example, if you had
a 1 day timestep (or smaller), defining an OnChanged trigger as DayofYear
or DayOf Month would force the element to be triggered every day. An
example file which illustrates this (Run PropertyTrigger.gsm) can be found
in the General Examples/ RunProperties folder in your GoldSim directory.

Read more: Specifying Triggering Events (page 324).

GoldSim User’s Guide Chapter 7: Running a Model  449


Understanding and Referencing Run Properties

GoldSim provides a number of special reserved names, referred to as Run


Run Properties: Properties, that can be directly referenced in expressions. Some Run Properties
Elapsed Time are associated with Elapsed Time. That is, they return information regarding the
simulated elapsed time.
These can be found under the “Elapsed Time” folder:

The Elapsed Time Run Properties are described below:


Etime: This is the elapsed time since the start of the simulation. It has units
of time.
RTime: This is the remaining time in the simulation (computed as total
duration minus the elapsed time). It has units of time.
EYear: This is the integer number of average years that have elapsed since
the start of the simulation (hence, at the start of the simulation, it is zero).
For the purposes of the calculation, an average year is computed as 365.25
days. It is unitless.
EQuarter: This is the integer number of average quarters that have elapsed
since the start of the simulation (hence, at the start of the simulation, it is
zero). For the purposes of the calculation, an average quarter is assumed to
have 365.25/4 = 91.3125 days. It is unitless.
EMonth: This is the integer number of average months that have elapsed
since the start of the simulation (hence, at the start of the simulation, it is
zero). For the purposes of the calculation, an average month is assumed to
have 365.25/12 = 30.4375 days. It is unitless.
EDay: This is the integer number of days that have elapsed since the start of
the simulation (hence, at the start of the simulation, it is zero). It is unitless.
EHour: This is the integer number of hours that have elapsed since the start
of the simulation (hence, at the start of the simulation, it is zero). It is
unitless.
EMinute: This is the integer number of minutes that have elapsed since the
start of the simulation (hence, at the start of the simulation, it is zero). It is
unitless.

450  Chapter 7: Running a Model GoldSim User’s Guide


Understanding and Referencing Run Properties

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:

The Simulation Run Properties are described below:


TimestepLength: This is the length of the current timestep. More
specifically, it is the time since the last model update. (At time = 0, the
TimestepLength is set to the length of the first scheduled timestep). Note
that under some circumstances (e.g. when creating “unscheduled updates”
to better represent discrete events, or to dynamically adjust the timestep
during a simulation), a model can be updated between scheduled timesteps,
and this will be reflected by the TimestepLength Run Property.
Read more: Understanding Timestepping in GoldSim (page 415);
Dynamically Controlling the Timestep (page 431).

Note: At Etime = 0, TimestepLength returns the anticipated length of the


first step (i.e., the length of the first scheduled timestep).

Note: An example file which illustrates the use of TimestepLength


(TimeStepLength.gsm) can be found in the General Examples/
RunProperties folder in your GoldSim directory.

Realization: This is the realization number. For a deterministic simulation,


it is always equal to 0. It is unitless.
NumOfReal: This is the total number of realizations being carried out in
the simulation.

GoldSim User’s Guide Chapter 7: Running a Model  451


Understanding and Referencing Run Properties

Note: NumOfReal actually represents the value entered into the #


Realizations field in the Simulation Settings dialog, and this is not
necessarily the same as the number of realizations that are carried out. In
some cases (e.g., if you specify a Deterministic run, if you instruct GoldSim
to run a particular realization, or if you are doing distributed processing),
GoldSim will actually only run a single realization, but would still report
the value from the # Realizations field as the NumOfReal.

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:

The Reporting Periods Run Properties are described below:


ReportingMonth: This is the current reporting month, relative to the month
specified as the “Start of reporting year” in the the Advanced Settings of the
Time tab of the Simulation Settings dialog. For example, if the “Start of
reporting year” was defined as April, and the current month in the
simulation was June, ReportingMonth would be 3; if the current month in
the simulation was April, ReportingMonth would be 1. This Run Property
is always available (even if no Reporting Periods are defined). It is unitless.
Read more: Controlling When Weeks and Years Start (page 437).
ETime_Major (where Major is the user-defined Major Period Label): This
is elapsed time since the start of the current Major Reporting Period. Note
that at the start of a new Major Period, this displays the duration of the just-
completed period. It has units of time, and is only available if a Major
Reporting Period is defined.
RTime_Major (where Major is the user-defined Major Period Label): This
is time remaining in the current Major Reporting Period. Note that at the
start of a new Major Period, this displays the duration of the period which is

452  Chapter 7: Running a Model GoldSim User’s Guide


Saving Outputs as Results

starting. It has units of time, and is only available if a Major Reporting


Period is defined.
IsNew_Major (where Major is the user-defined Major Period Label): This
is a condition which is True if the current time is the start of a Major
Reporting Period. Otherwise it is False. It is only available if a Major
Reporting Period is defined. Note that when this is True, ETime_Major
displays the duration of the just-completed period and RTime_Major
displays the duration of the period which is starting.
ETime_Minor (where Minor is the user-defined Minor Period Label): This
is elapsed time since the start of the current Minor Reporting Period. Note
that at the start of a new Minor Period, this displays the duration of the just-
completed period. It has units of time, and is only available if a Minor
Reporting Period is defined.
RTime_Minor (where Minor is the user-defined Minor Period Label): This
is time remaining in the current Minor Reporting Period. Note that at the
start of a new Minor Period, this displays the duration of the period which is
starting. It has units of time, and is only available if a Minor Reporting
Period is defined.
IsNew_Minor (where Minor is the user-defined Minor Period Label): This
is a condition which is True if the current time is the start of a Minor
Reporting Period. Otherwise it is False. It is only available if a Minor
Reporting Period is defined. Note that when this is True, ETime_Minor
displays the duration of the just-completed period and RTime_Minor
displays the duration of the period which is starting.

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.

Saving Outputs as Results


A GoldSim simulation has the potential to produce a large amount of results.
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
(GoldSim Model) file. Hence, for large models, particularly those with many
timesteps and/or multiple realizations, when in Result Mode, your model file
could potentially become very large.
In most cases, however, you will only be interested in a small subset of these
results, and GoldSim provides powerful tools to allow you to selective about
which results you save, and when they are to be saved.
Specifying Results to Before you run a model, you select the results that you wish to save. With regard
be Saved 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

GoldSim User’s Guide Chapter 7: Running a Model  453


Saving Outputs as Results

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:

454  Chapter 7: Running a Model GoldSim User’s Guide


Saving Outputs as Results

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:

Read more: Element Inputs and Outputs (page 82).


In some, but not all, of the outputs are being saved, the checkbox in the
properties dialog will become gray to indicate this:

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.

GoldSim User’s Guide Chapter 7: Running a Model  455


Using the Run Controller

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.

Read more: Understanding Timestepping in GoldSim (page 415); Specifying


When Time History Results Will Be Saved (page 423).
Highlighting Outputs In some cases, you may want to quickly ascertain which outputs in a model are
that Will be Saved set to be saved. This is important, for example, if you discovered (from the
Container dialog) that a large amount of disk space will be required to store all
of the results, and you wish to turn some of the save flags off.
GoldSim provides a quick way to do this. In particular, you can instruct
GoldSim to highlight all elements and outputs for which results are to be saved
in bold text within the browser. You do this by selecting View | Highlight
Saved Results from the main menu. You can toggle highlighting on and off
separately for Final Values and Time Histories.

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.

Using the Run Controller


Selecting Run | Run Model, pressing F5, or pressing the Run button in the
toolbar causes GoldSim to display the Run Controller:

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.

456  Chapter 7: Running a Model GoldSim User’s Guide


Using the Run Controller

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 elements cannot be added, deleted
or edited. Only cosmetic changes can be made to the model (e.g., adding
text, moving elements around the screen).
Result Mode: The model has been run and contains simulation results. In
this mode, you can navigate the model and view results, but no elements
(other than Result elements) can be added, deleted or edited. Only cosmetic
changes can be made to the model (e.g., adding text, moving elements
around the screen).
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: Creating, Running and Comparing Scenarios (page 463).
The mode that the model is in is clearly identified in the status bar (at the bottom
of the GoldSim window):

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:

Mode Can elements be edited? Run Controller visible?


Edit Yes Never
Run No Always
Result No Optional
Scenario Scenario Data only Never
Run Mode and Result Mode, and the use of the Run Controller within these
modes, are discussed in more detail in the following sections.
Carrying Out a Once you have finished editing your model, you can run the model by selecting
Simulation (Run Run | Run Model from the main menu, pressing F5, or pressing the Run button
Mode)

GoldSim User’s Guide Chapter 7: Running a Model  457


Using the Run Controller

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.

458  Chapter 7: Running a Model GoldSim User’s Guide


Using the Run Controller

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:

Read more: Pausing and Stepping through a Simulation (page 460).


Error
If a fatal error occurs while your simulation is running (e.g., if you set up a
model so that an element tries to divide by zero), a dialog explaining the error is
shown:

GoldSim User’s Guide Chapter 7: Running a Model  459


Using the Run Controller

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.

460  Chapter 7: Running a Model GoldSim User’s Guide


Using the Run Controller

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:

Simulate one realization Simulate one timestep

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:

The dialog provides you with two options:


Keep Results: This button will keep the existing results and place the
model in Result Mode.
Discard Results. This button will discard all results, and place the model in
Edit Mode.
If you are aborting during the first realization and you choose to keep
results, in order to generate results for the remainder of the partial
realization, 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 compute value).
If you are running multiple realizations, and abort after the first realization,
you will have the choice to Include results of current partially completed
realization. If this box is cleared (the default) and you choose to keep
results, the current partially completed realization will be discarded (only
the completed realizations will be saved). If this box is checked, GoldSim
will generate results for the remainder of the partial realization by skipping
to the end of the realization (i.e., skipping all further calculations for the
realization, keeping the values of all elements constant at their last compute
value).

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

GoldSim User’s Guide Chapter 7: Running a Model  461


Using the Run Controller

importantly, editing the model will be disabled. This is also indicated in the
status bar:

In addition, the cursor takes on a different appearance (it turns green).


When in Result Mode, elements with outputs that have been saved are identified
in two ways: 1) the elements (and their outputs) are bold in the browser (and
output interfaces); and 2) the element output ports in the graphics pane are green
(rather than red).
Via the Options dialog (Model | Options…), you can choose whether the Run
Controller is hidden or displayed by default when a model enters Result Mode.
Regardless of the default option selected, while in Result Mode, you can always
toggle the Run Controller on and off by pressing Ctrl+R.
Read more: Customizing the Behavior of the Run Controller (page 462).
When a model is in Result Mode, you can navigate it, open property dialogs,
and view result plots. You can also move elements around within the graphics
pane, add graphics (e.g., text, images), and add and edit result elements. 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).
Read more: Chapter 8: Displaying Results in GoldSim (page 511).
If you press F4, choose Run|Return to Edit Mode from the file menu, press the
Edit Mode button in the standard toolbar, or press the first button from the left in
the Run Controller (if visible), the results will be discarded and the model will
be returned to Edit Mode.
Customizing the You can move the Run Controller around the screen (by dragging it by the title
Behavior of the Run bar). GoldSim will remember the last location of the Run Controller (and save
this information to your Registry). Hence, if you return to Edit Mode, and then
Controller enter Run Mode again (or open a new file), the Run Controller will appear in the
same location on the screen that it last appeared.
In addition, you can make two other changes to the manner in which the Run
Controller behaves. In particular, you can control whether the Run Controller is
shown when in Result Mode, and whether a simulation starts immediately (skips
the “Ready” state and starts “Running”), or pauses at the “Ready” state when
you press F5.
Both of these options are available in the General tab of the Options dialog
(accessed via Model|Options… from the main menu:

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.

462  Chapter 7: Running a Model GoldSim User’s Guide


Creating, Running and Comparing Scenarios

Creating, Running and Comparing


Scenarios
GoldSim provides a specialized capability that allows you to create, run and
compare different scenarios for your model. Scenarios are differentiated by
having different sets of input data. In particular, different scenarios have
different values for one or more Data elements. GoldSim’s scenario modeling
capability allows you to directly compare results generated by your model by
different sets of input parameters. In effect, when you use this capability, your
model can store (and subsequently compare) multiple sets of inputs and outputs.
This can be very useful for carrying out sensitivity analyses, testing and
comparing alternative designs, and asking “what if” questions.
A simple example file which illustrates the use of Scenarios (Scenarios.gsm) can
be found in the General Examples folder in your GoldSim directory.
The details of how to create, run and compare scenarios are presented in the
sections below.

Warning: Scenarios are an advanced modeling capability. Prior to using this


capability, it is strongly recommended that you first learn how to create, run and
view model results in the standard way (without scenarios).

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):

GoldSim User’s Guide Chapter 7: Running a Model  463


Creating, Running and Comparing Scenarios

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).

How Are Scenarios GoldSim provides several ways to create scenarios.


Created? The most straightforward way to create scenarios is to use the Scenario
Manager. The Scenario Manager can be accessed from the main menu (Run |
Scenario Manager…) or by pressing F7.

464  Chapter 7: Running a Model GoldSim User’s Guide


Creating, Running and Comparing Scenarios

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:

GoldSim User’s Guide Chapter 7: Running a Model  465


Creating, Running and Comparing Scenarios

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:

466  Chapter 7: Running a Model GoldSim User’s Guide


Creating, Running and Comparing Scenarios

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.

Note: In addition to editing Scenario Data directly in your model as described


above, 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).

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):

GoldSim User’s Guide Chapter 7: Running a Model  467


Creating, Running and Comparing Scenarios

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:

468  Chapter 7: Running a Model GoldSim User’s Guide


Creating, Running and Comparing Scenarios

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).

 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).
The most straightforward way to run a scenario and place your model in
Scenario Mode is through the Scenario Manager:

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.

GoldSim User’s Guide Chapter 7: Running a Model  469


Creating, Running and Comparing Scenarios

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:

470  Chapter 7: Running a Model GoldSim User’s Guide


Creating, Running and Comparing Scenarios

Each scenario is shown and indicated in the legend.

Note: If the simulation is probabilistic, then when displaying a Time History of


scenarios, GoldSim displays a specified statistic for each scenario (e.g., the
mean), as defined in the Monte Carlo Result Options dialog.

Read more: Controlling Monte Carlo Result Options (page 441).


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.
This allows you to view detailed results for a particular scenario, as all results
for the Active Scenario will be available to view. Note that while in Result
Mode, you cannot compare scenarios (e.g., Result elements will only show
results for the Active Scenario).
Read more: Viewing Detailed Scenario Outputs in Result Mode (page 483).

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).

GoldSim User’s Guide Chapter 7: Running a Model  471


Creating, Running and Comparing Scenarios

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.

Read more: Introduction to Scenarios (page 463).


The Scenario Manager provides the primary mechanism for managing the
scenarios in your model. The Scenario Manager can be accessed from the main
menu (Run | Scenario Manager…) or by pressing F7, and looks like this:

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:

Note: By default, the scenario Description is the Analysis description specified


in the Information tab of the Simulation Settings dialog.

Read more: Viewing and Editing Model Summary Information (page 444).

472  Chapter 7: Running a Model GoldSim User’s Guide


Creating, Running and Comparing Scenarios

After entering a Scenario ID and Description, this information is displayed in


the Scenario Manager:

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..

Read more: Creating and Editing Scenarios in Dashboards (page 485).


The Style and Show columns control how and whether a scenario’s results are
displayed in charts. The Action column is used to run scenarios (or delete
scenario results).
Read more: Running Scenarios and Displaying Scenario Results (page 478).

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:

GoldSim User’s Guide Chapter 7: Running a Model  473


Creating, Running and Comparing Scenarios

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.

Note: Cloned Data elements cannot be specified as Scenario Data.

Read more: Cloning Elements (page 893).


You can edit the value for any Scenario Data element in any defined scenario
directly in this table. You cannot enter links into this table (entries must be
values, expressions containing only values, or, if the Data is a Condition, True
or False).
You can remove a Data element from the list of Scenario Data using the
Remove Element button. The Move Up and Move Down buttons allow you to
change the order of the Scenario Data elements in the list (simply for the
purpose of better organizing the data; the order has no impact on how the data is
used).
This table is very convenient because it displays all Scenario Data values for all
defined scenarios side-by-side.
Each column in the table (i.e., each scenario) has a Copy From button at the
top. Pressing this button displays a drop-list of all the other scenarios (as well as
the Live Model):

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

474  Chapter 7: Running a Model GoldSim User’s Guide


Creating, Running and Comparing Scenarios

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:

GoldSim User’s Guide Chapter 7: Running a Model  475


Creating, Running and Comparing 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).

Read more: Cloning Elements (page 893).


Here is the dialog for a Data element that has already been defined as Scenario
Data (i.e., the Scenario Data box is checked):

If you click on Scenario Data (the label, not the checkbox itself) a dialog will
be displayed indicating the values used for each scenario:

476  Chapter 7: Running a Model GoldSim User’s Guide


Creating, Running and Comparing Scenarios

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:

GoldSim User’s Guide Chapter 7: Running a Model  477


Creating, Running and Comparing Scenarios

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

478  Chapter 7: Running a Model GoldSim User’s Guide


Creating, Running and Comparing Scenarios

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.

There are two ways to place a model into Scenario Mode:


 Using the Scenario Manager to run one or more scenarios.
Read more: Generating and Deleting Scenario Results Using the
Scenario Manager (page 479).
 Transitioning directly from Result Mode to Scenario Mode.
Read more: Transitioning Directly from Result Mode to Scenario
Mode (page 484).
Generating and The most straightforward way to run a scenario and place your model in
Deleting Scenario Scenario Mode is through the Scenario Manager:
Results Using the
Scenario Manager

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:

GoldSim User’s Guide Chapter 7: Running a Model  479


Creating, Running and Comparing Scenarios

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:

480  Chapter 7: Running a Model GoldSim User’s Guide


Creating, Running and Comparing Scenarios

Note: Because, by definition, a model in Scenario Mode has at least one


scenario with results, if you delete all scenario results from the Scenario
Manager, the model will immediately return to Edit Mode.

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:

GoldSim User’s Guide Chapter 7: Running a Model  481


Creating, Running and Comparing Scenarios

Each scenario is shown and indicated in the legend.


If the simulation is probabilistic, a Distribution Result will look like this,
displaying the probability distribution for each scenario:

If the simulation is deterministic, then when displaying a Distribution Result for


scenarios, GoldSim displays a histogram showing a single result for each
scenario:

482  Chapter 7: Running a Model GoldSim User’s Guide


Creating, Running and Comparing Scenarios

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

GoldSim User’s Guide Chapter 7: Running a Model  483


Creating, Running and Comparing Scenarios

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:

484  Chapter 7: Running a Model GoldSim User’s Guide


Creating, Running and Comparing Scenarios

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

GoldSim User’s Guide Chapter 7: Running a Model  485


Running an Optimization

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

486  Chapter 7: Running a Model GoldSim User’s Guide


Running an Optimization

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.

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).
Read more: Setting the Optimization Precision (page 492); Understanding
Optimization Warning Messages (page 495).
When you complete an optimization run, GoldSim provides options for copying
the optimal values of the optimization variables to the element definitions before
carrying out any further simulations.
Defining the To prepare to carry out an optimization, select Run | Optimization… from the
Optimization Settings main menu. The following dialog will be displayed:

GoldSim User’s Guide Chapter 7: Running a Model  487


Running an Optimization

Note: You can only run an optimization from Edit Mode. You cannot run an
optimization if the model is in Result Mode.

Defining the optimization settings requires three steps:


 Specifying the objective function and any constraints;
 Specifying the optimization variables; and
 Setting the optimization precision.
These three steps are described in the sections below.
Specifying the The first step in preparing to carry out an optimization is to define an objective
Objective Function and function that is to be maximized or minimized. The objective function can be
Constraints 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.
In most cases, the objective function will represent either a cumulative value
(e.g., total accumulated cost), a peak (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).
You can also define a constraint that must be satisfied by the solution. 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.
The “Nature of Optimization Problem” section of the Define Optimization
Settings tab is used to specify the objective function and any constraints:

488  Chapter 7: Running a Model GoldSim User’s Guide


Running an Optimization

To select the Objective Function you must click on “<Click to select>”. A


dialog for selecting an output will be displayed. 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.
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 Required Condition is evaluated at the end of each realization. Solutions


that do not meet the specified condition will be dismissed, and no solutions that
violate this constraint will ever be included in the complex that is developed by
the optimizer.
Specifying the After you have defined the objective function, you need to identify one or more
Optimization Variables optimization variables that can be adjusted by GoldSim as it seeks 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.

GoldSim User’s Guide Chapter 7: Running a Model  489


Running an Optimization

Obviously, the objective function should be dependent (either directly or


indirectly) on all of the optimization variables.
The bottom half of the Define Optimization Settings tab allows you to specify
an arbitrary number of optimization variables:

You can add optimization variables by pressing the Add… button.


When you do so, a browser dialog will be displayed for selecting an output.
Optimization variables must be scalar Stochastic elements or Data elements.
They can be values or conditions.
The dialog will only list Stochastic elements and Data elements (no element
types other than Stochastics and Data elements will be listed). It will list Data
and Stochastic elements that are arrays, but if you select one, it will display an
error message.

Note: A clone can be selected as an optimization variable, but two “sister”


clones (clones of each other) cannot both be selected. If you try to do so,
GoldSim will display an error message.

Note: Only scalars can be specified as optimization variables. If you wish to


optimize a member or members of a vector or matrix, you can do so by creating
individual scalar Data elements that define the members of the vector or matrix.

Note: If a Stochastic is selected as an optimization variable, the


Probability_Density and Cumulative_Probability outputs for the element in the
model will always evaluate to 0 during the optimization runs.

After selecting an element as an optimization variable, the following dialog will


be displayed:

490  Chapter 7: Running a Model GoldSim User’s Guide


Running an Optimization

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.

Note: During the optimization process, GoldSim completely overrides the


values of the elements chosen as optimization variables. That is, the manner in
which they are defined (e.g., the distribution type for a Stochastic optimization
variable) has no impact on the optimization.

Note: During the optimization process, each run is treated as a deterministic


simulation. Hence, all Stochastic elements not defined as optimization variables
use their their determinitic value.

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.

GoldSim User’s Guide Chapter 7: Running a Model  491


Running an Optimization

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.

492  Chapter 7: Running a Model GoldSim User’s Guide


Running an Optimization

 For High Precision, convergence requires the range in objective


function values to be less than 0.00001 of the initial range or 1E4
solutions have been tried.
 For Maximum Precision, the optimizer will continue until it can no
longer improve the result, or 1E6 solutions have been tried.
In some cases, the optimization may not be able to converge within the allowed
number of iterations. In this case, GoldSim will display a warning message.
Read more: Understanding Optimization Warning Messages (page 495).
The Randomize Optimization Sequence checkbox (which is checked by
default), can be used to ensure that the initial complex is randomized every time
it is created. This can be used to help ensure that GoldSim finds a global
optimum by running the optimization more than once.
Read more: Finding a Global Optimum in Complex Models with Multiple
Optima (page 494).
Running the Once you have specified the objective function, constraints and optimization
Optimization variables, the optimization can be run. To run the optimization, simply click the
Optimize! button at the bottom of the Optimization dialog.

Note: During the optimization process, each run is treated as a deterministic


simulation. You cannot run an optimization if your Monte Carlo settings are
specified to run multiple realizations. The settings must be specified to either
run a deterministic simulation or a single probabilistic simulation (in which case
it will automatically be treated as a deterministic simulation).

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:

The Run Optimization tab is divided into two sections:

GoldSim User’s Guide Chapter 7: Running a Model  493


Running an 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).

Warning: When running an optimization, Interrupt messages are never


displayed. Moreover, unless the Specify Action When Message is off or
cannot be shown field in the Interrupt is set to "Continue" or "Skip remainder
of current Realization and Continue" (or the Interrupt is disabled), any triggered
Interrupts will result in a fatal error.

Read more: Interrupting a Simulation (page 372).

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

494  Chapter 7: Running a Model GoldSim User’s Guide


Running an Optimization

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.

Note: If the Randomize optimization sequence checkbox is cleared, each


optimization will use the same initial complex and hence will converge to the
same solution.

Although it is impossible to be sure that you have found a global optimum, if


you repeat the optimization multiple times (randomizing the initial complex) and
converge to the same solution, your confidence that you have found a global
optimum will certainly be increased.
Understanding In some cases, an optimization may not converge. In this case, GoldSim will
Optimization Warning provide one of three warning messages:
Messages Unable to create valid initial complex. Optimization failed. In order to
start the optimization, GoldSim must find 2N valid solutions, where N is the
number of optimization variables. This error indicates that GoldSim could
not find 2N valid solutions. This probably indicates that your problem is
over-constrained. That is, GoldSim could not find any combination of
optimization variables (within the bounds specified) that met the specified
constraint (the Required Condition).
Cannot improve on best solution, but failed to converge. Optimization
is probably successful. This indicates that the optimization has found a
number of valid solutions, but is “stuck” and cannot find any better
solutions (while still failing to meet the convergence criterion). In this case,
the solution is likely a good one, and it simply indicates that the
convergence criterion was too strict. You should carefully examine the Top
Results to determine if the optimal values are still significantly changing.
Solution still slowly improving, but failed to converge. Optimization is
probably successful. This indicates that the optimization has found a
number of valid solutions, and continues to slowly improve the solution, but
has not converged after a large number of iterations (100 for low, 1000 for
medium, 10,000 for high precision). In this case, the solution is likely a
good one, and it simply indicates that the convergence criterion was too
strict. You should carefully examine the Top Results to determine if the
optimal values are still significantly changing.
Optimizing a If you wish to optimize a probabilistic (uncertain) system, the objective function
Probabilistic Model to be optimized cannot be a single deterministic output. Rather, it must be a
statistic. That is, if X was an output of a probabilistic model (and hence was
output as a probability distribution), optimizing X itself would be meaningless.
Rather, you would need to optimize a particular statistic (e.g., the mean or 50th
percentile) of the output X.
In order to do this within GoldSim, you must use SubModels. In particular, you
must embed a SubModel within an outer model. The SubModel would be a
fully dynamic Monte Carlo simulation, and the outer model would be a static
optimization. The optimization variables for the outer model would be statistics
that have been exposed on the output interface of the SubModel.
Read more: Using SubModels to Embed Models Within Models (page 914).

Saving Optimization When you close the Optimization dialog, you will see a dialog with a number of
Settings and Results options:

GoldSim User’s Guide Chapter 7: Running a Model  495


Running an Optimization

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.

496  Chapter 7: Running a Model GoldSim User’s Guide


Running Sensitivity Analyses

Read more: Specifying a Deterministic Value for a Stochastic (page 181).

Running Sensitivity Analyses


GoldSim provides the ability to carry out a special type of run to facilitate
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
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 results is most sensitive.

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.

Read more: Viewing a Sensitivity Analysis Table (page 639).

Note: During the sensitivity analysis, each run is treated as a deterministic


simulation. Hence, all Stochastic elements not defined as independent variables
use their their determinitic value.

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

GoldSim User’s Guide Chapter 7: Running a Model  497


Running Sensitivity Analyses

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).

498  Chapter 7: Running a Model GoldSim User’s Guide


Running Sensitivity Analyses

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.

Note: If a Stochastic is selected as an independent variable for a sensitivity


analysis, the Probability_Density and Cumulative_Probability outputs for the
element in the model will always evaluate to 0 during the sensitivity analysis
runs.

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

GoldSim User’s Guide Chapter 7: Running a Model  499


Running Sensitivity Analyses

When GoldSim carries out a sensitivity analysis, it does so by running a series


of deterministic simulations, varying one independent variable at a time through
a range of values. You select the range of values using the Lower Bound,
Central Value and Upper Bound fields in this dialog.
Read more: Deterministic Simulation Options (page 442).
For each simulation, GoldSim must select single values for all of the other
independent variables (that are not currently being varied), and for any other
Stochastic elements in the model. The manner in which these single values are
selected is as follows:
 For Stochastics that are identified as one of the independent variables,
GoldSim uses the specified Central Value for the single value.
 For Stochastics that are not listed as one of the independent variables,
GoldSim uses the same value it would use if it were carrying out a
deterministic simulation.
 For Data elements that are identified as one of the independent
variables, GoldSim uses the specified Central Value for the single
value.
 For Data elements that are not listed as one of the independent
variables, GoldSim uses its defined value.
In order to carry out a sensitivity analysis, you must specify the range for each
variable, as well as the number of points to sample within each range.
The number of points sampled for each variable is specified in the #Points field.
This field defaults to 11, and must be an odd number.
For Data variables, you must always specify the Lower Bound, Central Value
and Upper Bound directly. You enter numbers (without units). The units are
displayed to the left of these three fields.
For Stochastic variables, you have a choice of how to define the range. If Use
quantiles for Stochastic elements is checked (the default), GoldSim defines the
bounds and the Central Value by using quantiles of the distribution. The Central
Value is always the 50th percentile. The Lower and Upper Bounds are
determined by the #Points using the following equations:

500  Chapter 7: Running a Model GoldSim User’s Guide


Running Sensitivity Analyses

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.

Read more: Viewing a Sensitivity Analysis Table (page 639).

Note: During the sensitivity analysis, each run is treated as a deterministic


simulation. You cannot run a sensitivity analysis if your Monte Carlo settings
are specified to run multiple realizations. The settings must be specified to
either run a deterministic simulation or a single probabilistic simulation (in
which case it will automatically be treated as a deterministic simulation).

GoldSim User’s Guide Chapter 7: Running a Model  501


Running Sensitivity Analyses

Warning: When running a sensitivity analysis, Interrupt messages are never


displayed. Moreover, unless the Specify Action When Message is off or
cannot be shown field in the Interrupt is set to "Continue" or "Skip remainder
of current Realization and Continue" (or the Interrupt is disabled), any triggered
Interrupts will result in a fatal error.

Read more: Interrupting a Simulation (page 372).

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:

502  Chapter 7: Running a Model GoldSim User’s Guide


Running Sensitivity Analyses

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

GoldSim User’s Guide Chapter 7: Running a Model  503


Running Sensitivity Analyses

their deterministic values, GoldSim runs n deterministic simulations,


where n is the number specified by #Points. For each simulation, the
first Independent Variable is varied from its Lower Bound to its
Upper Bound.
2. The process is repeated for each Independent Variable.
Once it carries out these simulations, it uses the results to construct an X-Y
function chart such as this:

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:

504  Chapter 7: Running a Model GoldSim User’s Guide


Running Sensitivity Analyses

(Value - Lower Bound)


Normalized Value 
(Upper Bound - Lower Bound)

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).

GoldSim User’s Guide Chapter 7: Running a Model  505


The Run Log

The Run Log


Whenever you run a GoldSim model, a Run Log is produced. 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.
If your simulation generates any warning messages during the run, you will
immediately be prompted to view the Run Log when the simulation completes.
The Run Log can also be viewed at any time after a simulation is completed by
selecting Run|View Run Log in the main menu.
The Run Log is automatically viewed by whatever application is associated with
".txt" files (typically Notepad or WordPad).

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).

A simple Run Log is shown below:

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”.

506  Chapter 7: Running a Model GoldSim User’s Guide


Running GoldSim from the Command Line

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”.

The Run Log is divided into four parts.


 The first part shows the GoldSim version number, the time the
simulation was begun (in effect, a timestamp for the run), the total
simulation time, and the Analysis Description. If you are calling any
external functions (via an External element), the version numbers for
the external functions are also recorded.
 The second part shows all of the simulation settings, summarizing
exactly how the simulation was carried out.
 The third part shows any warning and error messages associated with
the run. If the run has been aborted, this will be indicated here.
 The fourth part reports whether (and when) any elements have been
downloaded from a database prior to running the model.
Read more: Linking Elements to a Database (page 972).
The Run Log is important because it provides an internal, uneditable "audit trail"
for the run. By looking at the Run Log, you can immediately see key
information like when the model was run, what version of GoldSim was used,
and whether (and when) input data was downloaded from a database.

Running GoldSim from the Command


Line
In some cases, it may be useful to bypass the Run Controller and run GoldSim
directly from the command line.
This, for example, could be done by selecting Run from the Windows Start
menu, which displays the following dialog:

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.

GoldSim User’s Guide Chapter 7: Running a Model  507


Running GoldSim from the Command Line

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.

Parameter Description Comments


-show name Opens GoldSim and Used if you want a GoldSim
jumps to the model to simply open immediately
specified Container and display the contents of a
or Dashboard specific Container or Dashboard.
If this parameter is used to
reference a Container name that is
used multiple times within a
model (within localized
Containers), GoldSim opens the
first Container with the specified
name found while searching
downward through the
containment hierarchy.
-r Opens the GoldSim In this situation, GoldSim
-run file and immediately automatically skips the “Ready”
runs the simulation. state and starts the simulation.
-getdb [date] Executes a global The date is only required for
database download Yucca Mountain databases. The
for all elements date must be specified in local
linked to databases. format and be enclosed in quotes
(e.g., “7 March 2013”).
-x Closes GoldSim after Note that unless auto-save is
all other options have enabled (in the Options dialog), or
been executed. the –sv parameter was used, the
GoldSim model file will NOT be
saved when the application is
closed.
-sv [filename] Saves the model file This option can be used to run and
-save [filename] using either the save a model, or to open a model
optionally provided and save it in a newer version of
output filename, or GoldSim.
the input filename (if
an output file is not
provided).
-s Opens GoldSim in Used when running models on
-slave Slave Mode. multiple processors using
GoldSim’s distributed processing
features (GoldSim Distributed
Processing Module). This
command cannot be used with any
other parameters.

508  Chapter 7: Running a Model GoldSim User’s Guide


Running GoldSim from the Command Line

Parameter Description Comments


-d Inserts the provided This parameter allows you to
“element.input=equation” equation into the change the contents of an input
-data specifed input for the field for any element in GoldSim
“element.input=equation” specified element. using the command line.
The input can be omitted (only the
element name needs to be
specified) if the input name is
“Definition” (e.g., for Data and
Expression elements).
This parameter is particularly
useful if you want to stack a
number of runs in a batch file,
with each run changing one or
more element definitions.

Examples of how some of these parameters would commonly be used are


provided below. Note that these parameter strings would follow the name (and
path) of the GoldSim executable (goldsim.exe).

Command line Comments


-x –sv test1.gsm Opens test1.gsm, saves it, and closes GoldSim.
Useful, for example, if you want to convert
test1.gsm to the latest GoldSim version.
-x –sv test2.gsm test1.gsm Opens test1.gsm, saves it as test2.gsm, and
closes GoldSim. Only the destination model
(test2 in this case) is saved. Useful, for
example, if you want to convert test1.gsm to
the latest GoldSim version, but preserve the
original file.
-r test1.gsm Opens test1.gsm, executes pre-run checks and
starts the simulation. GoldSim remains open
after the simulation. The model file is only
saved if auto-save is enabled in the Options
dialog.
-r –sv test1.gsm Opens test1.gsm, executes pre-run checks and
starts the simulation. At the end of the
simulation, the model file is saved. GoldSim
remains open after the simulation.
-r –sv –x test1.gsm Opens test1.gsm, executes pre-run checks and
starts the simulation. At the end of the
simulation, the model file is saved. GoldSim is
then closed.
-r –sv test1res.gsm test1.gsm Opens test1.gsm, executes pre-run checks and
starts the simulation. At the end of the
simulation, the model file is saved to
test1res.gsm. GoldSim remains open after the
simulation.
-slave Starts GoldSim in Slave mode. This command
cannot be used with any other parameters.

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.

GoldSim User’s Guide Chapter 7: Running a Model  509


Running GoldSim from the Command Line

 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:

Command line Comments


-d “Data1=5m3” Puts the value of 5 m3 into the input of element
Data1. This would only be valid if Data1 had
an input named Definition (e.g., if it was a Data
element or Expression element).
-d “Pond.Initial Value = 10m3” Puts the value of 10 m3 into the Initial Value
input of element Pond (in this case, a
Reservoir).
-d “X = if(etime>5day,1,2)” Puts the expression if(etime>5day,1,2) into the
input of element X. This would only be valid if
X had an input named Definition (e.g., if it was
a Data element or Expression element).
-d “Data1=5m3” –d “Data2=5sec” Puts the value of 5 m3 into the input of element
Data1, and 5 sec into the input of element
Data2. This would only be valid if Data1 and
Data2 had an input named Definition (e.g., if
they were Data or Expression elements).

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:

CD c:\Program Files\GTG\GoldSim 10.1


Start /wait GoldSim.exe -r -sv r1.gsm -d "InputA=10m" -x c:\runs\input.gsm
Start /wait GoldSim.exe -r -sv r2.gsm -d "InputA=20m" -x input.gsm
Start /wait GoldSim.exe -r -sv r3.gsm -d "InputA=30m" -x input.gsm
Start /wait GoldSim.exe -r -sv r4.gsm -d "InputA=40m" -x input.gsm
The first line simply sets the directory to the location of the GoldSim executable.
The next line opens a GoldSim model called input.gsm. By specifying the path
here, this sets the path for all input and output files in the remainder of the batch
file. GoldSim changes the value of InputA to 10m, runs the model and saves it
as r1.gsm. GoldSim then closes. After closing, the next GoldSim command is
implemented (open input.gsm again, change InputA to 20m, run and save the
model to r2.gsm). This continues until all four GoldSim runs are complete.

510  Chapter 7: Running a Model GoldSim User’s Guide


Glossary of Terms
Active Scenario
When scenarios have been defined, the scenario that is being viewed when you
are browsing a model.
Affects View
A special browser view in GoldSim that allows you to see all the elements the
selected element affects.
Alias
The name by which an exposed output of a localized Container is referenced.
Allocator
An element that allocates an incoming signal to a number of outputs according
to a specified set of demands and priorities. Typically, the signal will be a flow
of material (e.g., water), but it could also be a resource, or a discrete transaction.
Array
A collection of variables that share common output attributes and can be
manipulated in GoldSim elements or input expressions.
Array Labels
A collection of labels identifying the items of an array.
Autocorrelate
To correlate a Stochastic element to a previous value of itself.
Browser
An alternative view of a GoldSim model, in which elements are displayed in a
tree, and organized either hierarchically, or by type.
Built-in Constants
Constants (such as pi) that are built-in to GoldSim and can be used when
creating expressions in input fields.
Built-in Functions
Mathematical functions (such as sine, maximum, round) that are built-in to
GoldSim and can be used when creating expressions in input fields.
Cancellation Code
An alphanumeric code generated by GoldSim that can be used to verify that a
registration has been terminated.
Causality Sequence
The specific order in which GoldSim updates (computes) elements every
timestep.

GoldSim User’s Guide Glossary of Terms  1081


Change Note
A note added to an element when using versioning that is subsequently
displayed when showing changes.
Chart Style
A collection of settings for a particular type of result display chart.
Clones
Sets of elements whose properties change simultaneously when any one member
of the set is edited.
Complementary Cumulative Distribution Function
The complement of the cumulative distribution function.
Conceptual Model
A representation of the significant features, events and processes controlling the
behavior of a system.
Condition
An output Type. A Condition is a Boolean switch (e.g., Yes/No, True/False,
On/Off).
Conditional Expression
An expression which evaluates to (produces) a Condition (rather than a Value).
Conditional Tail Expectation
The expected value of the output given that it lies above a specified quantile.
That is, it represents the mean of the worst 100(1 - α)% of outcomes, where α is
the specified quantile.
Container
An element that acts like a "box" or a "folder" into which other elements can be
placed. It can be used to create hierarchical models.
Convolution Element
An element that solves a convolution integral.
Coupled Link
A link between two elements which causes the elements to be solved in a
coupled (rather than a sequential) manner. Coupled links can only be created
when using an extension module.
Cumulative Distribution Function
The integral of a probability density function.
Data Source
A source of data external to your GoldSim model that can be automatically
imported into GoldSim elements. External data sources are either spreadsheets,
text files, databases or DLLs.
Date-time Simulation
A simulation that tracks time using the simulated Date/time.

1082  Glossary of Terms GoldSim User’s Guide


Delay Elements
A class of elements that simulate processes that delay continuous or discrete
signals and flows. The output of a delay element lags its inputs.
Deterministic Simulation
A simulation in which the input parameters are represented using single values
(i.e., they are "determined" or assumed to be known with certainty).
Dimensions
An output attribute for an element that defines the dimensionality (in terms of
Length, Time and other fundamental dimensions) of the output.
Discrete Change
An element that generates discrete change signals that can subsequently modify
stock elements.
Discrete Change Signal
A discrete signal that contains information regarding the response to an event.
Discrete Event Signal
A discrete signal indicating that something (e.g., an accident, an earthquake, a
bank deposit) has occurred.
Discrete Signal
A special category of output that emit information discretely, rather than
continuously.
Display Units
The units (e.g., m, g, $/day) in which an output is displayed within GoldSim.
Drawing Tools Toolbar
A toolbar at the top of the GoldSim interface that provides buttons for adding
graphical components to your model.
Edit Mode
The state of a model when it is being edited and does not contain simulation
results.
Elapsed Time Simulation
A simulation that tracks time using the elapsed time.
Euler Integration
A simple and commonly used numerical integration method.
Exposed
Description of an output within a localized Container that can be referenced
outside of the Container.
Expression Element
A function element that produces a single output by calculating user-specified
mathematical expressions.

GoldSim User’s Guide Glossary of Terms  1083


External Functions
User-defined modules that can be linked to GoldSim at runtime as Dynamic
Link Libraries (DLLs).
Feedback Loop
A circular system in which the variables in the loop impact each other, but do
not respond instantaneously. Feedback loops contain at least one state variable.
Function Elements
Elements that instantaneously compute outputs based on one or more defined
inputs.
Function Of View
A special browser view in GoldSim that allows you to see all the elements that
affect the selected element.
Graphical Objects
Objects in GoldSim that are used to embellish or document the model.
Graphics Pane
The primary portion of the GoldSim interface, where the graphical depiction of
the model is shown.
History Generator
An element that generates stochastic time histories of variables. A stochastic
time history is a random time history that is generated according to a specified
set of statistics.
Importance Sampling
An algorithm that biases sampling of probability distributions in order to better
resolve the tails of the distributions.
Information Delay
A delay element that delays information signals, and does not enforce
conservation of the signal.
Input Elements
Elements that are used to define basic inputs for a model.
Installation Code
An alphanumeric code which is automatically generated when you install
GoldSim.
Interactive Result
A result display that is shown in a modal window (i.e., windows that always
retain the focus). Interactive results can be converted to modeless Result
elements.
Keywords
Text delimited by the % symbol (e.g., %x_unit%) that can be used when
creating chart styles to insert context sensitive text (e.g., for axis labels).

1084  Glossary of Terms GoldSim User’s Guide


Kurtosis
A measure of how "fat" a distribution is relative to a normal distribution with the
same standard deviation. A normal distribution has a kurtosis of 0. The kurtosis
is a function of the fourth moment of the distribution.
Latin Hypercube Sampling
A stratified sampling method that has the effect of better ensuring that the space
of the parameter is uniformly spanned.
Link Cursor
A special cursor for creating links invoked by double-clicking on an input or
output object in a browser.
Live Model
When using GoldSim’s scenario features, a “scratch” model, or a temporary
placeholder model where you can experiment before saving something as a
scenario.
Localize
An action that you can apply to a Container that creates a separate scope for the
elements in that Container.
Lookup Table Element
A function element that allows you to create a 1, 2, or 3-dimensional lookup
table (response surface).
Material
Tangible things (water, dirt, cash, widgets) that are tracked in a simulation.
Material Delay
A delay element that delays flows of materials (e.g., masses, volumes, items).
Mathematical Model
A set of input assumptions, equations and algorithms describing the behavior of
a system.
Matrix
A two-dimensional array.
Mean
The expected value (average) of a distribution. It is the first moment of the
distribution.
Median
The 50th percentile of a distribution.
Menu Bar
A bar at the top of the GoldSim interface that provides access to menus from
which nearly any GoldSim operation can be carried out.
Model Objects
Objects in GoldSim that are used to quantitatively represent the variables and
relationships in a model. The primary model object is the element.

GoldSim User’s Guide Glossary of Terms  1085


Model Root
The top-level Container in a GoldSim model.
Modes
The states that a GoldSim model can be in at a given time. There are three
modes: Edit Mode, Run Mode, and Result Mode.
Monte Carlo Simulation
A method for propagating (translating) uncertainties in model inputs into
uncertainties in model results.
Normal Link
A standard link between two elements.
Note Pane
A dockable window in GoldSim that displays a Note associated with the
selected element.
Numerical Integration
An approximate solution to an integral equation, carried out by discretizing a
variable (e.g., time) into discrete intervals.
Output Attributes
Three properties of an element's output that determine the kinds of inputs to
which it can be linked: type, order and dimensions.
Pan Cursor
A special cursor for panning the graphics pane invoked via the Zoom toolbar.
Performance Measure
A specific model output by which you judge the performance of a system.
Plot Points
Points in time at which the value of outputs are saved for plotting time history
data.
Ports
Small arrows on the side of the element in the graphics pane. You can left-click
on a port to access the element's inputs and outputs.
Precedence
The order in which mathematical operators are evaluated in an expression.
Previous Value Element
An element that outputs the value of its input from the previous model update.
Primary Output
For an element with multiple outputs, the output that has the same name as the
element.

1086  Glossary of Terms GoldSim User’s Guide


Probabilistic Simulation
A simulation in which the uncertainty in input parameters is explicitly
represented by defining them as probability distributions.
Probability Density Function
A plot of the relative likelihood of the values of an uncertain variable.
Probability Distribution
A mathematical representation of the relative likelihood of a variable having
certain specific values.
Probability Histories
A probabilistic representation of the time history of an output in which the
percentiles for multiple realizations are plotted.
Probability Mass Function
A plot of the relative likelihood of the values of a discrete uncertain variable.
Realization
A single model run within a Monte Carlo simulation. It represents one possible
path the system could follow through time.
Recursive Loop
A system with circular logic that does not contain any state variables.
Reference Version
The version to which your current model is compared when tracking changes.
Registration Code
An alphanumeric code provided to you when you license GoldSim. This code is
required in order for you to register and run GoldSim.
Registration Key
An alphanumeric code sent to you if you are manually registering GoldSim
(rather than registering it via the Internet).
Reporting Periods
Regular time points during a simulation (e.g., every month, every year) at which
you can compute and view results associated with that period (e.g., monthly
averages, annual cumulative values).
Reservoir
A stock element that integrates and conserves flows of materials.
Resource
Something that has a limited supply (e.g., spare parts, fuel, skilled personnel,
money) and is required in order for elements of the modeled system to carry out
certain actions.
Result Element
An element that can be used to organize, analyze and display results.

GoldSim User’s Guide Glossary of Terms  1087


Result Mode
The state of a model when it has been run and contains simulation results for a
single set of input parameters.
Run Controller
A dialog used to control the manner in which a GoldSim simulation is run.
Run Log
Text that is stored with a GoldSim model that is in Result Mode. It contains
basic information regarding the simulation, and any warning or error messages
that were generated.
Run Mode
The state of a model when it is running.
Run Properties
A set of fundamental properties that track the progress of the simulation (e.g.,
Time, Realization) and can be referenced like outputs in expressions.
Scalar
An output consisting of a single value or condition.
Scenario Data
Data elements that differentiate the various scenarios in a model.
Scenario Manager
A dialog that allows you to create, define and run scenarios.
Scenario Mode
The state of a model when it contains scenario results, allowing multiple
scenarios to be compared.
Scenarios
Models with specific sets of input parameters. In particular, different scenarios
have different values for one or more Data elements.
Scheduled Timesteps
Timesteps that are directly specified by the user prior to running the model.
Scope
The portion of a model from which an element's output can be referenced. You
cannot reference an element in a different scope unless that output is specifically
exposed.
Script Element
An element that can be used to create a list of executable statements (e.g.,
variable definitions, variable assignments and statements controlling the
sequence of execution such as loops and if statements) in order to implement
complex logic and operations.
Secondary Output
For an element with multiple outputs, an output that has a different name than
the element.

1088  Glossary of Terms GoldSim User’s Guide


Simulation Model
The implementation of a mathematical model of a system within a specific
computational tool (or set of tools).
Skewness
A measure of the symmetry of a distribution. A symmetric distribution has a
skewness of 0. The skewness is a function of the third moment of the
distribution.
Splitter
An element that splits an incoming signal between a number of outputs based on
specified fractions or amounts. Typically, the signal will be a flow of material
(e.g., water), but it could also be a resource, or a discrete transaction.
Spreadsheet Element
An element that can dynamically link to an Excel spreadsheet.
Standard Deviation
The square root of the variance of a distribution. The variance is the second
moment of the distribution and reflects the amount of spread or dispersion in the
distribution.
Standard Toolbar
A toolbar at the top of the GoldSim interface that provides buttons for common
GoldSim actions.
State Variable
The output of an element in GoldSim whose value is computed based on the
historical value of the element’s inputs (as opposed to only being a function of
the current value of the element’s inputs). State variables have well-defined
initial conditions. Feedback loops can only be created if they contain at least one
state variable.
Status Bar
A bar at the bottom of the GoldSim interface that provides information
regarding the status of the model.
Stochastic
An element that can be used to quantitatively represent the uncertainty in a
model input.
Stock Elements
A class of elements that numerically integrate inputs, and hence are responsible
for internally generating the dynamic behavior of many systems.
Store
Stockpiles or places where a Resource (e.g., parts, personnel) is stored or located
when not being used. Resource Stores can be thought of as having physical
locations in the system you are modeling. The can be global or local (associated
with a Container).
Style File
An external file which stores chart style that you can import.

GoldSim User’s Guide Glossary of Terms  1089


SubModel
A specialized element that allows you embed one complete GoldSim model
within another GoldSim model. This facilitates, among other things,
probabilistic optimization, explicit separation of uncertainty from variability,
and manipulation of Monte Carlo statistics.
SubSystem
A specialized Container that is completely “self-contained”. SubSystems can
take on some useful features and properties (e.g., conditionality, having an
internal clock, and being able to loop), but also have some limitations (with
regard to how they can be incorporated into feedback loops).
System Units File
A file on your hard drive (named units.dat) that stores all of your unit settings.
Table Function
A special function for referencing user-defined lookup tables that can be
referenced in input fields. It is automatically created whenever you create a
Lookup Table element.
Timed Event
An element that generates discrete event signals based on a specified rate of
occurrence.
Timestep
A discrete interval of time used in dynamic simulations.
Total System Model
A simulation model that 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.
Unit Categories
A category of units defined by a name (e.g., Area) and a specific set of
dimensions (Length^2).
Unit Strings
Strings containing only unit abbreviations used to define compound units (e.g.,
m/sec, lbf/m2).
Unscheduled Updates
Timesteps that are inserted automatically by GoldSim during a simulation and
are not directly specified by the user prior to running the model.
Vector
A one-dimensional array.
Version
A "snapshot" of your model at a particular point in time.
Versioning
The process of tracking changes that you make to your model file.

1090  Glossary of Terms GoldSim User’s Guide


Affects View 117
SubModels 950
Index Aliases for exposed outputs 890
Aligning objects 718
Alignment of timestep 419
Allocator elements 257
Analysis description 444
.  And elements 288
.GSM extension 72 Annuity, computing 132
Appearance
of charts 661
2  of elements 395
2D scatter plots 635 of graphic objects 700
of hyperlinks 715
of influences 389
3  of text boxes 705
3D scatter plots of text objects 702
described 637 Appendices, list of 6
Arccosine function 128
Archiving files
A  with results 456
Aborting a run 461 Arcsine function 128
Absolute value function 129 Arctangent function 128
Accuracy of simulation models Array labels
1076 creating 728
Activating deleting 732
conditional Containers 846 understanding 727
extension modules 26 Array results 648
Activation event controlling chart style 659
output of conditional Container defined 518
846 displaying conditions 656
Active Scenario 467 screening results 658
Activity status viewing a matrix chart 653
output of conditional Container viewing a vector chart 651
845 viewing multiple realizations 658
Adding viewing properties 649
graphic objects to graphics pane viewing tables 656
697 Arrays
hyperlinks in graphics pane 712 copying between models 750
hyperlinks in Notes 711 creating with constructor
hyperlinks in text boxes 706 functions 738
images to graphics pane 707 creating with Data elements 733
multiple outputs to a distribution creating with Stochastic elements
display 611 737
multiple outputs to time history defining and assigning in scripts
display 544 812
new elements 82 displaying time histories 547
nodes to influences 390 functions that operate on 743
notes to elements 709 introduction 49
outputs to a multi-variate display manipulating in expressions 742
629 manipulating with elements 748
Result elements 527 plotting time histories of multiple
shapes to graphics pane 697 realizations 562
text boxes to graphics pane 704 referencing an item 736
text to an influence 390 using 726
text to graphics pane 701 using as lookup tables 740

GoldSim User’s Guide Index  1091


viewing in browsers 735 Buttons
Arrows between elements in toolbars 69
(influences) 102
Assisted registration 9 C 
Auto triggers in Conditional
Containers 849 Calculation logic 309
Autocorrelate 180 Calendar Time simulation 414
Autocorrelating Stochastics 180 Canceling a license 13
Automatic triggering 326 Cancellation Code 13
Auto-save 73 Capture points 428
Auto-suggesting input links 89 Capture points for timesteps
Axes in charts 664 viewing results at 525
Casting units 98
Categories of elements 150

Causality sequence 311, 908
Background ambiguous 317
changing for element 398 invalid 317
in graphics pane 386 modifying 911
Basic step length 419 viewing 909
Batch runs 507 CCDF 985
Bayesian updating 956 CDF 985
Bessel function 130 computing 1021
Beta distribution 162, 163, 996 Ceiling function 129
Beta function 130 Change control 963
BetaPERT distribution 163 Change Note 970
Binomial distribution 164, 997 Changed function 130
Boolean distribution 165, 997 Changing
Bounds element appearance 395
for Reservoirs 239 element background and outline
Braces, to identify units 96 398
Brackets, to reference array items element labels 398
736 element symbols 396
Browser graphic object appearance 700
activating 110 image appearance in graphics
context menu for 112 pane 707
deactivating 110 influence appearance 389
described 69 size of graphics pane 388
display tool-tips 71 text appearance in graphics pane
docking 110 702
hiding 110 text box appearance in graphics
moving location 110 pane 705
Search field 116 toolbars 385
synchronizing with graphics pane Chart styles
112 applying 671
types of views 110 array results 659
using 110 axes 664
viewing arrays 735 defining defaults 675
Browser distribution results 626
Previous and Home buttons 92 editing 661
Browser button 110 General tab 662
Built-in constants 133 grid 669
Built-in functions 128 header and footer 663
financial 132 importing and exporting 674
math 129 introduction 536
special 130 keywords 676
trigonometry 128 legend 668

1092  Index GoldSim User’s Guide


managing using style manager for Stochastic elements 159
674 function 183
multi-variate results 647 Conditional Containers
saving 671 activating 846
style manager 673 activation event 846
time history results 592 activity status output 845
Z-axis 667 auto triggers 849
Charts 520 behavior of elements within 842
context-sensitive menu 522 browser view 851
copying 691 completion event 846
distributions 604 completion status output 845
editing appearance 661 creating 139, 844
exporting 691 deactivating 847
styles 536 duration output 845
time histories 540 Number of Activations output
tool-tips 523 845
zooming within 523 outputs 845
Circles, adding to graphics pane specifying resources 849
699 termination event 846
Circular systems using 841
feedback loops 314 Conditional Tail Expectaion
recursive loops 901 computing 1025
Class View 110 Conditional Tail Expectation
Classifying realizations 533 for distribution results 601
Clones for Stochastic elements 159
Containers 896 function 183
copying 895 Conditions
copying Containers with clones defining outputs as 93
897 displaying in array charts 656
creating 894 displaying in distribution charts
freeing 896 607
moving 895 displaying in time history charts
understanding 893 541
Closed curves, adding to graphics expressions 134
pane 699 Confidence bounds on distributions
Closing files 72 603, 605, 1023
Coefficient of determination Confidence bounds on the mean
computing 1027 1022
Coefficient of variation of a Constants 133
distribution 987 Constructor functions for arrays
col 738
use in array constructors 738 Containers
Command line, running model appearance of contents 143
from 507 cloning 896
Complementary cumulative conditional 139, 841
distribution function 985 copying 106
Completion event copying clones 897
output of conditional Container features 137
846 global or local 138
Completion status influences between 104
output of conditional Container internal clocks 140
845 localized 886
output of Milestone 366 locking 148
Conceptual model 33 looping 141
Cond. Tail Expectation moving elements between 107
for distribution results 601 navigating within 101

GoldSim User’s Guide Index  1093


overview 100 Correlation algorithms 1009
properties dialog 136 Correlation coefficients
protecting 143 computing 1027
protecting contents from editing Correlation matrix
148 viewing 641
providing Resources 142 Cosine function 128
sealing 147 Cotangent function 128
SubSystems 139 Creating
summary information 144 array labels 728
using 136 arrays using constructor functions
using to disable Time History 738
Result elements 145 arrays using Data elements 733
using to save results 145 arrays using Stochastic elements
viewing in browser 110 737
Containment View 110 clones 894
Contaminant Transport Module 62 conditional Containers 139, 844
Context-sensitive Help 29 Generic database 1062
Context-sensitive menu hyperlinks in graphics pane 712
displaying 71 hyperlinks in Notes 711
in browser 112 hyperlinks in text boxes 706
in charts 522 links 86, 100
in input fields 91 model versions 964
using to insert elements 82 notes 709
Conventions Result elements 527
to describe key combinations 7 Simple GoldSim database 1062
to describe mouse actions 7 toolbars 385
Conveyor-belt units 402
treating Discrete Change Delay as units for items (e.g., widgets) 405
361 Yucca Mountain database 1068
treating Event Delay as 349 Cumulative distribution 165, 998
Convolution elements 759 Cumulative distribution function
defining as arrays 762 985
defining inputs 760 computing 1021
examples 762 Current service time for an Event
theory 759 Delay 347
Copula algortihms for correlation Curves, adding to graphics pane
1009 699
Copying Custom statistics for time histories
charts and tables 691 560
Containers 106 Customizing
data into a 1-D Table 265 behavior of Run Controller 462
data into a 2-D Table 268 the graphics pane 386
data into a 3-D Table 272 timesteps 426
data into a Time Series 198
data into an array 735 D 
elements 106
elements between files 108 Dashboard Authoring Tools 64
graphic objects 720 Dashboards
copying table results 523 default 723
Correlating elements Data display
algorithm 1009 multi-variate results 642
Correlating Stochastics 179 Data elements 154
Correlation using to create arrays 733
for History Generator elements Data source
779 linking to Lookup Tables 274
for Stochastic vectors 186 Data styles 669

1094  Index GoldSim User’s Guide


Data tips in charts 523 specifying Resources 362
Database links 972 time-variable delay times 361
adding data sources 973 with dispersion 360
downloading definitions 974 Discrete Change elements 352
downloading from Generic 975 Discrete change signals
downloading from Simple 976 defined 321
downloading from Yucca generating 255, 257, 352, 356,
Mountain 978 379
globally downloading 980 routing using Splitter 363
removing 981 Discrete changes
to Lookup Tables 279 generating with Time Series
types 972 elements 379
validating 975 Discrete Changes
Dates to a Reservoir 355
Date and Datetime units 407 to an Integrator 354
referencing in expressions 135 Discrete distribution 167, 607, 999
using in Spreadsheet elements Discrete event signals
872 defined 321
using in Time Series 198 generating 332
DateTime 448 Discrete events 319
Date-time simulation 414 Discrete outputs 94
Deactivating Discrete signals 94, 321
conditional Containers 847 Dispersion
extension modules 26 Discrete Change Delays 360
link cursor 100 Event Delays 348
Decision elements 338 Information Delays 295
Default Dashboard 723 Material Delays 304
Delay elements 81, 152, 291 Display units 95
Deleting Displaying
elements 106 CDFs 1021
graphic objects 698 confidence bounds on
influences 93 distributions 1023
links 93 confidence bounds on the mean
notes 709, 710 1022
text 702 notes 709
text boxes 705 PDFs 1022
Derivative of Lookup Table 284 toolbars 384
Description field for elements 85 tool-tips 71, 113
Deterministic simulations Displaying results
compared to probabilistic 990 arrays 648
defining values for Stochastics distributions 596
181 multiple distributions in one chart
running 442 611
Dimensions 94 multiple time histories in one
Disabling a Result element 591 chart 544
Discrete Change Delay elements multi-variate 629
357 overview 512
conveyer-belt approach 361 single realization distribution
no dispersion 359 displays 614
Number in queue 362 time histories 536
referencing the discrete change while model is running 529
Value 361 Distributed Processing Module 64
simulating queues 362 Distribution results 596
simulating queues using classifying results 616
Resources 362 controlling chart style 626
specifying capacities 362 defined 515

GoldSim User’s Guide Index  1095


displaying conditions 607 defining Lookup Tables using
displaying discrete results 607 280
properties 597 details 1034
result array 610, 1021 examples 1040
screening results 616 running in a separate process 879
viewing a distribution summary Docking toolbars and menu bars
600 386
viewing charts 604 Documenting models
viewing Distribution outputs 620 described 693
viewing multiple outputs 611 overview 57
viewing scenarios 622 Drawing Tools toolbar 69, 696
viewing single realizations 614 Duration
viewing tables 608 output of conditional Container
Distributions 845
beta 162, 163 Dynamic simulation 32, 42
Beta 996 Dynamically adjusted timesteps
BetaPERT 163 431
binomial 164, 997
Boolean 165, 997 E 
correlated 988
cumulative 165, 998 EDay 450
discrete 167, 999 Edit Mode 457
editing 158 Editing
exponential 168, 1000 array labels 728
externally-defined 168 chart appearance 661
extreme probability 169, 1000 element appearance 395
extreme value 170, 1001 element properties 84
gamma 171 graphic objects 700
Gamma 1001 Hyperlinks 713
log-cumulative 998 influence appearance 389
log-normal 171, 1002 notes 710
log-triangular 1006 text boxes in graphics pane 705
log-uniform 1008 text in graphics pane 702
mathematics of 996 EHour 450
moments of 986 Elapsed time
negative binomial 1003 referencing 105, 445
negative bionomial 172 run properties 450
normal 173, 1003 Elapsed Time simulation 414
Pareto 173, 1004 Elements
Pearson Type III 174, 1004 Allocator 257
Poisson 174, 1005 And 288
Sampled result 1005 categories 38, 150
sampled results 175 changing appearance of 395
specifying 987 changing background 398
Student’s t 176, 1005 changing labels 398
triangular 176, 1006 changing outline 398
truncated 1009 cloning 893
understanding 984 Containers 100
uniform 177, 1007 Convolution 759
Weibull 1008 copying 106
Weilbull 178 copying between files 108
Divide by zero in input fields 89 creating 77, 82
DLLs Data 154
calling details 1045 Decision 338
calling from GoldSim 873 defined 38
Delay 81, 152, 291

1096  Index GoldSim User’s Guide


deleting 106 tool-tips for 113
dependencies 117 Triggered Event 336
description 85 types of 38, 77, 150
Discrete Change 352 using to manipulate arrays 748
Discrete Change Delay 357 Ellipses, adding to graphics pane
editing properties 71, 84 699
Event 80, 151 Email
Event Delay 345 sending a model via 76
Expression 248 support 29
External 873 Embedding models within models
Extrema 249 914
File 884 emf, creating in GoldSim 396
finding 116 EMinute 450
Function 78, 151, 248 EMonth 450
History Generator 768 Empirical expressions 98
ID 85 Enabling/disabling result elements
images for 396 145
in conditional Containers 842 Enhanced metafile, creating in
Information Delay 292 GoldSim 396
Input 78 equality and inequality
Inputs 150 precision 88
inputs and outputs 82 EQuarter 450
inserting new 82 Error function 130
Integrator 228 ESecond 451
Interrupt 372 ETime 450
linking to databases 972 Euler integration 43, 231, 1077
links between containers 104 Event Delay elements 345
Logical 288 conveyer-belt approach 349
Lookup Table 263 Current service time 347
Material Delay 300 Mean time 347
Milestone 366 no dispersion 348
moving between containers 107 Number in queue 350
naming conventions 85 simulating queues 350
Not 291 simulating queues using
Or 289 Resources 350
overview of 38 specifying capacities 350
overview of categories 150 specifying Resources 350
Previous Value 898 time-variable delay times 349
Random Choice 341 with dispersion 348
Reservoir 236 Events
resetting images for multiple automatic triggering 326
elements 397 basic concepts 320
resetting multiple 397 calculation sequence 381
Result 81, 152, 526 causality sequence 381
Script 803 determining if they occur 380
selecting with mouse 70 Elements for simulating 80, 151
Selector 252 propagating between elements
Splitter 255 321
Spreadsheet 852 queuing 350
Status 364 responding to 352
Stochastic 156 simulating 319
Stock 78, 150, 228 triggering 323
Sum 262 Example models 5
symbols for 396 Expiration date of license 11
Time Series 187 Exponential distribution 168, 1000
Timed Event 333 Exponential function 129

GoldSim User’s Guide Index  1097


Exponential smoothing 299 F 
Exporting
chart styles 674 Feedback loops
charts 691 finding 316
graphics pane 722 how evaluated 314
results 678 involving SubSystems 316
results to spreadsheets using types 315
Result elements 678 File elements
results to spreadsheets using described 884
Spreadsheet elements 691 locking onto a file 886
results to text files using Result to access a network file 885
elements 686 to support distributed processing
Exposing outputs on a Container 884
888 Files
Expression elements 248 archiving 72
Expressions archiving with results 456
conditional 134 auto-save 73
empirical 98 closing 72
entering and editing 87 example models 5
mathematical operator extension GSM 72
precedence 87 opening 72
referencing dates 135 Player 722
referencing time 105, 445 protecting 75
relational operator precedence recovering 73
134 saving 72
Extending a license 11 sending via email 76
Extension modules Filtering influences 392
activating and deactivating 26 Final value results
overview 61 arrays 648
External elements 873 distributions 596
controlling when DLL is called multi-variate 629
883 Financial functions 132
defining lookup table outputs 880 Financial Module 61
details 1034 Finding
inputs and outputs 874 elements 116
locking onto a file 879 feedback loops 316
reading and creating time series recursive loops 903
881 Floating license 14
running DLLs in a separate Floor function 129
process 879 Flows, material and information
saving outputs 883 153
steps to create 874 Forecasting using exponential
External functions smoothing 299
calling details 1045 Freeing a clone 896
calling sequence 1043 Full Screen View 696
examples 1040 Function elements 78, 151, 248
implementing 1034 Function of View 117
Externally-Defined distribution 168 SubModels 950
Extrema elements 249 Functions
Extreme probability distribution absolute value 129
1000 arccosine 128
Extreme Probability distribution arcsine 128
169 arctangent 128
Extreme value distribution 1001 array 743
Extreme Value distribution 170 Bessel 130
EYear 450 beta 130

1098  Index GoldSim User’s Guide


built-in 128 extend or upgrade license 11
ceiling 129 features 3
changed 130 file extension 72
constructors for arrays 738 floating license 14
cosine 128 installing and registering 7
cotangent 128 knowledge base 30
error 130 learning to use 28
exponetial 129 license agreement 14
financial 132 model library 30
floor 129 modules 61
gamma 130 mouse actions 70
Gauss error 130 network license 14
hyperbolic cosine 128 online Help 29
hyperbolic sine 128 Player 65, 722
hyperbolic tangent 128 referencing time 105, 445
If then 130 registering manually 9
Importance sampling 130 registering via the Internet 9
logarithm base 10 129 splash screen 68
Math 129 testing the installation 25
maximum 129 transferring a license 13
minimum 129 tutorial 29
modulus 129 types of elements 77
natural logarithm 129 uninstalling 27
occurs 130 user interface described 68
Occurs 380 Graphics
round 129 adding images 707
sine 128 adding objects 697
special 130 editing objects 700
square root 129 manipulating 718
standard normal 130 Graphics pane
Student’s t distribution 130 background 386
tangent 128 copying settings 393
trigonometry 128 customizing 386
truncate 129 defined 69
Future value, computing 132 display tool-tip 71
exporting 722
G  grid 386
inserting new elements 82
Gamma distribution 171, 1001 moving objects with mouse 71
Gamma function 130 navigating within 109
Gauss error function 130 navigation bar 101
Generic database Pan cursor 109
creating 1062 printing 721
downloading from 975 saving position and scale 388
Global containers 138 selecting multiple objects 72
Global properties 443 sizing 388
Global Stores for Resources 785 synchronizing with browser 112
Globalizing a Container 893 Zoom toolbar 109
Globally downloading from zooming 109
databases 980 Graphics tab
GoldSim for Containers 143, 943
basic concepts 37 Grids
calculation logic 309 in charts 669
canceling a license 13 in graphics pane 386
context-sensitive Help 29 Grouping objects 719
described 35

GoldSim User’s Guide Index  1099


H  from databases 972
text data into 1-D Tables 266
Header and footer of charts 663 text data into 2-D Tables 269
Help 29 text data into 3-D Tables 272
Hiding ImpProb function 130
influences 392 ImpWeight function 130
the browser 110 Influences
Hierarchical models 48 adding nodes 390
Hierarchy, creating with Containers adding text 390
136 between containers 104
High resultion histories changing appearance of 389
viewing results 586 color 389
History Generator elements 768 defined 86
correlating arrays 779 deleting 93
geometric growth 772 filtering 392
geometric growth with reversion globally editing in a Container
775 391
random walk 776 hiding 392
random walk with reversion 777 properties 103
reversion to median 775 segmented 390
reversion to target 777 shape 389
types of histories 769 thickness 389
Home button when searching 92 Information Delay elements 292
Hyperbolic cosine function 128 initial values 296
Hyperbolic sine function 128 mathematics of 298
Hyperbolic tangent function 128 no dispersion 294
Hyperlinks simulating forecasts 299
adding to graphics pane 712 specifying inputs 293
appearance 715 time-variable delay times 297
in Notes 711 with dispersion 295
in text boxes 706 Information flow 153
locking 713 Information tab
making editable 713 Containers 144
specifying addresses 713 simulation settings dialog 444
Information tab or SubModels 943
I  Input elements 78, 150
Input fields
If then function 130 auto-complete 89
vector/matrix arguments 744 auto-suggest 89
Images context menu 91
adding to graphics pane 707 divide by zero 89
changing appearance 707 entering expresssions 87
globally resetting 397 error checking 98
Iman and Conover 1009 specifying contents 86
ImpOld function 130 tool-tips 115
Importance measures using constants in 133
computing 1029 using functions in 128
Importance sampling 1016 Inputs
custom 953 entering units 96
events 334 ports 83
Random Choice 343 Insert Link dialog 91
Stochastics 182 Inserting
Importance sampling function 130 graphic objects into the graphics
Importing pane 697
chart styles 674 images into the graphics pane 707
data from spreadsheets 852 new elements 82

1100  Index GoldSim User’s Guide


Result elements 527 Lines
shapes into the graphics pane 697 adding to graphics pane 698
text boxes into graphics pane 704 between elements (influences)
text into graphics pane 701 102
Installation Code 9 Link cursor
Installing GoldSim 7 deactivating 100
Integral of Lookup Table 284 described 100
Integration algorithm for Stocks Link types 103, 105
1077 Links
Integrator elements 228 between containers 104
computing moving averages 234 creating 77, 86, 100
integration algorithm 229 deleting 93
integration option 233 Local containers 138
specifying discrete changes 232 Local Stores for Resources 787
Specifying discrete changes 354 Localized Containers
specifying inputs 232 creating 887
Integratration algorithm for Stocks defining output aliases 890
229 exposing outputs 888
Internal clocks for Containers 140, globalizing 893
434 nesting 890
Interrupt elements 372 referencing outputs 887
buttons on message dialog 375 search logic 892
Continue 375 understanding 886
message 374 Locally available properties 750
Pause 375 for Resources 794
triggering interruption 373 Locations
without message 378 of Resources 798
writing to run log 377 Locking
Is_Full output of a Reservoir 246 Containers 148
Hyperlinks 713
K  text boxes 705
Locking onto a file
Key combinations DLLs 879
conventions to describe 7 File elements 886
Keywords in chart styles 676 spreadsheets 868
Knowledge base 30 Logarithm base 10 function 129
Kurtosis of a distribution 987 Log-cumulative distribution 998
Logging simulation events 408
L  Logging simulations 506
Logical elements 288
Labels, changing for elements 398 Log-Normal distribution 1002
Last Value tool-tips 512 Log-Normal Distribution 171
Latin hypercube sampling 439, Log-Triangular distribution 1006
1013 Log-Uniform distribution 1008
Legends in charts 668 Lookup Tables 263
License controlling interpolation and
agreement 14 extrapolation 280
canceling 13 defining 264
cancellation code 13 defining using an external DLL
expiration date 11 280
extending or upgrading 11 defining using External elements
network or floating 14 880
renewing 11 derivative of 1-D 284
sharing between versions 14 dynamic 287
transferring 13 handling data outside bounds 280
Line styles in charts 669

GoldSim User’s Guide Index  1101


importing from a text file 266, creating with Time Series
269, 272 elements 200
integral of 1-D 284 functions that operate on 743
inverse lookup 283 introduction 49
linking to a database 279 manipulating in expressions 742
linking to a spreadsheet 274 manipulating with elements 748
linking to a text file 278 referencing an item 736
linking to an external data source using 726
274 viewing final values 653
pasting into 1-D 265 viewing in browsers 735
pasting into 2-D 268 Maximum function 129
pasting into 3-D 272 Mean time for an Event Delay 347
referencing 281 Menu bars
reverse lookup 283 creating 385
specifying 1-D tables manually docking 386
265 main 69
specifying 2-D tables manually modifying 385
268 moving 386
specifying 3-D tables manually Menus
270 context-sensitive 71
Looping Containers 141 main 69
controlling looping 905 Microsoft Windows
examples 907 use Add/Remove Programs 27
using 904 versions supported by GoldSim 4
Loops Milestone elements 366
feedback 314 Minimum function 129
finding feedback 316 Model
finding recursive 903 conceptual 33
recursive 901 mathematical 34
Model author 444
M  Model Container 100
Model library 30
Manual Model root 100
list of appendices 6 Modeling aging chains
Notes in 7 overview 752
organization of 5 using Integrators with discrete
Warnings in 7 pushes 756
Material Delay elements 300 using Material Delays 754
applying an inflow limit 306 using Reservoirs 753
initial outflows 305 Models
mathematics of 307 building top-down 694
no Dispersion 303 copying elements between 108
specifying inputs 301 defining audiences for 694
time-variable delay times 305 example files 5
with dispersion 304 hierarchical 48
Material flow 153 navigating 108
Math functions 129 organizing 694
Mathematical model 34 overview of documenting 57
Matrices overview of running 121
copying between models 750 Modes
creating with constructor Edit 457
functions 738 overview 456
creating with Data elements 733 Result 461
creating with Stochastic elements Modules
737 activating and deactivating 26
Contaminant Transport 62

1102  Index GoldSim User’s Guide


Distributed Processing 64 Negative binomial distribution 172,
Financial 61 1003
overview 61 Nested Monte Carlo 933
Reliability 63 Net present value, computing 132
Modulus function 129 Network license 14
Monte Carlo options Normal distribution 173, 1003
# of realizations 439 Not elements 291
sampling method 439 Notes
setting 438 creating 709
Monte Carlo result options 441 deleting 709, 710
Monte Carlo simulation described 709
defined 990 editing and formating 710
overview 45 inserting hyperlinks 711
using distributed processing 64 viewing the note pane 709
Mouse actions NPV, computing 132
conventions to describe 7 Number in queue 350
defined 70 Numerical integration 1077
displaying context-sensitive menu NumOfReal 451
71
displaying tool-tip 71 O 
dragging 71
editing properties 71 Objective function for optimization
moving objects 71 488
selecting multiple objects 72 Objects
selecting objects 70 aligning and ordering 718
Moving copying and pasting 720
browser 110 displaying tool-tips 71
elements between containers 107 graphical 70
objects 71 graphics and text 696
objects precisely 719 grouping 719
toolbars and menu bars 386 model 70
Moving averages 234 moving precisely 719
Mulit-variate results moving with mouse 71
properties 633 rotating 720
Multi-variate results 629 selecting multiple 72
classifying resuls in a scatter plot selecting with mouse 70
643 spacing and sizing 719
controlling chart style 647 Occurs function 130, 380
defined 517 Offsets
reassigning axes 632 for Spreadsheet elements input
screening results 643 and outputs 865
selecting outputs for display 630 Opening files 72
sensitivity analysis 639 Optimization 486
viewing a 2D scatter plot 635 objective function 488
viewing a 3D scatter plot 637 optimization variables 489
viewing a correlation matrix 641 overview 486
viewing data 642 precision 492
probabilistic 495
randomizing 492

required condition 488
Naming elements 85 running 493
Natural logarithm function 129 saving settings and results 495
Navigating models 108 settings 487
Navigation bar in graphics pane warning messages 495
101 Optimizing a SubModel 944
Options

GoldSim User’s Guide Index  1103


updating expressions 108 Poisson events 1020
Options dialog Polygons, adding to graphics pane
General tab 408 698
Graphic tab 409 Polylines, adding to graphics pane
Results tab 409 698
Or elements 289 Ports
order of calculation for elements defined 83
908 Precedence
Ordering objects 718 for mathematical operators 87
Organization of manual 5 for relational operators 134
Organizing your model 694 Precedence conditions in Triggers
Outline, changing for element 398 328
Output attributes 93 Precision
Outputs of saved results 525
continuous and discrete 94 of tool-tips 116
discrete signals 94 Present value, computing 132
highlighting as saved results 456 Previous button when searching 92
ports 83 Previous Value elements 898
saving as results 453 browser view 900
Overflow rates from Reservoirs creating recursive loops 901
241 inputs and outputs 899
using to solve coupled equations
P  1079
Printing
Pan cursor 109 graphics pane 721
Panning 109 Probabilistic simulation 32
Pareto distribution 1004 options 439
Pareto Distribution 173 using Stochastic elements 156
Partial correlation coefficients Probabilistic simulations
computing 1028 compared to deterministic 990
Password Probability density function 985
for locked Container 148 Probability histories 555
Pasting selecting percentiles 558
data into a 1-D Table 265 Properties
data into a 2-D Table 268 displaying 71
data into a 3-D Table 272 of elements 84
data into a Time Series 198 of graphic objects 700
data into an array 735 of Hyperlink objects 713
Pausing a model 460 of influences 103
PDF 985 of text boxes 705
computing 1022 of text objects 702
Pearson Type III distribution 1004 Properties of results 520
Pearson Type III Distribution 174 Protecting a model file 75
Percent unit 407 Protecting Containers 143
Percentages 407
Percentiles

selecting for probability histories
558 Queues
viewing time histories of 555 Discrete Change Delays 362
when defining distributions 159 Event Delays 350
PERT distribution 163
Player 65, 722 R 
Plot points, saving 423
Plots, see Charts 520 Random Choice elements 341
Poisson distribution 1005 importance sampling 343
Poisson Distribution 174 Random events

1104  Index GoldSim User’s Guide


mathematics 1020 creating and editing Local Stores
Random events, generating 333 787
Random number seeds 440, 1012 defining and editing Resource
Randomizing optimization Types 782
sequence 492 defining requirements 790
Realization weights 440 elements that interact with 793
Realizations for Discrete Change Delays 362
classifying 533 for Event Delays 350
defined 45 generating 797
displaying time histories of 552 histories 802
referencing current number 451 in SubModels 942
running one at a time 460 interacting with 790
screening 533 introduction 781
simulation options 439 introduction to creating 781
Recovering files after crash 73 locally available properties 794
Rectangles, adding to graphics locations and users 798
pane 699 moving between Stores 795
Recursive loops 901 referencing resource availability
finding 903 and use 794
Redo 721 results 802
Reference version 966 Result
Registering GoldSim 7 properties 520
manually 9 Result array, for distributions 610,
via the Internet 9 1021
Registration Code 8 Result display
Registration Key 10 charts 520
Regular events, generating 333 dialogs 520
Relational operators 134 overview 512
Reliability Module 63 precision 525
Removing units 98 properties 520
Renew license 11 size of values 525
Reporting periods tables 520
defining 421 tool-tips 512
viewing results 564 types 513
ReportingMonth 452 Result elements
Required condition, in Triggers 330 creating 527
Requirements defined 152
operating system 4 described 526
Reservoir elements 236 disabling 591
computing overflow rates 241 exporting to spreadsheets 678
computing withdrawal rates 244 exporting to text files 686
integration algorithm 237 finding connected outputs 530
Is_Full output 246 special uses 532
replacing current value 247 types of 81
specifying discrete changes 247 viewing 529
Specifying discrete changes 355 Result Mode 461
specifying primary inputs 237 Results
upper and lower bounds 239 archiving 456
withdrawal rate output 238 arrays 648
Resetting classifying distribution results
element images globally 397 616
Resources classifying realizations 533
allocating amongst competing classifying time history results
requirements 794 571
creating and editing Global Stores disk space required 455
785

GoldSim User’s Guide Index  1105


displaying multiple distributions Sampling method
in a chart 611 importance sampling 182
displaying multiple time histories Latin hypercube 439
in one chart 544 Sampling Stochastic elements 178
displaying single realizations 614 Saving
distribution 596 chart styles 671
exporting 678 files 72
globally saving using Containers graphics pane settings 388
145 Player files 722
highlighting saved 456 results for specific outputs 453
introduction to viewing 122 results for subelements in
multi-variate 629 Containers 145
overview of display 512 results globally using Containers
saving for specific outputs 453 145
screening array results 658 toolbar settings 386
screening distribution results 616 Scaling in graphics pane 109
screening multi-variate results Scatter plots
643 2D 635
screening realizations 533 3D 637
screening time history results 571 classifying results 643
specifying how saved 453 Scenario Data 465
time history 536 Scenario Manager 471
types of 513 Scenario Mode 478
Reversion to median from Result Mode 484
History Generator elements 775 Scenarios
Reversion to target Basic Concepts 463
History Generator elements 777 defined 464
Rotating objects 720 exporting time histories to
Round function 129 spreadsheets 684
row Overview 463
use in array constructors 738 overview of displaying results
RTime 450 532
Run Controller running and displaying results
customizing behavior 462 478
overview 121 viewing distribution results 622
slowing down a simulation 460 viewing time history results 578
using 456 Scientific notation 409
Run log 506 Screening realizations 533
Run Mode Script elements
aborting a run 461 assigning values to variables 807
pausing a model 460 break statements 827
slowing down a simulation 460 breakpoints 833
states 458 browser view 841
stepping through a model 460 comments 832
Run properties 445 continue statements 827
Running a model controlling program flow 816
details 456 debugging 833
from command line 507 defining and assigning arrays 812
overview 119, 121 defining local variables 810
using a batch file 507 defining outputs 815
viewing results while 529 deleting statements 831
do loops 821
S  documenting 832
editing 829
Sampled result distribution 1005 examples 837
Sampled Results distribution 175 for loops 819

1106  Index GoldSim User’s Guide


getting started 805 described 412
hot-keys 830 deterministic runs 442
if-else statements 817 dynamic model 415
inserting statements 806 for a SubModel 919
introduction 803 globals 443
keyboard shortcuts 830 information 444
log statements 834 model author 444
moving statements 831 Monte Carlo options 438
outputs 815 Monte Carlo sampling method
printing 837 439
repeat until loops 823 overview 120
scope of variables 828 probabilistic runs 439
Variable Assignment statement time options 413
807 Sine function 128
Variable Definition statement 810 Sizing objects 719
while loops 825 Skewness of a distribution 987
Sealing Containers 147 Slowing down a simulation 460
Searching for elements 116 Sorting table results 524
Seeds, random number 440, 1012 Spacing objects 719
Selecting Special functions 130
multiple objects 72 Splash screen 68
objects with mouse 70 Splitter elements 255
Selector elements 252 Spreadsheet elements 852
Sending a model via email 76 browser view 873
Sensitivity analysis controlling when it links to
central value result 502 spreadsheet 869
graphical 497 creating and editing inputs 855
multi-variable 639 creating and editing outputs 857
single variable 497 creating inputs using the wizard
statistical 639 856
tornado chart 502 creating outputs using the wizard
X-Y function charts 503 863
Sequencing logic 908 defining offsets 865
Shift button defining properties 853
Spreadsheet elements 867 exchanging dates 872
Shorter timstep periods 426 exporting data to the spreadsheet
Show Changes (between versions) 855
967 importing data from the
Show Input Links/Values 112 spreadsheet 857
Significant figures 409 importing data in Edit Mode 871
Simple database importing probability
creating 1062 distributions 860
downloading from 976 locking onto a file 868
Simulated Bayesian updating 956 saving changes to spreadsheet
Simulation 871
accuracy of models 1076 saving outputs 872
basic concepts 32 shifting ranges simultaneously
dynamic 32, 42 867
probabilistic 32 Update Spreadsheet Outputs
static 415 option 871
Simulation modes wizard for exporting data to the
defined 76 spreadsheet 856
described 456 wizard for importing data from
Simulation settings the spreadsheet 863
advanced timestep options 426 Spreadsheets
analysis description 444

GoldSim User’s Guide Index  1107


exporting results from Time Affects View 950
History Result elements 678 appearance of contents 943
exporting results using applications of 914
Spreadsheet elements 691 building contents 918
exporting scenario results from controlling when run 931
Time History Result elements creating 915
684 examples 952
linking to Lookup Tables 274 exporting 946
linking to Time Series elements Function of View 950
194 importing 948
linking to via Spreadsheet Information tab 943
elements 852 input interface 921
Square root function 129 interrupting 950
Standard deviation of a distribution locking 946
987 logging run messages 946
Standard normal function 130 modules 917
Standard regression coefficients Nested Monte Carlo 933
computing 1028 optimizing 944
Standard toolbar 69 output interface 925
Start Dialog 68 pausing 950
State variables 309 protecting contents 946
Static simulation 415 Resources 942
Status bar 70 saving results inside 932
changing mode 77 sealing 946
Scale button 109 simulation settings 919
Status elements 364 solution type 917
Stepping through a model 460 viewing dependencies 950
Stochastic elements 156 viewing histories in parent model
autocorrelating 180 573
controlling sampling 370 viewing results inside 932
correlating 179 why use 914
defining as vectors 184 SubSystems
defining distributions 158 defined 139
deterministic value 181 in feedback loops 316
distribution functions 183 Sum elements 262
Distribution output 158 Support
distribution types 161 email 29
importance sampling of 182 GoldSim user forum 30
saving results for 158 knowledge base 30
triggering 370 model library 30
Stock elements tutorial 29
defined 150 Symbols for elements
types of 78 changing 396
using 228 globally changing 397
Stores Synchronizing graphics pane and
Global 785 browser 102
Local 787
Student’s t distribution 176, 1005 T 
Student’s t distribution function
130 Table results
Style manager 673 distributions 608
Styles for charts 536 selecting and copying 523
Subelements size of values displayed 525
saving 145 sorting 524
Submodels 914 time histories 542
SubModels Table Results 520

1108  Index GoldSim User’s Guide


copying 691 viewing unscheduled updates 586
Tables Time History results
Lookup 263 defined 514
Tangent function 128 exporting results to spreadsheets
Technical support 29 678
Temperature units 97 exporting results to text files 686
Termination event Time Series elements 187
output of conditional Container advanced options 214
846 browser view 227
Testing installation 25 changes over intervals 209
Text constant values over intervals 207
adding to an influence 390 data source 189
adding to graphics pane 701 defining discrete changes 189
changing appearance in graphics defining multiple time series data
pane 702 sets 219
editing in graphics pane 702 defining outputs 201
pasting with tabs in graphics pane defining vector data 200
720 discrete changes 212
Text boxes elapsed time entries 198
inserting hyperlinks 706 examples 205
Text boxes generating discrete changes 379
adding to graphics pane 704 importing data from spreadsheets
changing appearance in graphics 194
pane 705 input data represents 191
editing in graphics pane 705 instantaneous values 205
unlocking in graphics pane 706 linking to a time series definition
Text files 226
exporting results from Time pasting data into 198
History Result elements 686 referencing as a function 203
Time referencing dates 198
options 413 shifting origin of data 215
referencing in GoldSim 105, 445 time shifting data 215
Time basis for simulation 414 type and units 189
Time history results 536 using to record 222
arrays 547 viewing and editing data 192
classifying results 571 Timed Event elements 333
controlling chart style 592 importance sampling 334
multiple realizations 552 mathematics 1020
multiple realizations for multiple updating between timesteps 335
outputs 561 Timestepping algorithm 1080
multiple realizations of an array Timesteps
562 advanced options 426
plotting conditions 541 alignment 419
probability histories 555 capture points 428
properties 537 controlling unscheduled updates
reporting period-based 564 430
screening results 571 customizing 426
viewing charts 540 dynamically adjusting 431
viewing custom statistics 560 Elapsed or Calender 414
viewing multiple outputs 544 internal for Containers 434
viewing percentiles 555 length 419
viewing scenarios 578 overview 415, 430
viewing SubModel histories 573 pausing model between 460
viewing tables 542 periods with shorter 426
viewing Time History Definition plot points 423
outputs 573 referencing length 451

GoldSim User’s Guide Index  1109


reporting periods 421 Undo 721
saving 423 Uniform distribution 177, 1007
selecting 1080 Uninstalling GoldSim 27
Toolbars Units
activating and deactivating 384 appending automatically 97
creating 385 casting 98
customizing 384 creating 402
docking 386 creating for items (e.g., widgets)
Drawing Tools 69, 696 405
modifying 385 currencies 97
moving 386 display 95
saving settings 386 entering 96
standard 69 for dimensionally inconsistent
types 384 expressions 98
Tool-tips 113 Manager 400
displaying 71 managing user-defined 405
for elements 113 overview 94
for input fields 115 percentage symbol 407
for inputs and outputs 114 removing 98
in chart display windows 523 rules for entering 95, 96
viewing large and small numbers saving settings 405
in 116 table of conversion factors 1050
viewing results 512 temperature 97
Top-down models 48, 694 Units.dat file 405
Tornado chart 502 Unlocking
Tracking model changes 963 Containers 148
Transferring a license 13 Hyperlinks 713
Triangular distribution 176, 1006 text boxes 706
Triggered Event elements 336 Unscheduled updates
specifying resources 337 controlling 430
Triggering defined 418
defined 323 saving results 436
defining triggering events 324 viewing results 586
multiple elements simultaneously Upgrading a license 11
847 User interface
precedence conditions 328 browser 69
required condition 330 described 68
Resource Interactions 332 Drawing Tools toolbar 69
Stochastics 370 graphics pane 69
Trigonometry functions 128 menu bar 69
Truncate function 129 standard toolbar 69
Tutorial 29 status bar 70
Type button in properties dialogs toolbars 384
94 Users
Types of elements 38 of Resources 798
Types of links 103, 105


Validating database links 975
Uncertainty Variability
differentiating from variability differentiating from uncertainty
988 988
propagating 989 Variance of a distribution 987
quantifyin 984 Vectors
representing 44 copying between models 750
types 984

1110  Index GoldSim User’s Guide


creating with constructor in charts 523
functions 738 in graphics pane 109
creating with Data elements 733
creating with Stochastic elements
737
creating with Time Series
elements 200
functions that operate on 743
introduction 49
manipulating in expressions 742
manipulating with elements 748
referencing an item 736
using 726
using as lookup tables 740
viewing final values 651
viewing in browsers 735
Version Manager 965
Versioning
changes tracked 966
creating versions 964
defined 963
deleting versions 965
disabling 966
displaying differences 967
enabling 964
overview 963
reference version 966
reports 971
Version Change Note 970
Version Manager 965
Viewing
element dependencies 117
results, see Displaying results 512
Views
Affects 117
Functions Of 117
types of in browser 110


Web site
GoldSim Resource Center 30
Weibull distribution 178, 1008
Withdrawal rates from Reservoirs
238, 244


Yucca Mountain database
creating 1068
downloading from 978


Zoom toolbar 109
Zooming

GoldSim User’s Guide Index  1111

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy