You should be able to create a time series with zero values, though the tricky parts may be getting the right Vector object and the right first report time. Here's Ruby code to do it for a complete year:
require 'openstudio'
values = OpenStudio::Vector.new(8760, 0.0)
date = OpenStudio::Date.new(OpenStudio::MonthOfYear.new("Jan"), 1, 2009)
time = OpenStudio::Time.new(0,1,0,0)
timeSeries = OpenStudio::TimeSeries.new(date, time, values, "")
Note that in the documentation the firstReportDateTime
arguments are going to be the date and time of the first value in the time series, so if I had used one of those constructors I would be passing in 1/1/2009 01:00.
There are more examples here on creating time series. Unfortunately, the Ruby tests are gone now, only the C++ tests remain.
Are you referring to
SqlFile::timeseries
. The arguments to that function are envPeriod, reportingFrequency, timeSeriesName, and keyValue. If you are not getting an initialized TimeSeries object back then you are either passing in bad values for those arguments or you did not request that EnergyPlus output the desired data.Sorry for my wrong syntax. It's
.timeSeries
method. It's a space without infiltration or outdoor rate, so they would not get recorded in .sql. The value can be zero but the timedate data still should inputAre you asking how to create a TimeSeries?
So in some cases you do your query and get back a result, is that right? In other cases, you do your query and get back an empty result, what do you want to do in that case? Create a timeseries with all zero values? Why do you want to do that?
Yes, I want to get a times series with all zero value - that all time data have zero value
(1/1/2009 0h:0m:0s, 0)
0 . I got time duration bysqlFile.hoursSimulated
andRunPeriods
,OpenStudio::Date
for begin and and end day but have problem to create a TimeSeries with all zero array. I read here but still have problems with time creating and modifying in case of month or year frequency