Esempio n. 1
0
def make_structure():
    xs1 = xs.Rectangle(2, 2)
    A992 = ma.A992()
    s1 = Truss.Truss(cross=xs1, material=A992)

    s1.addNode(0, 0, fixity='pin')
    s1.addNode(1, 1)
    s1.addNode(2, 0, fixity='roller')
    s1.addMember(0, 1)
    s1.addMember(1, 2)
    s1.addMember(2, 0)
    return (s1, xs1)
Esempio n. 2
0
    def setUp(self):
        #Truss
        xs1 = xs.Rectangle(2, 2)
        A992 = ma.A992()
        s1 = Truss.Truss(cross=xs1, material=A992)

        s1.addNode(0, 0, fixity='pin')
        s1.addNode(1, 1)
        s1.addNode(2, 0, fixity='roller')

        s1.addMember(0, 1)
        s1.addMember(1, 2)
        s1.addMember(2, 0)

        self.s1 = s1
        self.xs1 = xs1
Esempio n. 3
0
	def test_Truss(self):
			
			xs1 = xs.generalSection(A=1.2)
			ma1 = ma.Custom(E=30*10**6, fy=60) #psi
			
			# Example 6.2.4
			T1 = Truss.Truss(cross=xs1,material=ma1)
			
			# Make nodes
			n1 = T1.addNode(0,-180)
			n2 = T1.addNode(0,0)
			n3 = T1.addNode(120,0,fixity='pin')
			n4 = T1.addNode(120,-180,fixity='wallslider')
			
			m1 = T1.addMember(0,3)
			m2 = T1.addMember(1,2)
			m3 = T1.addMember(1,0)
			m4 = T1.addMember(2,3)
			m5 = T1.addMember(0,2)
			m6 = T1.addMember(1,3)
			
			length = math.sqrt(120**2+180**2)
			
			self.assertEqual(m1.length, 120)
			self.assertEqual(m2.length, 120)
			self.assertEqual(m3.length, 180)
			self.assertEqual(m4.length, 180)
			
			self.assertEqual(m5.length, length)
			self.assertEqual(m6.length, length)
			
			self.assertEqual(m1.unVec[0],1)
			self.assertEqual(m1.unVec[1],0)
			
			loading = np.array([0,0,0,-4000,0,0,0,0])
			T1.directStiffness(loading)
			
			self.assertAlmostEqual(m1.axial[0,0],1333 + 1/3)
			self.assertAlmostEqual(m2.axial[0,0], - 1333 - 1/3)
			self.assertAlmostEqual(m3.axial[0,0], 2000)
			self.assertAlmostEqual(m4.axial[0,0], -2000)
			self.assertAlmostEqual(m5.axial[0,0], -2403.7008503093257)
			self.assertAlmostEqual(m6.axial[0,0], 2403.7008503093257)
Esempio n. 4
0
import StructPy.Truss as tr
import StructPy.materials as ma
import math

# UNITS: KIPS, INCHES

# Define material
A992 = ma.Custom(E=29000,fy=46)

# Define cross section
#xs1 = xs.IBeam(2, 2, 0.1, 0.1)
#xs1 = xs.AISC("HSS8X8X5/16")
xs1 = xs.AISC("HSS6.000X0.500")
# define blank structure
# we will add to this later
s1 = tr.Truss(cross=xs1, material=A992)

# Add nodes to the structure
# bottom chord
s1.addNode(0,  0, fixity='pin')
s1.addNode(5*12, 0)
s1.addNode(10*12, 0)
s1.addNode(15*12, 0)
s1.addNode(20*12, 0)
s1.addNode(25*12, 0)
s1.addNode(30*12, 0, fixity='pin')

#top chord
s1.addNode(5*12, 12*(4))
s1.addNode(10*12, 12*(4))
s1.addNode(15*12, 12*(4))
Esempio n. 5
0
import StructPy.cross_sections as xs
import StructPy.structural_classes as sc
import StructPy.materials as ma
import StructPy.Truss as Truss

# Define material
A992 = ma.A992()

# Define cross section
xs1 = xs.generalSection(A=1)

# define blank structure
# the cross section and material are defaults for the members
# we will add to this later
s1 = Truss.Truss(cross=xs1, material=A992)

# Add nodes to the structure
s1.addNode(0, 0, fixity='pin')
s1.addNode(1, 1)
s1.addNode(2, 0, fixity='roller')

# Add members to the structure
s1.addMember(0, 1)
s1.addMember(1, 2)
s1.addMember(0, 2)

s1.plot()

Forces = np.matrix('0; 0; 1000; 1000; 0; 0')
disp = s1.directStiffness(Forces)
s1.plotDeformation(nfig=1, mag=1)