How a Reservoir Computes
its Primary Output
Numerically, GoldSim approximates the integral represented by a Reservoir A stock element that integrates and conserves flows of materials. as a sum:
where:
In these equations, ∆ti is the timestep A discrete interval of time used in dynamic simulations. 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).
Reservoirs and Integrator elements use the same numerical integration An approximate solution to an integral equation, carried out by discretizing a variable (e.g., time) into discrete intervals. method, referred
to as
The key assumption involved in this integration method is that at any point in time, the Rates of Change (Additions and Withdrawals) 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 of the GoldSim User’s Guide.
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.
Learn more
- Browser View of a Reservoir Element
- Defining Upper and Lower Bounds for a Reservoir
- How a Reservoir Computes its Primary Output
- How a Reservoir Computes the Overflow Rate
- How a Reservoir Computes the Withdrawal Rate
- Instantaneously Replacing the Current Value of a Reservoir
- Modeling Discrete Changes to a Reservoir
- Reservoir Elements
- Specifying Discrete Additions and Withdrawals to a Reservoir
- Specifying the Dimensions, Initial Value and Rates of Change for a Reservoir
- Using the Is_Full Output of a Reservoir
- Using the Withdrawal Rate Output of a Reservoir