-
Notifications
You must be signed in to change notification settings - Fork 208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ScheduleDay::getValue applies interpolation differently than EnergyPlus #5001
Comments
For users, is the alternative/workaround here to add every single value to the day schedule for all timesteps? |
@joseph-robertson I suppose. Alternatively, the user could store the value of |
How about a new OS:ScheduleDay method |
Hi @eringold, can you have a look at #5111 and tell me if this is what you had in mind? This is a method to return all values of a day schedule, regardless of the |
Just noticed this OpenStudio/src/model/ScheduleDay.hpp Line 57 in 171ca2b
Maybe it'd be good to change it to be a choice field like E+, and bring the os-standards average method into C++
|
OpenStudio/src/utilities/data/Vector.hpp Lines 56 to 63 in 171ca2b
|
OpenStudio/src/model/ScheduleDay.cpp Lines 174 to 213 in 7a987d3
OpenStudio/src/utilities/data/Vector.cpp Lines 102 to 149 in 171ca2b
doesn't the getValues routine look inefficient? If I'm understanding correctly, you only need to find the time before and the time after and the corresponding, you can break early. I know, this is a scheduleday, so we're talking about 60 (timestep max in E+ If I recall correctly) * 24 hours datapoints max, so it's not noticeable, but still |
Issue overview
For a ScheduleDay with 'Interpolate to Timestep' = 'Yes', calling
getValue
with a Time value that does not equal one of the scheduled Hour+Minute values will return an interpolated value, which is inconsistent with how EnergyPlus interprets that input.
Current Behavior
EnergyPlus interprets 'Interpolate to Timestep' = 'Average' to mean "when the simulation timestep doesn't coincide with the scheduled interval, the value at the intermediate timestep is interpolated". I.e., for this schedule:
If the simulation timesteps per hour are 4, will evaluate like:

With 'Average' interpolation, for 10 timesteps per hour, it would evaluate like:

However

ScheduleDay::getValue
in OpenStudio interpolates between schedule times (i.e., 8:15 to 21:45), so callinggetValue
with intermediate times results in a plot like this:Expected Behavior
I expect
getValue
to return the same value that EnergyPlus would for a schedule at a given time.Steps to Reproduce
Create a ScheduleDay with 'Interpolate To Timestep' = 'Yes', and make successive calls to
getValue
like:-> ...
08:00:00, 0.0
08:15:00, 0.0
08:30:00, 0.01851851851851845
08:45:00, 0.03703703703703701
09:00:00, 0.05555555555555555
...
21:00:00, 0.9444444444444444
21:15:00, 0.9629629629629629
21:30:00, 0.9814814814814814
21:45:00, 1.0
22:00:00, 0.8888888888888893
22:15:00, 0.7777777777777786
Some additional details about your environment for this issue (if relevant):
Context
This impacts multiple uses of
getValue
, e.g. for determining HVAC occupancy schedules in openstudio-standards, schedule reporting in OpenStudio Results, etc.The text was updated successfully, but these errors were encountered: