def calc_Q_TN(): Hrs = tab5_gen_data[1] Q_rob_TN = calc_Q_rob_TN() n_modules = data_service.get_tab5_n_modules() k_zavant = calc_K_zavant() return [ Hrs[i] * Q_rob_TN[i] * n_modules * k_zavant[i] for i in range(len(Hrs)) ]
def calc_common_power_sgt(): P_consumed_TN = calc_P_consumed_TN() n_modules = data_service.get_tab5_n_modules() K_zavant = calc_K_zavant() P_aux_warmer = calc_P_aux_warmer() common_power_sgt = [ P_consumed_TN[i] * n_modules * K_zavant[i] + P_aux_warmer[i] for i in range(len(P_consumed_TN)) ] return common_power_sgt
def calc_P_aux_warmer(): # Qs = tab5_gen_data[3] # Ps = tab5_gen_data[2] Ps = calc_Ps_by_nasos() Qs_rob = calc_Q_rob_TN() n_modules = data_service.get_tab5_n_modules() P_aux_warmer = [(Ps[i] - Qs_rob[i] * n_modules) if (Ps[i] - Qs_rob[i] * n_modules) > 0 else 0 for i in range(len(Ps))] print(P_aux_warmer) return P_aux_warmer
def calc_SOR_syst(): n_modules = data_service.get_tab5_n_modules() Hrs = tab5_gen_data[1] Qs_rob = calc_Q_rob_TN() P_consumed = calc_P_consumed_TN() K_zavant = calc_K_zavant() P_aux = calc_P_aux_warmer() common_power_sgt = calc_common_power_sgt() power_syst_cyrcyl = calc_power_syst_cyrcyl() # sum_1 = sum([(Qs_rob[i] * n_modules * K_zavant[i] + P_aux[i]) * Hrs[i] for i in range(len(Hrs))]) sum_2 = sum([(common_power_sgt[i] + power_syst_cyrcyl) * Hrs[i] for i in range(len(Hrs))]) return float(sum_1 / sum_2)
def calc_SOR_TN(): n_modules = data_service.get_tab5_n_modules() Hrs = tab5_gen_data[1] Qs_rob = calc_Q_rob_TN() P_consumed = calc_P_consumed_TN() K_zavant = calc_K_zavant() # sum_1 = sum([ Qs_rob[i] * n_modules * K_zavant[i] * Hrs[i] for i in range(len(Hrs)) ]) sum_2 = sum([ P_consumed[i] * n_modules * K_zavant[i] * Hrs[i] for i in range(len(Hrs)) ]) return float(sum_1 / sum_2)
def calc_K_zavant(): # Ps = tab5_gen_data[2] Ps = calc_Ps_by_nasos() #teplovtrat Qs_rob = calc_Q_rob_TN() n_modules = data_service.get_tab5_n_modules() P_aux_warmer = calc_P_aux_warmer() K_zavantazhenya = [ float(((Ps[i] - P_aux_warmer[i]) / (float(Qs_rob[i] * float(n_modules))))) # if P_aux_warmer[i] > 0 # else 1 for i in range(len(Ps)) ] # print("K_Z_") # [print("%.30f" % float(((Ps[i] - P_aux_warmer[i]) / (float(Qs_rob[i] * float(n_modules)))))) # if P_aux_warmer[i] > 0 # else 1 # for i in range(len(Ps))] print("KZ", K_zavantazhenya) return K_zavantazhenya
def __init__(self, parent, controller): tk.Frame.__init__(self, parent) button_to_main = tk.Button( self, text="на головну", width=40, command=lambda: data_service.display_graph_and_set_active( controller, router.WelcomePage, "DISABLED")) button_to_main.pack() button_go_back = tk.Button( self, text="назад", width=40, command=lambda: data_service.display_graph_and_set_active( controller, Tab5Page, "DISABLED")) button_go_back.pack() n_modules = tk.StringVar() ent_n_modules = tk.Entry(self, textvariable=n_modules) ent_n_modules.insert(0, data_service.get_tab5_n_modules()) label = tk.Label(self, text=("""\nКількість модулів :"""), font=my_view.CONSOLE_FONT_12) label.configure(background='black', foreground='green') label.pack(pady=3, padx=3) ent_n_modules.pack() n_circ_nasos = tk.StringVar() ent_n_circ_nasos = tk.Entry(self, textvariable=n_circ_nasos) ent_n_circ_nasos.insert(0, data_service.get_tab5_n_circ_nasos()) label = tk.Label(self, text=("""\nКількість циркуляційних насосів :"""), font=my_view.CONSOLE_FONT_12) label.configure(background='black', foreground='green') label.pack(pady=3, padx=3) ent_n_circ_nasos.pack() n_funcoyles = tk.StringVar() ent_n_funcoyles = tk.Entry(self, textvariable=n_funcoyles) ent_n_funcoyles.insert(0, data_service.get_tab5_n_funcoyles()) label = tk.Label(self, text=("""\nКількість фанкойлів :"""), font=my_view.CONSOLE_FONT_12) label.configure(background='black', foreground='green') label.pack(pady=3, padx=3) ent_n_funcoyles.pack() power_circ_nasos = tk.StringVar() ent_power_circ_nasos = tk.Entry(self, textvariable=power_circ_nasos) ent_power_circ_nasos.insert(0, data_service.get_tab5_power_circ_nasos()) label = tk.Label(self, text=("""\nПотужність циркуляційних насосів :"""), font=my_view.CONSOLE_FONT_12) label.configure(background='black', foreground='green') label.pack(pady=3, padx=3) ent_power_circ_nasos.pack() power_funcoyles = tk.StringVar() ent_power_funcoyles = tk.Entry(self, textvariable=power_funcoyles) ent_power_funcoyles.insert(0, data_service.get_tab5_power_funcoyles()) label = tk.Label(self, text=("""\nПотужність фанкойлів:"""), font=my_view.CONSOLE_FONT_12) label.configure(background='black', foreground='green') label.pack(pady=3, padx=3) ent_power_funcoyles.pack() btn1 = tk.Button( self, text="OK", width=10, bg='lightgreen', fg='blue', relief='flat', bd=10, highlightthickness=4, highlightcolor="#37d3ff", highlightbackground="#37d3ff", borderwidth=4, command=lambda: data_service.set_tab5_data(n_modules.get( ), n_circ_nasos.get(), n_funcoyles.get(), power_circ_nasos.get(), power_funcoyles.get())) btn1.pack(padx=5, pady=5) button_to_set_timing = tk.Button( self, text="Обрати тепловий насос", width=50, bg='lightgreen', fg='blue', relief='flat', bd=10, highlightthickness=4, highlightcolor="#37d3ff", highlightbackground="#37d3ff", borderwidth=4, command=lambda: data_service.display_graph_and_set_active( controller, GetTN_Input, "DISABLED")) button_to_set_timing.pack(padx=15, pady=15)
def calc_N_blocks(): return [data_service.get_tab5_n_modules() for t in tab5_gen_data[0]]