Hi All,
As my first exercise using vensim I have modelled a rain water tank connected to a house with a given roof area. The model includes monthly average rainfall data, some constant use by people drawing water away from it, and an overflow if the level in the tank gets above 30m3.
My question is: is there a more refined, simpler way to get the result than the way I have done this?
You'll note I had to add in 2 time variables ('aux' and 'overflow occurrences') to get the units to match - I wonder if there is a way of constructing the model without these being required?
Also regarding units, I would like to add a variable "water use per person per month" with units Liters. This would feed into the 'water use per person' variable. How can I tell vensim that L = m*m*m/1000? I have tried to get this working, but can't figure it out.
(note the roof area and water use constants are not accurate figures at this point - just values that have helped me verify the equations are working as I intended)
Many thanks in advance.
Neil
refining model of rainwater tank w overflow
-
- Junior Member
- Posts: 4
- Joined: Wed Apr 10, 2013 6:06 am
- Vensim version: PLE
refining model of rainwater tank w overflow
- Attachments
-
- tank only v4.mdl
- (3.69 KiB) Downloaded 269 times
Re: refining model of rainwater tank w overflow
Here's a refinement. It's not simpler, but conceptually cleaner in a few respects.
- parameters embedded in equations converted to explicit variables with units (tank capacity)
- variable names indicate a quantity that can vary (water in tank)
- water use limited to water available (a term could be added to allow use as collected, if the physics permit)
- overflow clarified
- no causal inputs to levels (hence rain removed to a separate variable)
Note that TIME STEP is used in two places. This is essentially a stand-in for a time constant that is presumed to be shorter than the time constant of interest in the model.
- parameters embedded in equations converted to explicit variables with units (tank capacity)
- variable names indicate a quantity that can vary (water in tank)
- water use limited to water available (a term could be added to allow use as collected, if the physics permit)
- overflow clarified
- no causal inputs to levels (hence rain removed to a separate variable)
Note that TIME STEP is used in two places. This is essentially a stand-in for a time constant that is presumed to be shorter than the time constant of interest in the model.
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
-
- Junior Member
- Posts: 4
- Joined: Wed Apr 10, 2013 6:06 am
- Vensim version: PLE
Re: refining model of rainwater tank w overflow
Hi Tom,
That's fantastic - thank you
The time-step is certainly a better way to get the units working. But i do have a question about it: my data for rain is monthly. There can be significant changes in the value of rain month to month. The time step is currently set to 1 (month). After having a quick look at the manual and seeing there can be oscillation issues if the time step is not small enough, should I be altering this value to 0.5 (or less)? If I did this, surely it would impact the value of 'overflow' because the division would now be by 0.5 instead of 1... Note the model has been giving outputs as I would expect at this stage.
One more question re units: I would like to have 'water use per person' with units liters/day. Is there a way of being able to do this, while still leaving other variables like 'water in tank' expressed in cubic meters? I just can't figure out a way to convert between different units in the one model...
As you can see, I am just learning the ropes - thanks for your perseverance!
Neil
That's fantastic - thank you

The time-step is certainly a better way to get the units working. But i do have a question about it: my data for rain is monthly. There can be significant changes in the value of rain month to month. The time step is currently set to 1 (month). After having a quick look at the manual and seeing there can be oscillation issues if the time step is not small enough, should I be altering this value to 0.5 (or less)? If I did this, surely it would impact the value of 'overflow' because the division would now be by 0.5 instead of 1... Note the model has been giving outputs as I would expect at this stage.
One more question re units: I would like to have 'water use per person' with units liters/day. Is there a way of being able to do this, while still leaving other variables like 'water in tank' expressed in cubic meters? I just can't figure out a way to convert between different units in the one model...
As you can see, I am just learning the ropes - thanks for your perseverance!
Neil
Re: refining model of rainwater tank w overflow
1. TIME STEP should definitely be as short or shorter than the sampling interval of your data.
Stability is easy to verify empirically - just cut your time step in half and see if the behavior changes (it shouldn't, unless there are stochastic elements in your model). A general rule of thumb is that your time step should be less than half the shortest time constant (inverse of a fractional rate of change) in the model. Using TIME STEP as the time constant for the overflow process violates that, but only when there's an overflow, so it may not matter. Anyway, the real time constant of overflow is probably seconds, and you don't want to model that finely, so using TIME STEP is an approximation for "happens so fast we don't care."
2. Right ... forgot that question. Create a variable that's a unit converter, e.g.
liters per m3 = 1000 ~ liter/m/m/m
Then write
house use = desired house use/liters per m3
Stability is easy to verify empirically - just cut your time step in half and see if the behavior changes (it shouldn't, unless there are stochastic elements in your model). A general rule of thumb is that your time step should be less than half the shortest time constant (inverse of a fractional rate of change) in the model. Using TIME STEP as the time constant for the overflow process violates that, but only when there's an overflow, so it may not matter. Anyway, the real time constant of overflow is probably seconds, and you don't want to model that finely, so using TIME STEP is an approximation for "happens so fast we don't care."
2. Right ... forgot that question. Create a variable that's a unit converter, e.g.
liters per m3 = 1000 ~ liter/m/m/m
Then write
house use = desired house use/liters per m3
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/