Dear all
I want to achieve the function in Figure
The time step is month.
I was wondering how to achieve it in vensim? If the time boundaries is 120.
I try to use IF THEN ELSE and LEVEL. Each time step, the price will be accumulated.
IF THEN ELSE=12, price/12,0
IF THEN ELSE=60, price/60,0
But, it only works one time.
So, I was wondering is there an equation similar to the counter in Vensim that help accumlate data for a certain period of time.
Thank you very much
Kind regards
Is there an equation for counter in Vensim?
Is there an equation for counter in Vensim?
- Attachments
-
- Capture.JPG (33.72 KiB) Viewed 1763 times
Re: Is there an equation for counter in Vensim?
An extremely simple implementation would be
A = PR/SMOOTH(PR,smoothing time)
smoothing time = 3
The SMOOTH function gives you an exponentially-weighted moving average of its input, which is often a good model of perception. A fixed window is typically not as good a model of perception, unless there's some reporting process that enforces it.
A = PR/SMOOTH(PR,smoothing time)
smoothing time = 3
The SMOOTH function gives you an exponentially-weighted moving average of its input, which is often a good model of perception. A fixed window is typically not as good a model of perception, unless there's some reporting process that enforces it.
/*
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: Is there an equation for counter in Vensim?
If you need a fixed window, you can use something like:
avg input = x in window/tau
x in window = INTEG( input - outflow, input*tau )
outflow = DELAY FIXED( input, tau, input )
tau = 3
The time scale tau needs to be an integer multiple of the time step for this to initialize correctly, though you could adjust for that if needed.
avg input = x in window/tau
x in window = INTEG( input - outflow, input*tau )
outflow = DELAY FIXED( input, tau, input )
tau = 3
The time scale tau needs to be an integer multiple of the time step for this to initialize correctly, though you could adjust for that if needed.
/*
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
*/