modelDecay
Extends from Icons.UnidirectionalFlow (Icon for unidirectional flow classes), Interfaces.Basics.GenericFlow (Flow Template with two FlowPorts), Interfaces.Basics.ThreeSO_rate (Generic information output for flow elements).
Information
This information is part of the Business Simulation Library (BSL). Please support this work and ► donate.
The stock connected to port A (stockA) will be gradually drained at a rate determined by the average time of residence (residenceTime) in the stock. The rate which drains the stock (draining) is given by:
draining = stockA.y / residenceTime
Implementation
The residence time is clipped to never be smaller than the global parameter dt.
Notes
The process of decay is essentially exponential decline, since the outflow is a fraction of the stock. The rate of decay thus also exponentially declines towards zero if there is no inflow to the stock, that is connected to port A.
If there is no inflow to the stock the level of the stock will be less than α x InitialLevel (0 < α <1) after a time span of - ln(α) × residenceTime.
So we can note the following multiples for the residenceTime to calculate the time it takes to drain the stock A to α [%] of its initial level:
| α [%] | Time to drain as multiple of the residenceTime |
| 50 |
0.69 ⋅ |
| 1/e ≈ 37 |
1.0 ⋅ |
| 10 |
2.3 ⋅ |
| 5 |
3.0 ⋅ |
| 1 |
4.6 ⋅ |
| 0.1 = 1 ‰ |
6.9 ⋅ |
The time span it takes to drain the stock by half is called its half life. As can be seen from the equation and table above it is about ln(2) ⋅ residenceTime ≈ 69% of the (average) residence time.
See also
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Time | residenceTime | unspecified | Constant time of average residence (optional) |
| Structural Parameters | |||
| Boolean | hasConstantResidenceTime | false | = true, if the parameter residenceTime will be used instead of the continuous input u |
Connectors
| Type | Name | Default | Description |
|---|---|---|---|
| Connectors.FlowPort | portA (from GenericFlow) | Flow from/to Stock A | |
| Connectors.FlowPort | portB (from GenericFlow) | Flow to/from Stock B | |
| Interfaces.Connectors.RealInput | u | Residence time input |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| RealOutput | y (from ThreeSO_rate) | Rate information | |
| RealOutput | y1 (from ThreeSO_rate) | Rate information | |
| RealOutput | y2 (from ThreeSO_rate) | Rate information |
Revisions
- Value for parameter set to
unspecifiedin v2.1.0.