average value over time window

Use this forum to post Vensim related questions.
Post Reply
ebr567
Member
Posts: 36
Joined: Sat Mar 14, 2015 11:26 am
Vensim version: DSS

average value over time window

Post by ebr567 »

Hello,

I would like to use the average value of a function over a particular time window to get a better picture of my annualized inventories.

In other words, lets assume I have widgets being added to a warehouse at a variable daily rate. Each widget stays in the warehouse for exactly 365 days at which point it is removed. I am looking for a function that will tell me how many widgets are currently in the warehouse.

Mathematically, I want to solve the following integral: f(t) = integral( X(T), T=t-365..t), where t is the current time and X is an auxiliary variable.

How would I do this?
Thanks!
Administrator
Super Administrator
Posts: 4573
Joined: Wed Mar 05, 2003 3:10 am

Re: average value over time window

Post by Administrator »

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
ebr567
Member
Posts: 36
Joined: Sat Mar 14, 2015 11:26 am
Vensim version: DSS

Re: average value over time window

Post by ebr567 »

The Smooth function in Vensim applies a lowpass filter to the data, it doesn't perform time-window averaging. Is there another way?
Administrator
Super Administrator
Posts: 4573
Joined: Wed Mar 05, 2003 3:10 am

Re: average value over time window

Post by Administrator »

Create a level. The inflow is what you want to average, the outflow is the inflow delayed by the time window you want to average over. Divide the level by the time window and you have the average.

Hope that makes sense.
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
Post Reply