Page 1 of 1

SOS!- Please help with simple model!

Posted: Sun Apr 03, 2005 7:50 pm
by vensimnovice
Here's the issue:
"The lake has a maximum capacity of 1 million liters. If the amount of water in the lake exceeds 95% of capacity, operators open gates at the bottom of the lake to let water out at a rate of 500 liters per minute.The gates will remain open until the amount of water in the lake drops to 85% ofcapacity, at which time the gates automatically close."
I have the model set up with water in lake as stock, rainfall as inflow (this is given in the problem) and outflow and outflow. I don't know how to incorporate capacity and kick off the outflow when water level exceeds 95% of capacity and close the gates when water level goes down to 85% of capacity. Please help.

lake model

Posted: Mon Apr 04, 2005 9:57 am
by LAUJJL
Here is an example.
The variable called open is equal to 1 when the gates are open and 0 if the gates are closed.
The inflow must not be greater then the outflow when the gates are open.
J.J. Laublé

Posted: Tue Apr 05, 2005 11:25 am
by Pruyn
I think you made a mistake somewhere, since when I try your model with a random inflow, it will only bounce around te 95% limit. From vensimnovice's description I understood, the gates should remain open untill the level reached 85% of maximum.
I used a sample if true function to obtain this, see attached model.

lake mdl

Posted: Tue Apr 05, 2005 12:25 pm
by LAUJJL
Hi Pruyn

You are right, there is a 'slight' bug.
The equation for previous open has open set to -open instead to open.
It has nothing to do with random inflows.
The wrong equations worked with my intial deterministic inputs but could not work even with other deterministic inputs.
Ï prefer to use a level instead of the sample if true, because it is easier to uderstand and because the sample if true function is not supposed to work with PLE or PLE plus.
The sample if true has a simpler sketch but it is more difficult to understand.
It was recently reported to work with with certain versions of PLE.
Joined the corrected model.
Thanks for reporting the error.
J.J. Laublé

Posted: Tue Apr 05, 2005 1:41 pm
by Pruyn
Hi Laubé,

I didn't take the time to check your model, since it looked solid. I prefer the sample if true, for I am working with large models and this simplifies the overview. But I see your point.

Jeroen