示例#1
0
# commented out, but you can uncomment it to see for yourself what happens.

# BracedFrame.add_load_combo('1.4D', factors={'D':1.4})
BracedFrame.add_load_combo('1.2D+1.0W', factors={'D':1.2, 'W':1.0})
BracedFrame.add_load_combo('0.9D+1.0W', factors={'D':0.9, 'W':1.0})

# Analyze the braced frame
# P-Delta analysis could also be performed using BracedFrame.analyze_PDelta().
# Generally, P-Delta analysis will have little effect on a model of a braced
# frame, as there is usually very little bending moment in the members.
BracedFrame.analyze()

# Display the deformed shape of the structure magnified 50 times with the text
# height 5 model units (inches) high
from PyNite import Visualization
Visualization.render_model(BracedFrame, annotation_size=5, deformed_shape=True,
                          deformed_scale=50, combo_name='1.2D+1.0W')

# Plot the axial load diagrams for the braces. We should see no compression on
# 'Brace2' and 64 kips on 'Brace1' if the tension-only analysis worked
# correctly.
BracedFrame.Members['Brace1'].plot_axial(combo_name='1.2D+1.0W')
BracedFrame.Members['Brace2'].plot_axial(combo_name='1.2D+1.0W')

# Report the frame reactions for the load combination '1.2D+1.0W'. We should
# see a -50 kip horizontal reaction at node 'N1', and a zero kip reaction at
# node 'N4' if the tension-only analysis worked correctly. Similarly, we
print('1.2D+1.0W: N1 reaction FY =',
      '{:.3f}'.format(BracedFrame.Nodes['N1'].RxnFY['1.2D+1.0W']), 'kip')
print('1.2D+1.0W: N1 reaction FX =',
      '{:.3f}'.format(BracedFrame.Nodes['N1'].RxnFX['1.2D+1.0W']), 'kip')
print('1.2D+1.0W: N4 reaction FY =',
示例#2
0
# Provide simple supports
SimpleBeam.def_support('N1', True, True, True, True, False, False)  # Constrained for torsion at 'N1'
SimpleBeam.def_support('N2', True, True, True, False, False, False) # Not constrained for torsion at 'N2'

# Add a downward point load of 5 kips at the midspan of the beam
SimpleBeam.add_member_pt_load('M1', 'Fy', -5, 7*12, 'D') # 5 kips Dead load
SimpleBeam.add_member_pt_load('M1', 'Fy', -8, 7*12, 'L') # 8 kips Live load

# Add load combinations
SimpleBeam.add_load_combo('1.4D', {'D':1.4})
SimpleBeam.add_load_combo('1.2D+1.6L', {'D':1.2, 'L':1.6})

# Analyze the beam and perform a statics check
SimpleBeam.analyze(check_statics=True)

Visualization.render_model(SimpleBeam, annotation_size=10, deformed_shape=True, deformed_scale=30, render_loads=True, combo_name='1.2D+1.6L')

# Print the shear, moment, and deflection diagrams
SimpleBeam.Members['M1'].plot_shear('Fy', '1.2D+1.6L')
SimpleBeam.Members['M1'].plot_moment('Mz', '1.2D+1.6L')
SimpleBeam.Members['M1'].plot_deflection('dy', '1.2D+1.6L')

# Print reactions at each end of the beam
print('Left Support Reaction:', SimpleBeam.Nodes['N1'].RxnFY['1.2D+1.6L'], 'kip')
print('Right Support Reacton:', SimpleBeam.Nodes['N2'].RxnFY['1.2D+1.6L'], 'kip')

# Print the max/min shears and moments in the beam
print('Maximum Shear:', SimpleBeam.Members['M1'].max_shear('Fy', '1.2D+1.6L'), 'kip')
print('Minimum Shear:', SimpleBeam.Members['M1'].min_shear('Fy', '1.2D+1.6L'), 'kip')
print('Maximum Moment:', SimpleBeam.Members['M1'].max_moment('Mz', '1.2D+1.6L')/12, 'kip-ft')
print('Minimum Moment:', SimpleBeam.Members['M1'].min_moment('Mz', '1.2D+1.6L')/12, 'kip-ft')
# Add a load combination named '1.0W' with a factor of 1.0 applied to any loads designated as 'W'
model.add_load_combo('1.0W', {'W': 1.0})

# Analyze the model
model.analyze(check_statics=True)

# +-----------------------+
# | Discussion of Results |
# +-----------------------+

# Render the wall. The quad mesh will be set to show 'Mx' results.
from PyNite import Visualization
Visualization.render_model(model,
                           annotation_size=mesh_size / 6,
                           deformed_shape=False,
                           combo_name='1.0W',
                           color_map='Mx',
                           render_loads=True)

# The it should be noted that the rendered contours are smoothed. Smoothing averages the corner
# stresses from every quad framing into each node. This leads to a much more accurate contour.
# An unsmoothed plot would essentially show quad center stresses at the quad element corners.

# Here are the expected results from Timoshenko's "Theory of Plates and Shells" Table 35, p. 202.
# Note that the deflection values for the PyNite solution are slightly larger, due to transverse
# shear deformations being accounted for.
D = E * t**3 / (12 * (1 - nu**2))
print('Solution from Timoshenko Table 35 for b/a = 2.0:')
print('Expected displacement: ', 0.00254 * load * width**4 / D)
print('Expected Mx at Center:', -0.0412 * load * width**2)
print('Expected Mx at Edges:', 0.0829 * load * width**2)
示例#4
0
                           False, False, False, False, True, True)
truss.def_releases('BE', False, False, False, False, True, True, \
                           False, False, False, False, True, True)

