Modulo special functions in Stella Architect

Greetings everyone,

I have been having trouble getting the units of the following equation in Stella Architect:

monthly_counter = TIME MOD(12) ;

The model set is based on years running from a start period of 0 to an end period of 40.

Thanks in advance.

If the model is in years than counting months would need

monthly_counter = (Time*months_per_year) MOD 12

where months_per_year is 12 (units Months/Year). If you want the counter to run from 1 to 12 (instead of 0 to 11) use

monthly_counter = INT((Time*months_per_year) MOD 12)+1)

Hope that helps.

Hi Bob,

Thanks a lot for responding. However, the issue is still not resolved. The error is “monthly counter” has an equation with errors in its units. The dimensional analysis looks fine but the unit is not in agreement.