Hi,
I have a stock variable named "Content" (unit "Euro") and want to know, if it currently increases or decrease.
To calculate this I created a variable
IncrDecr = Content-DELAY1(Content, 1)
As far as I see IncrDecr is < 0, 0 or >0 as I need it.
But what is the correct unit? I alsways get an Unit Check error because DELAY1(Content, 1) has unit "Euro*Year" while Content has unit "Euro". How to overcome this?
Or is there another way to determine if a stock variable is increasing or decreasing?
Thanks for any help,
jmu
Unit Check problem
What I wanted do add:
The unit-problem with delay is still here (in other situations).
The manuals says:
Units: DELAY1(units,time) --> units
If I understand it right then the output unit is the same as the input unit. But I always see the time unit involved. This bothers me and causes some unit checking problems.
Best regards,
jmu
The unit-problem with delay is still here (in other situations).
The manuals says:
Units: DELAY1(units,time) --> units
If I understand it right then the output unit is the same as the input unit. But I always see the time unit involved. This bothers me and causes some unit checking problems.
Best regards,
jmu
Your definition of the incrdecr is the initial definition of the variation of a level and it is evident. Is il like writing that X = X. this variation has units Euros / time unit and it is right. One can consider that the difference between two levels is expressed in Euros / month For instance
if at time 10, the level equals 10 and at time 11 the level equals 12. you will say that the level has increased with a speed of 2 Euros by month.
But if you compare the two levels in my initial formulation, you get a difference between 12 Euros and 10 Euros, which is expressed in Euros, which is right too. Units checking is not only a pure mathematical system but it must always makes sense with reality and be intuitively understandable.
Otherwise if you want absolutely to use the delay1 function which is not necessary in this case, post the model.
I do not see what could be wrong in the DELAY1(units,time) --> units. Look at the exact definition of the DELAY1 in the Vensim guide. You will understand how it works.
Regards.
JJ
if at time 10, the level equals 10 and at time 11 the level equals 12. you will say that the level has increased with a speed of 2 Euros by month.
But if you compare the two levels in my initial formulation, you get a difference between 12 Euros and 10 Euros, which is expressed in Euros, which is right too. Units checking is not only a pure mathematical system but it must always makes sense with reality and be intuitively understandable.
Otherwise if you want absolutely to use the delay1 function which is not necessary in this case, post the model.
I do not see what could be wrong in the DELAY1(units,time) --> units. Look at the exact definition of the DELAY1 in the Vensim guide. You will understand how it works.
Regards.
JJ
Thanks for the discussion and your patience.
Concerning X = X:
Ok, but this allows me in advance to determine, if a stock variable will increase / decrease in the next time step. And when I use a delay I can simulate some adaption actions. But you already showed me a different way.
Concerning the unit check problem:
I played arround, implemented the delay1 as described in the manual and suddenly I saw the problem.
When I type DELAY1(input, 1) I have the error.
But when I type DELAY1(input, del-time) and del-time is defined as 1 unit Year then all is fine.
I find this a little bit annoying because I have to clutter my model with varibales (constant) just to avoid unit check errors.
Greetings,
jmu
Concerning X = X:
Ok, but this allows me in advance to determine, if a stock variable will increase / decrease in the next time step. And when I use a delay I can simulate some adaption actions. But you already showed me a different way.
Concerning the unit check problem:
I played arround, implemented the delay1 as described in the manual and suddenly I saw the problem.
When I type DELAY1(input, 1) I have the error.
But when I type DELAY1(input, del-time) and del-time is defined as 1 unit Year then all is fine.
I find this a little bit annoying because I have to clutter my model with varibales (constant) just to avoid unit check errors.
Greetings,
jmu
When Vensim sees a number it is more or less automatically assigned a dmnl dimension, 'no dimension'. This is why it sometimes does not generate any error when using stand alone value. It is a better practice not to use any value at all and consider it as a constant, which it is. It makes it possible to make the value vary with different simulations, study its sensibility etc..
System dynamics is an extremely demanding method where some rules must be followed strictly, otherwise beware!
Regards.
JJ
System dynamics is an extremely demanding method where some rules must be followed strictly, otherwise beware!
Regards.
JJ
One option is to use the TREND function.
Another option is:
ContentChangeRate = ( Content - SMOOTH(Content,horizon) )/horizon Unit: Euro/year
Horizon = ... (years)
If you want the instantaneous rate of change, you can set Horizon = TIME STEP; otherwise you can use a longer horizon.
What you find annoying (making constants to avoid units check errors) is actually an essential modeling practice. If you leave parameters hidden in your equations, there's no way to test them for sensitivity. You can always hide them to declutter your diagram. Also, for your model to be robust to changes in the TIME STEP, you may want to set del-time = TIME STEP, as for Horizon above.
Tom
Another option is:
ContentChangeRate = ( Content - SMOOTH(Content,horizon) )/horizon Unit: Euro/year
Horizon = ... (years)
If you want the instantaneous rate of change, you can set Horizon = TIME STEP; otherwise you can use a longer horizon.
What you find annoying (making constants to avoid units check errors) is actually an essential modeling practice. If you leave parameters hidden in your equations, there's no way to test them for sensitivity. You can always hide them to declutter your diagram. Also, for your model to be robust to changes in the TIME STEP, you may want to set del-time = TIME STEP, as for Horizon above.
Tom
/*
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
*/