Deplete a stock serially

Use this forum to post Vensim related questions.
Post Reply
addor
Senior Member
Posts: 50
Joined: Mon Oct 27, 2003 9:45 am

Deplete a stock serially

Post by addor »

I'm looking for a small model that fills and depletes a stock three times one an other, every time a little bit smaller. That means e.g.

Fill up to 20 by a constant inflow, deplete it by a first order delay
fill up to 10 by a constant inflow, deplete it by a first order delay
fill up to 5 by a constant inflow, deplete it by a first order delay

Finally and after more days trial and error I found the model below. But it is very, very nasty and certainly not good SD. May be I'm a blockhead. Do you see an elegant solution?

[Edited on 12-2-2008 by addor]
Attachments
sample_if_true_2.mdl
(3.38 KiB) Downloaded 377 times
Peter Addor
Administrator
Super Administrator
Posts: 4590
Joined: Wed Mar 05, 2003 3:10 am

Post by Administrator »

I would look into using subscripts on the inflows/outflows, or maybe using three different levels. This would give clearer diagram and easier to follow equations.

I've attached something that should get you started.

Tony.
Attachments
sample_if_true_2.mdl
(6.23 KiB) Downloaded 362 times
LAUJJL
Senior Member
Posts: 1427
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

Post by LAUJJL »

Hi Addor.

It would be better to explain what you want exactly to do.

I imagine that you fill the stock up to twenty, but at what rate, or how long?
Same for the depleting with a first order delay, which is the same as an exponential decay?
Etc.
Than just use three stocks as Tony suggests.
Regards.
JJ
addor
Senior Member
Posts: 50
Joined: Mon Oct 27, 2003 9:45 am

Post by addor »

Thank you Tony, your model looks very interesting. I also took subscripts into consideration but decided against it because it is something special to Vensim.

What I want do do, JJ? Well I'm building my own project model because the known models by Richardson, Pough, Lyneis, Ford et al. are related to development and construction projects. But I have mainly to do with integration and migration projects that follows their own policies.
In Integration projects there are e.g. acceptance tests that run completly through. All the failed test cases go through a rework cycle and arise later in a complete new regression test suite.
So within the last project we had a stock of acceptance tests. The failed cases had to be fixed by the development center and came back in the stock three months later. This cycle can be repeted a third time.

Nevertheless this context I found the question to deplete a stock three times serially very interesting. If you try it you will see that there is a real challenge in this problem because the conditons for the second fill-and-deplete are already valid during the first one. So you have to look for something special only for the second fill-and-deplete cycle.

The filling rate isn't so important. As I specified it is a constant rate a. Also the outflow is something like Stock/Delay time with some Delay Time T. Important is, that the stock has to be depleted prcatically complete that means as I also specified until < 0.01.

You will encouter this e.g. if you clean your pool. First you fill it complete such that all remaining cleaning agents are solved. Then you deplete the pool almost complete. Then you let in clean water again but only half a pool cause you don't have the patient to refill it completly. Etc.

Regards,
Peter
Peter Addor
LAUJJL
Senior Member
Posts: 1427
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

DEPLETE A STOCK SERIALLY

Post by LAUJJL »

Hi Addor

I understood well your pool example.
But I do not know why you do not try to replicate exactly what is happening in your process, instead of trying to represent it with your three cascading stocks.
For example if I had to model the pool that you were giving as an example, and I wanted to
know the effect of different policies I would model like the model joined.
It is a traditional coflow.
It replicates exactly what happens and I do not need to deplete a stock, for instance the stock
of the residual cleaning agents although in that case it is straghtforward.
But one can imagine more complex process where for example the policy of depleting may vary during the time depending for example from the proportion of cleaning agents and from
a policy of making the process more or less long.
Regards.
JJ
Attachments
pool.mdl
(3.81 KiB) Downloaded 377 times
addor
Senior Member
Posts: 50
Joined: Mon Oct 27, 2003 9:45 am

Post by addor »

Thanx JJ, your approach looks interesting but it doesn't shows the three fill-and-depletes.