# Add nodal loads
truss.add_node_load('A', 'FX', 10)
truss.add_node_load('A', 'FY', 60)
truss.add_node_load('A', 'FZ', 20)

# Analyze the model
truss.analyze(check_statics=True)

# Print results
print('Member BC calculated axial force: ' +
      str(truss.Members['BC'].max_axial()))
print('Member BC expected axial force: 32.7 Tension')
print('Member BD calculated axial force: ' +
      str(truss.Members['BD'].max_axial()))
print('Member BD expected axial force: 45.2 Tension')
print('Member BE calculated axial force: ' +
      str(truss.Members['BE'].max_axial()))
print('Member BE expected axial force: 112.1 Compression')

# Render the model for viewing. The text height will be set to 50 mm.
# Because the members in this example are nearly rigid, there will be virtually no deformation. The deformed shape won't be rendered.
# The program has created a default load case 'Case 1' and a default load combo 'Combo 1' since we didn't specify any. We'll display 'Case 1'.
Visualization.render_model(truss,
                           text_height=0.05,
                           render_loads=True,
                           case='Case 1')
示例#5
0
frame.def_support('N4', True, True, True, True, True, True)

# Create members (all members will have the same properties in this example)
J = 100
Iy = 200
Iz = 1000
E = 30000
G = 10000
A = 100

frame.add_member('M12', 'N1', 'N2', E, G, Iy, Iz, J, A)
frame.add_member('M23', 'N2', 'N3', E, G, Iy, Iz, J, A)
frame.add_member('M34', 'N3', 'N4', E, G, Iy, Iz, J, A)

# Add nodal loads
frame.add_node_load('N2', 'FY', -5)
frame.add_node_load('N2', 'MX', -100 * 12)
frame.add_node_load('N3', 'FZ', 40)

# Analyze the frame
frame.analyze()

print('Calculated results: ', frame.Nodes['N2'].DY, frame.Nodes['N3'].DZ)
print('Expected results: ', -0.063, 1.825)

# Render the model for viewing
Visualization.render_model(frame,
                           annotation_size=5,
                           deformed_shape=True,
                           deformed_scale=40,
                           render_loads=True)
示例#6
0
                           False, False, False, False, True, True)
truss.def_releases('BE', False, False, False, False, True, True, \
                           False, False, False, False, True, True)

# Add nodal loads
truss.add_node_load('A', 'FX', 10)
truss.add_node_load('A', 'FY', 60)
truss.add_node_load('A', 'FZ', 20)

# Analyze the model
truss.analyze(check_statics=True)

# Print results
print('Member BC calculated axial force: ' +
      str(truss.Members['BC'].max_axial()))
print('Member BC expected axial force: 32.7 Tension')
print('Member BD calculated axial force: ' +
      str(truss.Members['BD'].max_axial()))
print('Member BD expected axial force: 45.2 Tension')
print('Member BE calculated axial force: ' +
      str(truss.Members['BE'].max_axial()))
print('Member BE expected axial force: 112.1 Compression')

# Render the model for viewing. The text height will be set to 50 mm.
# Because the members in this example are nearly rigid, there will be virtually no deformation. The deformed shape won't be rendered.
# The program has created a default load case 'Case 1' and a default load combo 'Combo 1' since we didn't specify any. We'll display 'Case 1'.
Visualization.render_model(truss,
                           annotation_size=0.05,
                           render_loads=True,
                           case='Case 1')
示例#7
0
# 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.add_member('M1', 'N1', 'N2', 29000, 11400, 100, 150, 250, 20)

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

# Add a uniform load of 200 lbs/ft to the beam
SimpleBeam.add_member_dist_load('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.add_member_dist_load('M1', 'Fy', 200/1000/12, 200/1000/12)

# Analyze the beam
SimpleBeam.analyze()

# Print the shear, moment, and deflection diagrams
SimpleBeam.Members['M1'].plot_shear('Fy')
SimpleBeam.Members['M1'].plot_moment('Mz')
SimpleBeam.Members['M1'].plot_deflection('dy')

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

# Render the deformed shape of the beam magnified 100 times, with a text height of 5 inches
from PyNite import Visualization
Visualization.render_model(SimpleBeam, annotation_size=5, deformed_shape=True, deformed_scale=100, render_loads=True)
# Note that the load combination '1.4D' has no lateral load, but does have
# gravity load. The gravity load forces the tension only spring to receive
# minor compression, which causes it to be deactivated on the first iteration.
# Once deactivated the model is unstable and an exception is thrown. This is
# normal and correct behavior. Load combination '1.4D' has been commented out,
# but you can uncomment it to see for yourself what happens.

# braced_frame.add_load_combo('1.4D', factors={'D':1.4})
braced_frame.add_load_combo('1.2D+1.0W', factors={'D': 1.2, 'W': 1.0})
braced_frame.add_load_combo('0.9D+1.0W', factors={'D': 0.9, 'W': 1.0})

# Analyze the braced frame
# P-Delta analysis could also be performed using braced_frame.analyze_PDelta().
# Generally, P-Delta analysis will have little effect on a model of a braced
# frame, as there is usually very little bending moment in the members.
braced_frame.analyze()

# Display the deformed shape of the structure magnified 50 times with the text
# height 5 model units (inches) high.
from PyNite import Visualization
Visualization.render_model(braced_frame,
                           text_height=5,
                           deformed_shape=True,
                           deformed_scale=50,
                           combo_name='1.2D+1.0W')

# We should see upward displacement at N1 and downward displacement at N4 if
# our springs worked correctly
print('N1 displacement in Y =', braced_frame.Nodes['N1'].DY['1.2D+1.0W'])
print('N4 displacement in Y =', braced_frame.Nodes['N4'].DY['1.2D+1.0W'])