Page 1 of 1

Monthly Counter

Posted: Mon Jul 06, 2020 2:38 pm
by JoseG
Hello,

I am trying to create a variable that accounts for the number of the month as in the following table:

time step -> monthly counter
1-> 1
2 -> 2
3 -> 3
4 -> 4
5 -> 5
6 -> 6
7 -> 7
8 -> 8
9 -> 9
10 -> 10
11 -> 11
12 -> 12
13 -> 1
14 -> 2
15 -> 3
...

My simulation runs for 1200 months at time steps of 1 month. The lookup could work for small runs but I think it is not feasible for the length of my simulation

I am using Vensim PLE version.

Any advice?

Many thanks in advance

José

Re: Monthly Counter

Posted: Mon Jul 06, 2020 3:01 pm
by Administrator
Can you use the MODULO function?

Re: Monthly Counter

Posted: Mon Jul 06, 2020 3:08 pm
by tomfid
Something like:
Month Index = Modulo(Time,One Month)+1 ~ dmnl
One Month == 1 ~ months

Re: Monthly Counter

Posted: Mon Jul 06, 2020 5:01 pm
by JoseG
Thank you guys, I think it works with the MODULO function