2
##design of a column member I scetion only import math import xlrd file_location = "F:\steel_table\steel_table.xlsx" workbook = xlrd.open_workbook(file_location) sheet = workbook.sheet_by_index(0) ###constants to be used in the formulas f = 250 epsilon = 1 K = 1.0 E = 200000.0 gamma = 1.5 L = float(raw_input('Enter the lenght of the coulumn in m: ')) L = L * 1000 P = float(raw_input('Enter the desigh load in KN: ')) ########## def find_buckling_class(h, b, tf): ''' takes the width and thickness of flange and return the class as a string ''' e = 1 aList = ['a','b','c'] if (h/b) > 1.2 : if tf<=40: return 'b' elif tf > 40 and tf <= 100: return 'c' else: return 'd' def get_imperfection_factor(buckling_class): ''' Calculating the imperfection ratio depending upon the buckling class ''' if buckling_class == 'a': return 0.21 elif buckling_class == 'b': return 0.34 elif buckling_class == 'c': return 0.49 else: return 0.76 def eff_slenderness_ratio(f ,K ,L ,r ,E): ''' Calculating the effective slenderness ratio depending upon the values ''' var = (f*((K*L/r)**2))/(math.pi * math.pi * E) return math.sqrt(var) def phi(alpha , lambdda): return 0.5*(1+(alpha*(lambdda-0.2)) + (lambdda**2)) def des_comp_strenght(f, gamma, phi, lambdda): return f/(gamma * (phi + ((phi**2 - lambdda**2)**0.5))) def col_strenght(area, fcd): return area*fcd/(1000) def find_section(P, L): bucking_class =0 alpha=0

CAD Assignment

Embed Size (px)

DESCRIPTION

CAD assignment for Civil2015

Citation preview

##design of a column member I scetion onlyimport mathimport xlrdfile_location = "F:\steel_table\steel_table.xlsx"workbook = xlrd.open_workbook(file_location)sheet = workbook.sheet_by_index(0)###constants to be used in the formulasf = 250epsilon = 1K = 1.0E = 200000.0gamma = 1.5L = float(raw_input('Enter the lenght of the coulumn in m: '))L = L * 1000P = float(raw_input('Enter the desigh load in KN: '))##########def find_buckling_class(h, b, tf): ''' takes the width and thickness of flange and return the class as a string ''' e = 1 aList = ['a','b','c'] if (h/b) > 1.2 : if tf<=40: return 'b' elif tf > 40 and tf <= 100: return 'c' else: return 'd'def get_imperfection_factor(buckling_class): ''' Calculating the imperfection ratio depending upon the buckling class ''' if buckling_class == 'a': return 0.21 elif buckling_class == 'b': return 0.34 elif buckling_class == 'c': return 0.49 else: return 0.76

def eff_slenderness_ratio(f ,K ,L ,r ,E): ''' Calculating the effective slenderness ratio depending upon the values ''' var = (f*((K*L/r)**2))/(math.pi * math.pi * E) return math.sqrt(var)def phi(alpha , lambdda): return 0.5*(1+(alpha*(lambdda-0.2)) + (lambdda**2))def des_comp_strenght(f, gamma, phi, lambdda): return f/(gamma * (phi + ((phi**2 - lambdda**2)**0.5)))def col_strenght(area, fcd): return area*fcd/(1000)def find_section(P, L): bucking_class =0 alpha=0

lambdda=0 phis=0 fcd=0 strenght_of_column=0 for num in range(189,264): row_num = int(num) r =float(sheet.cell_value(row_num , 21)) h = float(sheet.cell_value(row_num , 2)) b = float(sheet.cell_value(row_num, 3)) tf = float(sheet.cell_value(row_num, 4)) area = float(sheet.cell_value(row_num, 8)) buckling_class = find_buckling_class(h, b, tf) alpha = get_imperfection_factor(buckling_class) lambdda = eff_slenderness_ratio(f ,K ,L ,r ,E) phis = phi(alpha , lambdda) fcd = des_comp_strenght(f, gamma, phis, lambdda) strenght_of_column = col_strenght(area, fcd) if P <= strenght_of_column: return 'Required Section is: '+ str(sheet.cell_value(row_num,0)) + ' having strenght: ' +str(round(strenght_of_column,2))+ 'KN' break else: continueans = find_section(P,L)print ans