I have found that using the function 'time shift' to look ahead along a data series, often returns an error if the shift parameter is not a constant. For example if the time series is shifted by a variable shift and shift=constant +1, where 1 is a constant, the error is returned even if shift is designated a constant.
Is there any way around this?
time shifted data
-
- Senior Member
- Posts: 1107
- Joined: Wed Mar 12, 2003 2:46 pm
You can only time shift using either a number or a model constant. If you have an equation such as
shift = constant + 1
then shift is treated as an auxiliary, even though it won't be time varying. There is no way around this but if you explain why you are trying to change the time shift there may be a useful solution.
shift = constant + 1
then shift is treated as an auxiliary, even though it won't be time varying. There is no way around this but if you explain why you are trying to change the time shift there may be a useful solution.
-
- Junior Member
- Posts: 14
- Joined: Tue Mar 25, 2003 9:25 am
That's as i expected.
Essentially I need to look ahead from the current day (the model time step) in some data read in from excel.
The trouble is the look ahead shift is dependent (a function of) on another variable which is read in from excel.
Incidentally, I have found that that using an element from a subscript range does work:
Eg days: day1,day2,day3
shift[days]=days
Time shifted data[days]=Time Shift(data,shift[days])
This seems to work, although i don't know why. However, it doesn't work if you want to add a constant to the shift value.
Essentially I need to look ahead from the current day (the model time step) in some data read in from excel.
The trouble is the look ahead shift is dependent (a function of) on another variable which is read in from excel.
Incidentally, I have found that that using an element from a subscript range does work:
Eg days: day1,day2,day3
shift[days]=days
Time shifted data[days]=Time Shift(data,shift[days])
This seems to work, although i don't know why. However, it doesn't work if you want to add a constant to the shift value.
-
- Senior Member
- Posts: 1107
- Joined: Wed Mar 12, 2003 2:46 pm