﻿<?xml version="1.0" encoding="utf-8"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title><![CDATA[GoldSim Wiki - Page Updates]]></title><link>http://www.GoldSim.com/Wiki/</link><atom:link href="http://www.GoldSim.com/Wiki/Knowledge Base.RSS.aspx?Category=Knowledge Base.Modeling Tips and Tricks" rel="self" type="application/rss+xml" /><description><![CDATA[Recent Page updates]]></description><pubDate>Sun, 19 May 2013 06:16:20 GMT</pubDate><generator>ScrewTurn Wiki RSS Feed Generator</generator><item><title><![CDATA[Mine Water and Waste Management Simulation]]></title><link>http://www.GoldSim.com/Wiki/Knowledge Base.Mine.ashx</link><author> (jlillywh)</author><description><![CDATA[<h2 class="separator">Mine Water and Waste Management Simulation<a class="headeranchor" id="Mine_Water_and_Waste_Management_Simulation_4" href="#Mine_Water_and_Waste_Management_Simulation_4" title="Link to this Section"></a></h2><div class="imageright"><a href="GetFile.aspx?Page=Mine&amp;File=MineSite.jpg" title="GetFile.aspx?Page=Mine&amp;File=MineSite.jpg"><img class="image" src="GetFile.aspx?Page=Knowledge%20Base.Mine&amp;File=MineSite.jpg" alt="Image" /></a></div><br />GoldSim allows you to create realistic models of mine systems in order to carry out risk analyses, evaluate potential environmental impacts, support strategic planning, and optimize operations.  <br /><br /><h3 class="separator">Mine Water Balance, Water Quality and Waste Management Modeling in GoldSim <a class="headeranchor" id="Mine_Water_Balance_Water_Quality_and_Waste_Management_Modeling_in_GoldSim_0" href="#Mine_Water_Balance_Water_Quality_and_Waste_Management_Modeling_in_GoldSim_0" title="Link to this Section"></a></h3>
GoldSim has been used extensively in the mining industry to address a broad range of issues, including:<br /><br /><ul><li>Mine water management/water balance</li><li><a class="pagelink" href="Knowledge Base.Contaminant-Transport.ashx" title="Contaminant Transport "> Contaminant transport</a> and environmental compliance</li><li>Evaluation of mine closure options</li><li>Mine material management and logistics</li><li><a class="unknownlink" href="Knowledge Base.Reliability-Engineering.ashx" title="Knowledge Base.Reliability-Engineering"> Reliability and throughput analysis</a> of processing facilities<br /></li></ul><br /><h3 class="separator">Related Model Library Articles<a class="headeranchor" id="Related_Model_Library_Articles_1" href="#Related_Model_Library_Articles_1" title="Link to this Section"></a></h3><ul><li><a class="unknownlink" href="Knowledge Base.Model%20Library.Mine-Water-Balance.ashx" title="Knowledge Base.Mine-Water-Balance"> Mine Water Balance</a></li><li><a class="unknownlink" href="Knowledge Base.Model%20Library.Water-Treatment-for-Acid-Mine-Drainage.ashx" title="Knowledge Base.Water-Treatment-for-Acid-Mine-Drainage"> Water Treatment for Acid Mine Drainage</a></li><li><a class="unknownlink" href="Knowledge Base.Model%20Library.Grinding-mill-reliability-model.ashx" title="Knowledge Base.Grinding-mill-reliability-model"> Grinding Mill Reliability Model</a><br /></li></ul><br /><h3 class="separator">See Also<a class="headeranchor" id="See_Also_2" href="#See_Also_2" title="Link to this Section"></a></h3><ul><li><a class="unknownlink" href="Knowledge Base.Water-Balance-Model%20.ashx" title="Knowledge Base.Water-Balance-Model "> Water Balance Model</a></li><li><a class="unknownlink" href="Knowledge Base.Runoff-Model.ashx" title="Knowledge Base.Runoff-Model"> Runoff Model</a></li><li><a class="unknownlink" href="Knowledge Base.Reliability-Engineering.ashx" title="Knowledge Base.Reliability-Engineering"> Reliability Engineering</a></li><li><a class="unknownlink" href="Knowledge Base.2006-User-Conference-Posters.ashx" title="Knowledge Base.2006-User-Conference-Posters"> 2006 User Conference Posters, Mining and Water Resources</a></li><li><a class="unknownlink" href="Knowledge Base.Conference-2003%20.ashx" title="Knowledge Base.Conference-2003 "> 2003 GoldSim International User Conference (Includes a few presentations related to mining operations)</a></li><li><a class="unknownlink" href="Knowledge Base.Conference-2002%20.ashx" title="Knowledge Base.Conference-2002 "> 2002 GoldSim International User Conference (Includes a few presentations related to mining operations)</a><br /></li></ul><br /><h3 class="separator">Other Resources<a class="headeranchor" id="Other_Resources_3" href="#Other_Resources_3" title="Link to this Section"></a></h3><ul><li><a class="externallink" href="http://www.goldsim.com/Web/Solutions/EnvironmentalSystems/MineWaterWaste" title=" GoldSim official website, Mine Water and Waste Management" target="_blank"> GoldSim official website, Mine Water and Waste Management</a></li><li><a class="externallink" href="http://www.goldsim.com/Web/Solutions/Showcase/EnvironmentalExamples/DiamondMine/" title=" GoldSim official website, Diamond Mine Assessment" target="_blank"> GoldSim official website, Diamond Mine Assessment</a></li><li><a class="externallink" href="http://www.goldsim.com/Web/Solutions/Showcase/EnvironmentalExamples/UraniumMining/" title=" GoldSim official website, Uranium Mine Assessment" target="_blank">  GoldSim official website, Uranium Mine Assessment</a></li><li><a class="externallink" href="http://www.goldsim.com/Web/Solutions/Showcase/TechnicalPapers/#Mining " title=" GoldSim official website, Technical Papers (10 Papers posted)" target="_blank"> GoldSim official website, Technical Papers (10 Papers posted)</a><br /></li></ul>
]]></description><pubDate>Fri, 22 Mar 2013 21:41:51 GMT</pubDate><guid isPermaLink="false">AA2D07A334EDA89D1D6BA7D2A55A753C</guid></item><item><title><![CDATA[Examples of GoldSim&#39;s New Script Element]]></title><link>http://www.GoldSim.com/Wiki/Knowledge Base.Examples-of-GoldSims-New-Script-Element.ashx</link><author> (jlillywh)</author><description><![CDATA[<h2 class="separator"> Examples of GoldSim's New Script Element <a class="headeranchor" id="Examples_of_GoldSims_New_Script_Element_3" href="#Examples_of_GoldSims_New_Script_Element_3" title="Link to this Section"></a></h2>
GoldSim’s new Script element is designed to make it easier to carry out iterative calculations, work with vectors and matrices, and develop other highly customized calculations. The Script element is inserted like any other element in GoldSim. The Script element has all the tools needed to build the script line by line through a guided process that keeps you from having to memorize syntax. <br /><br />Scripts usually include variable definition and assignment statements to create and work with variables that are local to the script. Variable definition statements define the units and dimensions of a variable and make an initial assignment to it. Variable assignment statements change the values of variables after they have been defined. Scripts can also include statements to control the flow of calculations, such as if statements, for loops, do loops, while loops, and repeat loops, as well as break and continue statements to alter the behavior of loops. You can insert comments throughout your scripts, and also insert statements that cause messages, warnings or errors to be written to the model’s run log or pop-up windows. There is a powerful debugging capability for scripts that makes it possible to pause part way through completion and step through statements line by line while using the mouse to see variable values in tooltips. <br /><br />Let's introduce the Script element in a couple of examples. <br /><br /><h3 class="separator"> First Script Example: Iterative Calculations  <a class="headeranchor" id="First_Script_Example:_Iterative_Calculations_0" href="#First_Script_Example:_Iterative_Calculations_0" title="Link to this Section"></a></h3>
This simple example illustrates how the Script element can be used to carry out an iterative calculation. It can be found in a file (Script.gsm) that is located in the General Examples folder of your GoldSim directory. The example uses Newton’s method to calculate the square root of 101. While you’re certainly not likely to need to calculate the square root of 101 by Newton’s method, the model does provide a nice example of how to iterate within a script. Newton’s method is a successive approximation method for finding real roots of differentiable functions. For a function f(X), which in this case represents the error in the approximation, which we wish to go to zero, the formula for Newton’s method is: <br /><br /><img src="GetFile.aspx?Page=Knowledge%20Base.Examples-of-GoldSims-New-Script-Element&amp;File=image1.png" alt="Image" /><br /><br />Where f ’ (Xn) is the first derivative with respect to X, and Xn is the nth approximation of the root (X0 is an initial guess for the root). Therefore, in our example of finding the square root of 101: <br /><br /><img src="GetFile.aspx?Page=Knowledge%20Base.Examples-of-GoldSims-New-Script-Element&amp;File=image2.png" alt="Image" /><br /><br />The script used for this simple example to solve for the square root of the variable Val is shown below: <br /><br /><img src="GetFile.aspx?Page=Knowledge%20Base.Examples-of-GoldSims-New-Script-Element&amp;File=image3.png" alt="Image" /><br /><br />The script starts out with Variable Definition statements in lines 1 and 2. Note that when script variables are referenced on the right side of equations (e.g., in line 4), a ~ symbol is required. This is because script variables are locally available properties. In line 1, the script references an element outside this Script element called Val (a constant whose square root is being sought, 101). Note that referencing another element’s output does not require the ~ symbol. <br /><br />After the Variable Definition statements, a FOR loop is defined. The FOR loop starting in line 3 shows that it creates a loop variable (named “I”) that is initially 1 and is incremented by 1 on each iteration, continuing while the expression “I<=MaxIterat” is true. Hence, the FOR loop executes the statements it contains until it is broken by a BREAK statement, or the loop count reaches the specified maximum number of iterations possible. In each FOR loop iteration, two more Variable Definition statements (with expressions as the assignments) compute the values for the function (F) and the derivative (FPrime). A Variable Assignment statement (line 13) then generates a new approximation of the square root at the bottom of the loop. <br /><br />The IF statement block beginning at line 7 tests the approximation error in the current estimate of the square root. If it is sufficiently small, a BREAK statement is executed to terminate the FOR loop. <br /><br />If the approximation error remains high and the maximum number of iterations is reached, a LOG statement (line 10) is written to the Run Log noting that the script failed to converge. Line 6 is another LOG statement reporting the progress of the successive approximations for each iteration of the FOR loop. <br /><br /><h3 class="separator"> Second Script Example: Working with Matrices  <a class="headeranchor" id="Second_Script_Example:_Working_with_Matrices_1" href="#Second_Script_Example:_Working_with_Matrices_1" title="Link to this Section"></a></h3>
A very common application of the Script element is to construct and/or manipulate arrays. This is typically facilitated by using one of the Script element’s looping constructs to assign values to rows, columns and/or individual items. The simple example described here illustrates how the Script element can be used to carry out array operations such as these. It can be found in a file (Script.gsm) that is located in the General Examples folder of your GoldSim directory. <br /><br />The example starts with an input matrix. In the input matrix, each column represents a variable, and each row represents an observation of the variable. The script computes the correlations among the various columns (variables) of the matrix, producing a symmetric correlation matrix (rows and columns both indexed by variable). The correlation coefficient, Cxy, between two columns of data (i.e., the correlation between two variables) is given by the following equation: <br /><br /><img src="GetFile.aspx?Page=Knowledge%20Base.Examples-of-GoldSims-New-Script-Element&amp;File=image4.png" alt="Image" /><br /><br />In this equation, x and y are the variables. xi and yi are the ith observations of variable x and y, respectively. mx and my are the means of the observations for those variables (i.e., the means of all values in a particular column). sx and sy are the standard deviations for those observations. n is the number of observations (i.e., the number of rows). <br /><br />The script used for this simple example is shown below: <br /><br /><img src="GetFile.aspx?Page=Knowledge%20Base.Examples-of-GoldSims-New-Script-Element&amp;File=image5.png" alt="Image" /><br /><br />At the top of the script (lines 2 and 4), Variable Definition statements (with expressions as the assignments) compute the means and standard deviations of each column. The calculation of the correlation coefficient for each column pair is then carried out using two Variable Assignment statements. The first (line 11) is in the middle of three nested DO loops. The second (line 14) is at the bottom of the second nested loop. <br /><br /><h3 class="separator"> More Examples in the Model Library  <a class="headeranchor" id="More_Examples_in_the_Model_Library_2" href="#More_Examples_in_the_Model_Library_2" title="Link to this Section"></a></h3>
If you are interested in Script element applications, please see two recent additions to the model library. One model is In that model a Script element is used to carry out a binary search for the headloss in pump. It solves a recursive loop in which the flow rate depends on the headloss of a pump and the headloss depends on the flow rate. Another recent addition to the model library is Muskingum channel routing is the simplest kinematic wave routing method. It is used for channel routing problems that are unidirectional without backwater effects, which includes most GoldSim water model situations where a travel time simulation is necessary. It is a specialized sort of material delay with dispersion for water in channels. <br /><br /><br /><br />]]></description><pubDate>Fri, 22 Mar 2013 21:34:16 GMT</pubDate><guid isPermaLink="false">0040B75819FF73D184DA6F8B55AA7C40</guid></item><item><title><![CDATA[Shifting Time Series Data - Using Historic Data in Predictive Models]]></title><link>http://www.GoldSim.com/Wiki/Knowledge Base.Shifting-Time-Series-Data-Using-Historic-Data-in-Predictive-Models.ashx</link><author> (jlillywh)</author><description><![CDATA[<h2 class="separator"> Shifting Time Series Data - Using Historic Data in Predictive Models <a class="headeranchor" id="Shifting_Time_Series_Data_-_Using_Historic_Data_in_Predictive_Models_0" href="#Shifting_Time_Series_Data_-_Using_Historic_Data_in_Predictive_Models_0" title="Link to this Section"></a></h2>
When we build simulations, we are often interested in simulating the future in order to make predictions that influence decision-making. In most cases, available data are past records or historic data. Thus it is important to effectively use the existing data in building realistic future simulations. <br /><br />The Time Series element enables us to easily import existing records and data from Excel spreadsheets and use it in models. Moreover, GoldSim 10.1 and later versions include Time Shifting Options that let us time-shift historic data to the simulation time period. <br /><br />The Time Shifting Options can be found under the <b>More</b> button in the Time Series Properties dialog. <br /><br /><img src="GetFile.aspx?Page=Knowledge%20Base.Shifting-Time-Series-Data-Using-Historic-Data-in-Predictive-Models&amp;File=image1.jpeg" alt="Image" /><br /><br />After expanding the dialog, tick the checkbox to enable Time Shifting of Time Series Data. <br /><br /><img src="GetFile.aspx?Page=Knowledge%20Base.Shifting-Time-Series-Data-Using-Historic-Data-in-Predictive-Models&amp;File=image2.jpeg" alt="Image" /><br /><br />There are two ways that Time Series data can be shifted: 1) Using a random starting point, or 2) aligning data years to the simulation start year. The first option randomly samples a starting point in the data set for each realization. The second option is available if the Time Series data is specified using Calendar Time and it simply aligns the data start year to the simulation start year. <br /><br /><img src="GetFile.aspx?Page=Knowledge%20Base.Shifting-Time-Series-Data-Using-Historic-Data-in-Predictive-Models&amp;File=image3.jpeg" alt="Image" /><br /><br />To illustrate this, let’s consider the following case: <br /><br />We have a record of daily temperature from January 10, 1997 until December 31, 2001. We are interested in building a model that runs from Aril 1st, 2010 until March 31st, 2013 in calendar time, and we’d like to use the temperature data from the record. <br /><br />After importing the record into the Time Series Data table, we have to specify how to use this record in the simulation. (Without Time shifting, Time Series data with no overlap with the simulation time cannot be used in the model.) <br /><br />If we choose the random starting point with no periodicity option, GoldSim will pick a random date between 1/10/1997 and 12/31/2001 at each realization and match it up with the simulation start time. If GoldSim samples a date close to the end of the data set, the Time Series may run out of data before the simulation end date. In this case, the Time Series will repeat itself from the beginning of the Time Series data. <br /><br />Figure 1 plots five different realizations of a Time Series output with the above settings. Different dates were sampled as the simulation start time at each realization and ran for three years. <br /><br /><img src="GetFile.aspx?Page=Knowledge%20Base.Shifting-Time-Series-Data-Using-Historic-Data-in-Predictive-Models&amp;File=image4.jpeg" alt="Image" /><br /><br /><b>Figure 1: Time Series with random starting point time shifting option with no periodicity</b><br /><br />In some cases, however, the data may be periodic and we may want to sample a particular date of a random year (or particular time of a random day) to match up with the simulation start time. For example, temperature data is annually periodic and we may want to sample April 1st of random years to match up with the simulation start time. (If we have data that repeats itself daily, we should use the diurnal periodicity option instead.)<br /><br /><img src="GetFile.aspx?Page=Knowledge%20Base.Shifting-Time-Series-Data-Using-Historic-Data-in-Predictive-Models&amp;File=image5.jpeg" alt="Image" /><br /><br />We can see in the Figure 2 that data is sampled from different dates in the Time Series data set but still keeps the trends of the annual periodicity. <br /><br /><img src="GetFile.aspx?Page=Knowledge%20Base.Shifting-Time-Series-Data-Using-Historic-Data-in-Predictive-Models&amp;File=image6.jpeg" alt="Image" /><br /><br /><b>Figure 2: Time Series with random starting point time shifting option with annual periodicity</b><br /><br />Another option is to simply time-shift the time series data year to the simulation start year in a way that the start dates match up. Because the Time Series data set starts at 1/10/1997 and the simulation start time is 4/1/2010, the Time Series will use data from April 1st of 1997 in the data set regardless of realizations. <br /><br /><img src="GetFile.aspx?Page=Knowledge%20Base.Shifting-Time-Series-Data-Using-Historic-Data-in-Predictive-Models&amp;File=image7.jpeg" alt="Image" /><br /><br /><img src="GetFile.aspx?Page=Knowledge%20Base.Shifting-Time-Series-Data-Using-Historic-Data-in-Predictive-Models&amp;File=image8.jpeg" alt="Image" /><br /><br /><b>Figure 3: Time Series with Aligning data year time shifting option</b><br /><br />]]></description><pubDate>Fri, 22 Mar 2013 21:29:55 GMT</pubDate><guid isPermaLink="false">6D76C133537278E2A3A5E45A6445F677</guid></item><item><title><![CDATA[An introduction to Resources]]></title><link>http://www.GoldSim.com/Wiki/Knowledge Base.An-introduction-to-Resources.ashx</link><author> (jlillywh)</author><description><![CDATA[<h2 class="separator"> An introduction to Resources  <a class="headeranchor" id="An_introduction_to_Resources_0" href="#An_introduction_to_Resources_0" title="Link to this Section"></a></h2>
GoldSim Version 10.1 includes a powerful new feature called Resources that can be used to model stocks of items and material that are required for elements to operate or carry out certain actions. This new feature enables you to easily keep track of things like money, equipment, spares and personnel that are needed for various operations. In this article, we’ll take a look at a model that uses some basic Resource functionality. The model discussed in this article is actually installed with GoldSim Version and can be accessed by opening the software, going to <b>File|Open Examples…</b>in the main menu and opening the RL_Resources.gsm example in the Reliability Examples folder. <br /><br />This example contains 3 reliability elements representing identical machines which fail approximately twice a month according to an exponential distribution. When a machine fails, a spare and a technician are required in order for it to be repaired. The repair takes 5 days and cannot begin until both a spare and a technician are available. <br /><br /><img src="GetFile.aspx?Page=Knowledge%20Base.An-introduction-to-Resources&amp;File=image1.jpeg" alt="Image" /><br /><br />Resources are defined and edited through the Resource Manager dialog that can be accessed by selecting <b>Model| Resources…</b> in the main menu. The dialog allows you to add, remove and edit Resource Stores. The properties of existing Stores can be viewed by double-clicking their entry in the dialog. In this model, spares are defined as item-type and there are five of them at the beginning of the simulation. They are replenished by a Discrete Change element called Add. The model also has a Technician Resource, which is also item-type. One technician is available to execute repairs on the three machines.<br /><br /><img src="GetFile.aspx?Page=Knowledge%20Base.An-introduction-to-Resources&amp;File=image2.jpeg" alt="Image" /><br /><br /><img src="GetFile.aspx?Page=Knowledge%20Base.An-introduction-to-Resources&amp;File=image3.jpeg" alt="Image" /><br /><br />Now let’s look at reliability elements. Since we are using Resources to repair failures, Resource requirements are defined on the <b>Failure Modes</b> tab. If you select the Exponential/Poisson mode and then click on the Resource button at the bottom of the tab, you can see Resource requirements for repair of that mode. One spare is “spent” and one technician is “borrowed.” This means that the total quantity of spares goes down by one during a repair, and the number of available technicians is reduced by one for the duration of the repair. <br /><br /><img src="GetFile.aspx?Page=Knowledge%20Base.An-introduction-to-Resources&amp;File=image4.jpeg" alt="Image" /><br /><br /><img src="GetFile.aspx?Page=Knowledge%20Base.An-introduction-to-Resources&amp;File=image5.jpeg" alt="Image" /><br /><br />Resource requirements for the other two reliability elements are identical. Because spares are consumed, they need to be resupplied regularly. This is simulated with the elements in the bottom left of the model. When a machine is repaired, the availability of spares is checked. If there are less than 2 spares left in the shop and no order has been yet made, 5 extra spares are ordered. There is a delivery delay after the order is placed, after which the spares are added to the Resource Store. <br /><br /><img src="GetFile.aspx?Page=Knowledge%20Base.An-introduction-to-Resources&amp;File=image6.jpeg" alt="Image" /><br /><br />If we plot the status of the machines over the duration of the simulation we get the following time history graph: <br /><br /><img src="GetFile.aspx?Page=Knowledge%20Base.An-introduction-to-Resources&amp;File=image7.jpeg" alt="Image" /><br /><br />Note that a value of 0 means that machines are functioning and a value of 2 means that they are failed and have not yet been repaired. Look at the circled region. Right before the failure of Element_2, Element_3 fails. As a consequence, the technician begins work on repairing Element_3, and she doesn’t start work on Element_2 until she’s done repairing Element_3. If Resources were not used, both of the elements would be repaired 5 days after failure regardless of the status of the other elements. <br /><br />In this example, we’ve looked at Resource usage in reliability elements. However Resources can be accessed through other elements such as conditional Containers, Triggered Event elements, Event Delays and Discrete Change Delays. To learn more about Resources, you can read the Version 10.10 Summary document, sign up for a Webinar, read the detailed description in the User’s Guide, and download other Resource examples from the Model Library. <br /><br /><br /><br />]]></description><pubDate>Fri, 22 Mar 2013 19:30:42 GMT</pubDate><guid isPermaLink="false">91EF73D2D8E91940408E5CC4FE9B523E</guid></item><item><title><![CDATA[Little-Known Tricks for Quickly Inserting Links]]></title><link>http://www.GoldSim.com/Wiki/Knowledge Base.Little-Known-Tricks-for-Quickly-Inserting-Links.ashx</link><author> (jlillywh)</author><description><![CDATA[<h2 class="separator"> Little-Known Tricks for Quickly Inserting Links <a class="headeranchor" id="Little-Known_Tricks_for_Quickly_Inserting_Links_3" href="#Little-Known_Tricks_for_Quickly_Inserting_Links_3" title="Link to this Section"></a></h2>
Creating links is simple when a GoldSim model is small, but becomes more complex as the model and its hierarchy grows. In large models finding the right element can become quite tedious. As a result, GoldSim has a number of features to ease the process of creating links and locating the right element.<br /><br /><h3 class="separator"> Utilizing Previous and Home Buttons  <a class="headeranchor" id="Utilizing_Previous_and_Home_Buttons_0" href="#Utilizing_Previous_and_Home_Buttons_0" title="Link to this Section"></a></h3>
The screenshot below is of an “Insert Link” dialog in a supply chain model. Note the search box (and search options) along with the <b><i>Previous</i></b> and <b><i>Home</i></b> buttons at the top of the dialog. Surprisingly, very few modelers utilize these timesaving features of GoldSim. <br /><br /><img src="GetFile.aspx?Page=Knowledge%20Base.Little-Known-Tricks-for-Quickly-Inserting-Links&amp;File=image1.jpeg" alt="Image" /><br /><br />The <b><i>Previous</i></b> and <b><i>Home</i></b> buttons are useful when you have a multilayered model and would like make a number of references to elements in a particular location.<br /><br />When you open the dialog from an input field of an element, GoldSim assumes that in most instances you will want to link to a nearby element, and selects the element that you called the Insert Link dialog from. For example, if you are creating a reference in the input filed of the “Desired_Inventory” element, the dialog will open with the Desired_Inventory element highlighted, as shown above.<br /><br />Many users are not aware that GoldSim remembers the last element you linked to using the Insert Link dialog. For instance, if you had previously referenced the Delay element in the Product_in_Transit Container, clicking the <b><i>Previous</i></b> button will open the Product_in_Transit Container and highlight the Delay element as shown below: <br /><br /><img src="GetFile.aspx?Page=Knowledge%20Base.Little-Known-Tricks-for-Quickly-Inserting-Links&amp;File=image2.jpeg" alt="Image" /><br /><br />If a link that you are trying to make is in the same Container as before, this can save you time by allowing you to go directly to this particular Container. Note that holding the <b><i>Ctrl</i></b> key while opening the Insert Link… dialog has the same effect as opening the dialog and pressing the <b><i>Previous</i></b> button.<br /><br />Pressing the <b><i>Home</i></b> link returns to the directory of the element you are linking to. <br /><br /><h3 class="separator"> Utilizing Search within the Insert Link Dialog  <a class="headeranchor" id="Utilizing_Search_within_the_Insert_Link_Dialog_1" href="#Utilizing_Search_within_the_Insert_Link_Dialog_1" title="Link to this Section"></a></h3>
Within a large model, searching by element ID is one of the fastest ways to find the element that you are trying to link to. You may type in a part of element ID and GoldSim will search all elements including the expression. You can also choose (in Search Options) to search by Descriptions and Notes. <br /><br /><h3 class="separator"> Shortcut Keys for Opening the Context Menu and Insert Link Browser <a class="headeranchor" id="Shortcut_Keys_for_Opening_the_Context_Menu_and_Insert_Link_Browser_2" href="#Shortcut_Keys_for_Opening_the_Context_Menu_and_Insert_Link_Browser_2" title="Link to this Section"></a></h3>
When an input field is selected, <b><i>Ctrl + M</i></b> is equivalent to right clicking within an input field. This opens up the context menu:<br /><br /><img src="GetFile.aspx?Page=Knowledge%20Base.Little-Known-Tricks-for-Quickly-Inserting-Links&amp;File=image3.jpeg" alt="Image" /><br /><br />You can also use <b><i>Ctrl + I</i></b> to directly open the Insert Link dialog (it is the equivalent of right-clicking and selecting Insert Link… and pressing the <b><i>Previous</i></b> button).<br /><br /><br /><br />]]></description><pubDate>Fri, 22 Mar 2013 19:17:33 GMT</pubDate><guid isPermaLink="false">032FC49ADB8B94C6B9EE48558B992E0B</guid></item><item><title><![CDATA[Vector and Matrix Constructors]]></title><link>http://www.GoldSim.com/Wiki/Knowledge Base.Vector-and-Matrix-Constructors.ashx</link><author> (jlillywh)</author><description><![CDATA[<h2 class="separator"> Vector and Matrix Constructors <a class="headeranchor" id="Vector_and_Matrix_Constructors_0" href="#Vector_and_Matrix_Constructors_0" title="Link to this Section"></a></h2><br /><br />Often it's necessary to assemble scalar values into vectors and scalar values and vectors into matrices. In versions prior to GoldSim 10, this could only be done at time zero using static values. This meant that array manipulation often required using an external DLL or spreadsheet. <br /><br />The latest version permits you to use both static and dynamic values within vector constructors. In the accompanying model to this article (which you can download <a class="externallink" href="http://www.goldsim.com/Wiki/Model%20Library.Vector-and-Matrix-Constructors-in-Version-10-and-Later.ashx" title="here" target="_blank">here</a>) you'll see the following example in the Dynamic_Values container: <br /><br /><img src="GetFile.aspx?Page=Knowledge%20Base.Vector-and-Matrix-Constructors&amp;File=image1.jpeg" alt="Image" /><br /><br />In this example, a static Data element output, a Stochastic element resampled daily, and an Expression element (equal to e^(1/(ETime|d|+1))) are combined together into a three element vector using the following equation:<br /><br />Vector(ThreeLabels, Data, Stochastic, Expression)<br /><br />If we plot the output of the CreateVector element we can see that the dynamic values are updated throughout the simulaton: <br /><br /><img src="GetFile.aspx?Page=Knowledge%20Base.Vector-and-Matrix-Constructors&amp;File=image2.jpeg" alt="Image" /><br /><br />The new constructors also allow you to combine vectors into matrices. In the model, this is shown in the Vector_to_Matrix container. Here I've created three vectors with 4 elements (Vector 1 is equal to <a class="unknownlink" href="Knowledge Base.1%2c%202%2c%203%2c%204.ashx" title="Knowledge Base.1, 2, 3, 4">1, 2, 3, 4</a>, Vector 2 is equal to <a class="unknownlink" href="Knowledge Base.10%2c%2020%2c%2030%2c%2040.ashx" title="Knowledge Base.10, 20, 30, 40">10, 20, 30, 40</a> and Vector 3 is equal to <a class="unknownlink" href="Knowledge Base.100%2c%20200%2c%20300%2c%20400.ashx" title="Knowledge Base.100, 200, 300, 400">100, 200, 300, 400</a>. These are combined into a 3 row, 4 column matrix in the Three_by_Four element using the following Matrix constructor:<br /><br />Matrix(ThreeLabels, FourLabels, Vector1, Vector2, Vector3)<br /><br />The result is the following: <br /><br /><img src="GetFile.aspx?Page=Knowledge%20Base.Vector-and-Matrix-Constructors&amp;File=image3.jpeg" alt="Image" /><br /><br />We can combine the same vectors into a 4 row, 3 column matrix in the Four_by_Three element using the following Matrix constructor:<br /><br />Matrix(FourLabels, ThreeLabels, Vector1, Vector2, Vector3)<br /><br />The result is the following:<br /><br /><img src="GetFile.aspx?Page=Knowledge%20Base.Vector-and-Matrix-Constructors&amp;File=image4.jpeg" alt="Image" /><br /><br />Version 10 also adds two special operators, row and col which can be used within the vector constructor. Two examples of this are shown in the Row_Col container. <br /><br />The first example, UpperTriangular, creates an upper triangular matrix of 1's. The following expression is used:<br /><br />Matrix(ThreeLabels, ThreeLabels, if(col>=row, 1, 0))<br /><br />The result looks like this: <br /><br /><img src="GetFile.aspx?Page=Knowledge%20Base.Vector-and-Matrix-Constructors&amp;File=image5.jpeg" alt="Image" /><br /><br />The second example, EvenZeros, creates a 4x4 matrix with 1's in the odd rows only. The following expression is used:<br /><br />Matrix(FourLabels, FourLabels, if(row mod 2 = 0, 0, 1)<br /><br />In this case, the result is as follows:<br /><br /><img src="GetFile.aspx?Page=Knowledge%20Base.Vector-and-Matrix-Constructors&amp;File=image6.jpeg" alt="Image" /><br /><br />Note that in both cases, the 1 could have been replaced with a link to an element's output (dynamic or static). <br /><br />More documentation on vector and matrix constuctors can be found under the topic Defining Arrays in an Input Field Using Array Constructor Functions in the GoldSim User's Guide and in the online help. 
]]></description><pubDate>Fri, 22 Mar 2013 17:40:08 GMT</pubDate><guid isPermaLink="false">AC6A07291080018C81FB8E2DC625E2CE</guid></item><item><title><![CDATA[Demystifying Triggering]]></title><link>http://www.GoldSim.com/Wiki/Knowledge Base.Demystifying-Triggering.ashx</link><author> (jlillywh)</author><description><![CDATA[<h2 class="separator"> Demystifying Triggering <a class="headeranchor" id="Demystifying_Triggering_2" href="#Demystifying_Triggering_2" title="Link to this Section"></a></h2>
One of GoldSim’s most powerful tools is triggering, but very few modelers use anything more than the most basic OnEvent or OnTrue triggers. In this article I’ll describe and demonstrate some of GoldSim’s advanced triggering features.<br /><br />All of the examples described in the model can be downloaded from the GRC as model #76. <br /><br /><h3 class="separator"> Using the Semicolon in On Event Triggers <a class="headeranchor" id="Using_the_Semicolon_in_On_Event_Triggers_0" href="#Using_the_Semicolon_in_On_Event_Triggers_0" title="Link to this Section"></a></h3>
A little-known triggering feature is the semicolon in an On Event type trigger. A semicolon can be placed between links to Event-type outputs to indicate that more than one event must occur before the trigger will fire. <br /><br />For example:<br /><br /><img src="GetFile.aspx?Page=Knowledge%20Base.Demystifying-Triggering&amp;File=image1.png" alt="Image" /><br /><br />indicates that Random_Event_A, Random_Event_B and Random_Event_C must occur before this element’s trigger will fire. If we were to look at the Cumulative Emitted output of the three Random_Event elements and the triggered element we would see the following:<br /><br /><img src="GetFile.aspx?Page=Knowledge%20Base.Demystifying-Triggering&amp;File=image2.emf" alt="Image" /><br /><br /><br /><br />In this realization of the simulation we see that Random_Event_B occurs first, followed by Random_Event_A. Random_Event_C is the last to occur, and since the Triggered_Event element’s trigger is now satisfied, it also emits an event at the same time.<br /><br /><h3 class="separator"> Precedence Conditions and the Required Condition Field <a class="headeranchor" id="Precedence_Conditions_and_the_Required_Condition_Field_1" href="#Precedence_Conditions_and_the_Required_Condition_Field_1" title="Link to this Section"></a></h3>
Whenever an On Event, On True, On False or On Changed trigger occurs, GoldSim checks two additional fields, both of which are accessed using the <b>More</b> button in the triggering dialog:<br /><br /><img src="GetFile.aspx?Page=Knowledge%20Base.Demystifying-Triggering&amp;File=image3.png" alt="Image" /><br /><br />A Precedence Condition tells GoldSim that any triggering events must be queued until that condition is met. For example, here are Triggering dialogs for two different Triggered Event elements:<br /><br /><img src="GetFile.aspx?Page=Knowledge%20Base.Demystifying-Triggering&amp;File=image4.png" alt="Image" /><br /><br /><img src="GetFile.aspx?Page=Knowledge%20Base.Demystifying-Triggering&amp;File=image5.png" alt="Image" /><br /><br />Both elements are initially triggered at 50d. They reference two different condition-type outputs (one true from 25 d onwards and the other true starting at 75d). If we plot the cumulative emitted outputs of both elements we would see the following:<br /><br /><img src="GetFile.aspx?Page=Knowledge%20Base.Demystifying-Triggering&amp;File=image6.emf" alt="Image" /><br /><br />Since the Precedence Condition for the first element is already satisfied at 50d, the event is immediately emitted. The second element waits until its Precedence Condition is satisfied at 75d before emitting an event.<br /><br />The Required Condition field is the last item to be checked prior to the event being emitted. Again, let’s look at triggering dialogs for two different Triggered Event elements:<br /><br /><img src="GetFile.aspx?Page=Knowledge%20Base.Demystifying-Triggering&amp;File=image7.png" alt="Image" /><br /><br /><img src="GetFile.aspx?Page=Knowledge%20Base.Demystifying-Triggering&amp;File=image8.png" alt="Image" /><br /><br />Both elements are initially triggered at 50d. The Required Condition field references two different condition-type outputs (one true from 75 d onwards and the other true starting at 25d). If we plot the cumulative emitted outputs of both elements we would see the following:<br /><br /><img src="GetFile.aspx?Page=Knowledge%20Base.Demystifying-Triggering&amp;File=image9.emf" alt="Image" /><br /><br />Since True_at_25d is true, the event that checks that condition is emitted. However, True_at_75d is false at 50d, and as a result the element with that required condition never emits an event.<br /><br />Precedence and Required Conditions can be combined in the same triggering dialog. Again, here are the Triggering dialogs for two Triggered Event elements:<br /><br /><img src="GetFile.aspx?Page=Knowledge%20Base.Demystifying-Triggering&amp;File=image10.png" alt="Image" /><br /><br /><img src="GetFile.aspx?Page=Knowledge%20Base.Demystifying-Triggering&amp;File=image11.png" alt="Image" /><br /><br />Both elements are initially triggered at 50d. The first element references True_at_75d as its Precedence Condition and True_at_25d as its Required Condtion. The second uses True_at_25d as its Precedence Condition and True_at_75d as its Required Condtion. If we plot the cumulative emitted outputs of both elements we would see the following:<br /><br /><img src="GetFile.aspx?Page=Knowledge%20Base.Demystifying-Triggering&amp;File=image12.emf" alt="Image" /><br /><br />The element that has a Precedence Condition of True_at_25d immediately checks its Required Condition (True_at_75d), which is false. As a result, that Triggered Event does not emit an event over the course of the simulation. The event with a Precedence Condition of True_at_75d waits until 75d to check its Required Condition (True_at_25d). Since this is true, the Triggered Event emits an event at 75d.<br /><br />All of these features are described in depth in the GoldSim User’s Guide and in the Online Help (under Specifying Triggering Events, Specifying a Precedence Condition for a Trigger and Specifying a Required Condtion for a Trigger). <br /><br /><br /><br />]]></description><pubDate>Fri, 22 Mar 2013 17:27:36 GMT</pubDate><guid isPermaLink="false">E643B31F7E3C61028E4DB2A4CA2D755A</guid></item><item><title><![CDATA[Using Importance Sampling to Model High-Consequence, Low-Probability Outcomes]]></title><link>http://www.GoldSim.com/Wiki/Knowledge Base.Using-Importance-Sampling-to-Model-High-Consequence-Low-Probability-Outcomes.ashx</link><author> (jlillywh)</author><description><![CDATA[<h2 class="separator"> Using Importance Sampling to Model High-Consequence, Low-Probability Outcomes <a class="headeranchor" id="Using_Importance_Sampling_to_Model_High-Consequence_Low-Probability_Outcomes_0" href="#Using_Importance_Sampling_to_Model_High-Consequence_Low-Probability_Outcomes_0" title="Link to this Section"></a></h2>
For risk analyses, it is frequently necessary to evaluate the low-probability, high-consequence end of the distribution of the performance of the system. Because the models for such systems are often complex (and hence need significant computer time to simulate), 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.<br /><br />To facilitate these type of analyses, GoldSim allows you to utilize an <b><i>importance sampling</i></b> 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.<br /><br />GoldSim has provided a mechanism to carry out importance sampling of parameters in your model (probability distributions) since its earliest version. In particular, you can instruct GoldSim to over-sample either the high-end or the low-end of a distribution. You will find this feature by expanding the Stochastic dialog. In Version 9.6, it looks like this:<br /><br /><img src="GetFile.aspx?Page=Knowledge%20Base.Using-Importance-Sampling-to-Model-High-Consequence-Low-Probability-Outcomes&amp;File=image1.gif" alt="Image" /><br /><br />In Version 10, it looks like this:<br /><br /><img src="GetFile.aspx?Page=Knowledge%20Base.Using-Importance-Sampling-to-Model-High-Consequence-Low-Probability-Outcomes&amp;File=image2.gif" alt="Image" /><br /><br />(The importance sampling algorithm was modified in Version 10 so that it is no longer necessary to specify a Magnification factor). <br /><br />GoldSim Version 10 introduces an even more powerful feature: the ability to apply importance sampling not only to parameters, but to events. This allows you to artificially increase the rate of occurrence of rare events in GoldSim (e.g., failures, accidents). The result is high-resolution development of the high-consequence, low-probability "tails" of the consequences resulting from these low-probability events. This kind of sampling is particularly powerful for risk analyses that involve rare events that can have disastrous (e.g., fatal) consequences.<br /><br />Version 10 provides importance sampling for Timed Event, Random Choice and Function and Action Reliability elements. It is specified by selecting the checkbox for <b>Use Importance Sampling for this element</b>:<br /><br /><img src="GetFile.aspx?Page=Knowledge%20Base.Using-Importance-Sampling-to-Model-High-Consequence-Low-Probability-Outcomes&amp;File=image3.gif" alt="Image" /><br /><br />One important note on importance sampling: it should be used very sparingly (typically for only 2 or 3 parameters and/or events at the most). This is because the degree of biasing that GoldSim can provide <u>decreases</u> with the number of elements for which importance sampling is applied. <br /><br />The mathematical details of the importance sampling algorithm utilized by GoldSim are discussed in detail in Appendix B of the GoldSim User’s Guide.<br /><br />]]></description><pubDate>Fri, 22 Mar 2013 17:12:14 GMT</pubDate><guid isPermaLink="false">492928E486C7B0908BDEBD272F24C093</guid></item><item><title><![CDATA[Using the Status Element to Track Boolean State Variables]]></title><link>http://www.GoldSim.com/Wiki/Knowledge Base.Using-the-Status-Element-to-Track-Boolean-State-Variables.ashx</link><author> (jlillywh)</author><description><![CDATA[<h2 class="separator">Using the Status Element to Track Boolean State Variables<a class="headeranchor" id="Using_the_Status_Element_to_Track_Boolean_State_Variables_0" href="#Using_the_Status_Element_to_Track_Boolean_State_Variables_0" title="Link to this Section"></a></h2>Most real-world models involve tracking the <i>status</i> of various aspects of a system that are Boolean; that is, always in one of two possible states or conditions (e.g., on/off; yes/no, true/false). For example:<br /><br /><ul><li>If modeling a water supply system, at any point in time, you may need to track whether or not a particular pump is on or off.</li><li>If modeling a project, at any point in time, you may need to track whether you are above or below a particular spend limit.<br />If modeling a complex machine, at any point in time, you may need to know whether or not certain parts of the system have failed, and if so, the manner in which it has failed.<br /></li></ul><br />GoldSim provides a powerful element to easily facilitate this - the Status element. Status elements allow you to monitor the status of something that is changed instantaneously (i.e., is <i>triggered</i>) by events. The single output of a Status element is a  (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. <br /><br />The dialog for a Status element looks like this:<br /><br /><img src="GetFile.aspx?Page=Knowledge%20Base.Using-the-Status-Element-to-Track-Boolean-State-Variables&amp;File=image1.gif" alt="Image" /><br /><br />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 . By default, it is False. You must then specify the triggering event(s) which cause the element to be set to True and False. These are both defined via Trigger… buttons, which provide access to standard Trigger dialogs:<br /><br /><img src="GetFile.aspx?Provider=(Knowledge Base.Using&amp;File=-the-Status-Element-to-Track-Boolean-State-Variables)}image2.gif" alt="Image" /><br /><br />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  (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.<br /><br />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  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). <br /><br />The output of this simulation would look like this (note that in a chart, 1 corresponds to True, and 0 corresponds to False):<br /><br /><img src="GetFile.aspx?Provider=(Knowledge Base.Using&amp;File=-the-Status-Element-to-Track-Boolean-State-Variables)}image3.gif" alt="Image" /><br /><br />This functionality allows you 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  (i.e., is it full?). You might then reference the output of the Status element in a Selector element or a Splitter element to appropriately control the flow of material in your model.
]]></description><pubDate>Fri, 22 Mar 2013 17:09:37 GMT</pubDate><guid isPermaLink="false">7AEE2766D5153DC467C3786B69CE6EED</guid></item><item><title><![CDATA[Running Models Using Calendar-Based Timesteps ]]></title><link>http://www.GoldSim.com/Wiki/Knowledge Base.Running-Models-Using-Calendar-Based-Timesteps.ashx</link><author> (jlillywh)</author><description><![CDATA[<h2 class="separator">Running Models Using Calendar-Based Timesteps<a class="headeranchor" id="Running_Models_Using_Calendar-Based_Timesteps_0" href="#Running_Models_Using_Calendar-Based_Timesteps_0" title="Link to this Section"></a></h2>
GoldSim allows you to run models based on either elapsed time or calendar date/time. Running calendar date/time models, however, can be a bit tricky, since calendar-based models are complicated by variability of the basic time units (e.g., the number of days in a month changes for each month, and due to leap years, the length of a year is also variable). So how do you instruct GoldSim to have a timestep once per month (e.g., on the 1st day of each month) or once per quarter (e.g., on the 1st day of each quarter)?<br /><br />This can be accomplished by using Time phases. Time phases can be used to create a simulation with timesteps at the beginning of every month, every quarter, or every year. Time phases are created within the Time tab of the Simulation Settings dialog. Phases can have different durations and timestep lengths. By default, there is a single time phase in GoldSim, with a duration (a time range) equal to the simulation duration. The timestep length is equal to the duration divided by the number of timesteps specified in the #Steps field for the phase:<br /><br /><img src="GetFile.aspx?Page=Knowledge%20Base.Running-Models-Using-Calendar-Based-Timesteps&amp;File=image1.gif" alt="Image" /><br /><br />In this example, there is a single time phase with a duration of 100 days and a timestep of one day.<br /><br />You can add a new phase by pressing the Add… button. You will then be prompted for the Start-Time for the new phase. <br /><br />When you are carrying out a Date-time simulation, you must enter the date and time for the start of the new phase:<br /><br /><img src="GetFile.aspx?Page=Knowledge%20Base.Running-Models-Using-Calendar-Based-Timesteps&amp;File=image2.gif" alt="Image" /><br /><br />This could, for example, result in the following:<br /><br /><img src="GetFile.aspx?Page=Knowledge%20Base.Running-Models-Using-Calendar-Based-Timesteps&amp;File=image3.gif" alt="Image" /><br /><br />In this example, there are two time phases, each with different durations consisting of a single step.<br /><br />Given this information, you could use time phases to create a monthly timestep as follows:<br /><br /><ul><li>Set up your simulation as a Date-time simulation.</li><li>Create a separate phase for each month (with the specified Start-Time for the phase being the 1st of each month), specifying that each phase has 1 step. <br />This approach works well on shorter simulations. However, if your simulation required a large number of phases, it would be tedious to create each phase (e.g., a 10 year simulation with monthly timesteps would require 120 phases to be manually created).<br /></li></ul><br />To address this, GoldSim provides a "shortcut" for automatically creating new phases. In particular, <i>if you have specified your Basic Time Settings to run a Date-time simulation</i>, a number of context menu options are provided when you right-click within a defined phase in the Time Phase Settings portion of the dialog:<br /><br /><img src="GetFile.aspx?Page=Knowledge%20Base.Running-Models-Using-Calendar-Based-Timesteps&amp;File=image4.gif" alt="Image" /><br /><br />Selecting Add a step for each calendar month causes GoldSim to insert a new Phase starting on the first day of each month:<br /><br /><img src="GetFile.aspx?Page=Knowledge%20Base.Running-Models-Using-Calendar-Based-Timesteps&amp;File=image5.gif" alt="Image" /><br /><br />Each phase has a single step with the length automatically adjusted for the actual length of time between each step. Similarly, selecting Add a step for each calendar quarter causes GoldSim to insert a new Phase starting on the first day of each quarter:<br /><br /><img src="GetFile.aspx?Page=Knowledge%20Base.Running-Models-Using-Calendar-Based-Timesteps&amp;File=image6.gif" alt="Image" /><br /><br />Selecting Add a step for each calendar year causes GoldSim to insert a new Phase starting on the first day of each year:<br /><br /><img src="GetFile.aspx?Page=Knowledge%20Base.Running-Models-Using-Calendar-Based-Timesteps&amp;File=image7.gif" alt="Image" /><br /><br />]]></description><pubDate>Fri, 22 Mar 2013 16:51:18 GMT</pubDate><guid isPermaLink="false">29ACC9990665719D7116A9038619BCE9</guid></item><item><title><![CDATA[Probability Distribution]]></title><link>http://www.GoldSim.com/Wiki/Knowledge Base.Probability-Distribution.ashx</link><author> (jlillywh)</author><description><![CDATA[<h2 class="separator">Probability Distribution<a class="headeranchor" id="Probability_Distribution_5" href="#Probability_Distribution_5" title="Link to this Section"></a></h2>
When uncertainty is quantified, it is expressed in terms of <b>probability
distributions</b>. A probability distribution is a mathematical representation of the
relative likelihood of an uncertain variable having certain specific values.<br /><br /><h3 class="separator">Probability Distributions Available within GoldSim<a class="headeranchor" id="Probability_Distributions_Available_within_GoldSim_3" href="#Probability_Distributions_Available_within_GoldSim_3" title="Link to this Section"></a></h3> 
<div class="imageright"><a href="GetFile.aspx?Page=Probability-Distribution&amp;File=Stochastic.jpg" title="GetFile.aspx?Page=Probability-Distribution&amp;File=Stochastic.jpg"><img class="image" src="GetFile.aspx?Page=Probability-Distribution&amp;File=Stochastic.jpg" alt="Image" /></a></div><br /><ul><li><b>Uniform</b><ul><li>log</li></ul></li><li><b>Beta (Generalized) Distribution</b></li><li><b>Beta Distribution</b></li><li><b>Binomial Distribution</b></li><li><b>Boolean Distribution</b></li><li><b>Cumulative Distribution</b></li><li><b>Discrete Distribution</b></li><li><b>Exponential Distribution</b></li><li><b>Extreme Probability Distribution</b><ul><li>Maximum Value</li><li>Minimum Value</li></ul></li><li><b>Extreme Value Distribution</b><ul><li>Maximum Value</li><li>Minimum Value</li></ul></li><li><b>Gamma Distribution</b><ul><li>Truncated</li></ul></li><li><b>Log-Normal Distribution</b><ul><li>Geometric Value</li><li>Truncated</li></ul></li><li><b>Negative Binomial Distribution</b></li><li><b>Normal Distribution</b><ul><li>Truncated</li></ul></li><li><b>Pareto Distribution</b><ul><li>Truncated</li></ul></li><li><b>Pearson Type III Distribution</b></li><li><b>Poisson Distribution</b></li><li><b>Simple Result Distribution</b></li><li><b>Student's t Distribution</b></li><li><b>Triangular Distribution</b><ul><li>Log</li></ul></li><li><b>Uniform Distribution</b><ul><li>Log</li></ul></li><li><b>Weibull Distribution</b><ul><li>Truncated<br /></li></ul></li></ul><br />
<h3 class="separator">Other distributions that can be generated using GoldSim<a class="headeranchor" id="Other_distributions_that_can_be_generated_using_GoldSim_4" href="#Other_distributions_that_can_be_generated_using_GoldSim_4" title="Link to this Section"></a></h3><h4 class="separator">Beta PERT Distribution<a class="headeranchor" id="Beta_PERT_Distribution_0" href="#Beta_PERT_Distribution_0" title="Link to this Section"></a></h4>The Beta PERT distribution is a special case of the beta distribution. It can be easily employed using Beta (generalized) Distribution within GoldSim. (See a Forum article for details: <a class="externallink" href="http://www.goldsim.com/Forum/default.aspx?g=posts&amp;t=33" title="http://www.goldsim.com/Forum/default.aspx?g=posts&amp;t=33" target="_blank">http://www.goldsim.com/Forum/default.aspx?g=posts&amp;t=33</a>)<br /><br /><h4 class="separator">Truncated Exponential Distribition<a class="headeranchor" id="Truncated_Exponential_Distribition_1" href="#Truncated_Exponential_Distribition_1" title="Link to this Section"></a></h4>An exponential distribution is a special case of a gamma distribution with the shape parameter k=1, and gamma distribution can be truncated in GoldSim. 
(See a Forum article for details: <a class="externallink" href="http://www.goldsim.com/Forum/default.aspx?g=posts&amp;t=39" title="http://www.goldsim.com/Forum/default.aspx?g=posts&amp;t=39" target="_blank">http://www.goldsim.com/Forum/default.aspx?g=posts&amp;t=39</a>) <br /><br /><h4 class="separator">Gumbel Distribution<a class="headeranchor" id="Gumbel_Distribution_2" href="#Gumbel_Distribution_2" title="Link to this Section"></a></h4>This is the same distribution as the Extreme Value Distribution. <br /><br />
]]></description><pubDate>Fri, 22 Mar 2013 16:27:07 GMT</pubDate><guid isPermaLink="false">3DC39B736CEAD84980101BA97328296F</guid></item><item><title><![CDATA[User-Defined Fonts on Dashboard Controls]]></title><link>http://www.GoldSim.com/Wiki/Knowledge Base.User-Defined-Fonts-on-Dashboard-Controls.ashx</link><author> (jlillywh)</author><description><![CDATA[<h2 class="separator"> Fonts in Dashboard Controls <a class="headeranchor" id="Fonts_in_Dashboard_Controls_0" href="#Fonts_in_Dashboard_Controls_0" title="Link to this Section"></a></h2><br /><br />
Font usage in non-documents is a complicated issue. GoldSim dashboards represent user interfaces rather than documents, such as a Word document or even a Rich Text text box in GoldSim. Our possibilities are limited for two primary reasons:<br /><br /><ul><li>Some of the dashboard controls are not native to GoldSim and GoldSim has no control over their fonts (such as button and edit controls). These controls default to the UI font of the underlying operating system (as used on dialogs).</li><li>GoldSim can’t embed fonts for distribution to ensure availability of the font on all target machines. This would require license deals and a lot of code that verifies correct implementation.<br />As a consequence, GoldSim is designed so that dashboard controls always use the system-specific UI font. The known side-effect of this decision is that the font is actually different depending on the OS version and OS locale. The font that is used is called <b>MS Shell Dlg</b>. This  provides many of the technical details. We don’t expect you to read it, but just glancing at it should convince you that this is not a trivial issue. Please note an important comment from that document: <br /></li></ul><br /><br /><br />However, when you do that you will find that it does not quite work! The screenshot below shows the slider control with a header as well as two labels using the specified font and sizes of 8pts and 9pts, respectively.<br /><br /><img src="GetFile.aspx?Page=User-Defined-Fonts-on-Dashboard-Controls&amp;File=image1.png" alt="Image" /><br /><br /><br /><br />The first one has the right length but is not high enough. The second one is a bit too high and too wide. Bummer! How can this be? Well, the system calculates the best mapping on a number of parameters (actually, many parameters): OS version, OS locale, display resolution, font family, font mapping based on family, font weight, DPI setting, logical pixel size and more. Using the debugger I can determine what the font specifics are:<br /><br /><br /><br />Notice that the second attribute is called font height, not font size. Logical fonts in Windows actually don’t have a point size – they have a height! Conversion can be done using the following formula:<br /><br /> <br /><br /><br /><br />There lies the problem, however, as the conversion function is integer-based! In our case the desired font point size is actually 8.5 pts. Unfortunately, you can’t do that with the basic label text. But you can do it with the Text Box control:<br /><br /><br /><br /><img src="GetFile.aspx?Page=User-Defined-Fonts-on-Dashboard-Controls&amp;File=image2.png" alt="Image" /><br /><br /><br /><br /><img src="GetFile.aspx?Page=User-Defined-Fonts-on-Dashboard-Controls&amp;File=image3.png" alt="Image" /><br /><br /><br /><br />So, there it is. However, I have to warn you, this may have still not always look the same. On a given target system MS Shell Dlg may map to a different font or a slightly different font size. In such case the controls will again look slightly different than your text with hardcoded font size of 8.5 pts.<br /><br />The only solution I can think of is that we set the font family and size of the text labels (the simple graphical text) dynamically when used on dashboards. However, this will require that users make the text component big enough so that the text can expand as needed.<br /><br />The image below shows a Text component using the GUI font. It looks good (again, I assume it will not look the same if this model is opened on a system with a different GUI font). Also, the font properties of the Text component would not correctly reflect the current font.<br /><br /><img src="GetFile.aspx?Page=User-Defined-Fonts-on-Dashboard-Controls&amp;File=image4.png" alt="Image" /><br /><br />An alternative might be to use a static control. I’m not sure it would support transparency. Another disadvantage would be that we then offer three incompatible choices: Text component, Text Box and Static Control (dashboard only).<br /><br />Lastly, we could probably limit the existing Text component to ALWAYS use the GUI font and font size when located on a dashboard. The font information would need to be reapplied every time the model opens (or the dashboard is shown). We would need to prevent access to the font properties, but that should not be a problem. <br /><br />I do not want to continue to discuss this via email. I understand why this is important to you, but I think GoldSim provides many approximations (i.e. fonts that come very close in style and size). If this is not acceptable to you and a significant number of our users we should address it. But we will have to have an in-person discussion that ends with a decision taking into account the total costs. I can only advice in regards to technical complexity and time requirements. You and Rick will need to decide on the importance and select the appropriate implementation.<br /><br />]]></description><pubDate>Fri, 22 Mar 2013 16:25:57 GMT</pubDate><guid isPermaLink="false">E31F5EAF9655346264B9164976B921BB</guid></item><item><title><![CDATA[Tips for Modeling Multiple Scenarios or Alternatives ]]></title><link>http://www.GoldSim.com/Wiki/Knowledge Base.Tips-for-Modeling-Multiple-Scenarios-or-Alternatives.ashx</link><author> (jlillywh)</author><description><![CDATA[<h2 class="separator">Introduction<a class="headeranchor" id="Introduction_5" href="#Introduction_5" title="Link to this Section"></a></h2>
Many GoldSim models are intended to compare various alternatives or options, or to run multiple scenarios for a particular system. What is the best way to model multiple scenarios or options in a GoldSim model?<br /><br />There are four ways to approach this:<br /><br /><ul><li>Run all of the scenarios/options simultaneously in a single model.</li><li>Run each scenario/option separately using a scenario/option flag.</li><li>Run all of the scenarios/options in series as multiple realizations.</li><li>Run all of the scenarios/options in series as multiple realizations using SubModels <br /></li></ul><br />Each of these four approaches (and their pros and cons) are discussed below.<br /><br /><h4 class="separator">1. Run All of The Scenarios/Options Simultaneously in a Single Model<a class="headeranchor" id="B_Run_All_of_The_ScenariosOptions_Simultaneously_in_a_Single_Model_0" href="#B_Run_All_of_The_ScenariosOptions_Simultaneously_in_a_Single_Model_0" title="Link to this Section"></a></h4>In this approach, you build all scenarios into a single model. Typically, this means having a localized Container for each scenario/option. By using cloned Containers for the primary parts of the algorithm in each Container, you can ensure that when you edit it, it only needs to be edited in one place. <br /><br />NOTE: To learn more about cloning Containers, open the GoldSim Help system, go to the Index tab, and search for "Clones" and select the subtopic "Containers". <br /><br />To ensure that each scenario/option uses the same random number seeds for Stochastic variables, all common Stochastics should be modeled as global parameters (at the top level of the model)<br /><br />Pros: All results are in a single model. Simulation can be probabilistic.
Cons: This approach works well for simple models, but breaks down if your model is very large and complex. <br /><br /><h4 class="separator">2. Run Each Scenario/Option Separately Using a Scenario/Option Flag<a class="headeranchor" id="C_Run_Each_ScenarioOption_Separately_Using_a_ScenarioOption_Flag_1" href="#C_Run_Each_ScenarioOption_Separately_Using_a_ScenarioOption_Flag_1" title="Link to this Section"></a></h4>In this approach, you build a single model that simulates one scenario/option at a time. The scenario/option being simulated is determined by a single Data element (a flag). If statements (and/or Selectors) are then set up that are functions of the flag (and switch the logic appropriately for each option).<br /><br />NOTE: Starting with Version 9.5, the scenario flag could also be a Global Property (defined in the Globals tab of the Simulation Settings).<br /><br />In order to view all the option results simultaneously, it is necessary to export the results for each run (e.g., to a spreadsheet).<br /><br />Pros: Can handle large, complex models. Simulation can be probabilistic.
Cons: Results for different scenarios/options must be exported to be viewed simultaneously.<br /><br /><h4 class="separator">3. Run All of the Scenarios/Options in Series as Multiple Realizations<a class="headeranchor" id="D_Run_All_of_the_ScenariosOptions_in_Series_as_Multiple_Realizations_2" href="#D_Run_All_of_the_ScenariosOptions_in_Series_as_Multiple_Realizations_2" title="Link to this Section"></a></h4>In this approach, you build a single model that simulates one scenario/option at a time (just as in Approach #2). Furthermore, the scenario/option being simulated is determined by a single element (a flag). If statements (and/or Selectors) are then set up that are functions of the flag (and switch the logic appropriately for each option). <br /><br />The difference with Approach #2 is that that flag is not a constant Data element, but is instead an Expression defined as "Realization". The model is run in Monte Carlo mode, with the number of realizations equal to the number of scenarios/options. Of course, this means that true Monte Carlo (probabilistic) simulations of the scenarios/options cannot be carried out.<br /><br />Pros: Can handle large, complex models. All results are in a single model.
Cons: Simulation can not be probabilistic.<br /><br /><h4 class="separator">4. Run All of the Scenarios/Options in Series as Multiple Realizations Using SubModels<a class="headeranchor" id="E_Run_All_of_the_ScenariosOptions_in_Series_as_Multiple_Realizations_Using_SubModels_3" href="#E_Run_All_of_the_ScenariosOptions_in_Series_as_Multiple_Realizations_Using_SubModels_3" title="Link to this Section"></a></h4>This Approach is identical to Approach #3, but uses GoldSim's SubModel feature (introduced on Version 9.5). <br /><br />NOTE: To learn more about SubModels, open the GoldSim Help system, go to the Contents tab, and under "Advanced Modeling Concepts", go to the topic "Using SubModels to Embed Models Within Models".<br /><br />In this approach, the "inner model" is the scenario/option (which can be run as a Monte Carlo simulation). The "outer model" is run in Monte Carlo mode, with the number of realizations equal to the number of scenarios/options. The flag is the primary element in the "outer model" that is sent to the "inner model".<br /><br />It is important to note that the outputs of a SubModel are statistics (e.g., a mean or percentile). They cannot be time histories. As a result, this approach only works if the scenarios/options can be compared in terms of statistics (e.g., mean peak water level, 95th percentile of cumulative cost), rather than by directly viewing and comparing time histories.<br /><br />Pros: Can handle large, complex models. All results are in a single model. Simulation can be probabilistic.
Cons: Cannot view time histories of individual scenario results. <br /><br /> 
<h3 class="separator">See Also<a class="headeranchor" id="See_Also_4" href="#See_Also_4" title="Link to this Section"></a></h3>
<ul><li><a class="externallink" href="http://www.goldsim.com/Wiki/Model%20Library.Modeling-Scenarios-in-GoldSim.ashx?HL=scenarios" title="Scenarios in GoldSim 10.5: An Example Model" target="_blank">Scenarios in GoldSim 10.5: An Example Model</a><br /></li></ul><br />]]></description><pubDate>Fri, 22 Mar 2013 00:04:41 GMT</pubDate><guid isPermaLink="false">ED9C89D8DE2BAA7C4F529E71419EEA7C</guid></item><item><title><![CDATA[Tips for Debugging a GoldSim Model ]]></title><link>http://www.GoldSim.com/Wiki/Knowledge Base.Tips-for-Debugging-a-GoldSim-Model.ashx</link><author> (jlillywh)</author><description><![CDATA[All of us at some point have built a GoldSim model, run it, and found that the results don't seem to make any sense. Of course, we often like to immediately conclude that the problem is due to a software bug (and sometimes it is!). However, in the overwhelming majority of cases, the problem is due to a logic error in your model. So how do you go about debugging such a model? <br /><br />Although debugging (whether in GoldSim or any modeling tool) is typically something that each individual develops their own approach for, there are several general rules you can follow and suggestions you might use to make the process more efficient.<br /><br />First of all, before starting to debug or test a model, in general there are two key things you should NOT do:<br /><br />1. Don't try to debug a probabilistic model. Monte Carlo results are typically too complex to facilitate debugging. If you suspect that something is wrong with a Monte Carlo result, you should run the model deterministically (either in deterministic mode or by running a single specified realization that you suspect has a problem). The bottom line here is that you first should also start debugging a model by looking at single realizations.<br /><br />2. If you are using the Radionuclide Transport Module for contaminant transport modeling, when first testing a model, you should NOT activate species decay and ingrowth. GoldSim provides an option (in the Options dialog) to temporarily deactivate decay. This makes it much simpler to determine if you have built a mass balancing model.<br /><br />So what techniques can be used to debug a model? Unfortunately, there are no silver bullets. It simply takes careful analysis and testing. In most cases, debugging will consist of viewing time histories of key variables. It is often useful to plot multiple time histories on one plot. More often than not, after viewing trends in plots, you may want to switch to Table view to display that actual values at each timestep. Careful analysis of time histories is the most powerful debugging tool you can use. A few suggestions in this regard:<br /><br />Create a number of "warning expressions" that when true, indicate a logical error in your model. For example, if a value cannot logically be negative, create a conditional expression (e.g., X < 0) and track this. As will be discussed below, an upcoming version of GoldSim will provide an even more powerful way to accomplish this.<br /><br />Use Time History Result elements for plotting time histories that you are evaluating as part of the debugging process. This allows you to easily re-run and view a group of time histories. <br /><br />Note that a Time History Result element can only accept outputs with two different dimensions. This means that you may need to create several Result elements (and open them both) to view multiple time histories at the same time.<br /><br />Another useful debugging tool is GoldSim's Sensitivity Analysis feature. When running a sensitivity analysis, GoldSim holds all inputs constant (at their specified deterministic value), and varies parameter that you specify over a specified range. So if you suspect that the model is not handling a particular parameter in a logical way, you can run a sensitivity analysis and vary that parameter (while holding others constant) in order to determine how that parameter impacts some result in your model.<br /><br />In the upcoming summer release of GoldSim, a new element (the Interrupt) will be provided. An Interrupt element will be a powerful debugging tool. In an Interrupt element, you specify a trigger (e.g., a condition such as X > Y). When the Interrupt is triggered, it pauses the model and displays a user-defined message (e.g., " X should never be greater than Y. Something is wrong with this model"). The message will include a button that directs the user to a specified element (e.g., X or Y).<br /><br />As a final note, the most important thing you can do to make your models easier to debug is to organize and document them well. A poorly organized and documented model is always more difficult to debug. That is, a well-organized and documented model is not only much more effective to present, it is likely to save you lots of time if you need to debug it<br /><br /><br /><br /><h3 class="separator">See Also<a class="headeranchor" id="See_Also_0" href="#See_Also_0" title="Link to this Section"></a></h3>
<ul><li><a class="externallink" href="http://www.goldsim.com/Web/Downloads/UserManuals/" title="User Manual Downloads" target="_blank">User Manual Downloads</a><br /></li></ul><br />]]></description><pubDate>Thu, 21 Mar 2013 23:53:36 GMT</pubDate><guid isPermaLink="false">491D10229C1D7095FDC9BA1FF3C082C3</guid></item><item><title><![CDATA[Creating an external function DLL using Lahey Fortran 95]]></title><link>http://www.GoldSim.com/Wiki/Knowledge Base.DLL-UsingLahey-Fortran-95.ashx</link><author> (jlillywh)</author><description><![CDATA[<h2 class="separator">Creating an external function DLL using Lahey Fortran 95<a class="headeranchor" id="Creating_an_external_function_DLL_using_Lahey_Fortran_JF_3" href="#Creating_an_external_function_DLL_using_Lahey_Fortran_JF_3" title="Link to this Section"></a></h2>
<ul><li><b>Category:</b> <a href="Knowledge Base.AllPages.aspx?Cat=Knowledge%20Base.Modeling%20Tips%20and%20Tricks%20" class="systemlink" title=" Modeling Tips and Tricks"> Modeling Tips and Tricks</a></li><li><b>Applicable versions: </b> All versions<br /></li></ul><br /><h3 class="separator">Question<a class="headeranchor" id="Question_0" href="#Question_0" title="Link to this Section"></a></h3>Can I use Lahey Fortran 95 to create external function <a class="pagelink" href="DLL%20.ashx" title="Dynamic Link Libraries (DLL)"> DLLs</a> for GoldSim? What are the steps for creating them?
 
