def test_stiffeners_everywhere(self): initial_cs = create_initial_cs(4000, 4000, 2000, 20, 20, 20) stiffener_1 = st.create_stiffener_global(1, 1, 1000, 0, 0, 300, 200, 200, 15) stiffener_2 = st.create_stiffener_global(1, 2, -1000, 0, 0, 300, 200, 200, 15) stiffener_3 = st.create_stiffener_global(2, 3, -2000, 1000, 3 * math.pi / 2, 200, 100, 100, 10) stiffener_4 = st.create_stiffener_global(3, 4, -1000, 2000, math.pi, 300, 200, 200, 15) stiffener_5 = st.create_stiffener_global(3, 5, 1000, 2000, math.pi, 300, 200, 200, 15) stiffener_6 = st.create_stiffener_global(4, 6, 2000, 1000, math.pi / 2, 200, 100, 100, 10) stiffeners = [ stiffener_1, stiffener_2, stiffener_3, stiffener_4, stiffener_5, stiffener_6 ] final_cs = merge.merge(initial_cs, stiffeners) length = len(final_cs.lines) self.assertEqual(length, 34) last_line = final_cs.get_line(tpl_number=16) code_16 = plcd.plate_code(4, 0, 16, 0, 0) self.assertEqual(last_line.code, code_16)
def test_empty(self): initial_cs = create_initial_cs(4000, 3000, 2000, 20, 20, 20) stiffeners = [] final_cs = merge.merge(initial_cs, stiffeners) length = len(final_cs.lines) line_4 = final_cs.get_line(pl_type=0, pl_position=4, tpl_number=4) code_4 = plcd.plate_code(4, 0, 4, 0, 0) self.assertEqual(length, 4) self.assertEqual(line_4.code, code_4)
def test_stiffeners_top(self): initial_cs = create_initial_cs(4000, 3000, 2000, 20, 20, 20) stiffener_1 = st.create_stiffener_global(1, 1, 1000, 0, 0, 300, 200, 200, 15) stiffener_2 = st.create_stiffener_global(1, 2, -1000, 0, 0, 300, 200, 200, 15) stiffeners = [stiffener_1, stiffener_2] final_cs = merge.merge(initial_cs, stiffeners) length = len(final_cs.lines) self.assertEqual(length, 14) stiffener_1_line_3 = final_cs.get_line(st_number=1, st_pl_position=3) st_1_3_length = stiffener_1_line_3.get_length_tot() self.assertEqual(st_1_3_length, 200) line_top_right = final_cs.get_line(tpl_number=5) code_5 = plcd.plate_code(1, 0, 5, 0, 0) self.assertEqual(line_top_right.code, code_5) self.assertEqual(line_top_right.a.y, -1150)
import initial_cs as ics from classes import stiffener as st from output import geometry_output as go from classes import point as pt from classes import line as ln from classes import plate_code as plcd from classes import merge from classes import crosssection as cs from proofs import global_plate_buckling as glb import data import math data.input_data.update({"M_Ed": -45000 * 10**6}) initial_cs = ics.create_initial_cs(4000, 3000, 2000, 10, 10, 5) stiffener_1 = st.create_stiffener_global(3, 1, -1000, 2000, math.pi, 200, 150, 100, 5) stiffener_2 = st.create_stiffener_global(3, 2, 1000, 2000, math.pi, 200, 150, 100, 5) stiffener_list = [stiffener_1, stiffener_2] final_cs = merge.merge(initial_cs, stiffener_list) final_cs = initial_cs point_a = pt.point(-1500, 2000) point_b = pt.point(1500, 2000) code = plcd.plate_code(3, 0, 3, 0, 0) plate = ln.line(code, point_a, point_b, 5) x_sec = ics.create_initial_cs(4000, 3000, 2000, 10, 10, 5) stiffened_plate = merge.merge(x_sec, stiffener_list)
def test_top_left(self): cs = create_initial_cs(4000, 3000, 2000, 10, 10, 10) y_top_left = cs.lines[0].a.y z_top_left = cs.lines[0].a.z self.assertEqual(y_top_left, 2000) self.assertEqual(z_top_left, 0)
def test_top_right(self): cs = create_initial_cs(4000, 3000, 2000, 10, 10, 10) y_top_right = cs.lines[0].b.y z_top_right = cs.lines[0].b.z self.assertEqual(y_top_right, -2000) self.assertEqual(z_top_right, 0)
#first version of geometry output using matplotlib 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))
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') sys.path.append('C:/Users/Nino/Google Drive/Studium/FS 2021/Bachelorarbeit/BA/ebplate') import initial_cs as ics from proofs import global_buckling as globb from proofs import local_buckling as locb from output import geometry_output as go import data import deck from classes import merge from classes import stiffener as st from proofs import buckling_proof 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": 1000}) data.input_data.update({"T_Ed": 1000}) data.input_data.update({"a": 1000}) data.input_data.update({"L_e": 1000}) data.input_data.update({"bending type": "sagging bending"}) 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) buckling_proof.buckling_proof(stiffened_cs)
#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') #sys.path.append('C:/Users/Vinzenz Müller/Dropbox/ETH/6. Semester/BA') import initial_cs as ics import math from classes import stiffener as st from output import geometry_output as go from classes import point as pt from classes import line as ln from classes import plate_code as plcd from classes import crosssection as cs from classes import merge import deck initial_cs = ics.create_initial_cs(4000, 4000, 2000, 20, 20, 20) st_list_deck = deck.deck(4000) s = len(st_list_deck) stiffener_1 = st.create_stiffener_global(2, s+1, -2000, 1000, 3*math.pi/2, 200, 100, 100, 10) stiffener_2 = st.create_stiffener_global(3, s+2, -1000, 2000, math.pi, 300, 200, 200, 15) stiffener_3 = st.create_stiffener_global(3, s+3, 1000, 2000, math.pi, 300, 200, 200, 15) stiffener_4 = st.create_stiffener_global(4, s+4, 2000, 1000, math.pi/2, 200, 100, 100, 10) st_list_rest = [stiffener_1, stiffener_2, stiffener_3, stiffener_4] st_list = st_list_deck + st_list_rest
sys.path.append('C:/Users/Nino/Google Drive/Studium/FS 2021/Bachelorarbeit/BA') from classes import substantiate as ss from classes import proposed_stiffener as ps from classes import stiffeners_proposition as st_prop import initial_cs as ics from output import geometry_output as go from classes import stiffener as st #assign input to variables b_sup = 4000 #data.input_data["b_sup"] b_inf = 2000 #data.input_data["b_inf"] h = 1500 #data.input_data["h"] #create initial cross section with t=20mm test_cs = ics.create_initial_cs(b_sup, b_inf, h, 20, 20, 20) for line in test_cs.lines: line.t = 20 #propose stiffeners, mimicking input from optimizer prop_1 = ps.proposed_stiffener(2, 1, 0.7, 10**7) prop_2 = ps.proposed_stiffener(2, 2, 0.15, 10**7) prop_3 = ps.proposed_stiffener(3, 3, -0.6, 10**7) prop_4 = ps.proposed_stiffener(3, 4, -0.3, 10**7) prop_5 = ps.proposed_stiffener(3, 5, 0, 10**7) prop_6 = ps.proposed_stiffener(3, 6, 0.3, 10**7) prop_7 = ps.proposed_stiffener(3, 7, 0.6, 10**7) prop_8 = ps.proposed_stiffener(4, 8, 0.15, 10**7) prop_9 = ps.proposed_stiffener(4, 9, 0.7, 10**7)
sys.path.append('C:/Users/Vinzenz Müller/Dropbox/ETH/6. Semester/BA') #script for analysing an existing crosssection from classes import stiffener from classes import crosssection from input import input_analysis_tool from proofs import buckling_proof import initial_cs import data import deck from output import geometry_output import math from optimizer import opt_eqpressure import defaults defaults.do_deck_as_prop = True #crosssection input and creation (only trapezoid plates) input_analysis_tool.set_cs_geometry() #set forces input_analysis_tool.set_forces() #data.check_input_data_complete() cs = initial_cs.create_initial_cs(data.input_data.get("b_sup"), data.input_data.get("b_inf"), data.input_data.get("h"), data.input_data.get("t_side"), data.input_data.get("t_deck"), data.input_data.get("t_bottom")) #add the deck stiffeners st_prop_deck = deck.deck(data.input_data.get("b_sup")) assert st_prop_deck.stiffeners != [], "st_prop_list is empty" opt_eqpressure.opt_eqpressure(cs, st_prop_deck)
from proofs import global_buckling from output import geometry_output from classes import stiffener from classes import stiffeners_proposition from classes import proposed_stiffener from classes import crosssection from classes import merge import deck import data import defaults defaults.set_cs_defaults() defaults.set_forces_defaults() cs = initial_cs.create_initial_cs(data.input_data.get("b_sup"), data.input_data.get("b_inf"), data.input_data.get("h"), 20, 20, 20) geometry_output.print_cs_red(cs) deck_stiffeners = deck.deck(data.input_data.get("b_sup")) cs = merge.merge(cs, deck_stiffeners) geometry_output.print_cs_red(cs) prop_list = stiffeners_proposition.stiffeners_proposition() #propose stiffeners, mimicking input from optimizer prop_1 = proposed_stiffener.proposed_stiffener(2, 1, 0.5, 10**7) prop_list.add(prop_1) #prop_2 = ps.proposed_stiffener(2, 2, 0.3, 10**7) #prop_list.add(prop_2) prop_3 = proposed_stiffener.proposed_stiffener(3, 2, -0.7, 10**7)
from classes import stiffeners_proposition as st_prop import initial_cs as ics from output import geometry_output as go from classes import stiffener as st import deck #assign input to variables b_sup = 4000 #data.input_data["b_sup"] b_inf = 2000 #data.input_data["b_inf"] h = 1500 #data.input_data["h"] t_side = 10 t_deck = 10 t_bottom = 10 #create initial cross section with t=20mm test_cs = ics.create_initial_cs(b_sup, b_inf, h, t_side, t_deck, t_bottom) for line in test_cs.lines: line.t = 20 deck_stiffeners = deck.deck(b_sup) test_cs = merge.merge(test_cs, deck_stiffeners) prop_list = st_prop.stiffeners_proposition() #propose stiffeners, mimicking input from optimizer prop_1 = ps.proposed_stiffener(2, 1, 0.8, 10**7) prop_list.add(prop_1) #prop_2 = ps.proposed_stiffener(2, 2, 0.3, 10**7) #prop_list.add(prop_2) #prop_3 = ps.proposed_stiffener(3, 3, -0.8, 10**7)