4.1.2. Elastic Frame Pushover Example
4.1.2.1. Introduction
This example is of a three story, three bay elastic frame structure, as shown in the figure, subject to static gravity and lateral loads. The model consists of sixteen nodes, twenty one elastic beam-column elements, two load patterns (one with distributed gravity loads on the beams and one with lateral nodal loads), and constraints that totally fix the nodes at the base of the building.
The complete scripts are available here: ElasticFramePushover.tcl (Tcl) and ElasticFramePushover.py (Python).
Note
All lines that begin with # are comments. They are ignored by the interpreter but are useful for documenting the code. When creating your own input scripts you are highly encouraged to use comments.
For brevity it is possible to put a comment after a command by using the ; to signify the end of the command.
The printing of information to the screen makes this example more complicated than it needs to be. If you don’t understand it, you can ignore it for now.
4.1.2.2. Parameters
Before we build the model we set some parameters using variables and expression evaluation. We set variables for the gravitational constant g, the floor loads, and from these the floor masses and the distributed beam loads. In Tcl we use the set and expr commands; in Python these are ordinary variable assignments.
# Units: kips, in, sec
set g 386.4
set ft 12.0
set Load1 1185.0
set Load2 1185.0
set Load3 970.0
# set floor masses
set m1 [expr $Load1/(4*$g)]; # 4 nodes per floor
set m2 [expr $Load2/(4*$g)]
set m3 [expr $Load3/(4*$g)]
# set floor distributed loads
set w1 [expr $Load1/(90*$ft)]; # frame 90 ft long
set w2 [expr $Load2/(90*$ft)]
set w3 [expr $Load3/(90*$ft)]
import openseespy.opensees as ops
# Units: kips, in, sec
g = 386.4
ft = 12.0
Load1 = 1185.0
Load2 = 1185.0
Load3 = 970.0
# set floor masses
m1 = Load1 / (4 * g) # 4 nodes per floor
m2 = Load2 / (4 * g)
m3 = Load3 / (4 * g)
# set floor distributed loads
w1 = Load1 / (90 * ft) # frame 90 ft long
w2 = Load2 / (90 * ft)
w3 = Load3 / (90 * ft)
4.1.2.3. Model Definition
There are no material objects associated with the elastic elements, but there are geometric transformations. For this example all the columns have a PDelta transformation, and all the beams a Linear transformation.
Note
Because the model is planar and is comprised of beam-column elements, the spatial dimension of the mesh (ndm) is specified as 2 and the nodes are specified to have 3 degrees-of-freedom (two translations and a rotation).
# Remove existing model
wipe
# Create ModelBuilder (with two-dimensions and 3 DOF/node)
model BasicBuilder -ndm 2 -ndf 3
# Create nodes & add to Domain
# command: node nodeId xCrd yCrd <-mass $massX $massY $massRz>
# NOTE: mass is optional
node 1 0.0 0.0
node 2 360.0 0.0
node 3 720.0 0.0
node 4 1080.0 0.0
node 5 0.0 162.0 -mass $m1 $m1 0.0
node 6 360.0 162.0 -mass $m1 $m1 0.0
node 7 720.0 162.0 -mass $m1 $m1 0.0
node 8 1080.0 162.0 -mass $m1 $m1 0.0
node 9 0.0 324.0 -mass $m2 $m2 0.0
node 10 360.0 324.0 -mass $m2 $m2 0.0
node 11 720.0 324.0 -mass $m2 $m2 0.0
node 12 1080.0 324.0 -mass $m2 $m2 0.0
node 13 0.0 486.0 -mass $m3 $m3 0.0
node 14 360.0 486.0 -mass $m3 $m3 0.0
node 15 720.0 486.0 -mass $m3 $m3 0.0
node 16 1080.0 486.0 -mass $m3 $m3 0.0
# Set the boundary conditions - command: fix nodeID xRestrnt? yRestrnt? rZRestrnt?
fix 1 1 1 1
fix 2 1 1 1
fix 3 1 1 1
fix 4 1 1 1
# Define geometric transformations for beam-column elements
geomTransf Linear 1; # beams
geomTransf PDelta 2; # columns
# Define elements
# Create elastic beam-column elements
# command: element elasticBeamColumn eleID node1 node2 A E Iz geomTransfTag
# Define the Columns
element elasticBeamColumn 1 1 5 75.6 29000.0 3400.0 2; # W14X257
element elasticBeamColumn 2 5 9 75.6 29000.0 3400.0 2; # W14X257
element elasticBeamColumn 3 9 13 75.6 29000.0 3400.0 2; # W14X257
element elasticBeamColumn 4 2 6 91.4 29000.0 4330.0 2; # W14X311
element elasticBeamColumn 5 6 10 91.4 29000.0 4330.0 2; # W14X311
element elasticBeamColumn 6 10 14 91.4 29000.0 4330.0 2; # W14X311
element elasticBeamColumn 7 3 7 91.4 29000.0 4330.0 2; # W14X311
element elasticBeamColumn 8 7 11 91.4 29000.0 4330.0 2; # W14X311
element elasticBeamColumn 9 11 15 91.4 29000.0 4330.0 2; # W14X311
element elasticBeamColumn 10 4 8 75.6 29000.0 3400.0 2; # W14X257
element elasticBeamColumn 11 8 12 75.6 29000.0 3400.0 2; # W14X257
element elasticBeamColumn 12 12 16 75.6 29000.0 3400.0 2; # W14X257
# Define the Beams
element elasticBeamColumn 13 5 6 34.7 29000.0 5900.0 1; # W33X118
element elasticBeamColumn 14 6 7 34.7 29000.0 5900.0 1; # W33X118
element elasticBeamColumn 15 7 8 34.7 29000.0 5900.0 1; # W33X118
element elasticBeamColumn 16 9 10 34.2 29000.0 4930.0 1; # W30X116
element elasticBeamColumn 17 10 11 34.2 29000.0 4930.0 1; # W30X116
element elasticBeamColumn 18 11 12 34.2 29000.0 4930.0 1; # W30X116
element elasticBeamColumn 19 13 14 20.1 29000.0 1830.0 1; # W24X68
element elasticBeamColumn 20 14 15 20.1 29000.0 1830.0 1; # W24X68
element elasticBeamColumn 21 15 16 20.1 29000.0 1830.0 1; # W24X68
# Define loads for Gravity Analysis
# ---------------------------------
# Create a Linear TimeSeries (load factor varies linearly with time)
# command: timeSeries Linear $tag
timeSeries Linear 1
# Create a Plain load pattern with the Linear TimeSeries
# command: pattern Plain $tag $timeSeriesTag { $loads }
pattern Plain 1 1 {
eleLoad -ele 13 14 15 -type -beamUniform -$w1
eleLoad -ele 16 17 18 -type -beamUniform -$w2
eleLoad -ele 19 20 21 -type -beamUniform -$w3
}
# Remove existing model
ops.wipe()
# Create ModelBuilder (with two-dimensions and 3 DOF/node)
ops.model('BasicBuilder', '-ndm', 2, '-ndf', 3)
# Create nodes & add to Domain
# command: node(nodeId, xCrd, yCrd, '-mass', massX, massY, massRz)
# NOTE: mass is optional
ops.node(1, 0.0, 0.0)
ops.node(2, 360.0, 0.0)
ops.node(3, 720.0, 0.0)
ops.node(4, 1080.0, 0.0)
ops.node(5, 0.0, 162.0, '-mass', m1, m1, 0.0)
ops.node(6, 360.0, 162.0, '-mass', m1, m1, 0.0)
ops.node(7, 720.0, 162.0, '-mass', m1, m1, 0.0)
ops.node(8, 1080.0, 162.0, '-mass', m1, m1, 0.0)
ops.node(9, 0.0, 324.0, '-mass', m2, m2, 0.0)
ops.node(10, 360.0, 324.0, '-mass', m2, m2, 0.0)
ops.node(11, 720.0, 324.0, '-mass', m2, m2, 0.0)
ops.node(12, 1080.0, 324.0, '-mass', m2, m2, 0.0)
ops.node(13, 0.0, 486.0, '-mass', m3, m3, 0.0)
ops.node(14, 360.0, 486.0, '-mass', m3, m3, 0.0)
ops.node(15, 720.0, 486.0, '-mass', m3, m3, 0.0)
ops.node(16, 1080.0, 486.0, '-mass', m3, m3, 0.0)
# Set the boundary conditions - command: fix(nodeID, xRestrnt, yRestrnt, rZRestrnt)
ops.fix(1, 1, 1, 1)
ops.fix(2, 1, 1, 1)
ops.fix(3, 1, 1, 1)
ops.fix(4, 1, 1, 1)
# Define geometric transformations for beam-column elements
ops.geomTransf('Linear', 1) # beams
ops.geomTransf('PDelta', 2) # columns
# Define elements
# Create elastic beam-column elements
# command: element('elasticBeamColumn', eleID, node1, node2, A, E, Iz, geomTransfTag)
# Define the Columns
ops.element('elasticBeamColumn', 1, 1, 5, 75.6, 29000.0, 3400.0, 2) # W14X257
ops.element('elasticBeamColumn', 2, 5, 9, 75.6, 29000.0, 3400.0, 2) # W14X257
ops.element('elasticBeamColumn', 3, 9, 13, 75.6, 29000.0, 3400.0, 2) # W14X257
ops.element('elasticBeamColumn', 4, 2, 6, 91.4, 29000.0, 4330.0, 2) # W14X311
ops.element('elasticBeamColumn', 5, 6, 10, 91.4, 29000.0, 4330.0, 2) # W14X311
ops.element('elasticBeamColumn', 6, 10, 14, 91.4, 29000.0, 4330.0, 2) # W14X311
ops.element('elasticBeamColumn', 7, 3, 7, 91.4, 29000.0, 4330.0, 2) # W14X311
ops.element('elasticBeamColumn', 8, 7, 11, 91.4, 29000.0, 4330.0, 2) # W14X311
ops.element('elasticBeamColumn', 9, 11, 15, 91.4, 29000.0, 4330.0, 2) # W14X311
ops.element('elasticBeamColumn', 10, 4, 8, 75.6, 29000.0, 3400.0, 2) # W14X257
ops.element('elasticBeamColumn', 11, 8, 12, 75.6, 29000.0, 3400.0, 2) # W14X257
ops.element('elasticBeamColumn', 12, 12, 16, 75.6, 29000.0, 3400.0, 2) # W14X257
# Define the Beams
ops.element('elasticBeamColumn', 13, 5, 6, 34.7, 29000.0, 5900.0, 1) # W33X118
ops.element('elasticBeamColumn', 14, 6, 7, 34.7, 29000.0, 5900.0, 1) # W33X118
ops.element('elasticBeamColumn', 15, 7, 8, 34.7, 29000.0, 5900.0, 1) # W33X118
ops.element('elasticBeamColumn', 16, 9, 10, 34.2, 29000.0, 4930.0, 1) # W30X116
ops.element('elasticBeamColumn', 17, 10, 11, 34.2, 29000.0, 4930.0, 1) # W30X116
ops.element('elasticBeamColumn', 18, 11, 12, 34.2, 29000.0, 4930.0, 1) # W30X116
ops.element('elasticBeamColumn', 19, 13, 14, 20.1, 29000.0, 1830.0, 1) # W24X68
ops.element('elasticBeamColumn', 20, 14, 15, 20.1, 29000.0, 1830.0, 1) # W24X68
ops.element('elasticBeamColumn', 21, 15, 16, 20.1, 29000.0, 1830.0, 1) # W24X68
# Define loads for Gravity Analysis
# ---------------------------------
# Create a Linear TimeSeries (load factor varies linearly with time)
# command: timeSeries('Linear', tag)
ops.timeSeries('Linear', 1)
# Create a Plain load pattern with the Linear TimeSeries
# command: pattern('Plain', tag, timeSeriesTag)
ops.pattern('Plain', 1, 1)
ops.eleLoad('-ele', 13, 14, 15, '-type', '-beamUniform', -w1)
ops.eleLoad('-ele', 16, 17, 18, '-type', '-beamUniform', -w2)
ops.eleLoad('-ele', 19, 20, 21, '-type', '-beamUniform', -w3)
4.1.2.4. Analysis - Gravity Load
We now show the commands to perform the gravity load analysis. A single step of LoadControl is used to get us to the desired load level. Although the elements are elastic, the PDelta transformation on the columns makes the response geometrically nonlinear, so a Newton algorithm with a NormDispIncr convergence test is used. The equations are formed using a banded system, so the System is BandSPD. The equations are numbered using the RCM (Reverse Cuthill-McKee) numberer, and the constraints are represented with a Plain constraint handler.
# Create the system of equation, a SPD using a band storage scheme
system BandSPD
# Create the DOF numberer, the reverse Cuthill-McKee algorithm
numberer RCM
# Create the constraint handler, a Plain handler is used as homo constraints
constraints Plain
# Create the integration scheme, the LoadControl scheme using steps of 1.0
integrator LoadControl 1.0
# Create the convergence test and the solution algorithm, a Newton algorithm
test NormDispIncr 1.0e-10 6
algorithm Newton
# create the analysis object
analysis Static
# Create the system of equation, a SPD using a band storage scheme
ops.system('BandSPD')
# Create the DOF numberer, the reverse Cuthill-McKee algorithm
ops.numberer('RCM')
# Create the constraint handler, a Plain handler is used as homo constraints
ops.constraints('Plain')
# Create the integration scheme, the LoadControl scheme using steps of 1.0
ops.integrator('LoadControl', 1.0)
# Create the convergence test and the solution algorithm, a Newton algorithm
ops.test('NormDispIncr', 1.0e-10, 6)
ops.algorithm('Newton')
# create the analysis object
ops.analysis('Static')
4.1.2.5. Perform the Gravity Analysis
After the objects for the model and analysis have been defined we now perform the analysis.
analyze 1
ops.analyze(1)
4.1.2.6. Print Information to Screen to Check Results
In addition to using recorders, it is possible to print output to the screen: in Tcl using the print and puts commands, in Python using printModel and the Python print function. We use the reactions command to have the domain compute the nodal reactions and the nodeReaction command to return the reactions at the individual nodes as a list. The values are then obtained from these lists, using the lindex command in Tcl and indexing in Python.
# invoke command to determine nodal reactions
reactions
set node1Rxn [nodeReaction 1]; # nodeReaction command returns nodal reactions for specified node in a list
set node2Rxn [nodeReaction 2]
set node3Rxn [nodeReaction 3]
set node4Rxn [nodeReaction 4]
set inputedFy [expr -$Load1-$Load2-$Load3]; # loads added in negative Fy direction to ele
set computedFx [expr [lindex $node1Rxn 0]+[lindex $node2Rxn 0]+[lindex $node3Rxn 0]+[lindex $node4Rxn 0]]
set computedFy [expr [lindex $node1Rxn 1]+[lindex $node2Rxn 1]+[lindex $node3Rxn 1]+[lindex $node4Rxn 1]]
puts "\nEqilibrium Check After Gravity:"
puts "SumX: Inputed: 0.0 + Computed: $computedFx = [expr 0.0+$computedFx]"
puts "SumY: Inputed: $inputedFy + Computed: $computedFy = [expr $inputedFy+$computedFy]"
# invoke command to determine nodal reactions
ops.reactions()
# nodeReaction command returns nodal reactions for specified node in a list
rxns = [ops.nodeReaction(nd) for nd in (1, 2, 3, 4)]
inputedFy = -Load1 - Load2 - Load3 # loads added in negative Fy direction to ele
computedFx = sum(r[0] for r in rxns)
computedFy = sum(r[1] for r in rxns)
print('\nEqilibrium Check After Gravity:')
print(f'SumX: Inputed: 0.0 + Computed: {computedFx} = {0.0 + computedFx}')
print(f'SumY: Inputed: {inputedFy} + Computed: {computedFy} = {inputedFy + computedFy}')
4.1.2.7. Add Lateral Loads
Now we prepare to add the lateral loads to the model. First we set the gravity loads constant, i.e. we do not want them changing as we apply more loads to the model. Then we create a second load pattern with nodal loads.
# set gravity loads constant and time in domain to 0.0
loadConst -time 0.0
timeSeries Linear 2
pattern Plain 2 2 {
load 13 220.0 0.0 0.0
load 9 180.0 0.0 0.0
load 5 90.0 0.0 0.0
}
# set gravity loads constant and time in domain to 0.0
ops.loadConst('-time', 0.0)
ops.timeSeries('Linear', 2)
ops.pattern('Plain', 2, 2)
ops.load(13, 220.0, 0.0, 0.0)
ops.load(9, 180.0, 0.0, 0.0)
ops.load(5, 90.0, 0.0, 0.0)
4.1.2.8. Output Specification
We create an element recorder to record the forces in the bottom story columns.
recorder Element -file EleForces.out -ele 1 4 7 10 forces
ops.recorder('Element', '-file', 'EleForces.out', '-ele', 1, 4, 7, 10, 'forces')
4.1.2.9. Perform the Lateral Load Analysis
analyze 1
ops.analyze(1)
4.1.2.10. Print Information to Screen to Check Results
reactions
set node1Rxn [nodeReaction 1]
set node2Rxn [nodeReaction 2]
set node3Rxn [nodeReaction 3]
set node4Rxn [nodeReaction 4]
set inputedFx [expr 220.0+180.0+90.0]
set computedFx [expr [lindex $node1Rxn 0]+[lindex $node2Rxn 0]+[lindex $node3Rxn 0]+[lindex $node4Rxn 0]]
set computedFy [expr [lindex $node1Rxn 1]+[lindex $node2Rxn 1]+[lindex $node3Rxn 1]+[lindex $node4Rxn 1]]
puts "\nEqilibrium Check After Lateral Loads:"
puts "SumX: Inputed: $inputedFx + Computed: $computedFx = [expr $inputedFx+$computedFx]"
puts "SumY: Inputed: $inputedFy + Computed: $computedFy = [expr $inputedFy+$computedFy]"
# print ele information for columns at base
print ele 1 4 7 10
ops.reactions()
rxns = [ops.nodeReaction(nd) for nd in (1, 2, 3, 4)]
inputedFx = 220.0 + 180.0 + 90.0
computedFx = sum(r[0] for r in rxns)
computedFy = sum(r[1] for r in rxns)
print('\nEqilibrium Check After Lateral Loads:')
print(f'SumX: Inputed: {inputedFx} + Computed: {computedFx} = {inputedFx + computedFx}')
print(f'SumY: Inputed: {inputedFy} + Computed: {computedFy} = {inputedFy + computedFy}')
# print ele information for columns at base
ops.printModel('-ele', 1, 4, 7, 10)
4.1.2.11. Results
When you run the script, you should see the following printed to the screen:
OpenSees -- Open System For Earthquake Engineering Simulation
Pacific Earthquake Engineering Research Center
Version 3.8.1 64-Bit (8e63ec6792e4387e4a9836d3c89caf68148ff963)
(c) Copyright 1999-2016 The Regents of the University of California
All Rights Reserved
(Copyright and Disclaimer @ http://www.berkeley.edu/OpenSees/copyright.html)
Eqilibrium Check After Gravity:
SumX: Inputed: 0.0 + Computed: -2.1316282072803006e-14 = -2.1316282072803006e-14
SumY: Inputed: -3340.0 + Computed: 3340.0000000000005 = 4.547473508864641e-13
Eqilibrium Check After Lateral Loads:
SumX: Inputed: 490.0 + Computed: -489.9999999999999 = 1.1368683772161603e-13
SumY: Inputed: -3340.0 + Computed: 3340.0000000000005 = 4.547473508864641e-13
ElasticBeam2d: 1
Connected Nodes: 1 5
CoordTransf: 2
mass density: 0, cMass: 0
alpha: 0, depth: 0
release code: 0
End 1 Forces (P V M): 401.845 65.7665 8971.03
End 2 Forces (P V M): -401.845 -65.7665 1683.13
ElasticBeam2d: 4
Connected Nodes: 2 6
CoordTransf: 2
mass density: 0, cMass: 0
alpha: 0, depth: 0
release code: 0
End 1 Forces (P V M): 1151.99 155.983 15200.9
End 2 Forces (P V M): -1151.99 -155.983 10068.3
ElasticBeam2d: 7
Connected Nodes: 3 7
CoordTransf: 2
mass density: 0, cMass: 0
alpha: 0, depth: 0
release code: 0
End 1 Forces (P V M): 1129.67 146.725 14638.1
End 2 Forces (P V M): -1129.67 -146.725 9131.38
ElasticBeam2d: 10
Connected Nodes: 4 8
CoordTransf: 2
mass density: 0, cMass: 0
alpha: 0, depth: 0
release code: 0
End 1 Forces (P V M): 656.494 136.088 12620.2
End 2 Forces (P V M): -656.494 -136.088 9426.02
Eqilibrium Check After Gravity:
SumX: Inputed: 0.0 + Computed: -1.9095836023552692e-14 = -1.9095836023552692e-14
SumY: Inputed: -3340.0 + Computed: 3340.0000000000005 = 4.547473508864641e-13
Eqilibrium Check After Lateral Loads:
SumX: Inputed: 490.0 + Computed: -489.9999999999999 = 1.1368683772161603e-13
SumY: Inputed: -3340.0 + Computed: 3340.0000000000005 = 4.547473508864641e-13
ElasticBeam2d: 1
Connected Nodes: 1 5
CoordTransf: 2
mass density: 0, cMass: 0
release code: 0
End 1 Forces (P V M): 401.845 65.7665 8971.03
End 2 Forces (P V M): -401.845 -65.7665 1683.13
ElasticBeam2d: 4
Connected Nodes: 2 6
CoordTransf: 2
mass density: 0, cMass: 0
release code: 0
End 1 Forces (P V M): 1151.99 155.983 15200.9
End 2 Forces (P V M): -1151.99 -155.983 10068.3
ElasticBeam2d: 7
Connected Nodes: 3 7
CoordTransf: 2
mass density: 0, cMass: 0
release code: 0
End 1 Forces (P V M): 1129.67 146.725 14638.1
End 2 Forces (P V M): -1129.67 -146.725 9131.38
ElasticBeam2d: 10
Connected Nodes: 4 8
CoordTransf: 2
mass density: 0, cMass: 0
release code: 0
End 1 Forces (P V M): 656.494 136.088 12620.2
End 2 Forces (P V M): -656.494 -136.088 9426.02