Page 1 of 1

Repeating LOOKUP TABLE

Posted: Fri Apr 22, 2022 8:49 pm
by cerrem
Hi..
I have a LOOKUP TABLE that has 20 data pairs....
This is based by the HOUR..
I entering the data for 24 hours..
Since this data repeats exactly the same for each 24 hours, I need to repeat this data for a week and then up to a month..
Entering all this data manually would be very time consuming and inefficient.
Is there a way to have the same data "recycle" every 24 hours ??

Thanks in advance...
Best Regards

Re: Repeating LOOKUP TABLE

Posted: Fri Apr 22, 2022 8:58 pm
by Administrator
How is time measured in your model? Is it by hour? If yes, you can use the MODULO function to get the hour of the day, and pass that into the lookup function.

Re: Repeating LOOKUP TABLE

Posted: Fri Apr 22, 2022 9:19 pm
by cerrem
Hi..
Yes, it is by the hour... Here it is :
[(0,0)-(10,10)],(0,7.77778e+06),(2,5.28e+06),(4,4.4444e+06),(6,5.33328e+06),(8,1.06666e+07),(9,1.05555e+07),(10,1e+07),(16,9.44435e+06),(20,1.6e+07),(21,1.55554e+07),(24,8.44436e+06)

0 to 24 hours with Power in the Y-co-ordinate...
I have data for each hour, but in the interest of simplification I used fewer hours in the day to put together a crude Piece-Wise function..
I need to continue the same Y-co-ordinates but up to 168 Hours for one week and maybe up to a month..
I am interested in learning more about the MODULO function and how to apply it..
Many Thanks..

Re: Repeating LOOKUP TABLE

Posted: Tue May 03, 2022 2:26 am
by tomfid
If you wanted something to repeat every week, you could use something like,

work time = daily work lookup( MODULO( hour, one week ) )

Where hour (units of hours obviously) would be the hour of the week, and one week would be the length of a week in hours. The MODULO function would then repeat on the interval 0 to <168 hours, and the lookup would have that range as its x-axis.

Lots of other variations are possible, depending on the units that are most convenient.

Re: Repeating LOOKUP TABLE

Posted: Wed Oct 05, 2022 11:31 pm
by fipac
Hi, does anyone know if the same as above (lookup using MODULO) can be done by reading the data from a CSV ?

Re: Repeating LOOKUP TABLE

Posted: Thu Oct 06, 2022 10:15 am
by Administrator
Vensim PLE cannot read CSV data.

Re: Repeating LOOKUP TABLE

Posted: Thu Oct 06, 2022 11:47 am
by fipac
Any example on how that can be achieved in a non-PLE version?