Page 1 of 1
Negative Stock
Posted: Sat Jun 04, 2011 3:31 am
by nadia
Hye everybody,
Why stock become negative? When I try extreme condition test my stock become negative.But, the others variables behave appropriately. Only the stock become negative.Anybody please help me. Is that possible if I attach my model and get comment for improvement in my model. Really need your help. Thank you in advance.
Regards,
Nadia.
Re: Negative Stock
Posted: Sat Jun 04, 2011 6:27 am
by Administrator
See the following thread. It should help.
http://www.ventanasystems.co.uk/forum/v ... ock#p14605
Or post your model here so we can take a look.
Tony.
Re: Negative Stock
Posted: Sat Jun 04, 2011 7:15 pm
by nadia
Hi,
My model as attached. Hope I can get comments and suggestions for improvement for my model. Thank you.
Nadia.
Re: Negative Stock
Posted: Sun Jun 05, 2011 8:27 am
by Administrator
Try the following modifications.
local supply = min ( Rice Stock / time step , FRACTION STOCK RELEASE * Rice Stock )
What this equation does is take "what you want" (FRACTION STOCK RELEASE * Rice Stock) out of the stock, but if there is not enough, it completely empties the stock (Rice Stock / time step)
rice stock release = min ( gap in import , Rice Stock / time step - local supply )
This equation is similar to the local supply equation, you take out what you want (gap in import) or what is available (Rice Stock / time step minus anything taken out by "local supply").
This will stop the stock going negative.
Hope this helps.
Tony.
Re: Negative Stock
Posted: Mon Jun 06, 2011 2:35 am
by nadia
Ok.Thank you very much. It really helps me a lot.But what about the farmers net income? Where I can get the info about how to use min function?Thank you in advance.
Nadia.
Re: Negative Stock
Posted: Mon Jun 06, 2011 5:46 pm
by Administrator
Where I can get the info about how to use min function?
It's just MINIMUM. STOCK / TIME STEP is the rate the empty the entire stock in one time step. So you take out the minimum of everything (stock/time step) or what you actually want to take out.
You can think of it as
IF THEN ELSE ( what you want to take out > STOCK , what you want to take out , STOCK / TIME STEP )
I hope this makes sense.