Ejemplo n.º 1
0
def example_unterlagen_test(curr_doc: CurrentDoc):
    q = Symbol('q')
    l = Symbol('l')
    m = Symbol('M')
    start_knot = Knot.Knot(0, 0.5, 2, ElSupEnum.SUPPORT_ROLLER_END.value, [0, 0, 0], [0, 0, 0], 0)
    middle_knot1 = Knot.Knot(1, 2.5, 2, ElSupEnum.JOINT.value, [0, 0, 0], [0, 0, 0], 0)
    middle_knot2 = Knot.Knot(2, 2.5, 1, ElSupEnum.THROUGH_ELEMENT.value, [0, 0, 0], [0, 0, - 2 * m], 0)
    end_knot = Knot.Knot(3, 4.5, 1, ElSupEnum.SUPPORT_CLAMPED.value)
    lineload = [0, q]
    temp_prop = TempProps.TempProps(0, 0, 0)
    knot_list = []
    elementlist = []
    ele = ElementCalculation(0, start_knot, middle_knot1, 2 * l, lineload, temp_prop, Symbol('EI'), float('inf'), Symbol('h'))
    elementlist.append(ele)
    knot_list.append([start_knot, middle_knot1])
    ele = ElementCalculation(1, middle_knot1, middle_knot2, l, [0, 0], temp_prop, float('inf'), float('inf'), Symbol('h'))
    elementlist.append(ele)
    knot_list.append([middle_knot1, middle_knot2])
    ele = ElementCalculation(2, middle_knot2, end_knot, 2 * l, [0, 0], temp_prop, Symbol('EI'), float('inf'), Symbol('h'))
    elementlist.append(ele)
    knot_list.append([middle_knot2, end_knot])
    start_knot.add_coupled_el(0)
    middle_knot1.add_coupled_el([0, 1])
    middle_knot2.add_coupled_el([1, 2])
    end_knot.add_coupled_el(2)
    functions, x, l_list = CalculationElement(elementlist)
    testbox.print_graphs(functions, x, l_list, knot_list)
    testbox.vis_structure_from_input(knot_list, elementlist)
Ejemplo n.º 2
0
def example_ss13(curr_doc: CurrentDoc):
    q = Symbol('p')
    l = Symbol('l')
    start_knot = Knot.Knot(0, 0, 0, ElSupEnum.SUPPORT_TRANSVERSE_FORCE.value, [0, 0, 0], [0, 2 * q * l, (-1) * 2 * q * l**2], 0)
    middle_knot1 = Knot.Knot(1, 1, 0, ElSupEnum.JOINT.value)
    middle_knot2 = Knot.Knot(2, 1.5, 0, ElSupEnum.SUPPORT_ROLLER_CONTINUOUS.value, [0, 0, 0], [0, 0, q * l**2], 0)
    end_knot = Knot.Knot(3, 2.5, 0, ElSupEnum.SUPPORT_ROLLER_END.value)
    lineload = [0, q]
    temp_prop = TempProps.TempProps(0, 0, 0)
    knot_list = []
    elementlist = []
    ele = ElementCalculation(0, start_knot, middle_knot1, l, [0, 0], temp_prop, Symbol('EI'), float('inf'), Symbol('h'))
    elementlist.append(ele)
    knot_list.append([start_knot, middle_knot1])
    ele = ElementCalculation(1, middle_knot1, middle_knot2, 0.5 * l, [0, 0], temp_prop, float('inf'), float('inf'), Symbol('h'))
    elementlist.append(ele)
    knot_list.append([middle_knot1, middle_knot2])
    ele = ElementCalculation(2, middle_knot2, end_knot, l, lineload, temp_prop, Symbol('EI'), float('inf'), Symbol('h'))
    elementlist.append(ele)
    start_knot.add_coupled_el(0)
    middle_knot1.add_coupled_el([0, 1])
    middle_knot2.add_coupled_el([1, 2])
    end_knot.add_coupled_el(2)
    knot_list.append([middle_knot2, end_knot])
    functions, x, l_list = CalculationElement(elementlist)
    testbox.print_graphs(functions, x, l_list, knot_list)
Ejemplo n.º 3
0
def example_2_3_neu(curr_doc: CurrentDoc):
    l = Symbol('l')
    start_knot = Knot.Knot(0, 0, 0, ElSupEnum.SUPPORT_FIXED_END.value, [0, 0, 0], [0, 0, 0], 0)
    middle_knot1 = Knot.Knot(1, 1, 0, ElSupEnum.SUPPORT_ROLLER_JOINT.value, [0, 0, 0], [0, 0, 0])
    middle_knot2 = Knot.Knot(2, 2, 0, ElSupEnum.SUPPORT_ROLLER_JOINT.value, [0, 0, 0], [Symbol('F'), 0, 0])
    end_knot = Knot.Knot(3, 3, 0, ElSupEnum.SUPPORT_FIXED_END.value, [0, 0, 0], [0, 0, 0], 0)
    knot_list = []
    elementlist = []
    lineload = [- Symbol('p'), 0]
    temp_prop = TempProps.TempProps(0, 0, 0)
    knot_list.append([start_knot, middle_knot1])
    ele1 = ElementCalculation(0, start_knot, middle_knot1, l, lineload, temp_prop, float('inf'), Symbol('EA'), Symbol('h'))
    elementlist.append(ele1)
    knot_list.append([middle_knot1, middle_knot2])
    ele2 = ElementCalculation(1, middle_knot1, middle_knot2, l, [0, 0], temp_prop, 0, 0, Symbol('h'),2 * Symbol('EA')/l)
    elementlist.append(ele2)
    knot_list.append([middle_knot2, end_knot])
    ele3 = ElementCalculation(2, middle_knot2, end_knot, l, [0, 0], temp_prop, float('inf'), Symbol('EA'), Symbol('h'))
    elementlist.append(ele3)
    start_knot.add_coupled_el(0)
    middle_knot1.add_coupled_el([0, 1])
    middle_knot2.add_coupled_el([1, 2])
    end_knot.add_coupled_el(2)
    functions, x, l_list = CalculationElement(elementlist)
    testbox.print_graphs(functions, x, l_list, knot_list)
    testbox.vis_structure_from_input(knot_list, elementlist)
