Getting the final value of a stock to another variable

Use this forum to post Vensim related questions.
Post Reply
taskia
Junior Member
Posts: 8
Joined: Tue Aug 27, 2019 2:20 am
Vensim version: PRO

Getting the final value of a stock to another variable

Post 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
Attachments
example.mdl
(2.43 KiB) Downloaded 35 times

Administrator
Super Administrator
Posts: 3624
Joined: Wed Mar 05, 2003 3:10 am

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

Post by Administrator »

You can use
arrived tasks at final time = IF THEN ELSE ( time = FINAL TIME , arrived tasks , 0 )
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391

Units are important!
http://www.bbc.co.uk/news/magazine-27509559

taskia
Junior Member
Posts: 8
Joined: Tue Aug 27, 2019 2:20 am
Vensim version: PRO

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

Post 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

Administrator
Super Administrator
Posts: 3624
Joined: Wed Mar 05, 2003 3:10 am

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

Post 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.
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391

Units are important!
http://www.bbc.co.uk/news/magazine-27509559

taskia
Junior Member
Posts: 8
Joined: Tue Aug 27, 2019 2:20 am
Vensim version: PRO

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

Post by taskia »

Thank you very much.

tomfid
Administrator
Posts: 3049
Joined: Wed May 24, 2006 4:54 am

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

Post 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.

Post Reply