Example #1
0
    print('--------------------------', thk)
    # draw_point_graph(g,dirddd,color='b')

    Pc = Profile_Constant(thickness=thk, graph=g, dir=dirddd)

    new_dir = Pc.profile_To_centriod()

    cccc = dict_To_cos(new_dir)
    # cccc = lis
    print('ccccc--->', cccc, '\n\n')

    pp = [-1.0246, -0.45]

    cc = open_profile.Open_Profile(cccc, Pc, thickness=thk, Qx=0, Qy=1)

    A = open_profile.Surround_Area(cc.cos_value, basic_point=[-1, 0])
    xx = open_profile.get_Shear_center_x(cc,
                                         Shear_ST=cc.Shear_ST,
                                         basic_point=pp)
    print('xxxxxx--->\n', xx, xx - pp[0], xx + pp[0])

    cc = open_profile.Open_Profile(cccc, Pc, thickness=thk, Qx=1, Qy=0)
    yy = open_profile.get_Shear_center_y(cc,
                                         Shear_ST=cc.Shear_ST,
                                         basic_point=pp)
    print('yyyyyyy--->\n', yy, yy - pp[1], yy + pp[1])

    # A = open_profile.Surround_Area(cc.cos_value,basic_point = [-1,0])
    # Q0 = open_profile.get_Shear_Qo(cc.Shear_ST,cccc,basic_point =[0,0]) / (2*A)
    # # print('QQQ----[[[-*',Q0)
    # Shear_ST = [x - Q0 for x in cc.Shear_ST]
Example #2
0
def close_Shear_center_y(profile_constant,cos_value = [],Shear_ST=[],thickness = [], \
      basic_point = [0,0]):
    '''
	Attention that if without the Shear flow, the profile's Ixy must equal to ZERO 
	The Shear Flow used here is still the open-profile Shear Flow, NOT closed one.
	'''

    PSy = 0
    Syt = 0
    Dst = 0
    y1 = 0
    y2 = 0
    y3 = 0

    mcos_value = cos_value

    if mcos_value == []:
        mcos_value = profile_constant.cos_value

    if thickness == []:
        if len(mcos_value) == 2:
            thickness = [1]
        else:
            thickness = np.ones(len(mcos_value) - 1)
            thickness = thickness.tolist()

    A = open_profile.Surround_Area(mcos_value, basic_point)

    y_center = 0
    Sy = profile_constant.Sy
    Iy = profile_constant.Iy
    Shear_flow = Shear_ST

    # print(Shear_flow)
    k = profile_toolbox.if_clockwise(mcos_value)

    if k < 0:
        mcos_value.reverse()
        Shear_flow.reverse()
        # print('--yyy------reverse----yyy---in_line-')
        # print(mcos_value,'\n',Shear_flow)

    if k > 0:
        pass

    if Shear_flow:
        for i in range(0, len(Shear_flow)):
            ys = mcos_value[i][1]
            ye = mcos_value[i + 1][1]
            xs = mcos_value[i][0]
            xe = mcos_value[i + 1][0]

            yy = ye - ys
            xx = xe - xs
            length = math.sqrt(yy**2 + xx**2)
            P_distance = dot_distance_line(mcos_value[i], mcos_value[i + 1],
                                           basic_point)

            qpds = Shear_flow[i] * P_distance
            y1 = y1 + syp.integrate(qpds, (s, 0, length))

            qtds = Shear_flow[i] / thickness[i] * 1.0
            y2 = y2 + syp.integrate(qtds, (s, 0, length))

            tt = 1.0 / thickness[i]
            y3 = y3 + syp.integrate(tt, (s, 0, length))

        y_center = 2 * A * y2 / y3 - y1
        return -1 * y_center

    else:
        for i in range(0, len(Sy)):
            ys = cos_value[i][1]
            ye = cos_value[i + 1][1]
            xs = cos_value[i][0]
            xe = cos_value[i + 1][0]

            yy = ye - ys
            xx = xe - xs
            length = math.sqrt(yy**2 + xx**2)

            P_distance = dot_distance_line(cos_value[i], cos_value[i + 1],
                                           basic_point)

            y1 = P_distance * Sy[i]
            PSy = PSy + syp.integrate(y1, (s, 0, length))

            y2 = Sy[i] / thickness[i] * 1.0
            Syt = Syt + syp.integrate(y2, (s, 0, length))

            y3 = 1.0 / thickness[i]
            Dst = Dst + syp.integrate(y3, (s, 0, length))

        y_center = (2 * A * PSy / Dst - PSy) / Iy

        return y_center
