constraining level to positive numbers
-
- Newbie
- Posts: 1
- Joined: Tue May 12, 2015 8:11 pm
- Vensim version: PLE
constraining level to positive numbers
Hello, I apologize for asking a question that has already been answered in previous posts, but I was unable to access those answers through this forum (I saw an error message when I tried to do so). Anyway, I have a lot of experience with Stella, but less so with Vensim, and I am trying to figure out how to constrain a stock/level so that it cannot become negative. Is there an easy way to do this, or do I have to engineer and IF THEN statement? Thank you.
Re: constraining level to positive numbers
There's a lengthy discussion of this here http://www.ventanasystems.co.uk/forum/v ... =26&t=1128
The basic point is that you need to express why the stock can't go negative, i.e. how the "physics" of the situation limits its outflows when the stock nears 0.
The most common situation is the standard linear model, in which outflow = stock/duration, which automatically takes care of the problem, as long as TIME STEP <= duration.
Sometimes stock/TIME STEP is a reasonable shortcut - that's essentially what you get when you check the Stella nonnegativity box. For example, you might write outflow = MIN( desired outflow, stock/TIME STEP).
If the dynamics of stockouts are important, you'll probably want to create something more sophisticated.
The basic point is that you need to express why the stock can't go negative, i.e. how the "physics" of the situation limits its outflows when the stock nears 0.
The most common situation is the standard linear model, in which outflow = stock/duration, which automatically takes care of the problem, as long as TIME STEP <= duration.
Sometimes stock/TIME STEP is a reasonable shortcut - that's essentially what you get when you check the Stella nonnegativity box. For example, you might write outflow = MIN( desired outflow, stock/TIME STEP).
If the dynamics of stockouts are important, you'll probably want to create something more sophisticated.
/*
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
*/
Re: constraining level to positive numbers
For a few special situations the SINTEG function may be useful - see the Help system.
/*
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
*/