Ejemplo n.º 4
0
def multiple_elements(curr_doc: CurrentDoc):
    l = Symbol('l')
    start_knot = Knot.Knot(0, 0, 0, ElSupEnum.SUPPORT_FIXED_END.value, [0, 0, 0], [0, 0, 0], 0)
    middle_knot = Knot.Knot(1, 1, 0, ElSupEnum.THROUGH_ELEMENT.value)
    end_knot1 = Knot.Knot(2, 2, 0, ElSupEnum.FREE_END.value, [0, 0, 0], [0, Symbol('F'), 0], 0)
    end_knot2 = Knot.Knot(2, 1, 2, ElSupEnum.SUPPORT_ROLLER_END.value, [0, 0, 0], [0, 0, 0], 180)
    knot_list = []
    elementlist = []
    temp_prop = TempProps.TempProps(0, 0, 0)
    lineload = [0, 0]
    knot_list.append([start_knot, middle_knot])
    ele0 = ElementCalculation(0, start_knot, middle_knot, l, lineload, temp_prop, Symbol('EI'), float('inf'), Symbol('h'))
    elementlist.append(ele0)
    ele1 = ElementCalculation(1, middle_knot, end_knot1, l, lineload, temp_prop, Symbol('EI'), float('inf'), Symbol('h'))
    elementlist.append(ele1)
    knot_list.append([middle_knot, end_knot1])
    ele2 = ElementCalculation(2, middle_knot, end_knot2, l, lineload, temp_prop, Symbol('EI'), float('inf'), Symbol('h'))
    elementlist.append(ele2)
    knot_list.append([middle_knot, end_knot2])
    start_knot.add_coupled_el(0)
    middle_knot.add_coupled_el([0, 1, 2])
    end_knot1.add_coupled_el(1)
    end_knot2.add_coupled_el(2)
    functions, x, l_list = CalculationElement(elementlist)
    testbox.print_graphs(functions, x, l_list, knot_list)
    testbox.vis_structure_from_input(knot_list, elementlist)
Ejemplo n.º 5
0
def example_ss15(curr_doc: CurrentDoc):
    q = Symbol('p')
    l = Symbol('l')
    x = Symbol('x')
    start_knot = Knot.Knot(0, 0, 0, ElSupEnum.SUPPORT_FIXED_END.value)
    middle_knot1 = Knot.Knot(1, 2, 0, ElSupEnum.JOINT.value, [0, 0, 3 * Symbol('EI')/l], [0, - 8 * q * l, 0])
    middle_knot2 = Knot.Knot(2, 4, 0, ElSupEnum.SUPPORT_ROLLER_CONTINUOUS.value, [0, 0, 0], [0, 0, 6 * q * l**2], 0)
    end_knot = Knot.Knot(3, 5, 0, ElSupEnum.FREE_END.value, [0, Symbol('EI')/(l**3), 0])
    lineload = [0, 7.5 * q * x]
    temp_prop = TempProps.TempProps(0, 0, 0)
    knot_list = []
    elementlist = []
    ele = ElementCalculation(0, start_knot, middle_knot1, 2 * l, lineload, temp_prop, 2 * Symbol('EI'), float('inf'), Symbol('h'))
    elementlist.append(ele)
    knot_list.append([start_knot, middle_knot1])
    ele = ElementCalculation(1, middle_knot1, middle_knot2, 2 * l, [0, 0], temp_prop, Symbol('EI'), float('inf'), Symbol('h'))
    elementlist.append(ele)
    knot_list.append([middle_knot1, middle_knot2])
    ele = ElementCalculation(2, middle_knot2, end_knot, l, [0, 0], temp_prop, Symbol('EI'), float('inf'), Symbol('h'))
    elementlist.append(ele)
    start_knot.add_coupled_el(0)
    middle_knot1.add_coupled_el([0, 1])
    middle_knot2.add_coupled_el([1, 2])
    end_knot.add_coupled_el(2)
    knot_list.append([middle_knot2, end_knot])
    functions, x, l_list = CalculationElement(elementlist)
    testbox.print_graphs(functions, x, l_list, knot_list)
    testbox.vis_structure_from_input(knot_list, elementlist)