Example #3
0
def close_Shear_center_x(profile_constant,cos_value = [],Shear_ST=[],thickness = [], \
      basic_point = [0,0]):
    '''
	Attention that if without the Shear flow, the profile's Ixy must equal to ZERO 
	The Shear Flow used here is still the open-profile Shear Flow, NOT closed one.
	'''

    PSx = 0
    Sxt = 0
    Dst = 0
    x1 = 0
    x2 = 0
    x3 = 0

    mcos_value = cos_value

    if mcos_value == []:
        mcos_value = copy.copy(profile_constant.cos_value)

    if thickness == []:
        if len(mcos_value) == 2:
            thickness = [1]
        else:
            thickness = np.ones(len(mcos_value) - 1)
            thickness = thickness.tolist()

    A = open_profile.Surround_Area(mcos_value, basic_point)

    x_center = 0
    Sx = profile_constant.Sx
    Ix = profile_constant.Ix
    Shear_flow = Shear_ST

    k = profile_toolbox.if_clockwise(mcos_value)

    if k < 0:
        pass
    if k > 0:
        mcos_value.reverse()
        Shear_flow.reverse()
        thickness.reverse()
        # print('---xxx-----reverse---xxx---in line-')

    if Shear_flow:

        for i in range(0, len(Shear_flow)):
            ys = mcos_value[i][1]
            ye = mcos_value[i + 1][1]
            xs = mcos_value[i][0]
            xe = mcos_value[i + 1][0]

            yy = ye - ys
            xx = xe - xs
            length = math.sqrt(yy**2 + xx**2)
            P_distance = dot_distance_line(mcos_value[i], mcos_value[i + 1],
                                           basic_point)

            qpds = Shear_flow[i] * P_distance
            x1 = x1 + syp.integrate(qpds, (s, 0, length))

            qtds = Shear_flow[i] / thickness[i] * 1.0
            x2 = x2 + syp.integrate(qtds, (s, 0, length))

            tt = 1.0 / thickness[i]
            x3 = x3 + syp.integrate(tt, (s, 0, length))

        # print('x1,x2,x3',x1,'   ',x2,'   ',x3)
        x_center = x1 - 2 * A * x2 / x3
        return x_center

    else:
        for i in range(0, len(Sx)):
            ys = cos_value[i][1]
            ye = cos_value[i + 1][1]
            xs = cos_value[i][0]
            xe = cos_value[i + 1][0]

            yy = ye - ys
            xx = xe - xs
            length = math.sqrt(yy**2 + xx**2)

            P_distance = dot_distance_line(cos_value[i], cos_value[i + 1],
                                           basic_point)

            x1 = P_distance * Sx[i]
            PSx = PSx + syp.integrate(x1, (s, 0, length))

            x2 = Sx[i] / thickness[i] * 1.0
            Sxt = Sxt + syp.integrate(x2, (s, 0, length))

            x3 = 1.0 / thickness[i]
            Dst = Dst + syp.integrate(x3, (s, 0, length))

        x_center = (Psx - 2 * A * Sxt / Dst) / Ix
        return x_center
    # draw_point_graph(g,Pc.dir ,color='b')
    cccc = dict_To_cos(Pc.dir)
    # cccc = [new_dir[0],new_dir[1]]

    val = open_profile.Open_Profile(cccc, Pc, thickness=thk, Qx=1, Qy=0)
    # print('__doc__-->',val.__doc__)
    # print('cos_value-->',val.cos_value)
    # print('length-->',val.length)
    # print('Ix-->',val.Ix)
    # print('Iy-->',val.Iy)
    # print('Ixy-->',val.Ixy)
    # print('Sx-->',val.Sx)
    # print('Sy-->-->',val.Sy)
    # print('Shear_ST-->',val.Shear_ST)

    A = open_profile.Surround_Area(val.cos_value, basic_point=[0, 0])

    Sxy = close_profile.close_Shear_center(cccc,
                                           Pc,
                                           thickness=thk,
                                           basic_point=[0.5, 0.5])
    print(Sxy, A)
    # draw_point_graph(g,new_dir,color='b',axis = 'equal',Show_Number = 0,Shear_Center=Sxy)

    Qo = open_profile.get_Shear_Qo(val.Shear_ST, val.cos_value)

    # print(cccc == val.cos_value)
    Shear_ST = [n + Qo / (2 * A) for n in val.Shear_ST]
    lin = line_value_package(range(len(lis)))
    draw_ShearFlow3D(g,new_dir,Shear_ST,lin,Shear_Center=Sxy,axis = 1,gif = 0\
      ,pbaspect = [1,10,1],Show_Number=0,Load=[1,-1])