ibpsa / project1

Project 1
48 stars 39 forks source link

CalendarTime shows bug with non-zero offset #980 #30

Closed damienpicard closed 5 years ago

damienpicard commented 5 years ago

When CalendarTime is used with non-zero offset, an unexpected behaviour appears: the next day starts at hour 1 instead of 0 and the minutes goes to a higher value than 60:

Examples: The simulation of Example/CalendarTime.mo with calendarTime2016.offset = 3600 gives this: image

damienpicard commented 5 years ago

This is solved by substracting the offset from the initial equations:

hourSampleStart = integer(time /3600)*3600 - offset;
daySampleStart  = integer((time) /(3600*24))*3600*24 - offset;

I'll propose a pull request.

damienpicard commented 5 years ago

sorry, wrong place