Page 1 of 1

Getting the final value of a stock to another variable

Posted: Fri Dec 13, 2019 6:13 am
by taskia
Hello,
I am Taskia.
I am facing a problem. I am developing a model where I want to get only the final value of a stock variable to another variable. I used the 'CUMULATEF' function for this purpose, but it shows 'no data'. Please give me some suggestions on how can I solve the problem.

For understanding, I have uploaded a sample model.

I am using DSS version of Vensim.

Thank you.

Taskia

Re: Getting the final value of a stock to another variable

Posted: Fri Dec 13, 2019 7:54 am
by Administrator
You can use
arrived tasks at final time = IF THEN ELSE ( time = FINAL TIME , arrived tasks , 0 )

Re: Getting the final value of a stock to another variable

Posted: Fri Dec 13, 2019 8:12 am
by taskia
Thank you for your reply.
Another issue is that if I want to use the value of 'arrived tasks at final time' as the initial value for another stock, it remains zero because the final value of 'arrived task' is shown at FINAL TIME. In this case, how can I use this value to other stock's initial value?
Please give me a suggestion about this.

Thank you.
Taskia

Re: Getting the final value of a stock to another variable

Posted: Fri Dec 13, 2019 9:11 am
by Administrator
All you can do is run the simulation to get the value at FINAL TIME. Then use that value to initialize the other level and run the simulation again.

Re: Getting the final value of a stock to another variable

Posted: Fri Dec 13, 2019 9:31 am
by taskia
Thank you very much.

Re: Getting the final value of a stock to another variable

Posted: Fri Dec 13, 2019 3:27 pm
by tomfid
More importantly, using the value of a variable at FINAL TIME to set the value of another stock at INITIAL TIME is acausal, i.e. it implies effect preceding cause. You can't do that in Vensim by design, because no one really knows the future.