def geometric_K(beam_props): # beam_props is a dictionary with the following values # xn1 : position vector for start node # xn2 : position vector for end node # Le : Effective beam length (taking into account node diameter) # Asy : Effective area for shear effects, y direction # Asz : Effective area for shear effects, z direction # G : Shear modulus # E : Elastic modulus # J : Polar moment of inertia # Iy : Bending moment of inertia, y direction # Iz : bending moment of inertia, z direction # p : The roll angle (radians) # T : internal element end force # shear : whether shear effects are considered. xn1 = beam_props["xn1"] xn2 = beam_props["xn2"] L = beam_props["Le"] Le = beam_props["Le"] Ax = beam_props["Ax"] Asy = beam_props["Asy"] Asz = beam_props["Asz"] G = beam_props["G"] E = beam_props["E"] J = beam_props["J"] Iy = beam_props["Iy"] Iz = beam_props["Iz"] p = beam_props["p"] T = beam_props["T"] shear = beam_props["shear"] #initialize the geometric stiffness matrix kg = np.zeros((12, 12)) t = pfeautil.coord_trans(xn1, xn2, Le, p) if shear: Ksy = 12.0 * E * Iz / (G * Asy * Le * Le) Ksz = 12.0 * E * Iy / (G * Asz * Le * Le) Dsy = (1 + Ksy) * (1 + Ksy) Dsz = (1 + Ksz) * (1 + Ksz) else: Ksy = Ksz = 0.0 Dsy = Dsz = 1.0 #print(T) kg[0][0] = kg[6][6] = 0.0 # T/L kg[1][1] = kg[7][7] = T / L * (1.2 + 2.0 * Ksy + Ksy * Ksy) / Dsy kg[2][2] = kg[8][8] = T / L * (1.2 + 2.0 * Ksz + Ksz * Ksz) / Dsz kg[3][3] = kg[9][9] = T / L * J / Ax kg[4][4] = kg[10][10] = T * L * (2.0 / 15.0 + Ksz / 6.0 + Ksz * Ksz / 12.0) / Dsz kg[5][5] = kg[11][11] = T * L * (2.0 / 15.0 + Ksy / 6.0 + Ksy * Ksy / 12.0) / Dsy kg[0][6] = kg[6][0] = 0.0 # -T/L kg[4][2] = kg[2][4] = kg[10][2] = kg[2][10] = -T / 10.0 / Dsz kg[8][4] = kg[4][8] = kg[10][8] = kg[8][10] = T / 10.0 / Dsz kg[5][1] = kg[1][5] = kg[11][1] = kg[1][11] = T / 10.0 / Dsy kg[7][5] = kg[5][7] = kg[11][7] = kg[7][11] = -T / 10.0 / Dsy kg[3][9] = kg[9][3] = -kg[3][3] kg[7][1] = kg[1][7] = -T / L * (1.2 + 2.0 * Ksy + Ksy * Ksy) / Dsy kg[8][2] = kg[2][8] = -T / L * (1.2 + 2.0 * Ksz + Ksz * Ksz) / Dsz kg[10][4] = kg[4][10] = -T * L * (1.0 / 30.0 + Ksz / 6.0 + Ksz * Ksz / 12.0) / Dsz kg[11][5] = kg[5][11] = -T * L * (1.0 / 30.0 + Ksy / 6.0 + Ksy * Ksy / 12.0) / Dsy #now we transform kg to the global coordinates kg = pfeautil.atma(t, kg) # Check and enforce symmetry of the elastic stiffness matrix for the element kg = 0.5 * (kg + kg.T) return [kg[:6, :6], kg[6:, :6], kg[:6, 6:], kg[6:, 6:]]
def geometric_K(beam_props): # beam_props is a dictionary with the following values # xn1 : position vector for start node # xn2 : position vector for end node # Le : Effective beam length (taking into account node diameter) # Asy : Effective area for shear effects, y direction # Asz : Effective area for shear effects, z direction # G : Shear modulus # E : Elastic modulus # J : Polar moment of inertia # Iy : Bending moment of inertia, y direction # Iz : bending moment of inertia, z direction # p : The roll angle (radians) # T : internal element end force # shear : whether shear effects are considered. xn1 = beam_props["xn1"] xn2 = beam_props["xn2"] L = beam_props["Le"] Le = beam_props["Le"] Ax = beam_props["Ax"] Asy = beam_props["Asy"] Asz = beam_props["Asz"] G = beam_props["G"] E = beam_props["E"] J = beam_props["J"] Iy = beam_props["Iy"] Iz = beam_props["Iz"] p = beam_props["p"] T = beam_props["T"] shear = beam_props["shear"] #initialize the geometric stiffness matrix kg = np.zeros((12,12)) t = pfeautil.coord_trans(xn1,xn2,Le,p) if shear: Ksy = 12.0*E*Iz / (G*Asy*Le*Le); Ksz = 12.0*E*Iy / (G*Asz*Le*Le); Dsy = (1+Ksy)*(1+Ksy); Dsz = (1+Ksz)*(1+Ksz); else: Ksy = Ksz = 0.0; Dsy = Dsz = 1.0; #print(T) kg[0][0] = kg[6][6] = 0.0 # T/L kg[1][1] = kg[7][7] = T/L*(1.2+2.0*Ksy+Ksy*Ksy)/Dsy kg[2][2] = kg[8][8] = T/L*(1.2+2.0*Ksz+Ksz*Ksz)/Dsz kg[3][3] = kg[9][9] = T/L*J/Ax kg[4][4] = kg[10][10] = T*L*(2.0/15.0+Ksz/6.0+Ksz*Ksz/12.0)/Dsz kg[5][5] = kg[11][11] = T*L*(2.0/15.0+Ksy/6.0+Ksy*Ksy/12.0)/Dsy kg[0][6] = kg[6][0] = 0.0 # -T/L kg[4][2] = kg[2][4] = kg[10][2] = kg[2][10] = -T/10.0/Dsz kg[8][4] = kg[4][8] = kg[10][8] = kg[8][10] = T/10.0/Dsz kg[5][1] = kg[1][5] = kg[11][1] = kg[1][11] = T/10.0/Dsy kg[7][5] = kg[5][7] = kg[11][7] = kg[7][11] = -T/10.0/Dsy kg[3][9] = kg[9][3] = -kg[3][3] kg[7][1] = kg[1][7] = -T/L*(1.2+2.0*Ksy+Ksy*Ksy)/Dsy kg[8][2] = kg[2][8] = -T/L*(1.2+2.0*Ksz+Ksz*Ksz)/Dsz kg[10][4] = kg[4][10] = -T*L*(1.0/30.0+Ksz/6.0+Ksz*Ksz/12.0)/Dsz kg[11][5] = kg[5][11] = -T*L*(1.0/30.0+Ksy/6.0+Ksy*Ksy/12.0)/Dsy #now we transform kg to the global coordinates kg = pfeautil.atma(t,kg) # Check and enforce symmetry of the elastic stiffness matrix for the element kg = 0.5*(kg+kg.T) return [kg[:6,:6],kg[6:,:6],kg[:6,6:],kg[6:,6:]]
def elastic_K(beam_props): # beam_props is a dictionary with the following values # xn1 : position vector for start node # xn2 : position vector for end node # Le : Effective beam length (taking into account node diameter) # Asy : Effective area for shear effects, y direction # Asz : Effective area for shear effects, z direction # G : Shear modulus # E : Elastic modulus # J : Polar moment of inertia # Iy : Bending moment of inertia, y direction # Iz : bending moment of inertia, z direction # p : The roll angle (radians) # T : internal element end force # shear : Do we consider shear effects #Start by importing the beam properties xn1 = beam_props["xn1"] xn2 = beam_props["xn2"] Le = beam_props["Le"] Ax = beam_props["Ax"] Asy = beam_props["Asy"] Asz = beam_props["Asz"] G = beam_props["G"] E = beam_props["E"] J = beam_props["J"] Iy = beam_props["Iy"] Iz = beam_props["Iz"] p = beam_props["p"] shear = beam_props["shear"] #initialize the output k = np.zeros((12, 12)) #k = co.matrix(0.0,(12,12)) #define the transform between local and global coordinate frames t = pfeautil.coord_trans(xn1, xn2, Le, p) #calculate Shear deformation effects Ksy = 0 Ksz = 0 #begin populating that elastic stiffness matrix if shear: Ksy = 12.0 * E * Iz / (G * Asy * Le * Le) Ksz = 12.0 * E * Iy / (G * Asz * Le * Le) else: Ksy = Ksz = 0.0 k[0, 0] = k[6, 6] = 1.0 * E * Ax / Le k[1, 1] = k[7, 7] = 12. * E * Iz / (Le * Le * Le * (1. + Ksy)) k[2, 2] = k[8, 8] = 12. * E * Iy / (Le * Le * Le * (1. + Ksz)) k[3, 3] = k[9, 9] = 1.0 * G * J / Le k[4, 4] = k[10, 10] = (4. + Ksz) * E * Iy / (Le * (1. + Ksz)) k[5, 5] = k[11, 11] = (4. + Ksy) * E * Iz / (Le * (1. + Ksy)) k[4, 2] = k[2, 4] = -6. * E * Iy / (Le * Le * (1. + Ksz)) k[5, 1] = k[1, 5] = 6. * E * Iz / (Le * Le * (1. + Ksy)) k[6, 0] = k[0, 6] = -k[0, 0] k[11, 7] = k[7, 11] = k[7, 5] = k[5, 7] = -k[5, 1] k[10, 8] = k[8, 10] = k[8, 4] = k[4, 8] = -k[4, 2] k[9, 3] = k[3, 9] = -k[3, 3] k[10, 2] = k[2, 10] = k[4, 2] k[11, 1] = k[1, 11] = k[5, 1] k[7, 1] = k[1, 7] = -k[1, 1] k[8, 2] = k[2, 8] = -k[2, 2] k[10, 4] = k[4, 10] = (2. - Ksz) * E * Iy / (Le * (1. + Ksz)) k[11, 5] = k[5, 11] = (2. - Ksy) * E * Iz / (Le * (1. + Ksy)) #now we transform k to the global coordinates k = pfeautil.atma(t, k) # Check and enforce symmetry of the elastic stiffness matrix for the element k = 0.5 * (k + k.T) ''' for i in range(12): for j in range(i+1,12): if(k[i][j]!=k[j][i]): if(abs(1.0*k[i][j]/k[j][i]-1.0) > 1.0e-6 and (abs(1.0*k[i][j]/k[i][i]) > 1e-6 or abs(1.0*k[j][i]/k[i][i]) > 1e-6)): print("Ke Not Symmetric") k[i][j] = k[j][i] = 0.5 * ( k[i][j] + k[j][i] ) ''' return [k[:6, :6], k[6:, :6], k[:6, 6:], k[6:, 6:]]
def elastic_K(beam_props): # beam_props is a dictionary with the following values # xn1 : position vector for start node # xn2 : position vector for end node # Le : Effective beam length (taking into account node diameter) # Asy : Effective area for shear effects, y direction # Asz : Effective area for shear effects, z direction # G : Shear modulus # E : Elastic modulus # J : Polar moment of inertia # Iy : Bending moment of inertia, y direction # Iz : bending moment of inertia, z direction # p : The roll angle (radians) # T : internal element end force # shear : Do we consider shear effects #Start by importing the beam properties xn1 = beam_props["xn1"] xn2 = beam_props["xn2"] Le = beam_props["Le"] Ax = beam_props["Ax"] Asy = beam_props["Asy"] Asz = beam_props["Asz"] G = beam_props["G"] E = beam_props["E"] J = beam_props["J"] Iy = beam_props["Iy"] Iz = beam_props["Iz"] p = beam_props["p"] shear = beam_props["shear"] #initialize the output k = np.zeros((12,12)) #k = co.matrix(0.0,(12,12)) #define the transform between local and global coordinate frames t = pfeautil.coord_trans(xn1,xn2,Le,p) #calculate Shear deformation effects Ksy = 0 Ksz = 0 #begin populating that elastic stiffness matrix if shear: Ksy = 12.0*E*Iz / (G*Asy*Le*Le) Ksz = 12.0*E*Iy / (G*Asz*Le*Le) else: Ksy = Ksz = 0.0 k[0,0] = k[6,6] = 1.0*E*Ax / Le k[1,1] = k[7,7] = 12.*E*Iz / ( Le*Le*Le*(1.+Ksy) ) k[2,2] = k[8,8] = 12.*E*Iy / ( Le*Le*Le*(1.+Ksz) ) k[3,3] = k[9,9] = 1.0*G*J / Le k[4,4] = k[10,10] = (4.+Ksz)*E*Iy / ( Le*(1.+Ksz) ) k[5,5] = k[11,11] = (4.+Ksy)*E*Iz / ( Le*(1.+Ksy) ) k[4,2] = k[2,4] = -6.*E*Iy / ( Le*Le*(1.+Ksz) ) k[5,1] = k[1,5] = 6.*E*Iz / ( Le*Le*(1.+Ksy) ) k[6,0] = k[0,6] = -k[0,0] k[11,7] = k[7,11] = k[7,5] = k[5,7] = -k[5,1] k[10,8] = k[8,10] = k[8,4] = k[4,8] = -k[4,2] k[9,3] = k[3,9] = -k[3,3] k[10,2] = k[2,10] = k[4,2] k[11,1] = k[1,11] = k[5,1] k[7,1] = k[1,7] = -k[1,1] k[8,2] = k[2,8] = -k[2,2] k[10,4] = k[4,10] = (2.-Ksz)*E*Iy / ( Le*(1.+Ksz) ) k[11,5] = k[5,11] = (2.-Ksy)*E*Iz / ( Le*(1.+Ksy) ) #now we transform k to the global coordinates k = pfeautil.atma(t,k) # Check and enforce symmetry of the elastic stiffness matrix for the element k = 0.5*(k+k.T) ''' for i in range(12): for j in range(i+1,12): if(k[i][j]!=k[j][i]): if(abs(1.0*k[i][j]/k[j][i]-1.0) > 1.0e-6 and (abs(1.0*k[i][j]/k[i][i]) > 1e-6 or abs(1.0*k[j][i]/k[i][i]) > 1e-6)): print("Ke Not Symmetric") k[i][j] = k[j][i] = 0.5 * ( k[i][j] + k[j][i] ) ''' return [k[:6,:6],k[6:,:6],k[:6,6:],k[6:,6:]]