How to Reset a Stock?

Use this forum to discuss any issues relating to Systems Dynamics and Systems Thinking.
Post Reply
Posts: 1
Joined: Mon Nov 06, 2017 2:25 am
Vensim version: PLE

How to Reset a Stock?

Post by Alsulaim » Mon Nov 06, 2017 2:35 am

I have a stock that is accumulating data per hour. How can I reset it at the end of some period?

I need to accumulate dollar savings per day to reach a monthly total, then use that total as an input to another part of the model. Therefore, at the end of every month I have to reset the savings stock to start accumulating the savings of the next month. Is this even possible? If so, how can I also store that monthly value to be used somewhere else in the model?

Any help is appreciated here!

Thank you!

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

Re: How to Reset a Stock?

Post by Administrator » Mon Nov 06, 2017 7:29 am

This structure will reset the savings at time = 30. I'm sure you can adjust it to reset the savings at the end of each month.

Code: Select all

cumulative savings = integ( savings - end of month savings reset , initial savings )

end of month savings reset =  if then else ( time = 30 , cumulative savings , 0 )
Advice to posters seeking help (it really helps us to help you) ... f=2&t=4391

Units are important!

Post Reply