I wonder that you ask "why you do not try to replicate exactly what is happening". I'm just trying this, and hence your critic could rather be "why do you try to replicate what's happening in such a naive manner".

I will give you another example. You have emtpy drank a bottle of something, say apple cider with a deposit. Some of the deposit adheres at the bottom of the bottle. Now you want to clean the bottle. For this you fill the bottle with water, say for three quarters, turn upside down and empty the bottle by shaking. If the bottle is empty you refill it untill say one half, turn upside down and empty it by shaking. Same procedure a third time but you refilled it only with a quarter of water.
So the bottle is the stock, and I want to see the three times fill-and-deplete.
Peter Addor
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post by bob@vensim.com »

Hi Peter,

In your apple cider example the process involves adding water, shaking, and discarding water. At that level of detail, the feedback is basically for the person to add water till they are ready to shake, shake till they are ready to dump, and dump till they are ready to stop. You need cumulative adding, cumulative shaking and cumulative dumping to manage those loops.

That said, the real feedback here is simply to get the bottle clean which requires a certain amount of time and water and can then easily be managed using auxiliary variables - perhaps a lookup function that relates the amount of water used to resulting cleanliness.

If you think that the project models you have seen do not apply to the kinds of projects you are worried about you are probably taking the variables in these models much too literally. Real life projects have hundreds of thousands of tasks and activities. Modeling at that level of detail would not be helpful. The core doing work, discovering rework and doing rework physics at the heart of project models is completely generic. What you have described is really just a refinement to the rework discovery process. If you look at the mproject model that comes with Vensim you will see that downstream tasks can be used to drive rework discovery of upstream tasks - that is probably the approach that would work best for you.
addor
Senior Member
Posts: 50
Joined: Mon Oct 27, 2003 9:45 am

Post by addor »

Thank you Bob. I studied the project models familiar by the literature and - believe me - they all seems not usefull to me because they are too academic. In practice project dynamics follows other rules, at least Integration and self-referential projects. My problem with filling and depleting an stock isn't the only one but besides its context interesting enough. I learned by Tony's approach that it cannot be solved by basic SD structures but oviousely needs subscripts or functions like "sample if true"

Peter
Peter Addor
LAUJJL
Senior Member
Posts: 1427
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

Depleting stocks

Post by LAUJJL »

Hi Addor

Before having a clear description of your problem, it is very difficult to say whether subscritps or sample if true or whatever is useful.
You are to my opinion too much SD and technically centered and not enough problem centered.
Anyhow, if you are allowed to do it, it would be interesting that you give a plain english description of your problem, eventually simplified (it is always possible to add details later on) that would give people on this forum, the opportunity to propose valid solutions. Otherwise not knowing the heart of your problem, we can discuss forever.
I can add that simplifying the definition of a problem is highly instructive and is often a good way to get a higher view of the problem, which is the fundamental objective of SD modelling.
Regards
JJ




[Edited on 15-2-2008 by LAUJJL]
Monte
Senior Member
Posts: 133
Joined: Sat Aug 13, 2005 4:18 am
Vensim version: PLE+

Post by Monte »

Hi JJ,

Good suggestion. I would totally agree that having a model purpose clear and sharp, the model is half built. This is particularly helpful for academics, who are free to select practical problems to do a research. But I am not sure consultants are free to sharpen the model purpose by simplifying the problem, which will simplifying the model results expected to see by the client.

With respect,
MK
LAUJJL
Senior Member
Posts: 1427
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

Depleting stock

Post by LAUJJL »

Hi Monte.

I think that it is up to the modeller to understand the client’s purpose that can be highly variable.
A client’s purpose may be the support of his own views. In this case, the client may be interested by a very complicated model that people not thinking like him will not be able to
contradict, hoping that the notoriety of the modeller and the sophistication of the model will make the difference. This is the case of a misuse of SD.
A naïve client (there are many of them) may think too that his problem looking complex, the solution must be automatically complex too.
Older people, know by experience that simplicity is more efficient than complexity in general, and that it takes more time to build something simple than complex.
I think then that the freedom of the consultant will depend mainly on the kind of client he faces.
Regards.
JJ
Post Reply