Hi,
I found similar topics on the forum but couldn't apply the solutions provided to my own issue...
My model aims to calculate the energy performance of a building and compare this energy performance before/after the building refurbishment (TIME STEP = 1 month).
With a lookup, I "scored" the yearly building energy performance from 4 to 0 (worst to best) depending on the amount of yearly energy consumptions (as a sum of consumptions over the past 12 months of the year). So this variable only gets a value every 12 time steps.
I wish to compare the "current energy class" scored at MODULO(Time,12)=0 with the "last known energy class" computed at [Time-12] in order to obtain the distance between previous and current scores.
I tried to use the DELAY FIXED equation, but couldn't get what I need, as :
1) the first value for the variable "current energy class" appears at [Time=12], so I would expect the variable "last known energy class" to be calculated at [Time=24] for the first time... yet "last known energy class" appears earlier than expected at [Time=13] ;
2) I would expect the variable "last known energy class" to appear at the same yearly time as "current energy class" (meaning at Times 24, 36, 48, ...) in order to measure the distance between previous and current values... but instead the "last known energy class" is calculated with a shift in time, and I get the values at Times 13, 25, 37, 49, ... .
Can you please help me find a way to put it right ? What am I missing here ?
Thank you a lot !
Best regards,
Laura
How to get the last value of an auxiliary variable ?
Re: How to get the last value of an auxiliary variable ?
/*
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: How to get the last value of an auxiliary variable ?
Hi,
Thanks for your answer ! This solution is okay to get the values at the same time. But I don't understand how to get the value of the "current energy class" variable at Time-12, as DELAY FIXED must directly follow the equal sign ?
Best regards,
Laura
Thanks for your answer ! This solution is okay to get the values at the same time. But I don't understand how to get the value of the "current energy class" variable at Time-12, as DELAY FIXED must directly follow the equal sign ?
Best regards,
Laura
Re: How to get the last value of an auxiliary variable ?
Keep the delayed value in a separate variable.
If you're doing this a lot, you can encapsulate DELAY FIXED in a macro - then it can be used directly on the RHS.
If you're doing this a lot, you can encapsulate DELAY FIXED in a macro - then it can be used directly on the RHS.
/*
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: How to get the last value of an auxiliary variable ?
You might also check this:
http://vensim.com/discrete-stochastic/
http://vensim.com/discrete-stochastic/
/*
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: How to get the last value of an auxiliary variable ?
Oh yes now I understand what you meant, and it works ! Thank you a lot !
Laura
Laura