Ejemplo n.º 6
0
def example_ss14(curr_doc: CurrentDoc):
    q = Symbol('p')
    l = Symbol('l')
    k = Symbol('k')
    h = Symbol('h')
    at = Symbol('at')
    ei = Symbol('EI')
    start_knot = Knot.Knot(0, 0, 0, ElSupEnum.FREE_END.value, [0, k, 0], [0, 0, 0], 0)
    middle_knot1 = Knot.Knot(1, 2, 0, ElSupEnum.SUPPORT_ROLLER_CONTINUOUS.value, [0, 0, 0], [0, 0, - 2 * q * l**2], 0)
    middle_knot2 = Knot.Knot(2, 3, 0, ElSupEnum.JOINT.value)
    end_knot = Knot.Knot(3, 4, 0, ElSupEnum.SUPPORT_CLAMPED.value)
    lineload = [0, 2 * q]
    temp_prop = TempProps.TempProps(0, at, (2 * h * q * l**2)/(ei * at))
    temp_prop1 = TempProps.TempProps(0, 0, 0)
    knot_list = []
    elementlist = []
    ele = ElementCalculation(0, start_knot, middle_knot1, 2 * l, lineload, temp_prop1, Symbol('EI'), float('inf'), Symbol('h'))
    elementlist.append(ele)
    knot_list.append([start_knot, middle_knot1])
    ele = ElementCalculation(1, middle_knot1, middle_knot2, l, [0, 0], temp_prop, Symbol('EI'), float('inf'), Symbol('h'))
    elementlist.append(ele)
    knot_list.append([middle_knot1, middle_knot2])
    ele = ElementCalculation(2, middle_knot2, end_knot, l, [0, 0], temp_prop1, Symbol('EI'), float('inf'), Symbol('h'))
    elementlist.append(ele)
    knot_list.append([middle_knot2, end_knot])
    start_knot.add_coupled_el(0)
    middle_knot1.add_coupled_el([0, 1])
    middle_knot2.add_coupled_el([1, 2])
    end_knot.add_coupled_el(2)
    functions, x, l_list = CalculationElement(elementlist)
    testbox.print_graphs(functions, x, l_list, knot_list)
Ejemplo n.º 7
0
def single_clamping_left_side_single_load(curr_doc: CurrentDoc):
    start_knot = Knot.Knot(0, 0, 0, ElSupEnum.SUPPORT_CLAMPED.value)
    end_knot = Knot.Knot(1, 1, 0, ElSupEnum.FREE_END.value, [0, 0, 0], [0, Symbol('F'), 0])
    q = Symbol('p')
    l = Symbol('l')
    lineload = [0, 0]
    temp_prop = TempProps.TempProps(0, 0, 0)
    knot_list = [[start_knot, end_knot]]
    elementlist = []
    ele = ElementCalculation(0, start_knot, end_knot, l, lineload, temp_prop)
    start_knot.add_coupled_el(0)
    end_knot.add_coupled_el(0)
    elementlist.append(ele)
    functions, x, l_list = CalculationElement(elementlist)
    testbox.print_graphs(functions, x, l_list, knot_list)
Ejemplo n.º 8
0
def single_clamping_left_side(curr_doc: CurrentDoc):                # TODO:  Aufpassen mit den Richtungen, spinnt, wenn mann die Koordinaten vertauscht
    start_knot = Knot.Knot(0, 0, 0, ElSupEnum.SUPPORT_CLAMPED.value)
    end_knot = Knot.Knot(1, 1, 0, ElSupEnum.FREE_END.value, [0, 0, 0], [0, Symbol('F'), 0])
    q = Symbol('p')
    l = Symbol('l')
    lineload = [0, q]
    temp_prop = TempProps.TempProps(0, 0, 0)
    knot_list = [[start_knot, end_knot]]
    elementlist = []
    ele = ElementCalculation(0, start_knot, end_knot, l, lineload, temp_prop)
    start_knot.add_coupled_el(0)
    end_knot.add_coupled_el(0)
    elementlist.append(ele)
    functions, x, l_list = CalculationElement(elementlist)
    testbox.print_graphs(functions, x, l_list, knot_list)
Ejemplo n.º 9
0
def single_beam_schraeg(curr_doc: CurrentDoc):
    start_knot = Knot.Knot(0, 0, 0, ElSupEnum.SUPPORT_FIXED_END.value, [0, 0, 0], [0, 0, 0], 45)
    end_knot = Knot.Knot(1, math.sqrt(0.5), math.sqrt(0.5), ElSupEnum.SUPPORT_ROLLER_END.value, [0, 0, 0], [0, Symbol('F'), 0], 45)
    q = Symbol('p')
    l = Symbol('l')
    lineload = [0, 0]
    temp_prop = TempProps.TempProps(0, 0, 0)
    knot_list = [[start_knot, end_knot]]
    elementlist = []
    ele = ElementCalculation(0, start_knot, end_knot, l, lineload, temp_prop, Symbol('EI'), Symbol('EA'), Symbol('h'))
    start_knot.add_coupled_el(0)
    end_knot.add_coupled_el(0)
    elementlist.append(ele)
    functions, x, l_list = CalculationElement(elementlist)
    testbox.print_graphs(functions, x, l_list, knot_list)
