Stock Accumulation

Use this forum to discuss any issues relating to Systems Dynamics and Systems Thinking.
aalto-comnet
Member
Posts: 20
Joined: Fri Dec 07, 2018 9:20 am
Vensim version: DSS

Stock Accumulation

Hello!

I have a stock which is accumulating data. When this data is constant, the stock is normally showing the data accumulation per year. However, when I read some non-constant data per year from a csv file, the accumulation is not accurate.

Could it be an integration function issue? Any ideas?

Thanks!

Posts: 3286
Joined: Wed Mar 05, 2003 3:10 am

Re: Stock Accumulation

Vensim will interpolate between points, so you might need to make use of the RAW data keyword to ensure you just accumulate the points.
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391

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

aalto-comnet
Member
Posts: 20
Joined: Fri Dec 07, 2018 9:20 am
Vensim version: DSS

Re: Stock Accumulation

Hi!

Thank you for relying. In the end, I believe it is a timestep issue. The model was accumulating in one stock based on time that was written in decimal form whereas for the other time didn't contain decimal points (e.g., 2010 for one stock, 2010.5 for the other stock).

Posts: 3286
Joined: Wed Mar 05, 2003 3:10 am

Re: Stock Accumulation

I'd be surprised if it were a time step issue.
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391

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

aalto-comnet
Member
Posts: 20
Joined: Fri Dec 07, 2018 9:20 am
Vensim version: DSS

Re: Stock Accumulation

Here is the file I am using as input, and its output with a 0.25 timestep. There are two stocks accumulating equally so the result should be the input divided by two. As you can see from the closer screen shot the result is wrong. If timestep is set to 1 then the output is as it should.
Attachments
output-2.png (30.16 KiB) Viewed 976 times
output-1.png (48.71 KiB) Viewed 976 times
input.png (30.44 KiB) Viewed 976 times

Posts: 3286
Joined: Wed Mar 05, 2003 3:10 am

Re: Stock Accumulation

Changing time step to make something look correct indicates an error in the model.
Here are some guidelines on selecting a suitable time step.
http://www.vensim.com/documentation/ind ... e_step.htm

Have you looked at
http://www.vensim.com/documentation/ind ... mulate.htm

I think this is what you need (along with the correct time step for your model).
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391

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

aalto-comnet
Member
Posts: 20
Joined: Fri Dec 07, 2018 9:20 am
Vensim version: DSS

Re: Stock Accumulation

Hi there!

Thank you for spending time on this.

The model here states that it is missing a vdf file and therefore I cannot simulate it.
http://www.vensim.com/documentation/ind ... mulate.htm

Essentially, the model I am using is this one attached. I doubt that there could be an error in it, as it is a sample model from Vensim's website.

What I am doing, in the end, is reading the demand from the csv that I have attached above instead of giving a constant demand of 1 million/year.

However, the installed bases are displayed incorrectly as shown in the figures, if the timestep is left at 0.25. If timestep is set at 1 the results are correct.

If you could be so kind to let me know how would you treat the installed bases using the cumulate function (I presume this is what you suggest), I would really appreciate it.
Attachments
NETWORKE.MDL

Posts: 3286
Joined: Wed Mar 05, 2003 3:10 am

Re: Stock Accumulation

That model (networke.mdl) runs fine for me and does not need any external data. And it's not one of our models (a quick search of the web suggests it comes with the Business Dynamics book).

For Vensim sample models, look on your machine, try C:\Users\Public\Vensim\Models\FunctionExamples.

If you upload what you are working on, I'm sure I can help.
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391

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

aalto-comnet
Member
Posts: 20
Joined: Fri Dec 07, 2018 9:20 am
Vensim version: DSS

Re: Stock Accumulation

Hello!

Please find attached the model I am working on. What is not making sense, as I have mentioned, is that when timestep is set to 1, the installed bases (and the apps stocks) are accumulating fine, whereas when it is set to 0.25 or 0.5 they are not.

Please feel free to ask in case anything is not making sense to you or make recommendations/suggestions on how would you design anything differently.

Thank you!
Attachments
model.zip

Posts: 3286
Joined: Wed Mar 05, 2003 3:10 am

Re: Stock Accumulation

What are the exact parameters that are giving errors?

And what is a suitable time step to use?
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391

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

aalto-comnet
Member
Posts: 20
Joined: Fri Dec 07, 2018 9:20 am
Vensim version: DSS

Re: Stock Accumulation

A 0.25 timestep would be suitable.

The four stocks, two installed bases and two app stocks, are not accumulating correctly at this timestep. And neither they do with a 0.5 timestep for example. They do accumulate correctly nevertheless with a timestep of 1.

Posts: 3286
Joined: Wed Mar 05, 2003 3:10 am

Re: Stock Accumulation

I think you need to look into more detail at the data equations.

Between data points, Vensim interpolates the data. For example, the value used for "TOTAL number of app store and google play apps" will be interpolated between the two yearly points which is why the total accumulation is not correct.

I think if you use :HOLD_BACKWARD:, the numbers will match what you expect.
http://www.vensim.com/documentation/ind ... ations.htm

You might also want to put units into your model, this is another very common source of errors.
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391

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

aalto-comnet
Member
Posts: 20
Joined: Fri Dec 07, 2018 9:20 am
Vensim version: DSS

Re: Stock Accumulation

Let me just double-check this with you, to see if there is something I misunderstand here.

Let's just run the model with a 0.5 timestep. As far as I understand, this implies that the smartphone demand of 2009 for example, which is 173500000, will be evenly accumulated from the two installed bases in two steps. That is 86750000 (173500000/2) until 2009.5 and another 86750000 until 2010.

If that is correct, I can understand the 433750000 (86750000/2) that is shown for each installed base at 2009.5, however I cannot understand the 103150000 that is shown at 2010. Where does this value come from? Shouldn't it be 86750000 for each installed base? The 433750000 that is accumulated until 2009.5 plus another 433750000 to sum a total of 173500000 from the two installed bases.

Am I saying something wrong?

Posts: 3286
Joined: Wed Mar 05, 2003 3:10 am

Re: Stock Accumulation

I cannot follow what you are describing. Can you quote exact variable names so I can look at those in the model?

I'd also strongly suggest adding units to ensure your model passes the most basic of quality checks. Personally, I do not believe any results I see from a model unless it is dimensionally correct.
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391

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

aalto-comnet
Member
Posts: 20
Joined: Fri Dec 07, 2018 9:20 am
Vensim version: DSS