def test_cs_collector(self): defaults.optimize_for_cost_only = True defaults.optimize_for_spec_ei = False defaults.optimize_for_target_function = False cs1 = crosssection.crosssection(0, 0, 0) cs1.cost = 4 data.cs_collection.append(cs1) cs2 = crosssection.crosssection(0, 0, 0) cs2.cost = 2 data.cs_collection.append(cs2) cs3 = crosssection.crosssection(0, 0, 0) cs3.cost = 2 data.cs_collection.append(cs3) cs4 = crosssection.crosssection(0, 0, 0) cs4.cost = 2 data.cs_collection.append(cs4) best = cs_collector.get_best_cost() self.assertEqual(best[0].cost, 2) self.assertEqual(best[1].cost, 2) self.assertEqual(best[2].cost, 2)
def create_deck_stiffener_local(b_sup, b_inf, h, t, t_deck): assert b_sup >= b_inf, "width out of bound or wrong way around" #assumption: b_sup is equal to distance between stiffeners #create points a = point.point(b_sup,0) b = point.point(-b_sup, 0) c = point.point(0.5*b_sup, 0) d = point.point(-0.5*b_sup, 0) e = point.point(-0.5*b_inf, h) f = point.point(0.5*b_inf, h) #create plates code_1 = plate_code.plate_code(1,0,0,0,0) line_1 = line.line(code_1, a, b, t_deck) code_2 = plate_code.plate_code(2,0,0,0,0) line_2 = line.line(code_2, d, e, t) code_3 = plate_code.plate_code(3,0,0,0,0) line_3 = line.line(code_3, e, f, t) code_4 = plate_code.plate_code(4,0,0,0,0) line_4 = line.line(code_4, f, c, t) deck_stiffener = crosssection.crosssection(b_sup, b_inf, h) #add the lines to itself deck_stiffener.addline(line_1) deck_stiffener.addline(line_2) deck_stiffener.addline(line_3) deck_stiffener.addline(line_4) return deck_stiffener
def create_stiffener_local(b_sup, b_inf, h, t): #assert b_sup >= b_inf, "width out of bound or wrong way around" half_width_diff = b_sup - b_inf length_side = math.sqrt(half_width_diff**2 + h**2) own_angle = math.atan(half_width_diff / h) #create plate 2 a2 = point.point(-b_sup / 2, 0) b2 = point.point(a2.y + math.sin(own_angle) * length_side, math.cos(own_angle) * length_side) code2 = plate_code.plate_code(0, 1, 0, 0, 2) line2 = line.line(code2, a2, b2, t) #create plate 3 a3 = b2 b3 = point.point(a3.y + b_inf, a3.z) code3 = plate_code.plate_code(0, 1, 0, 0, 3) line3 = line.line(code3, a3, b3, t) #create plate 4 a4 = b3 b4 = point.point(b_sup / 2, 0) code4 = plate_code.plate_code(0, 1, 0, 0, 4) line4 = line.line(code4, a4, b4, t) stiffener_local = crosssection.crosssection(b_sup, b_inf, h) #add the lines to itself stiffener_local.addline(line2) stiffener_local.addline(line3) stiffener_local.addline(line4) return stiffener_local
def create_stiffener_global(pl_position, st_number, center_y, center_z, angle, b_sup, b_inf, h, t): y_corr = center_y - math.cos(angle) * b_sup * 0.5 z_corr = center_z - math.sin(angle) * b_sup * 0.5 assert b_sup >= b_inf, "width out of bound or wrong way around" half_width_diff = (b_sup - b_inf) / 2 length_side = math.sqrt(half_width_diff**2 + h**2) if half_width_diff > 0: own_angle = math.atan(h / half_width_diff) else: own_angle = math.pi / 2 #create plate 2 a2 = point.point(y_corr, z_corr) b2 = point.point(y_corr + math.cos(own_angle + angle) * length_side, z_corr + math.sin(own_angle + angle) * length_side) code2 = plate_code.plate_code(pl_position, 1, 0, st_number, 2) line2 = line.line(code2, a2, b2, t) #create plate 3 a3 = point.point(y_corr + math.cos(own_angle + angle) * length_side, z_corr + math.sin(own_angle + angle) * length_side) b3 = point.point(a3.y + math.cos(angle) * b_inf, a3.z + math.sin(angle) * b_inf) code3 = plate_code.plate_code(pl_position, 1, 0, st_number, 3) line3 = line.line(code3, a3, b3, t) #create plate 4 a4 = point.point(a3.y + math.cos(angle) * b_inf, a3.z + math.sin(angle) * b_inf) b4 = point.point(y_corr + math.cos(angle) * b_sup, z_corr + math.sin(angle) * b_sup) code4 = plate_code.plate_code(pl_position, 1, 0, st_number, 4) line4 = line.line(code4, a4, b4, t) stiffener_global = crosssection.crosssection(b_sup, b_inf, h) #add the lines to itself stiffener_global.addline(line2) stiffener_global.addline(line3) stiffener_global.addline(line4) return stiffener_global
def interaction_flange(total_cs, flange_plate, eta_3): string = "\n 7.1 Interaction between shear force, bending moment and axial force" string += "\n Flange -> comment (5)" printing.printing(string) #choose correct shear stresses for calculation if eta_3 <= 0.5: #no interaction needed #what is a resonable return value, -1? utilisation = -1 string = "\n eta_3 <= 0.5; no interaction needed" string += " utilisation: -1" printing.printing(string) else: eta_1_bar = abs( data.input_data.get("M_Ed") / total_cs.get_m_rd_el_eff()) utilisation = eta_1_bar + (1 - m_f_rd / m_pl_rd) * (2 * eta_3 - 1)**2 string = "\n eta_3 > 0.5; interaction needed" string += "\n eta_1_bar: " + str( math.floor(1000 * eta_1_bar) / 1000) string += " utilisation: " + str( math.floor(1000 * utilisation) / 1000) printing.printing(string) #prove shear resistance for each subpanel string = "\n Proofing Resistance to shear for each subpanel" printing.printing(string) for plate in flange_plate.lines: if plate.code.tpl_number != 0: v_ed_panel = stress_cal.get_tau_int_subpanel(total_cs, plate, data.input_data.get("V_Ed"),\ data.input_data.get("T_Ed")) panel_cs = crosssection.crosssection(0, 0, 0) panel_cs.addline(plate) eta_3_panel = resistance_to_shear.resistance_to_shear( panel_cs, v_ed_panel) if eta_3_panel > 1: utilisation = 10 else: assert True, "This is not possible" return utilisation
import sys #just add the directory where the BA folder is on your computer sys.path.append('C:/Users/Nino/Google Drive/Studium/FS 2021/Bachelorarbeit/BA') #imports import matplotlib.pyplot as plt import numpy as np import initial_cs as ics from classes import crosssection as cs from classes import point from classes import line as ln from output import geometry_output as go test_cs = ics.create_initial_cs(1000, 500, 400) stiffener = cs.crosssection() code = (0, 0, 0, 0, 0) a = point.point(100, 0) b = point.point(50, 50) c = point.point(-50, 50) d = point.point(-100, 0) e = point.point(100, 400) f = point.point(50, 350) g = point.point(-50, 350) h = point.point(-100, 400) stiffener.addline(ln.line(code, a, b, 1)) stiffener.addline(ln.line(code, b, c, 1)) stiffener.addline(ln.line(code, c, d, 1))
def global_plate_buckling(total_cs, plate_glob): string = "\n 4.5.2 Plate type behaviour" printing.printing(string) stiffened_plate = copy.deepcopy(plate_glob) #identify the border plates a and b and numbers of end stiffeners plate_a = None plate_b = None min_tpl = -1 max_tpl = -1 max_stn = 0 min_stn = 1000 for plate in stiffened_plate.lines: if plate.code.pl_type == 0: if min_tpl == -1 and max_tpl == -1: min_tpl = plate.code.tpl_number max_tpl = plate.code.tpl_number if plate.code.tpl_number <= min_tpl: plate_a = plate if plate.code.tpl_number >= max_tpl: plate_b = plate else: if plate.code.st_number <= min_stn and plate.code.st_number != 0: min_stn = plate.code.st_number if plate.code.st_number >= max_stn and plate.code.st_number != 0: max_stn = plate.code.st_number assert plate_a != None and plate_b != None, "For-Loop failed." ### Get Stresses ### sigma_a = stress_cal.get_sigma_a_red(total_cs, plate_a, data.input_data.get("M_Ed")) sigma_b = stress_cal.get_sigma_b_red(total_cs, plate_b, data.input_data.get("M_Ed")) if abs(sigma_a) <= 0.1: sigma_a = sigma_a / abs(sigma_a) * 0.1 if abs(sigma_b) <= 0.1: sigma_b = sigma_b / abs(sigma_b) * 0.1 if abs(sigma_a) > 1000: sigma_a = sigma_a / abs(sigma_a) * 1000 if abs(sigma_b) > 1000: sigma_b = sigma_b / abs(sigma_b) * 1000 psi = min(sigma_a, sigma_b) / max(sigma_a, sigma_b) if sigma_a <= 0 and sigma_b <= 0: rho_glob = 1 sigma_cr_p = 10**10 ### Get Plate Geometry ### else: h = 0 for plate in stiffened_plate.lines: if plate.code.pl_type == 0: h += plate.get_length_tot() t = plate_a.t b = data.input_data.get("a") #find borders of compression zone comp = None if sigma_a > 0 and sigma_b > 0: comp = (0, h) elif sigma_a > 0 and sigma_b <= 0: h_red = h * sigma_a / (sigma_a - sigma_b) comp = (0, h_red) elif sigma_b > 0 and sigma_a <= 0: h_red = h * -sigma_a / (sigma_b - sigma_a) comp = (h_red, h) else: assert True, "This should never happen!" #coordinate transformation (a+b)/2 is the new origin and baseplate is horizontal #set new origin move_z = 0.5 * (plate_a.a.z + plate_b.b.z) move_y = 0.5 * (plate_a.a.y + plate_b.b.y) for plate in stiffened_plate.lines: plate.a.y -= move_y plate.a.z -= move_z plate.b.y -= move_y plate.b.z -= move_z plate.p1.y -= move_y plate.p1.z -= move_z plate.p2.y -= move_y plate.p2.z -= move_z #find rotation angle if plate_a.a.z == plate_b.b.z: #horizontal plate angle = 0 if plate_a.a.y == plate_b.b.y: #vertical plate angle = math.pi / 2 else: #inclined plate angle = -math.atan( (plate_b.b.z - plate_a.a.z) / (plate_b.b.y - plate_a.a.y)) #perform rotation for plate in stiffened_plate.lines: ay = plate.a.y az = plate.a.z by = plate.b.y bz = plate.b.z p1y = plate.p1.y p1z = plate.p1.z p2y = plate.p2.y p2z = plate.p2.z plate.a.y = math.cos(angle) * ay - math.sin(angle) * az plate.a.z = math.sin(angle) * ay + math.cos(angle) * az plate.b.y = math.cos(angle) * by - math.sin(angle) * bz plate.b.z = math.sin(angle) * by + math.cos(angle) * bz plate.p1.y = math.cos(angle) * p1y - math.sin(angle) * p1z plate.p1.z = math.sin(angle) * p1y + math.cos(angle) * p1z plate.p2.y = math.cos(angle) * p2y - math.sin(angle) * p2z plate.p2.z = math.sin(angle) * p2y + math.cos(angle) * p2z #claculate A of stiffened plate A_tot = h * t #create a list of all stiffeners stiffener_list = [] plate_num_list = [] corresp_tpl = -2 for st_number in range(min_stn, max_stn + 1, 1): stiffener_list.insert(st_number - min_stn, crosssection.crosssection(0, 0, 0)) #find three plates of stiffener for plate in stiffened_plate.lines: if plate.code.st_number == st_number: stiffener_list[st_number - min_stn].addline(plate) #find middle part of the trapezoid if plate.code.tpl_number != 0: corresp_tpl = plate.code.tpl_number plate_num_list.insert(st_number - min_stn, corresp_tpl) else: corresp_tpl = -2 #find adjacent parts of the trapezoid for plate in stiffened_plate.lines: if plate.code.tpl_number == corresp_tpl - 1 or plate.code.tpl_number == corresp_tpl + 1: stiffener_list[st_number - min_stn].addline(plate) ###calculate adimensional parameters for each stiffener### stiffeners_ebp = [] compression_stiffener = False for i in range(len(stiffener_list)): #extract the useful plates stiffener = stiffener_list[i] corresp_tpl = plate_num_list[i] center_plate = None top_plate = None top_plate_tpl = 0 bottom_plate = None for plate in stiffened_plate.lines: if plate.code.tpl_number == corresp_tpl and plate.code.pl_type == 0: center_plate = plate if plate.code.tpl_number == corresp_tpl + 1: bottom_plate = plate bottom_plate_tpl = plate.code.tpl_number elif plate.code.tpl_number == corresp_tpl - 1: top_plate = plate top_plate_tpl = plate.code.tpl_number #find distance to point a delta_z = center_plate.get_center_z_tot() - plate_a.a.z delta_y = center_plate.get_center_y_tot() - plate_a.a.y distance = math.sqrt(delta_z**2 + delta_y**2) #calculate theta b_sup_st = stiffener.get_line(st_pl_position=1).get_length_tot() b_inf_st = stiffener.get_line(st_pl_position=3).get_length_tot() t_st = stiffener.get_line(st_pl_position=3).t diag = stiffener.get_line(st_pl_position=2).get_length_tot() diff = (b_sup_st - b_inf_st) / 2 h_st = math.sqrt(diag**2 - diff**2) A_0 = 0.5 * (b_sup_st + b_inf_st) * h_st integral = b_sup_st / t + (2 * diag + b_inf_st) / t_st J_T = 4 * A_0**2 / integral J_T_ref = 1 / 3 * h * t**3 theta = J_T / J_T_ref #calculate delta unit_vec_to_a = (top_plate.a.y - top_plate.b.y) / top_plate.get_length_tot() unit_vec_to_b = (bottom_plate.b.y - bottom_plate.a.y) / bottom_plate.get_length_tot() #find additional parts of top plate top_original = total_cs.get_line(tpl_number=top_plate_tpl) sigma_a_top = stress_cal.get_sigma_a(total_cs, top_original, data.input_data.get("M_Ed")) sigma_b_top = stress_cal.get_sigma_b(total_cs, top_original, data.input_data.get("M_Ed")) psi_top = min(sigma_a_top, sigma_b_top) / max( sigma_a_top, sigma_b_top) length_top = 0 if sigma_b_top > 0: if sigma_a_top > 0: if sigma_a_top < sigma_b_top: #high stress side length_top = top_plate.get_length_tot() * 2 / (5 - psi_top) else: #low stress side length_top = top_plate.get_length_tot() * ( 3 - psi_top) / (5 - psi_top) else: #point a in tension zone b_comp = top_plate.get_length_tot() / (1 - psi_top) length_top = 0.4 * b_comp else: #tension zone pass #find additional parts of bottom plate bottom_original = total_cs.get_line(tpl_number=bottom_plate_tpl) sigma_a_bottom = stress_cal.get_sigma_a( total_cs, bottom_original, data.input_data.get("M_Ed")) sigma_b_bottom = stress_cal.get_sigma_b( total_cs, bottom_original, data.input_data.get("M_Ed")) psi_bottom = min(sigma_a_bottom, sigma_b_bottom) / max( sigma_a_bottom, sigma_b_bottom) length_bottom = 0 if sigma_a_bottom > 0: if sigma_b_bottom > 0: if sigma_b_bottom < sigma_a_bottom: #high stress side length_bottom = bottom_plate.get_length_tot() * 2 / ( 5 - psi_bottom) else: #low stress side length_bottom = bottom_plate.get_length_tot() * ( 3 - psi_bottom) / (5 - psi_bottom) else: #point a in tension zone b_comp = bottom_plate.get_length_tot() / (1 - psi_bottom) length_bottom = 0.4 * b_comp else: #tension zone pass #add additional parts of plate to stiffener new_top_point = point.point( top_plate.b.y + unit_vec_to_a * length_top, top_plate.b.z) new_top_plate = line.line(top_plate.code, new_top_point, top_plate.b, top_plate.t) new_bottom_point = point.point( bottom_plate.a.y + unit_vec_to_b * length_bottom, bottom_plate.a.z) new_bottom_plate = line.line(bottom_plate.code, bottom_plate.a, new_bottom_point, top_plate.t) stiffener.lines.append(new_top_plate) stiffener.lines.append(new_bottom_plate) delta = stiffener.get_area_tot() / A_tot #calculate gamma length_gamma = defaults.effective_width_parameter * center_plate.t if length_gamma > 0.5 * center_plate.get_length_tot(): new_top_plate.a = point.point( new_top_plate.b.y + unit_vec_to_a * length_gamma, new_top_plate.b.z) new_bottom_plate.b = point.point( new_bottom_plate.a.y + unit_vec_to_b * length_gamma, new_bottom_plate.a.z) else: stiffener.lines.remove(center_plate) new_top_plate.a = point.point( new_top_plate.b.y + unit_vec_to_a * length_gamma, new_top_plate.b.z) new_top_plate.b = point.point( new_top_plate.b.y + unit_vec_to_b * length_gamma, new_top_plate.b.z) new_bottom_plate.b = point.point( new_bottom_plate.a.y + unit_vec_to_b * length_gamma, new_bottom_plate.a.z) new_bottom_plate.a = point.point( new_bottom_plate.a.y + unit_vec_to_a * length_gamma, new_bottom_plate.a.z) gamma = stiffener.get_i_y_tot() * 12 * (1 - 0.3**2) / (h * t**3) ### USE EBPlate ### #assure that there is at least on stiffener in compression zone if distance > comp[0] and distance < comp[1]: compression_stiffener = True if gamma > 1000: gamma = 1000 if theta > 1000: theta = 1000 if delta > 1000: delta = 1000 assert gamma <= 1000 and gamma >= 0, "gamma too high or low" assert theta <= 1000 and theta >= 0, "theta too high or low" assert delta <= 1000 and delta >= 0, "theta too high or low" stiffeners_ebp.insert(i, (distance, gamma, theta, delta)) assert t >= 3, "\nError: Plate too thin." if 100 > b: b = 100 if 100 > h: h = 100 #finding critical buckling load phi_cr_p = 0 if compression_stiffener == True and abs(sigma_a) >= 0.1 and abs( sigma_a) <= 1000 and abs(sigma_b) >= 0.1 and abs( sigma_b) <= 1000 and 3 <= t and 100 <= b and 100 <= h: phi_cr_p = ebplate.ebplate(b, h, t, sigma_a, sigma_b, stiffeners_ebp) elif compression_stiffener == False: string = "\nno compression stiffener" printing.printing(string) return 1, 0 else: assert True, "Error: Calculation of phi_cr_p not possible." sigma_max = max(sigma_a, sigma_b) sigma_cr_p = sigma_max * phi_cr_p string = "\n sigma_cr_plate = " + str( math.floor(1000 * sigma_cr_p) / 1000) printing.printing(string) ### Calculation according to EC3, 1-5, 4.5.2 ### #calculating plate slenderness beta_a_c = get_beta_ac(plate_glob) lambda_p_glob_bar = math.sqrt(beta_a_c * data.constants.get("f_y") / sigma_cr_p) string = "\n Lambda: " + str( math.floor(1000 * lambda_p_glob_bar) / 1000) printing.printing(string) #calculate rho_glob for plate buckling #assumption: cross section parts always supported on both sides rho_glob = 0 #held on both sides if lambda_p_glob_bar <= 0.673: rho_glob = 1.0 elif lambda_p_glob_bar > 0.673 and (3 + psi) >= 0: rho_glob = (lambda_p_glob_bar - 0.055 * (3 + psi)) / lambda_p_glob_bar**2 if rho_glob > 1.0: rho_glob = 1.0 else: string = "\n plate slenderness or stress ratio out of range" printing.printing(string) pass string = " Rho_Global: " + str(math.floor(1000 * rho_glob) / 1000) printing.printing(string) return rho_glob, sigma_cr_p
from proofs import resistance_to_shear as rts from classes import crosssection as cs from classes import stiffener as st from classes import merge import deck import data import initial_cs as ics data.input_data.update({"b_inf": 3000}) data.input_data.update({"b_sup": 4000}) data.input_data.update({"h": 1500}) data.input_data.update({"M_Ed": 50*10**9}) data.input_data.update({"Q_Ed": 100*10**3}) data.input_data.update({"T_Ed": 3*10**9}) data.input_data.update({"a": 1000}) data.input_data.update({"L_e": 1000}) data.input_data.update({"bending type": 1000}) data.input_data.update({"cs position": 1000}) initial_cs = ics.create_initial_cs(4000, 3000, 1500, 4, 4, 4) deck_stiffeners = deck.deck(4000) stiffened_cs = merge.merge(initial_cs, deck_stiffeners) plate_glob = cs.crosssection(0,0,0) for line in stiffened_cs.lines: if line.code.pl_position == 1: plate_glob.addline(line) eta_3 = rts.resistance_to_shear(stiffened_cs, plate_glob) print("eta3 = " + str(eta_3))
h = 1500 M_Ed = -100000000 data.input_data["M_Ed"] = M_Ed data.input_data["h"] = h data.input_data["b_inf"] = b_inf data.input_data["b_sup"] = b_sup print(data.input_data) print(data.constants) cs = initial_cs.create_initial_cs(b_sup, b_inf, h, 20, 20, 20) geometry_output.print_cs_red(cs) #deck_stiffeners = deck.deck(b_sup) #cs = merge.merge(cs, deck_stiffeners) #prop_list = stiffeners_proposition.stiffeners_proposition() # #prop_1 = proposed_stiffener.proposed_stiffener(2, 1, 0.5, 10**7) #prop_list.add(prop_1) #prop_3 = proposed_stiffener.proposed_stiffener(3, 2, -0.7, 10**7) #prop_list.add(prop_3) #prop_4 = proposed_stiffener.proposed_stiffener(3, 3, 0.7, 10**7) #prop_list.add(prop_4) #prop_5 = proposed_stiffener.proposed_stiffener(4, 4, 0.5, 10**7) #prop_list.add(prop_5) line = cs.get_line(pl_position=1) new_cs = crosssection.crosssection(0, 0, 0) geometry_output.print_cs_red(new_cs)
import sys sys.path.append('C:/Users/Vinzenz Müller/Dropbox/ETH/6. Semester/BA') from classes import crosssection import cs_collector cs1 = crosssection.crosssection(0, 0, 0) cs1.cost = 4 cs_collector.into_collector(cs1) cs2 = crosssection.crosssection(0, 0, 0) cs2.cost = 2 cs_collector.into_collector(cs2) cs3 = crosssection.crosssection(0, 0, 0) cs3.cost = 2 cs_collector.into_collector(cs3) cs4 = crosssection.crosssection(0, 0, 0) cs4.cost = 2 cs_collector.into_collector(cs4) best = cs_collector.get_best() for i in best: print(i.cost)
def get_m_rd_pl_eff(total_cs): #remove side stiffeners cs = crosssection.crosssection(total_cs.b_sup, total_cs.b_inf, total_cs.h) for plate in total_cs.lines: if (plate.code.pl_position == 2 or plate.code.pl_position == 4) and plate.code.pl_type == 1: pass else: cs.addline(plate) total_area = cs.get_area_red(stress=True) convergence = defaults.convergence_limit_m_rd_pl_eff * total_area continue_iteration = True area_top = 10**12 area_btm = 0 start = True z_min = 0 z = cs.h / 2 z_max = cs.h code = plate_code.plate_code(-1, -1, -1, -1, -1) counter = 0 #interation loop to find position of plastic zero line while abs(area_top - area_btm) > convergence and continue_iteration == True: counter += 1 start = False top_part = crosssection.crosssection(0, 0, 0) bottom_part = crosssection.crosssection(0, 0, 0) for plate in cs.lines: #plate is entirely below assumed plastic zero line if plate.a.z >= z and plate.b.z >= z: bottom_part.addline(plate) #plate is entirely above plastic zero line elif plate.a.z <= z and plate.b.z <= z: top_part.addline(plate) #plate crosses plastic zero line, a on top elif plate.a.z <= z and plate.b.z >= z: #case 1: pzl crosses a-p1 if plate.a.z < z and plate.p1.z > z: share = (z - plate.a.z) / (plate.p1.z - plate.a.z) y = plate.a.y + share * (plate.p1.y - plate.a.y) point_middle = point.point(y, z) line_a = line.line(code, plate.a, point_middle, plate.t) top_part.addline(line_a) line_b1 = line.line(code, point_middle, plate.p1, plate.t) bottom_part.addline(line_b1) line_b2 = line.line(code, plate.p2, plate.b, plate.t) bottom_part.addline(line_b2) #case 2: pzl crosses p2-b elif plate.p2.z < z and plate.b.z > z: share = (z - plate.p2.z) / (plate.b.z - plate.p2.z) y = plate.p2.y + share * (plate.b.y - plate.p2.y) point_middle = point.point(y, z) line_a1 = line.line(code, plate.a, plate.p1, plate.t) top_part.addline(line_a1) line_a2 = line.line(code, plate.p2, point_middle, plate.t) top_part.addline(line_a2) line_b = line.line(code, point_middle, plate.b, plate.t) bottom_part.addline(line_b) #case 3 pzl crosses p1-p2 else: line_a = line.line(code, plate.a, plate.p1, plate.t) top_part.addline(line_a) line_b = line.line(code, plate.p1, plate.b, plate.t) bottom_part.addline(line_b) elif plate.a.z >= z and plate.b.z <= z: #case 1: pzl crosses b-p2 if plate.b.z < z and plate.p2.z > z: share = (z - plate.b.z) / (plate.p2.z - plate.b.z) y = plate.b.y + share * (plate.p2.y - plate.b.y) point_middle = point.point(y, z) line_b = line.line(code, plate.b, point_middle, plate.t) top_part.addline(line_b) line_a1 = line.line(code, point_middle, plate.p2, plate.t) bottom_part.addline(line_a1) line_a2 = line.line(code, plate.p1, plate.a, plate.t) bottom_part.addline(line_a2) #case 2: pzl crosses p1-a elif plate.p1.z < z and plate.a.z > z: share = (z - plate.p1.z) / (plate.a.z - plate.p1.z) y = plate.p1.y + share * (plate.a.y - plate.p1.y) point_middle = point.point(y, z) line_b1 = line.line(code, plate.b, plate.p2, plate.t) top_part.addline(line_b1) line_b2 = line.line(code, plate.p1, point_middle, plate.t) top_part.addline(line_b2) line_a = line.line(code, point_middle, plate.a, plate.t) bottom_part.addline(line_a) #case 3 pzl crosses p1-p2 else: line_b = line.line(code, plate.b, plate.p2, plate.t) top_part.addline(line_b) line_a = line.line(code, plate.p2, plate.a, plate.t) bottom_part.addline(line_a) area_top = top_part.get_area_red(stress=True) area_btm = bottom_part.get_area_red(stress=True) if area_top > area_btm: z_max = z z = 0.5 * (z + z_min) else: z_min = z z = 0.5 * (z + z_max) counter += 1 if counter > 10: continue_iteration = False z_s_top = abs(z - top_part.get_center_z_red(stress=True)) z_s_btm = abs(z - bottom_part.get_center_z_red(stress=True)) m_pl_rd_eff = (z_s_top * area_top + z_s_btm * area_btm) * data.constants.get( "f_y") / data.constants.get("gamma_M1") return m_pl_rd_eff
def column_buckling(plate_glob, side, height_zero_pressure, height_max_pressure): string = "\n 4.5.3 Column type buckling behaviour" printing.printing(string) #add the lines to the right list stiffener_lines = [] tpl_lines_list = [] stiffeners_list = [] #points of max pressure and zero pressure; needed for extrapolation point_max = None sigma_max = 0 for plate in plate_glob.lines: if plate.code.tpl_number == 0: stiffener_lines.append(plate) elif plate.code.pl_type == 0: tpl_lines_list.append(plate) #for extrapolation b_c and the positions will be required if plate.sigma_a_red >= sigma_max: point_max = copy.deepcopy(plate.a) sigma_max = plate.sigma_a_red elif plate.sigma_b_red >= sigma_max: point_max = copy.deepcopy(plate.b) sigma_max = plate.sigma_b_red #case 1: stiffened plate if stiffener_lines != []: st_number_min = stiffener_lines[0].code.st_number st_number_max = stiffener_lines[0].code.st_number for plate in stiffener_lines: if plate.code.st_number < st_number_min: st_number_min = plate.code.st_number elif plate.code.st_number > st_number_max: st_number_max = plate.code.st_number number_of_stiffeners = int(len(stiffener_lines) / 3) for i in range(number_of_stiffeners): stiffeners_list.append(crosssection.crosssection(0, 0, 0)) for plate in stiffener_lines: if plate.code.st_number == i + st_number_min: stiffeners_list[i].lines.append(plate) #sort the lists tpl_lines_list = sorted(tpl_lines_list, key=lambda plate: plate.code.tpl_number) stiffeners_list = sorted( stiffeners_list, key=lambda stiffener: stiffener.lines[0].code.st_number) #create sets tpl_st_lines_set = {} tpl_betw_lines_set = {} j = 1 for plate in tpl_lines_list: #is the tpl_number even, (or odd, see correction) #meaning included in a stiffener if j % 2 == 0: st_number = st_number_min + int(j / 2) - 1 tpl_st_lines_set.update({st_number: plate}) else: st_number_before = st_number_min + int(j / 2) - 1 tpl_betw_lines_set.update({st_number_before: plate}) j += 1 stiffeners_set = {} stiffeners_set_length = 0 for stiffener in stiffeners_list: st_number = stiffener.lines[0].code.st_number stiffeners_set.update({st_number: stiffener}) stiffeners_set_length += 1 columns = {} i = st_number_min #a set of all columns (stiffener + carrying widths) is created -> see column_class #they carry the number of the stiffener and they have the stiffener number as a key while i < st_number_max + 1: stiffener_i = copy.deepcopy(stiffeners_set.get(i)) plate_before = copy.deepcopy(tpl_betw_lines_set.get(i - 1)) plate_between = copy.deepcopy(tpl_st_lines_set.get(i)) plate_after = copy.deepcopy(tpl_betw_lines_set.get(i)) code_before = plate_before.code code_between = plate_between.code code_after = plate_after.code plate_between_A_tot = plate_between.get_area_tot() plate_between_A_red = plate_between.get_area_red() plate_between_I_tot = plate_between.get_i_along_tot() #plate_before plate_before_gross_len = figure_Aone(plate_before, False, True) factor = plate_before_gross_len / plate_before.get_length_tot() point_a_y = plate_before.b.y + factor * (plate_before.a.y - plate_before.b.y) point_a_z = plate_before.b.z + factor * (plate_before.a.z - plate_before.b.z) border_before_gross = point.point(point_a_y, point_a_z) plate_before_gross = line.line(code_before, border_before_gross, plate_before.b, plate_before.t) plate_before_gross_I = plate_before_gross.get_i_along_tot() plate_before_gross_A = plate_before_gross.get_area_tot() sigma_border_before_gross = plate_before.sigma_b_red + factor * ( plate_before.sigma_a_red - plate_before.sigma_b_red) plate_before_gross.sigma_a_red = sigma_border_before_gross plate_before_gross.sigma_b_red = plate_before.sigma_b_red plate_before_eff_len = figure_Aone(plate_before, False, False) factor = plate_before_eff_len / plate_before.get_length_tot() point_a_y = plate_before.b.y + factor * (plate_before.a.y - plate_before.b.y) point_a_z = plate_before.b.z + factor * (plate_before.a.z - plate_before.b.z) border_before_eff = point.point(point_a_y, point_a_z) plate_before_eff = line.line(code_before, border_before_eff, plate_before.b, plate_before.t) plate_before_eff_I = plate_before_eff.get_i_along_tot() plate_before_eff_A = plate_before_eff.get_area_tot() sigma_border_before_eff = plate_before.sigma_b_red + factor * ( plate_before.sigma_a_red - plate_before.sigma_b_red) plate_before_eff.sigma_a_red = sigma_border_before_eff plate_before_eff.sigma_b_red = plate_before.sigma_b_red #plate_after plate_after_gross_len = figure_Aone(plate_after, True, True) factor = plate_after_gross_len / plate_after.get_length_tot() point_b_y = plate_after.a.y + factor * (plate_after.b.y - plate_after.a.y) point_b_z = plate_after.a.z + factor * (plate_after.b.z - plate_after.a.z) border_after_gross = point.point(point_b_y, point_b_z) plate_after_gross = line.line(code_after, plate_after.a, border_after_gross, plate_after.t) plate_after_gross_I = plate_after_gross.get_i_along_tot() plate_after_gross_A = plate_after_gross.get_area_tot() sigma_border_after_gross = plate_after.sigma_b_red + factor * ( plate_after.sigma_a_red - plate_after.sigma_b_red) plate_after_gross.sigma_a_red = plate_after.sigma_a_red plate_after_gross.sigma_b_red = sigma_border_after_gross plate_after_eff_len = figure_Aone(plate_after, True, False) factor = plate_after_eff_len / plate_after.get_length_tot() point_b_y = plate_after.a.y + factor * (plate_after.b.y - plate_after.a.y) point_b_z = plate_after.a.z + factor * (plate_after.b.z - plate_after.a.z) border_after_eff = point.point(point_b_y, point_b_z) plate_after_eff = line.line(code_after, plate_after.a, border_after_eff, plate_after.t) plate_after_eff_I = plate_after_eff.get_i_along_tot() plate_after_eff_A = plate_after_eff.get_area_tot() sigma_border_after_eff = plate_after.sigma_b_red + factor * ( plate_after.sigma_a_red - plate_after.sigma_b_red) plate_after_eff.sigma_a_red = plate_after.sigma_a_red plate_after_eff.sigma_b_red = sigma_border_after_eff #EC 1993 1-5 4.5.3 (3) A_sl = stiffener_i.get_area_tot( ) + plate_before_gross_A + plate_after_gross_A + plate_between_A_tot A_sl_eff = stiffener_i.get_area_red( ) + plate_before_eff_A + plate_after_eff_A + plate_between_A_red I_sl = stiffener_i.get_i_along_tot( plate_between ) + plate_before_gross_I + plate_after_gross_I + plate_between_I_tot sigma_cr_sl = (math.pi**2 * data.constants.get("E") * I_sl) / (A_sl * data.input_data.get("a")**2) ######calculation of sigma_cr_c################ #span of column b = dis_points(border_before_gross, border_after_gross) #stress ratio across the whole cross-section of the column stress_ratio = min( sigma_border_before_gross, sigma_border_after_gross) / max( sigma_border_before_gross, sigma_border_after_gross) column_as_cs = copy.deepcopy(stiffener_i) column_as_cs.addline(plate_before_gross) column_as_cs.addline(plate_after_gross) column_as_cs.addline(plate_between) #calculating stiffener center tpl_st_center = point.point( tpl_st_lines_set.get(i).get_center_y_tot(), tpl_st_lines_set.get(i).get_center_z_tot()) height_stiffener_center = tpl_st_center.z #calculating b_c and sigma_cr_c all_tension = False if sigma_border_before_gross < 0 and sigma_border_after_gross < 0: #all tension b_c = 0 sigma_cr_c = 10**8 all_tension = True elif abs(sigma_border_before_gross - sigma_border_after_gross) < 0.5: #same pressure; bottom stiffener; no extrapolation required b_c = b sigma_cr_c = sigma_cr_sl all_tension = False #different pressure; side stiffener; extrapolation required else: b_sl_1 = height_stiffener_center - height_zero_pressure b_c = height_max_pressure - height_zero_pressure if b_sl_1 == 0: sigma_cr_c = 10**8 all_tension = True factor = b_c / b_sl_1 if factor > 0: #stiffener in compression zone --> extrapolation sigma_cr_c = sigma_cr_sl * factor else: #stiffener in tension zone --> no proof required b_c = 0 sigma_cr_c = 10**8 all_tension = True #excentricities st_center = point.point(stiffener_i.get_center_y_tot(), stiffener_i.get_center_z_tot()) sl_cs = crosssection.crosssection(0, 0, 0) for plate in stiffener_i.lines: sl_cs.addline(plate) sl_cs.addline(plate_before_gross) sl_cs.addline(plate_after_gross) sl_cs.addline(plate_between) #center of the whole column sl_center = point.point(sl_cs.get_center_y_tot(), sl_cs.get_center_z_tot()) e2 = dis_plate_point(tpl_st_lines_set.get(i), sl_center) e1 = dis_plate_point(tpl_st_lines_set.get(i), st_center) - e2 column = column_class(i, A_sl, A_sl_eff, I_sl, sigma_cr_c, e1, e2, all_tension, column_as_cs) columns.update({i: column}) printing.printing(str(column)) i += 1 #all columns created Chi_c = 10**8 sigma_cr_c = 1 #searches for the single column buckling mechanism with the smallest Chi_c #this one will be the defining column mechanism #as not all our stiffeners will be the same, we can not conclude that it is one at a border (highest pressure) for key in columns: Chi_c_column = column_buckling_Chi_c(columns.get(key)) if Chi_c_column < Chi_c: Chi_c = Chi_c_column sigma_cr_c = columns.get(key).sigma_cr_c #case 2: unstiffened plate else: t_plate = tpl_lines_list[0].t sigma_cr_c = math.pi**2 * data.constants.get("E") * t_plate**2 / \ (12 * (1-data.constants.get("nu")**2)*data.input_data.get("a")**2) lambda_c_bar = math.sqrt(data.constants.get("f_y") / sigma_cr_c) alpha = 0.21 Phi_c = 0.5 * (1 + alpha * (lambda_c_bar - 0.2) + lambda_c_bar**2) Chi_c = 1 / (Phi_c + math.sqrt(Phi_c**2 - lambda_c_bar**2)) if Chi_c > 1: Chi_c = 1 string = "\n Unstiffened Plate" string += "\n sigma_cr_c: " + str( math.floor(1000 * sigma_cr_c) / 1000) #string += "\n lambda_c_bar ="+str(lambda_c_bar) #string += "\n Phi_c: "+str(Phi_c) string += "\n Chi_c: " + str( math.floor(1000 * Chi_c) / 1000) printing.printing(string) string = "\n Critical buckling values" string += " sigma_cr_c: " + str(math.floor(1000 * sigma_cr_c) / 1000) string += " Chi_c: " + str(math.floor(1000 * Chi_c) / 1000) printing.printing(string) return Chi_c, sigma_cr_c
def resistance_to_shear(plate_glob, V_Ed_plate): string = "\n 5. Resistance to shear" printing.printing(string) #get values of constants f_y = data.constants.get("f_y") gamma_M1 = data.constants.get("gamma_M1") eta = defaults.eta side = plate_glob.lines[0].code.pl_position a = data.input_data.get("a") #import important geometry parameters #calculate lambda_w_bar for subpanels h_w = 0 lambda_w_bar_3 = 0 for plate in plate_glob.lines: if plate.code.pl_type == 0: k_tau_loc = 0 h_w_i = plate.get_length_tot() if a / h_w_i >= 1: k_tau_loc = 5.34 + 4*(h_w_i/a)**2 else: k_tau_loc = 4.0 + 5.34 * (h_w_i/a)**2 lambda_w_bar_loc = h_w_i / (37.4*plate.t*math.sqrt(235/f_y)*math.sqrt(k_tau_loc)) #if plate.code.pl_type == 0: # string = "\n lambda_w_bar_loc of the trapezoid line nr. "+str(plate.code.tpl_number)+": "+str(math.floor(lambda_w_bar_loc*1000)/1000) #else: # string = "\n lambda_w_bar_loc of the stiffener line nr. "+str(plate.code.st_number)+": "+str(math.floor(lambda_w_bar_loc*1000)/1000) #printing.printing(string) if lambda_w_bar_loc > lambda_w_bar_3: lambda_w_bar_3 = lambda_w_bar_loc h_w += plate.get_length_tot() t = plate_glob.get_line(pl_type = 0).t stiffened = True if len(plate_glob.lines) == 1: stiffened = False #calculate k_tau k_tau = 0 if stiffened == False: string = "\n unstiffened plate; (A.5)" if a / h_w >= 1: k_tau = 5.34 + 4*(h_w/a)**2 string += " k_tau: "+str(math.floor(1000*k_tau)/1000) else: k_tau = 4.0 + 5.34 * (h_w/a)**2 string += " k_tau: "+str(math.floor(1000*k_tau)/1000) printing.printing(string) else: string = "\n stiffened plate; EBPlate" plate_a = None plate_b = None min_tpl = -1 max_tpl = -1 max_stn = 0 min_stn = 1000 stiffened_plate = copy.deepcopy(plate_glob) for plate in stiffened_plate.lines: if plate.code.pl_type == 0: if min_tpl == -1 and max_tpl == -1: min_tpl = plate.code.tpl_number max_tpl = plate.code.tpl_number if plate.code.tpl_number <= min_tpl: plate_a = plate if plate.code.tpl_number >= max_tpl: plate_b = plate else: if plate.code.st_number <= min_stn and plate.code.st_number != 0: min_stn = plate.code.st_number if plate.code.st_number >= max_stn and plate.code.st_number != 0: max_stn = plate.code.st_number assert plate_a != None and plate_b != None, "For-Loop failed." move_z = 0.5*(plate_a.a.z + plate_b.b.z) move_y = 0.5*(plate_a.a.y + plate_b.b.y) for plate in stiffened_plate.lines: plate.a.y -= move_y plate.a.z -= move_z plate.b.y -= move_y plate.b.z -= move_z #find rotation angle if plate_a.a.z == plate_b.b.z: #horizontal plate angle = 0 if plate_a.a.y == plate_b.b.y: #vertical plate angle = math.pi/2 else: #inclined plate angle = - math.atan((plate_b.b.z-plate_a.a.z)/(plate_b.b.y-plate_a.a.y)) #perform rotation for plate in stiffened_plate.lines: ay = plate.a.y az = plate.a.z by = plate.b.y bz = plate.b.z plate.a.y = math.cos(angle)*ay - math.sin(angle)*az plate.a.z = math.sin(angle)*ay + math.cos(angle)*az plate.b.y = math.cos(angle)*by - math.sin(angle)*bz plate.b.z = math.sin(angle)*by + math.cos(angle)*bz stiffener_list = [] stiffeners_ebp = [] for st_number in range(min_stn, max_stn+1, 1): i = st_number - min_stn stiffener_list.insert(i, crosssection.crosssection(0,0,0)) #find three plates of stiffener for plate in stiffened_plate.lines: if plate.code.st_number == st_number: stiffener_list[st_number - min_stn].addline(plate) b_inf = stiffener_list[i].get_line(st_pl_position = 3).get_length_tot() b_sup = stiffener_list[i].get_line(st_pl_position = 1).get_length_tot() diff = (0.5*(b_sup - b_inf)) diag = stiffener_list[i].get_line(st_pl_position = 2).get_length_tot() h = math.sqrt(diag**2-diff**2) t_stiff = stiffener_list[i].get_line(st_pl_position = 3).t center_y = stiffener_list[i].get_center_y_tot() distance = abs(center_y-plate_a.a.y) stiffeners_ebp.insert(i, (distance, h, b_sup, b_inf, t_stiff)) tau = V_Ed_plate / (t*h_w) sigma_E = 190000*(t/h_w)**2 if abs(tau) > 0.1 and 3 <= t: k_tau = ebplate.ebplate_shear(a, h_w, t, tau, stiffeners_ebp) * tau / sigma_E string += "\n k_tau: "+str(math.floor(1000*k_tau)/1000) elif t<3: eta_3 = 10**2 string += "\n plate too thin; eta_3: "+ str(math.floor(1000*eta_3)/1000) return eta_3 else: eta_3 = 0 string += "\n tau too small; eta_3: "+ str(0) return eta_3 printing.printing(string) #pre_evaluation proof_required = True if stiffened == False: eval = 72 / eta * math.sqrt(235/f_y) if h_w/t < eval: proof_required = False else: eval = 31 / eta * math.sqrt(235 *k_tau/f_y) if h_w/t < eval: proof_required = False V_Rd = f_y*h_w*t/(math.sqrt(3)*gamma_M1) #calculate reduction factor chi_w if required if proof_required == True: #calculate tau_cr sigma_E = 190000*(t/h_w)**2 tau_cr = k_tau * sigma_E lambda_w_bar_1 = 0.76 * math.sqrt(f_y / tau_cr) # formula 5.3 lambda_w_bar_2 = h_w /(37.4*t*math.sqrt(235/f_y)*math.sqrt(k_tau)) #formula 5.6 lambda_w_bar = min(lambda_w_bar_1, lambda_w_bar_2) lambda_w_bar = max(lambda_w_bar, lambda_w_bar_3) #string = "\n (5.3) lambda_w_bar_1= "+str(math.floor(lambda_w_bar_1*1000)/1000) #string += "\n (5.6) lambda_w_bar_2= "+str(math.floor(lambda_w_bar_2*1000)/1000) #string += "\n (5.7) lambda_w_bar_3= "+str(math.floor(lambda_w_bar_3*1000)/1000)+" max single plate slenderness" #string = " lambda_w_bar= "+str(math.floor(lambda_w_bar*1000)/1000) #printing.printing(string) assert lambda_w_bar > 0, "Strange value for lambda_w_bar" #assume a deformable support stiffener #no resistance due to plastic hinges in flanges chi_w = 0 if lambda_w_bar < 0.83/eta: chi_w = eta else: chi_w = 0.83/lambda_w_bar assert chi_w <= eta, "value for chi_w too high" #calculate resistance V_Rd = chi_w*f_y*h_w*t/(math.sqrt(3)*gamma_M1) eta_3 = V_Ed_plate / V_Rd #string = "\n V_Ed_plate: "+str(math.floor(V_Ed_plate*1000)/1000) #string += "\n V_Rd: "+str(math.floor(V_Rd*1000)/1000) string = " eta_3: "+str(math.floor(1000*eta_3)/1000) printing.printing(string) return eta_3
def reduction_global_buckling(cs, side): string = "\n Side " + str(side) printing.printing(string) #extract the respective plate plate_glob = crosssection.crosssection(0, 0, 0) line_min = cs.get_line(pl_position=side, pl_type=0) line_max = line_min for plate in cs.lines: if plate.code.pl_position == side: plate_glob.addline(plate) if plate.code.tpl_number != 0 and plate.code.tpl_number < line_min.code.tpl_number: line_min = plate if plate.code.tpl_number != 0 and plate.code.tpl_number > line_max.code.tpl_number: line_max = plate #initialize buckling factors chi_c = 1 rho_p = 1 sigma_cr_c = 1 sigma_cr_p = 1 all_tension = False plate_stiffened = True #case 1: the whole plate is under tension if line_min.sigma_a_red < 0 and line_max.sigma_b_red < 0: rho_c = 1 all_tension = True #case 2: unstiffened plate elif len(plate_glob.lines) == 1: rho_c = 1 plate_stiffened = False #case 3: stiffened plate partly compressed else: #perform global buckling proof, EC3 1-5, 4.5.2 if defaults.do_global_plate_buckling == True: rho_p, sigma_cr_p = global_plate_buckling.global_plate_buckling( cs, plate_glob) else: rho_p = 1 sigma_cr_p = 0 #perform column buckling proof, EC3 1-5, 4.5.3 if defaults.do_column_plate_buckling == True: height_zero_pressure = cs.get_center_z_red(stress=True) if data.input_data.get("M_Ed") < 0: height_max_pressure = data.input_data.get("h") else: height_max_pressure = 0 chi_c, sigma_cr_c = column_buckling.column_buckling( plate_glob, side, height_zero_pressure, height_max_pressure) else: chi_c = 1 sigma_cr_c = 1 #interaction according to EC3, 1-5, 4.5.4 if defaults.do_column_plate_buckling == True and defaults.do_column_plate_buckling == True: eta = sigma_cr_p / sigma_cr_c - 1 if eta > 1: eta = 1 elif eta < 0: eta = 0 elif defaults.do_column_plate_buckling == True and defaults.do_column_plate_buckling == False: eta = 0 elif defaults.do_column_plate_buckling == False and defaults.do_column_plate_buckling == True: eta = 1 else: eta = 1 rho_c = (rho_p - chi_c) * eta * (2 - eta) + chi_c string = "\n 4.5.4 Interaction between plate and column buckling" string += "\n all_tension: " + str(all_tension) string += " rho_c = " + str(math.floor(1000 * rho_c) / 1000) printing.printing(string) #EC 1-5 (4.5) edge plates not reduced by rho_c plate_a = cs.get_plate_a(side) plate_b = cs.get_plate_b(side) #set values to the cross section for plate in cs.lines: if plate.code.pl_position == side: plate.chi_c = chi_c plate.sigma_cr_c = sigma_cr_c plate.rho_p = rho_p plate.sigma_cr_p = sigma_cr_p plate.rho_c_a = rho_c plate.rho_c_b = rho_c if plate == plate_a: plate.rho_c_a = 1 if plate == plate_b: plate.rho_c_b = 1 return cs