def winterPeak(a, decrease_gas, sched_skew_std, add_heat_degree): winterload_ops = winterLoad(a, decrease_gas, add_heat_degree)[::2] options = [] if a < 0: a0 = "To lower winter peak, we can " a1 = "increase" ch = 1 else: a0 = "To increase winter peak, we can " a1 = "decrease" ch = -1 print(a0 + a1 + " schedule skew standard deviation.") # test two different changes val1 = sched_skew_std + ch * 900 val2 = sched_skew_std + ch * 1800 # constrain the values within our set limits if not limits.SchedSkewSTDLIM(val1): if a < 0: val1 = limits.schedSkewStd_high else: val1 = limits.schedSkewStd_low if not limits.SchedSkewSTDLIM(val2): if a < 0: val2 = limits.schedSkewStd_high else: val1 = limits.schedSkewStd_low # for each option from winterLoad, test each schedule skew std value for i in winterload_ops: options.extend([i + [val1], i + [val2]]) # get rid of any duplicates final = list(map(list, set(map(tuple, options)))) return final
def peakLevel(a, cool_offset, heat_offset, cop_high, cop_low, sched_skew_std): options = [None] * 7 for i in range(7): options[i] = [ cool_offset, heat_offset, cop_high, cop_low, sched_skew_std ] if a < 0: a0 = "To lower peaks, we can " a1 = "decrease" a2 = "increase" a3 = "increase" ch = -1 else: a0 = "To increase peaks, we can " a1 = "increase" a2 = "decrease" a3 = "decrease" ch = 1 print(a0 + a1 + " set point offsets, " + a2 + " COP values, " + a3 + " schedule skew standard deviation.") cool_offset_new = cool_offset + ch * 0.5 heat_offset_new = heat_offset + ch * 0.5 cop_high_new = round(cop_high - ch * 0.05, 2) cop_low_new = round(cop_low - ch * 0.05, 2) sched_skew_std_new = sched_skew_std - ch * 900 # Changing COP values together and offsets together for now. options[0][0:2] = cool_offset_new, heat_offset_new # change offsets options[1][2:4] = cop_high_new, cop_low_new # change COP scaling options[2][4] = sched_skew_std_new # change schedule skew std options[3][ 0: 4] = cool_offset_new, heat_offset_new, cop_high_new, cop_low_new # change offsets and COP scaling options[4][0], options[4][1], options[4][ 4] = cool_offset_new, heat_offset_new, sched_skew_std_new # change offsets and schedule skew std options[5][ 2: 5] = cop_high_new, cop_low_new, sched_skew_std_new # change COP scaling and schedule skew std options[6] = [ cool_offset_new, heat_offset_new, cop_high_new, cop_low_new, sched_skew_std_new ] # change COP scaling, offsets, and schedule skew std for i in range(7): if not limits.OffsetsLIM( options[i][1], options[i] [0]): # Will need modification if changing offsets independently. if a < 0: options[i][0], options[i][ 1] = -limits.offset_band, -limits.offset_band else: options[i][0], options[i][ 1] = limits.offset_band, limits.offset_band if not limits.COPvalsLIM( options[i][2], options[i][3] ): # Will need modification if changing COP high and COP low independently. if a < 0: options[i][2], options[i][ 3] = limits.COPlim_high, limits.COPlim_high else: options[i][2], options[i][ 3] = limits.COPlim_low, limits.COPlim_low if not limits.SchedSkewSTDLIM(options[i][4]): if a < 0: options[i][4] = limits.schedSkewStd_high else: options[i][4] = limits.schedSkewStd_low # Get rid of any duplicates that were created after limits imposed. final = list(map(list, set(map(tuple, options)))) return final