How to calculate the difference in value for a variable in vensim over time?

Use this forum to post Vensim related questions.
Post Reply
Susan@6
Junior Member
Posts: 2
Joined: Thu Mar 28, 2024 4:12 pm
Vensim version: PLE

How to calculate the difference in value for a variable in vensim over time?

Post by Susan@6 »

Hello, Sir/Madam. I am relativity new to vensim. I projected GDP data for 25 years and want to find the change in GDP each year. It seems unable to find a simple function that calculates the difference of a value for an auxiliary variable (GDP) in the current time with the value of that same var. (GDP) in the previous year.
Some function like this: Change in GDP= (GDP at time t - GDP at time t-1)? I need this as an auxiliary variable (Change in GDP).
Note: I have vensim PLE (Student Version).
It would be a great help if I could find a solution.
I appreciate any help you can provide. Thank You
tomfid
Administrator
Posts: 3811
Joined: Wed May 24, 2006 4:54 am

Re: How to calculate the difference in value for a variable in vensim over time?

Post by tomfid »

You can use DELAY FIXED for this:

Previous GDP = DELAY FIXED( Current GDP, one year, Current GDP ) ~ $/year
one year == 1 ~ year

In continuous time, you can use the SMOOTH function, i.e.
Previous GDP = SMOOTH( Current GDP, one year ) ~ $/year

You can also use the TREND function to compute a fractional rate of change on the same basis.
Susan@6
Junior Member
Posts: 2
Joined: Thu Mar 28, 2024 4:12 pm
Vensim version: PLE

Re: How to calculate the difference in value for a variable in vensim over time?

Post by Susan@6 »

Thank you so much for your kind help. It's working fine.
Post Reply