Ejemplo n.º 10
0
def single_beam_temperature_test(curr_doc: CurrentDoc):
    start_knot = Knot.Knot(0, 0, 0, ElSupEnum.SUPPORT_FIXED_END.value, 0)
    end_knot = Knot.Knot(1, 1, 0, ElSupEnum.SUPPORT_FIXED_END.value, 0)
    q = Symbol('p')
    l = Symbol('l')
    lineload = [0, 0]
    temp_prop = TempProps.TempProps(Symbol('dT'), 0, Symbol('aT'))
    knot_list = [[start_knot, end_knot]]
    elementlist = []
    ele = ElementCalculation(0, start_knot, end_knot, l, lineload, temp_prop)
    start_knot.add_coupled_el(0)
    end_knot.add_coupled_el(0)
    elementlist.append(ele)
    functions, x, l_list = CalculationElement(elementlist)
    testbox.print_graphs(functions, x, l_list, knot_list)
Ejemplo n.º 11
0
def single_beam_single_load_vertical_test(curr_doc: CurrentDoc):
    start_knot = Knot.Knot(0, 0, 0, ElSupEnum.SUPPORT_FIXED_END.value, 90, [0, 0, 0], [0, 0, 0])
    end_knot = Knot.Knot(1, 0, 1, ElSupEnum.SUPPORT_ROLLER_END.value, 90, [0, 0, 0], [0, Symbol('F'), 0])        # in globalen Koordinaten
    q = Symbol('p')
    l = Symbol('l')
    lineload = [0, 0]
    temp_prop = TempProps.TempProps(0, 0, 0)
    knot_list = [[start_knot, end_knot]]
    elementlist = []
    ele = ElementCalculation(0, start_knot, end_knot, l, lineload, temp_prop)
    start_knot.add_coupled_el(0)
    end_knot.add_coupled_el(0)
    elementlist.append(ele)
    functions, x, l_list = CalculationElement(elementlist)
    testbox.print_graphs(functions, x, l_list, knot_list)
Ejemplo n.º 12
0
def single_beam_lineload_test_underdefined(curr_doc: CurrentDoc):
    start_knot = Knot.Knot(0, 0, 0, ElSupEnum.SUPPORT_ROLLER_END.value, 0)
    end_knot = Knot.Knot(1, 1, 0, ElSupEnum.SUPPORT_ROLLER_END.value, 0, [0, 0, 0], [0, 0, 0])
    q = Symbol('p')
    l = Symbol('l')
    lineload = [0, q]
    temp_prop = TempProps.TempProps(0, 0, 0)
    knot_list = [[start_knot, end_knot]]
    elementlist = []
    ele = ElementCalculation(0, start_knot, end_knot, l, lineload, temp_prop)
    start_knot.add_coupled_el(0)
    end_knot.add_coupled_el(0)
    elementlist.append(ele)
    functions, x, l_list = CalculationElement(elementlist)
    testbox.print_graphs(functions, x, l_list, knot_list)
Ejemplo n.º 13
0
def single_beam_cos_test(curr_doc: CurrentDoc):
    start_knot = Knot.Knot(0, 0, 0, ElSupEnum.SUPPORT_ROLLER_END.value)
    end_knot = Knot.Knot(1, 1, 0, ElSupEnum.SUPPORT_FIXED_END.value)
    q = Symbol('p')
    l = Symbol('l')
    x = Symbol('x')
    lineload = [0, q * sin(2 * math.pi * x)]
    temp_prop = TempProps.TempProps(0, 0, 0)
    knot_list = [[start_knot, end_knot]]
    elementlist = []
    ele = ElementCalculation(0, start_knot, end_knot, l, lineload, temp_prop, Symbol('EI'), float('inf'), Symbol('h'))
    elementlist.append(ele)
    start_knot.add_coupled_el(0)
    end_knot.add_coupled_el(0)
    functions, x, l_list = CalculationElement(elementlist)
    testbox.print_graphs(functions, x, l_list, knot_list)
Ejemplo n.º 14
0
def single_beam_normal_lineload_test(curr_doc: CurrentDoc):
    start_knot = Knot.Knot(0, 0, 0, ElSupEnum.SUPPORT_FIXED_END.value, 0, [0, 0, 0], [0, 0, 0])
    end_knot = Knot.Knot(1, 1, 0, ElSupEnum.SUPPORT_ROLLER_END.value, 0, [0, 0, 0], [0, 0, 0])
    q = Symbol('n')
    l = Symbol('l')
    x = Symbol('x')
    lineload = [- q * x, 0]
    temp_prop = TempProps.TempProps(0, 0, 0)
    knot_list = [[start_knot, end_knot]]
    elementlist = []
    ele = ElementCalculation(0, start_knot, end_knot, l, lineload, temp_prop, Symbol('EI'), Symbol('EA'), Symbol('h'))
    start_knot.add_coupled_el(0)
    end_knot.add_coupled_el(0)
    elementlist.append(ele)
    functions, x, l_list = CalculationElement(elementlist)
    testbox.print_graphs(functions, x, l_list, knot_list)
