In addition to adding mass to a Cell via an initial/boundary condition, and adding/removing mass via mass flux links, GoldSim allows you to instantaneously add, remove or redefine (replace) the amount of species mass in a Cell.
This is done using the Discrete Changes field in the Cell dialog, which is located within the “Cell Inventory” section:
This field only accepts discrete change signals. The discrete change signal must be a vector by species and have dimensions of mass. Typically, such a discrete change signal will be the output of a Discrete Change element that has been triggered by an event.
Discrete change signals have an instruction associated with them. Two types of instructions are possible: Add and Replace. The Discrete Changes field for a Cell accepts both Add and Replace signals.
When an Add signal is sent to a Cell during a simulation, the specified amount of mass of each species in the discrete change vector is added to the current mass in the pathway. If the vector contains negative values, mass is subtracted from the pathway for those species which have negative values.
Note: The mass is added (or subtracted) uniformly over a timestep previous to when the discrete change occurred. For example, if you had a 10-day timestep, and an event occurred (which interrupted the clock) which added mass at 35 days, the mass would be added uniformly between 30 and 35 days.
Note: Because a pathway cannot contain a negative amount of species mass, GoldSim will not remove more mass from the pathway than is present. That is, if the discrete change signal specifies that a quantity of species mass is to be subtracted which exceeds the current species mass in the Cell, GoldSim will finish the simulation, set the Cell mass to zero and display a warning message.
When a signal with a Replace instruction is sent to a Cell during a simulation, the specified amount of mass completely replaces the current mass values in the pathway.
Note: Because a pathway cannot contain a negative amount of species mass, GoldSim will not replace the current mass with a negative value. That is, if the Replace signal specifies a negative quantity of species mass, GoldSim will stop the simulation and display a fatal error message.
Like most input fields that accept discrete change signals, you can specify multiple discrete changes. You can do this in two ways:
1. You can enter multiple discrete changes into the input field by separating the entries using a semi-colon; and
2. You can use the Multiple Discrete Changes button to the right of the input field (i.e., the small button with two exclamation marks) to access a table listing the Discrete Changes (to which you can add or delete entries).
In the latter case, any Discrete Changes which are added to the list are also automatically added to the input field, separated by semi-colons.
The Discrete Changes field can be very useful for instantaneously modifying your system in response to discrete events. Note, however, that this feature should be used with care, since when it is applied, conservation of mass in the system is the responsibility of the user.
Learn more about: