200 / 12**4, 10 / 12**2)

# Add a fixed support at the base of the column
cantilever.DefineSupport('1', True, True, True, True, True, True)

# Add a -10 kip axial load to the top of the column
cantilever.AddNodeLoad(str(num_nodes), 'FY', -P)

# Add a 5 kip lateral load to the top of the column
cantilever.AddNodeLoad(str(num_nodes), 'FX', H)

# Perform 2nd order analysis
cantilever.Analyze_PDelta()

# Render the deformed shape
Visualization.DeformedShape(cantilever, 1, 0.3)

# Print the moment at the base of the column
print('PyNite Calculated Moment: ',
      -cantilever.GetMember('1').Moment('Mz', 0.001))

# Print the deflection at the top of the column
print('PyNite Calculated Displacement: ',
      cantilever.GetNode(str(num_nodes)).DX * 12)

# Print the AISC benchmark problem solution:
alpha = (P * L**2 / (E * I))**0.5
Mmax = H * L * (math.tan(alpha) / alpha)
ymax = H * L**3 / (3 * E * I) * (3 * (math.tan(alpha) - alpha) / alpha**3)
print('AISC Benchmark Problem Moment: ', Mmax)
print('AISC Benchmark Problem Displacement: ', ymax * 12)
# Add a beam with the following properties:
# E = 29000 ksi, G = 11400 ksi, Iy = 100 in^4, Iz = 150 in^4, J = 250 in^4, A = 20 in^2
SimpleBeam.AddMember('M1', 'N1', 'N2', 29000, 11400, 100, 150, 250, 20)

# Provide simple supports
SimpleBeam.DefineSupport('N1', True, True, True, False, False, False)
SimpleBeam.DefineSupport('N2', True, True, True, True, False, False)

# Add a uniform load of 200 lbs/ft to the beam
SimpleBeam.AddMemberDistLoad('M1', 'Fy', -200/1000/12, -200/1000/12, 0, 168)

# Alternatively the following line would do apply the load to the full length of the member as well
# SimpleBeam.AddMemberDistLoad('M1', 'Fy', 200/1000/12, 200/1000/12)

# Analyze the beam
SimpleBeam.Analyze()

# Print the shear, moment, and deflection diagrams
SimpleBeam.GetMember('M1').PlotShear('Fy')
SimpleBeam.GetMember('M1').PlotMoment('Mz')
SimpleBeam.GetMember('M1').PlotDeflection('dy')

# Print reactions at each end of the beam
print('Left Support Reaction:', round(SimpleBeam.GetNode('N1').RxnFY, 3), 'kip')
print('Right Support Reacton:', round(SimpleBeam.GetNode('N2').RxnFY, 3), 'kip')

# Render the deformed shape of the beam magnified 100 times, with a text height of 5 inches
from PyNite import Visualization
Visualization.DeformedShape(SimpleBeam, 100, 5)
示例#3
0
# Add a uniform load to the beam
beam.AddMemberDistLoad('AB', 'Fy', -2 / 12, -2 / 12)
beam.AddMemberDistLoad('BC', 'Fy', -2 / 12, -2 / 12)
beam.AddMemberDistLoad('CD', 'Fy', -2 / 12, -2 / 12)

# Add support settlements
beam.AddNodeDisplacement('B', 'DY', -5 / 8)
beam.AddNodeDisplacement('C', 'DY', -1.5)
beam.AddNodeDisplacement('D', 'DY', -0.75)

# Analyze the beam
beam.Analyze()

# Render the beam's deformed shape
Visualization.DeformedShape(beam, 40, 12)

# Print reactions
print('Calculated Reaction at A:', beam.GetNode('A').RxnFY, 'k')
print('Calculated Reaction at B:', beam.GetNode('B').RxnFY, 'k')
print('Calculated Reaction at C:', beam.GetNode('C').RxnFY, 'k')
print('Calculated Reaction at D:', beam.GetNode('D').RxnFY, 'k')
print('Expected Reaction at A: -1.098 k')
print('Expected Reaction at B: 122.373 k')
print('Expected Reaction at C: -61.451 k')
print('Expected Reaction at D: 60.176 k')

# Print the shear diagrams
beam.GetMember('AB').PlotShear('Fy')
beam.GetMember('BC').PlotShear('Fy')
beam.GetMember('CD').PlotShear('Fy')
Iy = 100
Iz = 100
E = 30000
G = 10000
A = 10

frame.AddMember('M1', 'N2', 'N1', E, G, Iy, Iz, J, A)
frame.AddMember('M2', 'N3', 'N1', E, G, Iy, Iz, J, A)
frame.AddMember('M3', 'N4', 'N1', E, G, Iy, Iz, J, A)

# Add nodal loads
frame.AddNodeLoad('N1', 'FY', -50)
frame.AddNodeLoad('N1', 'MX', -1000)

# Analyze the model
frame.Analyze(check_statics=False)

# Render the deformed shape
Visualization.DeformedShape(frame, 100, 5)

# Print the node 1 displacements
print('Node 1 deformations:')
print('Calculated values: ',
      frame.GetNode('N1').DX,
      frame.GetNode('N1').DY,
      frame.GetNode('N1').DZ,
      frame.GetNode('N1').RX,
      frame.GetNode('N1').RY,
      frame.GetNode('N1').RZ)
print('Expected values: ', 7.098e-5, -0.014, -2.352e-3, -3.996e-3, 1.78e-5,
      -1.033e-4)