Ejemplo n.º 15
0
def final_structure_software_lab(curr_doc: CurrentDoc):
    f = Symbol('F')
    k = Symbol('k')
    start_knot = Knot.Knot(0, 1, 3, ElSupEnum.SUPPORT_CLAMPED.value)
    middle_knot = Knot.Knot(1, 2, 3, ElSupEnum.JOINT.value, [0, 0, 0], [0, f, 0])
    end_knot = Knot.Knot(2, 3, 2, ElSupEnum.SUPPORT_ROLLER_END.value, [0, 0, k])
    q = Symbol('q')
    l = Symbol('l')
    h = Symbol('h')
    x = Symbol('x')
    at = Symbol('at')
    ei = Symbol('EI')
    line_load_0 = [0, q * x]
    temp_load_0 = TempProps.TempProps(0, 0, 0)
    knot_list = []
    elementlist = []

    # ELEMENT 0
    l0 = gc.knot_dist(start_knot, middle_knot) * l
    print(l0)
    ele0 = ElementCalculation(0, start_knot, middle_knot, l0, line_load_0, temp_load_0, ei=ei, ea=float('inf'), h=h)
    elementlist.append(ele0)
    knot_list.append([start_knot, middle_knot])

    # ELEMENT 1
    line_load_1 = [0, 0]
    temp_load_1 = TempProps.TempProps(0, Symbol('dT'), at)
    l1 = gc.knot_dist(middle_knot, end_knot) * l
    print(l1)
    ele1 = ElementCalculation(1, middle_knot, end_knot, l1, line_load_1, temp_load_1, ei=ei, ea=float('inf'), h=h)
    elementlist.append(ele1)
    knot_list.append([middle_knot, end_knot])

    start_knot.add_coupled_el(0)
    middle_knot.add_coupled_el([0, 1])
    end_knot.add_coupled_el(1)
    functions, x, l_list = CalculationElement(elementlist)
    testbox.print_graphs(functions, x, l_list, knot_list)

    # VIS STRUCTURE
    testbox.vis_structure_from_input(knot_list, elementlist)
Ejemplo n.º 16
0
def two_beam_combined_to_one_single_load_middle(curr_doc: CurrentDoc):
    start_knot = Knot.Knot(0, 0, 0, ElSupEnum.SUPPORT_FIXED_END.value, 0)
    middle_knot = Knot.Knot(1, 0.5, 0, ElSupEnum.THROUGH_ELEMENT.value, 0, [0, 0, 0], [0, Symbol('F'), 0])
    end_knot = Knot.Knot(2, 1, 0, ElSupEnum.SUPPORT_ROLLER_END.value, 0)
    q = Symbol('p')
    l = Symbol('l')
    lineload = [0, 0]
    temp_prop = TempProps.TempProps(0, 0, 0)
    knot_list = []
    elementlist = []
    ele = ElementCalculation(0, start_knot, middle_knot, l, lineload, temp_prop, Symbol('EI'), float('inf'), Symbol('h'))
    elementlist.append(ele)
    knot_list.append([start_knot, middle_knot])
    ele = ElementCalculation(1, middle_knot, end_knot, l, lineload, temp_prop, Symbol('EI'), float('inf'), Symbol('h'))
    knot_list.append([middle_knot, end_knot])
    start_knot.add_coupled_el(0)
    middle_knot.add_coupled_el([0, 1])
    end_knot.add_coupled_el(1)
    elementlist.append(ele)
    functions, x, l_list = CalculationElement(elementlist)
    testbox.print_graphs(functions, x, l_list, knot_list)
Ejemplo n.º 17
0
def example_from_sheet_2_4(curr_doc: CurrentDoc):
    l = Symbol('l')
    start_knot = Knot.Knot(0, 0, 0, ElSupEnum.SUPPORT_FIXED_END.value)
    middle_knot = Knot.Knot(1, 1, 0, ElSupEnum.THROUGH_ELEMENT.value, [2 * Symbol('EA')/l, 0, 0])
    end_knot = Knot.Knot(2, 2, 0, ElSupEnum.SUPPORT_ROLLER_END.value, [0, 0, 0], [Symbol('F'), 0, 0])
    q = Symbol('p')
    lineload = [0, 0]
    temp_prop = TempProps.TempProps(0, 0, 0)
    knot_list = []
    elementlist = []
    ele = ElementCalculation(0, start_knot, middle_knot, l, lineload, temp_prop, Symbol('EI'), Symbol('EA'), Symbol('h'))
    elementlist.append(ele)
    knot_list.append([start_knot, middle_knot])
    ele = ElementCalculation(1, middle_knot, end_knot, l, lineload, temp_prop, Symbol('EI'), Symbol('EA'), Symbol('h'))
    knot_list.append([middle_knot, end_knot])
    start_knot.add_coupled_el(0)
    middle_knot.add_coupled_el([0, 1])
    end_knot.add_coupled_el(1)
    elementlist.append(ele)
    functions, x, l_list = CalculationElement(elementlist)
    testbox.print_graphs(functions, x, l_list, knot_list)
Ejemplo n.º 18
0
def example_unterlagen_test_vereinfacht(curr_doc: CurrentDoc):
    q = Symbol('p')
    l = Symbol('l')
    middle_knot1 = Knot.Knot(1, 2, 1, ElSupEnum.FREE_END.value, [0, 0, 0], [0, q * l, 0], 0)
    middle_knot2 = Knot.Knot(2, 2, 0, ElSupEnum.THROUGH_ELEMENT.value, [0, 0, 0], [0, 0, - 2 * q * l**2], 0)
    end_knot = Knot.Knot(3, 4, 0, ElSupEnum.SUPPORT_CLAMPED.value)
    lineload = [0, q]
    temp_prop = TempProps.TempProps(0, 0, 0)
    knot_list = []
    elementlist = []
    ele = ElementCalculation(0, middle_knot1, middle_knot2, l, [0, 0], temp_prop, float('inf'), float('inf'), Symbol('h'))
    elementlist.append(ele)
    knot_list.append([middle_knot1, middle_knot2])
    ele = ElementCalculation(1, middle_knot2, end_knot, 2 * l, [0, 0], temp_prop, Symbol('EI'), float('inf'), Symbol('h'))
    elementlist.append(ele)
    knot_list.append([middle_knot2, end_knot])
    middle_knot1.add_coupled_el(0)
    middle_knot2.add_coupled_el([0, 1])
    end_knot.add_coupled_el(1)
    functions, x, l_list = CalculationElement(elementlist)
    testbox.print_graphs(functions, x, l_list, knot_list)
