<jupyter_start><jupyter_text>1. Functions that automate the heuristics  Type of Flow<jupyter_code>def type_of_flow(L,D):
    D=D/304.8 
    if 0<L<=50 and 3<D<=20:
        return"reverse Flow"
    if 50.10<L<=500 and 3<D<=20:
        return"cross flow"
    if 500<L<=1000 and 7<D<=20:
        return"cross flow"
    else:
        return"choose  diferent dimensions"
print(type_of_flow(30,12))<jupyter_output>choose  diferent dimensions<jupyter_text>Tower internals type<jupyter_code>def tower_internal_type(L):
    #L is the liquid flow rate in m^3/m^2*h
    if L>0 and L<30:
        return"Choose TRAYS as a type of internals"
    if L>=30 and L<50:
        return"Choose  RANDOM PACKINGS as a type of internals"
    if L>=50:
        return"Choose as STRUCTURED PACKINGS  a type of internals"
print(tower_internal_type(10))<jupyter_output>Choose TRAYS as a type of internals<jupyter_text>Choice of packing size<jupyter_code>def packing_size(D):
    #Note that the ranges of D are in mm, but the results are in mm
    if D<=300:
        return"Choose a packing size less than 25mm"
    if 300<D<900:
        return"Choose a packing size from  25 mm to 38mm"
    if D>900:
        return"Choose a packing size from  50 mm to 75mm"
    
print(packing_size(10))

def conv_str_num(a):
        return (int(a))

print(conv_str_num("23"))<jupyter_output>23<jupyter_text>2. Creating a graphical  user interface(GUI) ,for distillation column internals design<jupyter_code>import tkinter as tk

def conv_str_num(a):
        return (int(a))

class Startpage1(tk.Tk):
    
    def wrapper(self,event):
        self.update_internals(self)
        self.update_packing_size(self)
        self.update_type_of_flow(self)
        
        
        
    def Lista(self):
        print(self.Comp1.get(),self.Comp2.get())
        
    def update_internals(self,event):
        TI = conv_str_num(self.scaleB.get())
        self.T1.delete("0.0", "0.end")
        self.T1.insert("0.0", tower_internal_type(TI))
        
    def update_packing_size(self,event):
        PS = conv_str_num(self.scaleA.get())
        self.T2.delete("0.0", "0.end")
        self.T2.insert("0.0", packing_size(PS))

    def update_type_of_flow(self,event):
        TF1 = conv_str_num(self.scaleB.get())
        TF2 = conv_str_num(self.scaleA.get())
        self.T3.delete("0.0", "0.end")
        self.T3.insert("0.0",type_of_flow(TF1,TF2))

     
        
    
    
    def __init__(self):
        
        
        tk.Tk.__init__(self)
        
        #This is creating a container or window################
        container = tk.Frame(self)
        container.pack(side="top", fill="both", expand=True)
        self.title("Python Graphical user interface(GUI)")
        #######################################################
        
        #This is the top heading######################################
        self.label = tk.Label(container, text = "Supportive environment for distillation column internals design")
        self.label.pack(side='left', fill='both', expand=1)
        ##############################################################
        
        #This is "components" heading###################################
        componentframe = tk.LabelFrame(self, text="Components")
        componentframe.pack(fill="both", expand='yes')
        frame = tk.Frame(componentframe)
        label = tk.Label(frame, text='Component1')
        label.pack(side='left')
        ################################################################
        
        self.column_diameter = tk.IntVar(value=10)
        #this is code for a single slider###############################
        LabelA = tk.Label(self,text="Diameter of Column_mm")
        LabelA.pack(side='left')
        scaleA = self.scaleA = tk.Scale(self, from_=10,to=2000, orient= tk.HORIZONTAL, variable=self.column_diameter,command=self.wrapper)
        scaleA.pack(side='left')
        #LabelA.place(relx=0.4, rely=0, anchor=tk.CENTER)
        ################################################################
        
        self.vapour_flow_rate = tk.IntVar(value=10)
        self.liquid_flow_rate = tk.IntVar(value=10)
        
        self.LabelB = tk.Label(self,text="Liquid Flow Rate")
        self.LabelB.pack(side='left')
        scaleB = self.scaleB = tk.Scale(self, from_=1,to=2000, orient= tk.HORIZONTAL, variable=self.liquid_flow_rate,command=self.wrapper)
        self.scaleB.pack(side='left')
        
        
#   
        LabelC = tk.Label(self,text="Vapour Flow Rate")
        LabelC.pack(side='left')
        self.scaleC = scaleC = tk.Scale(self, from_=1,to=2000, orient= tk.HORIZONTAL, variable=[self.column_diameter,self.liquid_flow_rate],command=self.update_type_of_flow) #command=self.update_internals
        scaleC.pack(side='left')
        
            
        self.width = container.winfo_reqwidth()
        
        
        LabelD = tk.Label(self,text="Tower Internal")
        LabelD.pack() 
        self.T1 = T1 = tk.Text(self,height=1,width=40)
        T1.pack()
        #T1.Entry(self,width=40,textvariable=self.vapour_flow_rate)
        T1.insert('1.0',str(tower_internal_type(scaleA.get())))
#       print(slide_(scaleA.get(),scaleB.get(),scaleC.get()))
        
        LabelE = tk.Label(self,text="Choice of Packing Size")
        LabelE.pack()
        self.T2 = T2 = tk.Text(self,height=1,width=40)
        T2.pack()
        T2.insert('1.0',str(packing_size(scaleC.get())))
        
        LabelF = tk.Label(self,text="Type of Flow")
        LabelF.pack()
        self.T3=T3 = tk.Text(self,height=1,width=40)
        T3.pack()
        T3.insert('1.0',str(type_of_flow(scaleB.get(),scaleA.get())))

app = Startpage1()
app.mainloop()
a = tk.Scale()
int(a.get())<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.18429737710613167, 'fraction_numerical': 0.02831335765155463, 'mean_word_length': 2.9303754266211604, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '586565', 'license': 'MIT', 'n_tokens_mistral': 2042, 'n_tokens_neox': 1928, 'n_words': 342, 'path': 'DISTILLATION COLUMN INTERNALS DESIGN  INTERFACE.ipynb', 'repo_name': 'Chipire2017/CSC411-Project-1', 'size': '5757'}