The use of 'TIME STEP' in equations

Use this forum to post Vensim related questions.
Post Reply
Xizhu He
Junior Member
Posts: 11
Joined: Wed Jun 28, 2023 4:58 pm
Vensim version: PLE

The use of 'TIME STEP' in equations

Post by Xizhu He »

Hi, I'm trying to define the variable 'resident income growth rate' using the variable 'resident income.' Is it possible to use (resident income(TIME STEP)) * 100 in the equation to express the meaning of ((Resident Income - Previous Resident Income) / Previous Resident Income) * 100?
Administrator
Super Administrator
Posts: 4590
Joined: Wed Mar 05, 2003 3:10 am

Re: The use of 'TIME STEP' in equations

Post by Administrator »

I'm not sure I follow what you are trying to do.

You definitely cannot use (resident income(TIME STEP)) * 100 to give the growth rate in the way you are thinking.

Can you upload your model and explain a little more?
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
Xizhu He
Junior Member
Posts: 11
Joined: Wed Jun 28, 2023 4:58 pm
Vensim version: PLE

Re: The use of 'TIME STEP' in equations

Post by Xizhu He »

Administrator wrote: Mon Jul 24, 2023 8:22 pm I'm not sure I follow what you are trying to do.

You definitely cannot use (resident income(TIME STEP)) * 100 to give the growth rate in the way you are thinking.

Can you upload your model and explain a little more?
I am trying to recreate a SD model from a paper. In the paper, the researchers used this structure for one of the subsystems (I attached a screenshot of that SD model). There are only two variables ('resident income' & 'TIME STEP') leading to the variable 'resident income growth rate.' Unfortunately, the researchers didn't provide the equation for 'resident income growth rate' in the paper.
Attachments
截屏2023-07-24 21.18.09.png
截屏2023-07-24 21.18.09.png (581.49 KiB) Viewed 701 times
Xizhu He
Junior Member
Posts: 11
Joined: Wed Jun 28, 2023 4:58 pm
Vensim version: PLE

Re: The use of 'TIME STEP' in equations

Post by Xizhu He »

Xizhu He wrote: Tue Jul 25, 2023 4:24 am
Administrator wrote: Mon Jul 24, 2023 8:22 pm I'm not sure I follow what you are trying to do.

You definitely cannot use (resident income(TIME STEP)) * 100 to give the growth rate in the way you are thinking.

Can you upload your model and explain a little more?
I am trying to recreate a SD model from a paper. In the paper, the researchers used this structure for one of the subsystems (I attached a screenshot of that SD model). There are only two variables ('resident income' & 'TIME STEP') leading to the variable 'resident income growth rate.' Unfortunately, the researchers didn't provide the equation for 'resident income growth rate' in the paper.
How should I use <TIME STEP> in an equation?
tomfid
Administrator
Posts: 3811
Joined: Wed May 24, 2006 4:54 am

Re: The use of 'TIME STEP' in equations

Post by tomfid »

It sounds like you're trying to recover the value of a variable at a previous time step? This appears to be computing a growth rate or derivative?

You could write something like:

Previous Resident Income = SMOOTH(Resident Income,TIME STEP)
income trend = ( (Resident Income - Previous Resident Income ) / Previous Resident Income )/TIME STEP

If the behavior is not smooth, or this represents a perception process, TIME STEP should be replaced with a longer explicit time constant.

You might also consider the TREND function, https://www.vensim.com/documentation/fn_trend.html

I'd strongly encourage adding units.
Xizhu He
Junior Member
Posts: 11
Joined: Wed Jun 28, 2023 4:58 pm
Vensim version: PLE

Re: The use of 'TIME STEP' in equations

Post by Xizhu He »

tomfid wrote: Tue Jul 25, 2023 9:43 pm It sounds like you're trying to recover the value of a variable at a previous time step? This appears to be computing a growth rate or derivative?

You could write something like:

Previous Resident Income = SMOOTH(Resident Income,TIME STEP)
income trend = ( (Resident Income - Previous Resident Income ) / Previous Resident Income )/TIME STEP

If the behavior is not smooth, or this represents a perception process, TIME STEP should be replaced with a longer explicit time constant.

You might also consider the TREND function, https://www.vensim.com/documentation/fn_trend.html

I'd strongly encourage adding units.
Thank you so much for your reply! I have some follow-up questions: I modified the structure of my model by adding a new variable 'previous resident income.' I input the equation for the 'previous resident income' and the equation of income trend for 'resident income growth rate'. But is there any way that does not require me to add a variable in the model? Can I somehow write both equations in the same equation box through formatting?
Attachments
截屏2023-07-26 09.34.05.png
截屏2023-07-26 09.34.05.png (73.73 KiB) Viewed 673 times
Administrator
Super Administrator
Posts: 4590
Joined: Wed Mar 05, 2003 3:10 am

Re: The use of 'TIME STEP' in equations

Post by Administrator »

Xizhu He wrote: Wed Jul 26, 2023 4:47 pm Thank you so much for your reply! I have some follow-up questions: I modified the structure of my model by adding a new variable 'previous resident income.' I input the equation for the 'previous resident income' and the equation of income trend for 'resident income growth rate'. But is there any way that does not require me to add a variable in the model? Can I somehow write both equations in the same equation box through formatting?
No, you'll need a separate variable. This is good practice anyway, we see too often users making equations far too complicated. Keep things easy and simple, others will be able to follow what you are doing, and you will find it easier to debug your model.
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
Xizhu He
Junior Member
Posts: 11
Joined: Wed Jun 28, 2023 4:58 pm
Vensim version: PLE

Re: The use of 'TIME STEP' in equations

Post by Xizhu He »

Administrator wrote: Wed Jul 26, 2023 6:45 pm
Xizhu He wrote: Wed Jul 26, 2023 4:47 pm Thank you so much for your reply! I have some follow-up questions: I modified the structure of my model by adding a new variable 'previous resident income.' I input the equation for the 'previous resident income' and the equation of income trend for 'resident income growth rate'. But is there any way that does not require me to add a variable in the model? Can I somehow write both equations in the same equation box through formatting?
No, you'll need a separate variable. This is good practice anyway, we see too often users making equations far too complicated. Keep things easy and simple, others will be able to follow what you are doing, and you will find it easier to debug your model.

I see! Thank you so much for your help!
tomfid
Administrator
Posts: 3811
Joined: Wed May 24, 2006 4:54 am

Re: The use of 'TIME STEP' in equations

Post by tomfid »

However ... the TREND function does essentially what I proposed, without requiring the extra equation.
Post Reply