Ejemplo n.º 19
0
def two_beam_triangle_load_middle_not_symmetrical(curr_doc: CurrentDoc):
    start_knot = Knot.Knot(0, 0, 0, ElSupEnum.SUPPORT_FIXED_END.value)
    middle_knot = Knot.Knot(1, 2, 1, ElSupEnum.JOINT.value, [0, 0, 0], [0, Symbol('F'), 0], 0)
    end_knot = Knot.Knot(2, 3, 0, ElSupEnum.SUPPORT_FIXED_END.value, [0, 0, 0], [0, 0, 0], 0)
    q = Symbol('p')
    l = Symbol('l')
    lineload = [0, 0]
    temp_prop = TempProps.TempProps(0, 0, 0)
    knot_list = []
    elementlist = []
    ele = ElementCalculation(0, start_knot, middle_knot, math.sqrt(5) * l, lineload, temp_prop, Symbol('EI'), float('inf'), Symbol('h'))
    elementlist.append(ele)
    knot_list.append([start_knot, middle_knot])
    ele = ElementCalculation(1, middle_knot, end_knot, math.sqrt(2) * l, lineload, temp_prop, Symbol('EI'), float('inf'), Symbol('h'))
    knot_list.append([middle_knot, end_knot])
    start_knot.add_coupled_el(0)
    middle_knot.add_coupled_el([0, 1])
    end_knot.add_coupled_el(1)
    elementlist.append(ele)
    functions, x, l_list = CalculationElement(elementlist)
    testbox.print_graphs(functions, x, l_list, knot_list)
Ejemplo n.º 20
0
def example_ss12_vereinfacht(curr_doc: CurrentDoc):
    q = Symbol('p')
    l = Symbol('l')
    start_knot = Knot.Knot(0, 0, 0, ElSupEnum.SUPPORT_CLAMPED.value)
    middle_knot1 = Knot.Knot(1, 1, 0, ElSupEnum.JOINT.value)
    middle_knot2 = Knot.Knot(2, 2, 0, ElSupEnum.SUPPORT_ROLLER_END.value, [0, 0, 0], [0, q * l, (-1) * 2 * q * l**2], 0)
    lineload = [0, q]
    temp_prop = TempProps.TempProps(0, 0, 0)
    knot_list = []
    elementlist = []
    ele = ElementCalculation(0, start_knot, middle_knot1, l, lineload, temp_prop, Symbol('EI'), float('inf'), Symbol('h'))
    elementlist.append(ele)
    knot_list.append([start_knot, middle_knot1])
    ele = ElementCalculation(1, middle_knot1, middle_knot2, l, [0, 0], temp_prop, Symbol('EI'), float('inf'), Symbol('h'))
    elementlist.append(ele)
    knot_list.append([middle_knot1, middle_knot2])
    start_knot.add_coupled_el(0)
    middle_knot1.add_coupled_el([0, 1])
    middle_knot2.add_coupled_el(1)
    functions, x, l_list = CalculationElement(elementlist)
    testbox.print_graphs(functions, x, l_list, knot_list)
Ejemplo n.º 21
0
def two_beam_corner_line_load(curr_doc: CurrentDoc):
    start_knot = Knot.Knot(0, 0, 0, ElSupEnum.SUPPORT_FIXED_END.value)
    middle_knot = Knot.Knot(1, 0, 1, ElSupEnum.JOINT.value, [0, 0, 0], [0, 0, 0])
    end_knot = Knot.Knot(2, 1, 1, ElSupEnum.SUPPORT_FIXED_END.value)
    q = Symbol('p')
    l = Symbol('l')
    lineload = [0, q]
    temp_prop = TempProps.TempProps(0, 0, 0)
    knot_list = []
    elementlist = []
    ele = ElementCalculation(0, start_knot, middle_knot, l, lineload, temp_prop, Symbol('EI'), float('inf'), Symbol('h'))
    elementlist.append(ele)
    knot_list.append([start_knot, middle_knot])
    ele = ElementCalculation(1, middle_knot, end_knot, l, lineload, temp_prop, Symbol('EI'), float('inf'), Symbol('h'))
    knot_list.append([middle_knot, end_knot])
    start_knot.add_coupled_el(0)
    middle_knot.add_coupled_el([0, 1])
    end_knot.add_coupled_el(1)
    elementlist.append(ele)
    functions, x, l_list = CalculationElement(elementlist)
    testbox.print_graphs(functions, x, l_list, knot_list)
    testbox.vis_structure_from_input(knot_list, elementlist)