<h3 class="separator">Answer<a class="headeranchor" id="Answer_1" href="#Answer_1" title="Link to this Section"></a></h3>GoldSim allows users to develop separate program modules (written in C, C++, Fortran or any other compatible programming language) which can then be directly coupled with the main GoldSim algorithms. This article explains how to create such an external function module (<a class="pagelink" href="DLL%20.ashx" title="Dynamic Link Libraries (DLL)"> DLL</a>) using the Lahey Fortran 95 compiler. Example source code, a DLL and a model file are also available via <i><a class="pagelink" href="Model%20Library.External-Function-Using-Lahey-Fortran-95-Compiler%20.ashx" title="External Function Example Using Lahey Fortran 95 Compiler"> External Function Example Using Lahey Fortran 95 Compiler</a></i> in the Model Library.<br /><br />In order to be able to communicate with GoldSim, external functions must always be written using the syntax specified in the GoldSim User Manuals. The following template shows the appropriate declaration of a simple function in Lahey Fortran:
<pre>
subroutine Sum (method, state, in, out)
    dll_export Sum
    integer(4), value &#58;&#58; method
    integer(4) state
    real(8) in(&#42;), out(&#42;), x, y
    
    if (method.eq.1) then !Calculate
        out(1) = in(1) + in(2) !Sum
    elseif (method.eq.2) then !Report version
        out(1) = 1.0
    elseif (method.eq.3) then !Report arguments
        out(1) = 2 !Two incoming arguments
        out(2) = 1 !One outgoing argument
    endif
end
</pre>
The first two lines define the subroutine name and the (function) name that should be exported, which must be identical. This is the function name that is later used by GoldSim when calling the external DLL. This example uses the function name Sum.<br /><br />The function arguments and the variable definitions must always be specified as shown in lines 3 to 5. They are independent from the actual meaning and purpose of your function since they define the communication between GoldSim and the external function.<br /><br />When calling a function GoldSim always specifies the purpose of the call using the method variable. For instance, GoldSim assigns the value 1 to argument method to request the calculation. Depending on the value of method, the arguments in and out provide additional data or can be used to return results.<br /><br />The code block in lines 7-14 shows the three method values that a function must always handle: report version, provide number of arguments, and do the calculation. Appendix C of the user manual lists all method values that GoldSim might use, and provides the details for how to use them. In this example, the function expects two incoming arguments, which will be added and returned to GoldSim.<br /><br />After coding your function you should save your work in a file, for example gsfunc.f90. You can build a dynamic link library (DLL) typing the following command in the command line prompt:
<pre>
lf95 gsfunc.f90 -dll
</pre>
This command starts the Lahey Fortran compiler and translates the Fortran code into machine specific byte code that is stored in a DLL named gsfunc.dll.<br /><br />You can check the correctness of the exported name declaration with the following command: dumpbin /exports gsfunc.dll<br /><br />This command is very handy if GoldSim reports that a specified function can not be found. It allows you to see the function name as it is exported by the compiler.<br /><br />You can now use the function in the DLL from within GoldSim. Simply create two new Data Definition elements representing the two incoming arguments. Call the elements A and B and give them constant values of 5 and 10.<br /><br />Create an External element and add two inputs to it. Link the inputs two the outputs of elements A and B.<br /><br />Then create a new output. You can use the provided defaults for data type and unit.<br /><br />As the last step, you must specify the name and path of the DLL (gsfunc.dll) and the function name (Sum). You can now run the model. If you did everything correctly, the value of the external output should be 15. <br /><br />
<h3 class="separator">See Also<a class="headeranchor" id="See_Also_2" href="#See_Also_2" title="Link to this Section"></a></h3><ul><li><i><a class="pagelink" href="Model%20Library.External-Function-Using-Lahey-Fortran-95-Compiler%20.ashx" title="External Function Example Using Lahey Fortran 95 Compiler"> Model Library, External Function Example Using Lahey Fortran 95 Compiler</a></i></li><li><i><a class="pagelink" href="Knowledge Base.Search-Order-for-Loading-a-DLL%20.ashx" title="Order that GoldSim Searches When Loading a DLL"> Order that GoldSim Searches When Loading a DLL</a></i></li><li><a href="Knowledge Base.AllPages.aspx?Cat=Knowledge%20Base.Modeling%20Tips%20and%20Tricks%20" class="systemlink" title=" More Modeling Tips and Tricks"> More Modeling Tips and Tricks</a><br /></li></ul>
]]></description><pubDate>Thu, 14 Mar 2013 22:36:24 GMT</pubDate><guid isPermaLink="false">C61A800C5513CCED3A62474A18C5B870</guid></item></channel></rss>