Shift forward (NOT delay) a variable (not DATA type)?

Use this forum to post Vensim related questions.
Post Reply
WayneZhou2009
Senior Member
Posts: 105
Joined: Wed Oct 25, 2017 3:52 pm
Vensim version: PRO

Shift forward (NOT delay) a variable (not DATA type)?

Post by WayneZhou2009 »

Hi everyone,

I am struggling with "shifting" the value of a variable (auxiliary type, NOT data type). Put it more specifically, the original variable A spans from year 0 to year 100, now I want to have it "shifted forward" by 15 years, so that at any given time t, the value of "shifted" variable B (t) = the value of original variable A (t + 15).

Please note this is the opposite to DELAY FIXED, because it is not for the purpose of delaying, i.e. B (t) = A (t-15), rather, it is for bringing forward the original A, i.e. B (t) = A (t+15). So I do not think DELAY FIXED can address this issue.

I understand that there are functions such as TIME SHIFT or GET DATA AT TIME, however they are applicable to DATA type, but not Auxiliary type or other types.

For SAMPLE IF TRUE, it can get the values I want, however the time can not be shifted.

I understand it might be possible to solve this problem through this approach: (1) firstly run the main model and generates a dataset (.VDF) containing variable A; (2) then create a separate small model which defines variable A as a DATA type and extracting it values from the .VDF dataset, so that it becomes DATA type; (3) apply the TIME SHIFT function to get variable B in DATA type; and (4) in the main model, define variable B which extracts the values from the dataset VDF generated in the small model. However, this is really not what I want. I prefer to realise the shifting within just one single model, without having to explicitly use the VDF file.

Is there a way around this situation? I really appreciate your help. Thank you so much.

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

Re: Shift forward (NOT delay) a variable (not DATA type)?

Post by Administrator »

It cannot be done, the value of "a" at t+15 is in the future, it has not been calculated yet.

It might be better if you explain what you are trying to model, maybe we can suggest the correct thing to do.
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
tomfid
Administrator
Posts: 3804
Joined: Wed May 24, 2006 4:54 am

Re: Shift forward (NOT delay) a variable (not DATA type)?

Post by tomfid »

There's a good reason that it can't be done, which is that this kind of operation is acausal - it implies knowledge of the future that can't exist in the real world, and therefore should not be used in a good model.
tomfid
Administrator
Posts: 3804
Joined: Wed May 24, 2006 4:54 am

Re: Shift forward (NOT delay) a variable (not DATA type)?

Post by tomfid »

That's not to say that people don't have expectations about the future, which can be legitimately modeled.
WayneZhou2009
Senior Member
Posts: 105
Joined: Wed Oct 25, 2017 3:52 pm
Vensim version: PRO

Re: Shift forward (NOT delay) a variable (not DATA type)?

Post by WayneZhou2009 »

Hi Administrator and tomfid,

Thank you both for your reply. As suggested by Administrator, I have attached a very simple model showing what I want. Appreciate if you could advise any way dealing with it.

WZ
Administrator wrote:It cannot be done, the value of "a" at t+15 is in the future, it has not been calculated yet.

It might be better if you explain what you are trying to model, maybe we can suggest the correct thing to do.
Last edited by WayneZhou2009 on Fri Oct 27, 2017 10:52 am, edited 1 time in total.
tomfid
Administrator
Posts: 3804
Joined: Wed May 24, 2006 4:54 am

Re: Shift forward (NOT delay) a variable (not DATA type)?

Post by tomfid »

I understand what you want but not why you want it.

If this is for display purposes, you could potentially create an alternate TIME BASE with the shift in it.

If it's for a dynamic calculation, the answer depends on what it represents.

Can you elaborate?
WayneZhou2009
Senior Member
Posts: 105
Joined: Wed Oct 25, 2017 3:52 pm
Vensim version: PRO

Re: Shift forward (NOT delay) a variable (not DATA type)?

Post by WayneZhou2009 »

Hi tomfid, thanks for your reply. No, it is not for display purpose. The left-shifted curve will be used as a function to be applied to the product maintenance rate (not shown in the model). The shift, say, 30 years, leads to the shifted curve which is used to weight the potential rate of products for maintenance, so that only those products with at least 30 years remaining lifetime will be maintained (otherwise it is considered economically unattractive). Here it is assumed that the maintenance only improves the quality but not increase the lifetime of a product.

Thanks.
tomfid wrote:I understand what you want but not why you want it.

If this is for display purposes, you could potentially create an alternate TIME BASE with the shift in it.

If it's for a dynamic calculation, the answer depends on what it represents.

Can you elaborate?
tomfid
Administrator
Posts: 3804
Joined: Wed May 24, 2006 4:54 am

Re: Shift forward (NOT delay) a variable (not DATA type)?

Post by tomfid »

I don't think time shifting would work for a generalized input in this case, even if it were possible.

Instead, you need the model to recognize the two distinct states of maintenance - something like this:
maintenance.png
maintenance.png (10.2 KiB) Viewed 3408 times
You could further generalize that to have 10yr cohorts of products (i.e. stocks of 0-10yr old items, 10-20yr old, ... etc.).

I'd generally avoid DELAY PROFILE and use simpler distributions (first order or DELAY 3), especially if there's heterogeneity in product usage.
Post Reply