Ejemplo n.º 22
0
def example_SS_16(curr_doc: CurrentDoc):
    q = Symbol('p')
    x = Symbol('x')
    l = Symbol('l')
    start_knot = Knot.Knot(0, 0, 0, ElSupEnum.SUPPORT_TRANSVERSE_FORCE.value, [0, 0, 0], [0, - 3 * q * l, 0], 0)
    middle_knot = Knot.Knot(1, 1, 0, ElSupEnum.JOINT.value, [0, 3 * Symbol('EI')/l**3, 0])
    end_knot = Knot.Knot(2, 2, 0, ElSupEnum.FREE_END.value, [0, - 6 * Symbol('EI')/l**3, 0], [0, 0, 2 * q * l**2], 0)
    knot_list = []
    elementlist = []
    lineload = [0, 12 * q]
    temp_prop = TempProps.TempProps(0, 0, 0)
    knot_list.append([start_knot, middle_knot])
    ele1 = ElementCalculation(0, start_knot, middle_knot, l, [0, 0], temp_prop, float('inf'), float('inf'),
                              Symbol('h'))
    elementlist.append(ele1)
    ele2 = ElementCalculation(1, middle_knot, end_knot, l, lineload, temp_prop, Symbol('EI'), float('inf'),
                              Symbol('h'))
    elementlist.append(ele2)
    knot_list.append([middle_knot, end_knot])
    start_knot.add_coupled_el(0)
    middle_knot.add_coupled_el([0, 1])
    end_knot.add_coupled_el(1)
    functions, x, l_list = CalculationElement(elementlist)
    testbox.print_graphs(functions, x, l_list, knot_list)
Ejemplo n.º 23
0
def single_beam_lineload_test_seperated_elements(curr_doc: CurrentDoc):
    start_knot = Knot.Knot(0, 0, 0, ElSupEnum.SUPPORT_FIXED_END.value)
    end_knot = Knot.Knot(1, 1, 0, ElSupEnum.SUPPORT_ROLLER_END.value)
    start_knot2 = Knot.Knot(3, 0, 1, ElSupEnum.SUPPORT_FIXED_END.value)
    end_knot2 = Knot.Knot(4, 1, 1, ElSupEnum.SUPPORT_ROLLER_END.value)
    knot_list = []
    knot_list.append([start_knot, end_knot])
    knot_list.append([start_knot2, end_knot2])
    q = Symbol('p')
    l1 = Symbol('l1')
    l2= Symbol('l2')
    lineload = [0, q]
    temp_prop = TempProps.TempProps(0, 0, 0)
    elementlist = []
    ele = ElementCalculation(0, start_knot, end_knot, l1, lineload, temp_prop)
    elementlist.append(ele)
    ele = ElementCalculation(1, start_knot2, end_knot2, l2, lineload, temp_prop)
    start_knot.add_coupled_el(0)
    end_knot.add_coupled_el(0)
    start_knot2.add_coupled_el(1)
    end_knot2.add_coupled_el(1)
    elementlist.append(ele)
    functions, x, l_list = CalculationElement(elementlist)
    testbox.print_graphs(functions, x, l_list, knot_list)
Ejemplo n.º 24
0
def example_2_23(curr_doc: CurrentDoc):
    start_knot = Knot.Knot(0, 0, 0, ElSupEnum.SUPPORT_ROLLER_END.value, [Symbol('k'), 0, 0], [0, 0, 0], 0)
    middle_knot = Knot.Knot(1, 1, 0, ElSupEnum.THROUGH_ELEMENT.value)
    end_knot = Knot.Knot(2, 2, 0, ElSupEnum.SUPPORT_ROLLER_END.value, [2 * Symbol('k'), 0, 0], [0, 0, 0], 0)
    q = Symbol('p')
    x = Symbol('x')
    l = Symbol('l')
    knot_list = []
    elementlist = []
    lineload = [- q * cos(math.pi * x / 2), 0]
    temp_prop = TempProps.TempProps(0, 0, 0)
    knot_list.append([start_knot, middle_knot])
    ele1 = ElementCalculation(0, start_knot, middle_knot, l, [0, 0], temp_prop, Symbol('EI'), float('inf'),
                              Symbol('h'))
    elementlist.append(ele1)
    ele2 = ElementCalculation(1, middle_knot, end_knot, l, lineload, temp_prop, Symbol('EI'), Symbol('EA'),
                              Symbol('h'))
    elementlist.append(ele2)
    knot_list.append([middle_knot, end_knot])
    start_knot.add_coupled_el(0)
    middle_knot.add_coupled_el([0, 1])
    end_knot.add_coupled_el(1)
    functions, x, l_list = CalculationElement(elementlist)
    testbox.print_graphs(functions, x, l_list, knot_list)
