|
@@ -19,7 +19,7 @@ from ...tools.data_cleaner import DataCleaner
|
|
|
|
|
|
|
|
class SDHU_AB(BaseDevice):
|
|
class SDHU_AB(BaseDevice):
|
|
|
|
|
|
|
|
- val_rw_adj_target = ('coil_3_ToutA','coil_3_DoutA')
|
|
|
|
|
|
|
+ val_rw_adj_target = ('coil_2_ToutA','coil_2_DoutA')
|
|
|
|
|
|
|
|
def __init__(
|
|
def __init__(
|
|
|
self,
|
|
self,
|
|
@@ -116,8 +116,7 @@ class SDHU_AB(BaseDevice):
|
|
|
if self.DHU_type == 'A':
|
|
if self.DHU_type == 'A':
|
|
|
return model_A(*args,**kwargs)
|
|
return model_A(*args,**kwargs)
|
|
|
elif self.DHU_type == 'B':
|
|
elif self.DHU_type == 'B':
|
|
|
- # return model_B(*args,**kwargs)
|
|
|
|
|
- pass
|
|
|
|
|
|
|
+ return model_B(*args,**kwargs)
|
|
|
else:
|
|
else:
|
|
|
raise ValueError('DHU_type must be A or B')
|
|
raise ValueError('DHU_type must be A or B')
|
|
|
|
|
|
|
@@ -162,7 +161,7 @@ class SDHU_AB(BaseDevice):
|
|
|
model = reorder_posterior(param_prior,self.param_posterior),
|
|
model = reorder_posterior(param_prior,self.param_posterior),
|
|
|
train_data = {
|
|
train_data = {
|
|
|
'wheel_1_TinR': observed_data.loc[:,'wheel_1_TinR'].values,
|
|
'wheel_1_TinR': observed_data.loc[:,'wheel_1_TinR'].values,
|
|
|
- 'fan_2_Hz' : observed_data.loc[:,'wheel_2_TinR'].values,
|
|
|
|
|
|
|
+ 'fan_2_Hz' : observed_data.loc[:,'fan_2_Hz'].values,
|
|
|
'coil_2_DoutA': observed_data.loc[:,'coil_2_DoutA'].values,
|
|
'coil_2_DoutA': observed_data.loc[:,'coil_2_DoutA'].values,
|
|
|
},
|
|
},
|
|
|
train_metric = {'R2':1,'MAE':1,'MAPE':1}
|
|
train_metric = {'R2':1,'MAE':1,'MAPE':1}
|
|
@@ -191,7 +190,9 @@ class SDHU_AB(BaseDevice):
|
|
|
data = data.replace(-9999,np.nan)
|
|
data = data.replace(-9999,np.nan)
|
|
|
clean_data = DataCleaner(data,print_process=print_process)
|
|
clean_data = DataCleaner(data,print_process=print_process)
|
|
|
|
|
|
|
|
|
|
+ filter_columns = []
|
|
|
if 'input' in data_type:
|
|
if 'input' in data_type:
|
|
|
|
|
+ filter_columns += list(self.model_input_data_columns.values())
|
|
|
clean_data = (
|
|
clean_data = (
|
|
|
clean_data
|
|
clean_data
|
|
|
.rm_rolling_fluct(window=60,fun='ptp',thre=0.1,include_cols=['State'])
|
|
.rm_rolling_fluct(window=60,fun='ptp',thre=0.1,include_cols=['State'])
|
|
@@ -200,7 +201,7 @@ class SDHU_AB(BaseDevice):
|
|
|
.rm_outrange(method='raw',upper=140,lower=20,include_cols=['wheel_1_TinR'])
|
|
.rm_outrange(method='raw',upper=140,lower=20,include_cols=['wheel_1_TinR'])
|
|
|
)
|
|
)
|
|
|
if 'observed' in data_type:
|
|
if 'observed' in data_type:
|
|
|
- pass
|
|
|
|
|
|
|
+ filter_columns += list(self.model_observe_data_columns.values())
|
|
|
clean_data = clean_data.get_data(
|
|
clean_data = clean_data.get_data(
|
|
|
fill = 0 if fill_zero else None,
|
|
fill = 0 if fill_zero else None,
|
|
|
save_log = save_log
|
|
save_log = save_log
|
|
@@ -418,7 +419,83 @@ def model_A(
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+def model_B(
|
|
|
|
|
+ Tin_Fr, # 再生侧入口温度
|
|
|
|
|
+ Hin_Fr, # 再生侧入口湿度
|
|
|
|
|
+ coil_1_ToutA,
|
|
|
|
|
+ coil_1_HoutA,
|
|
|
|
|
+ fan_1_Hz, # 处理侧风机频率
|
|
|
|
|
+ fan_2_Hz, # 再生侧风机频率
|
|
|
|
|
+ coil_2_TinW, # 中表冷进水温度
|
|
|
|
|
+ coil_2_Val, # 中表冷阀门开度
|
|
|
|
|
+ wheel_1_TinR, # 前转轮再生侧温度
|
|
|
|
|
+ engine : str,
|
|
|
|
|
+ components: dict,
|
|
|
|
|
+ param : dict,
|
|
|
|
|
+ mixed_1_TinM = 0, # 回风温度(处理侧)
|
|
|
|
|
+ mixed_1_HinM = 0, # 回风湿度(处理侧)
|
|
|
|
|
+) -> dict:
|
|
|
|
|
+ # 水的质量流量
|
|
|
|
|
+ coil_2_FW = coil_2_Val / 100
|
|
|
|
|
+ # 空气的质量流量
|
|
|
|
|
+ air_flow = AirFlow_SDHU_B.model(fan_1_Hz=fan_1_Hz,fan_2_Hz=fan_2_Hz,param=param)
|
|
|
|
|
|
|
|
|
|
+ # 前转轮
|
|
|
|
|
+ wheel_1_res = components['wheel_1'].model(
|
|
|
|
|
+ TinP = coil_1_ToutA,
|
|
|
|
|
+ HinP = coil_1_HoutA,
|
|
|
|
|
+ FP = air_flow['wheel_1_FaP'],
|
|
|
|
|
+ TinR = wheel_1_TinR,
|
|
|
|
|
+ HinR = Hin_Fr,
|
|
|
|
|
+ FR = air_flow['wheel_1_FaR'],
|
|
|
|
|
+ engine = engine,
|
|
|
|
|
+ param = param['wheel_1']
|
|
|
|
|
+ )
|
|
|
|
|
+ # 处理侧混风(回风)
|
|
|
|
|
+ mixed_1_res = components['mixed_1'].model(
|
|
|
|
|
+ TinA = wheel_1_res['ToutP'],
|
|
|
|
|
+ HinA = wheel_1_res['HoutP'],
|
|
|
|
|
+ FA = air_flow['mixed_1_FaA'],
|
|
|
|
|
+ TinM = mixed_1_TinM,
|
|
|
|
|
+ HinM = mixed_1_HinM,
|
|
|
|
|
+ FM = air_flow['mixed_1_FaM'],
|
|
|
|
|
+ engine = engine
|
|
|
|
|
+ )
|
|
|
|
|
+ # 中表冷
|
|
|
|
|
+ coil_2_res = components['coil_2'].model(
|
|
|
|
|
+ TinA = mixed_1_res['ToutA'],
|
|
|
|
|
+ HinA = mixed_1_res['HoutA'],
|
|
|
|
|
+ FA = air_flow['coil_2_FaA'],
|
|
|
|
|
+ TinW = coil_2_TinW,
|
|
|
|
|
+ FW = coil_2_FW,
|
|
|
|
|
+ engine = engine,
|
|
|
|
|
+ param = param['coil_2']
|
|
|
|
|
+ )
|
|
|
|
|
+ # 前再生加热盘管
|
|
|
|
|
+ heatingcoil_1_res = components['heatingcoil_1'].model(
|
|
|
|
|
+ TinA = Tin_Fr,
|
|
|
|
|
+ ToutA = wheel_1_TinR,
|
|
|
|
|
+ FA = air_flow['heatingcoil_1_Fa'],
|
|
|
|
|
+ param = param['heatingcoil_1'],
|
|
|
|
|
+ engine = engine
|
|
|
|
|
+ )
|
|
|
|
|
+ waste = cal_Q_waste(
|
|
|
|
|
+ wheel_1_res = wheel_1_res,
|
|
|
|
|
+ heatingcoil_1_res = heatingcoil_1_res,
|
|
|
|
|
+ wheel_1_TinR = wheel_1_TinR,
|
|
|
|
|
+ fan_2_Hz = fan_2_Hz
|
|
|
|
|
+ )
|
|
|
|
|
+ return {
|
|
|
|
|
+ 'coil_2' : coil_2_res,
|
|
|
|
|
+ 'wheel_1' : wheel_1_res,
|
|
|
|
|
+ 'mixed_1' : mixed_1_res,
|
|
|
|
|
+ 'heatingcoil_1': heatingcoil_1_res,
|
|
|
|
|
+ 'Fa' : air_flow,
|
|
|
|
|
+ 'summary' : {
|
|
|
|
|
+ 'Fs' : heatingcoil_1_res['Fs'],
|
|
|
|
|
+ **waste,
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
class AirFlow_SDHU_A:
|
|
class AirFlow_SDHU_A:
|
|
|
|
|
|
|
@@ -454,6 +531,11 @@ class AirFlow_SDHU_A:
|
|
|
param['HzP_H'] = pm.HalfNormal('F_air_HzP_H',sigma=1,initval=0.5)
|
|
param['HzP_H'] = pm.HalfNormal('F_air_HzP_H',sigma=1,initval=0.5)
|
|
|
return param
|
|
return param
|
|
|
|
|
|
|
|
|
|
+class AirFlow_SDHU_B:
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def model(cls,fan_1_Hz,fan_2_Hz,param):
|
|
|
|
|
+ ...
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|
def cal_Q_waste(
|
|
def cal_Q_waste(
|
|
@@ -469,8 +551,13 @@ def cal_Q_waste(
|
|
|
waste = 0.25 * (1 - np.exp(-0.04 * (TinR - 70)))
|
|
waste = 0.25 * (1 - np.exp(-0.04 * (TinR - 70)))
|
|
|
return np.where(waste>0,waste,0)
|
|
return np.where(waste>0,waste,0)
|
|
|
|
|
|
|
|
|
|
+ if isinstance(wheel_1_res['Qsen'],np.ndarray):
|
|
|
|
|
+ WHERE = np.where
|
|
|
|
|
+ else:
|
|
|
|
|
+ WHERE = pm.math.switch
|
|
|
|
|
+
|
|
|
heatingcoil_1_Q = heatingcoil_1_res['Q']
|
|
heatingcoil_1_Q = heatingcoil_1_res['Q']
|
|
|
- heatingcoil_1_Q = np.where(heatingcoil_1_Q>0,heatingcoil_1_Q,0)
|
|
|
|
|
|
|
+ heatingcoil_1_Q = WHERE(heatingcoil_1_Q>0,heatingcoil_1_Q,0)
|
|
|
|
|
|
|
|
waste_Qsen1 = wheel_1_res['Qsen']
|
|
waste_Qsen1 = wheel_1_res['Qsen']
|
|
|
waste_cond1 = heatingcoil_1_Q * waste_cond_func1(wheel_1_TinR)
|
|
waste_cond1 = heatingcoil_1_Q * waste_cond_func1(wheel_1_TinR)
|
|
@@ -481,7 +568,7 @@ def cal_Q_waste(
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
waste_out = heatingcoil_1_Q - wheel_1_res['Qsen'] - wheel_1_res['Qlat']
|
|
waste_out = heatingcoil_1_Q - wheel_1_res['Qsen'] - wheel_1_res['Qlat']
|
|
|
- waste_out = np.where(waste_out>0,waste_out,0)
|
|
|
|
|
|
|
+ waste_out = WHERE(waste_out>0,waste_out,0)
|
|
|
waste = waste_Qsen1 + waste_cond1 + waste_out + fan_2_Hz/100
|
|
waste = waste_Qsen1 + waste_cond1 + waste_out + fan_2_Hz/100
|
|
|
res['waste_out'] = waste_out
|
|
res['waste_out'] = waste_out
|
|
|
res['waste'] = waste
|
|
res['waste'] = waste
|