Ejemplo n.º 25
0
def interface(curr_doc, ds_indep, ds_nodedep):
    """
    Gets the input from the graph and sorts this input into several list due to the properties
    Calls the ElementCalculation class with the correct input
    Calls the plot functions to visualise the calculated results
    :param ds_indep: all elements which can exist independently in the plot (supports, connectors)
    :param ds_nodedep: all elements, which are related to the independent elements (elements, loads, springs)
    :return:
    """
    print('Start calc interface')
    vis_init.expand_msg2user(curr_doc, "Start data conversion")

    # get all knots
    node_list = get_all_node_from_indep(ds_indep)
    '''
    Noetige Unterscheidungen:
    DONE SUPPORT_FIXED_END vs. SUPPORT_FIXED_JOINT: Kein weiteres Element, len(coupled_el) <= 1
    DONE SUPPORT_ROLLER_END vs. SUPPORT_ROLLER_JOINT: Alle in SUPPORT_ROLLER_JOINT angelegt, dann anpassen
    DONE Node in FREE_END or THROUGH_ELEMENT: Unterscheidung siehe oben
    DONE Rod, vs. Beam: ROD (EA unendlich), BEAM (EI unendlich) (wird ueber Nutzereingabe gelöst)
    DONE Federn muessen in Konstante k eingespeichert werden. Federkonstante muss relativ zum Auflagerwinkel angegeben werden
    DONE Spring anlegen
    '''

    # print("Node list: " + str(node_list))
    element_list = []
    load_line_dict = {}
    load_temp_dict = {}
    beam_id = 0
    beam_dict = dict()
    # print("len Node dependent" + str(len(ds_nodedep.data["type"])))
    for i in range(len(ds_nodedep.data["type"])):
        # print("i: " + str(i))
        el_type = ds_nodedep.data["type"][i]
        # print(ds_nodedep.data["type"][i])
        # get beams and rods
        if ElSupEnum.check_beams_and_rods(el_type):
            ele = extract_beams_and_rods(ds_nodedep, i, node_list, beam_id)
            element_list.append(ele)
            beam_dict.update(
                {prhlp.get_id_from_knots(ele.start_knot, ele.end_knot): ele})
            # print("Beam created: " + str(prhlp.get_id_from_knots(ele.start_knot, ele.end_knot)))
            # print(element_list[-1])
            beam_id += 1

        # get springs in structure
        elif ElSupEnum.check_line_spring(el_type):
            ele = extract_line_spring(ds_nodedep, i, node_list, beam_id)
            element_list.append(ele)
            beam_dict.update(
                {prhlp.get_id_from_knots(ele.start_knot, ele.end_knot): ele})
            # print("Spring created: " + str(prhlp.get_id_from_knots(ele.start_knot, ele.end_knot)))
            # print(element_list[-1])
            beam_id += 1

        # get line loads
        elif ElSupEnum.check_line_load(el_type):
            # print("Line load found")
            load = extract_line_load(ds_nodedep, i, node_list)
            knot_1, knot_2 = get_related_knots_for_elements(
                ds_nodedep, i, node_list)
            load_line_dict.update(
                {prhlp.get_id_from_knots(knot_1, knot_2): load})
            # print("Lineload successfully created: " + str(prhlp.get_id_from_knots(knot_1, knot_2)))

        # get point springs
        elif ElSupEnum.check_point_spring(el_type):
            # print("Point spring found")
            k_x, k_y, k_mom = extract_point_spring(ds_nodedep, i, node_list)
            # print("Point spring successfully added [{}, {}, {}]".format(str(k_x), str(k_y), str(k_mom)))

        # get point loads and add them to element
        elif ElSupEnum.check_point_load(el_type):
            # print("Pointload found")
            f_x, f_y, mom = extract_point_load(ds_nodedep, i, node_list)
            # print("Point load successfully added [{}, {}, {}]".format(str(f_x), str(f_y), str(mom)))

        # get Temperatur loads
        elif ElSupEnum.check_temp_load(el_type):
            load = extract_temp_loads(ds_nodedep, i, node_list)
            knot_1, knot_2 = get_related_knots_for_elements(
                ds_nodedep, i, node_list)
            load_temp_dict.update(
                {prhlp.get_id_from_knots(knot_1, knot_2): load})
            # print("TempLoad successfully created: " + str(prhlp.get_id_from_knots(knot_1, knot_2)))
            # print(load)

        elif ElSupEnum.check_user_defined_load(el_type):
            load = extract_user_defined_load(ds_nodedep, i, node_list)
            knot_1, knot_2 = get_related_knots_for_elements(
                ds_nodedep, i, node_list)
            load_temp_dict.update(
                {prhlp.get_id_from_knots(knot_1, knot_2): load})
            # print("User defined load successfully created: " + str(prhlp.get_id_from_knots(knot_1, knot_2)))
            # print(load)

    # Add loads to the Beams and rods
    add_loads_to_elements(curr_doc,
                          beam_dict,
                          load_line_dict,
                          load_type="lineload")
    add_loads_to_elements(curr_doc,
                          beam_dict,
                          load_temp_dict,
                          load_type="tempload")

    # Refactor knot ids and change supports to calc supports
    adjust_nodes_for_calc(node_list)

    node_list_to_plot = []
    vis_init.expand_msg2user(curr_doc, "Data conversion successful")
    for el in element_list:
        el.start_calculation()
        node_list_to_plot.append([el.start_knot, el.end_knot])
    for el in element_list:
        el.set_start_end_knot_correctly()
        el.start_calculation()
    prhlp.print_knot_and_element_list(
        prhlp.list_with_every_knot_only_once(node_list), element_list)
    func_list, val, l_list = CalculationElement(curr_doc, element_list)
    vis_init.expand_msg2user(curr_doc, "Start visualisation of results")
    outvis.plot_output_functions(curr_doc, func_list, node_list_to_plot, val,
                                 l_list)
    vis_init.expand_msg2user(curr_doc, "Visualisation successful")