Portal 2D Frame - Dynamic EQ Ground MotionΒΆ

Converted to openseespy by: Pavan Chigullapally
                      University of Auckland
                      Email: pchi893@aucklanduni.ac.nz
  1. This is a simple model of an elastic portal frame with EQ ground motion and gravity loading. Here the structure is excited using uniform excitation load pattern

  2. All units are in kip, inch, second

  3. To run EQ ground-motion analysis, BM68elc.acc needs to be downloaded into the same directory)

  4. The source code is shown below, which can be downloaded here.

  5. The detailed problem description can be found here (example: 1b)

  1# -*- coding: utf-8 -*-
  2"""
  3Created on Mon Apr 22 17:29:26 2019
  4
  5@author: pchi893
  6"""
  7# Converted to openseespy by: Pavan Chigullapally       
  8#                         University of Auckland  
  9#                         Email: pchi893@aucklanduni.ac.nz 
 10# Example 1b. portal frame in 2D
 11#This is a simple model of an elastic portal frame with EQ ground motion and gravity loading. Here the structure is excited using uniform excitation load pattern
 12# all units are in kip, inch, second
 13#To run EQ ground-motion analysis (BM68elc.acc needs to be downloaded into the same directory).
 14#the detailed problem description can be found here: http://opensees.berkeley.edu/wiki/index.php/Examples_Manual  (example: 1b)
 15# --------------------------------------------------------------------------------------------------
 16# elasticBeamColumn ELEMENT
 17#	OpenSees (Tcl) code by:	Silvia Mazzoni & Frank McKenna, 2006
 18
 19#
 20#    ^Y
 21#    |
 22#    3_________(3)________4       __ 
 23#    |                                    |          | 
 24#    |                                    |          |
 25#    |                                    |          |
 26#  (1)                                 (2)       LCol
 27#    |                                    |          |
 28#    |                                    |          |
 29#    |                                    |          |
 30#  =1=                               =2=      _|_  -------->X
 31#    |----------LBeam------------|
 32#
 33
 34# SET UP -----------------------------------------------------------------------------
 35
 36import openseespy.opensees as op
 37#import the os module
 38import os
 39op.wipe()
 40
 41#########################################################################################################################################################################
 42
 43#########################################################################################################################################################################
 44op.model('basic', '-ndm', 2, '-ndf', 3) 
 45
 46#to create a directory at specified path with name "Data"
 47#os.chdir('C:\\Opensees Python\\OpenseesPy examples')
 48
 49#this will create the directory with name 'Data' and will update it when we rerun the analysis, otherwise we have to keep deleting the old 'Data' Folder
 50dir = "Data-1b"
 51if not os.path.exists(dir):
 52    os.makedirs(dir)
 53
 54#this will create just 'Data' folder    
 55#os.mkdir("Data-1b")
 56    
 57#detect the current working directory
 58#path1 = os.getcwd()
 59#print(path1)
 60
 61h = 432.0
 62w  =  504.0
 63
 64op.node(1, 0.0, 0.0)
 65op.node(2, h, 0.0)
 66op.node(3, 0.0, w)
 67op.node(4, h, w)
 68
 69op.fix(1, 1,1,1)
 70op.fix(2, 1,1,1)
 71op.fix(3, 0,0,0)
 72op.fix(4, 0,0,0)
 73
 74op.mass(3, 5.18, 0.0, 0.0)
 75op.mass(4, 5.18, 0.0, 0.0)  
 76
 77op.geomTransf('Linear', 1)
 78A = 3600000000.0
 79E = 4227.0
 80Iz = 1080000.0
 81
 82A1 = 5760000000.0
 83Iz1 = 4423680.0
 84op.element('elasticBeamColumn', 1, 1, 3, A, E, Iz, 1)
 85op.element('elasticBeamColumn', 2, 2, 4, A, E, Iz, 1)
 86op.element('elasticBeamColumn', 3, 3, 4, A1, E, Iz1, 1)
 87
 88op.recorder('Node', '-file', 'Data-1b/DFree.out','-time', '-node', 3,4, '-dof', 1,2,3, 'disp')
 89op.recorder('Node', '-file', 'Data-1b/DBase.out','-time', '-node', 1,2, '-dof', 1,2,3, 'disp')
 90op.recorder('Node', '-file', 'Data-1b/RBase.out','-time', '-node', 1,2, '-dof', 1,2,3, 'reaction')
 91#op.recorder('Drift', '-file', 'Data-1b/Drift.out','-time', '-node', 1, '-dof', 1,2,3, 'disp')
 92op.recorder('Element', '-file', 'Data-1b/FCol.out','-time', '-ele', 1,2, 'globalForce')
 93op.recorder('Element', '-file', 'Data-1b/DCol.out','-time', '-ele', 3, 'deformations')
 94
 95#defining gravity loads
 96op.timeSeries('Linear', 1)
 97op.pattern('Plain', 1, 1)
 98op.eleLoad('-ele', 3, '-type', '-beamUniform', -7.94)
 99
100op.constraints('Plain')
101op.numberer('Plain')
102op.system('BandGeneral')
103op.test('NormDispIncr', 1e-8, 6)
104op.algorithm('Newton')
105op.integrator('LoadControl', 0.1)
106op.analysis('Static')
107op.analyze(10)
108    
109op.loadConst('-time', 0.0)
110
111#applying Dynamic Ground motion analysis
112op.timeSeries('Path', 2, '-dt', 0.01, '-filePath', 'BM68elc.acc', '-factor', 1.0)
113op.pattern('UniformExcitation', 2, 1, '-accel', 2) #how to give accelseriesTag?
114
115eigen = op. eigen('-fullGenLapack', 1)
116import math
117power = math.pow(eigen[0], 0.5)
118betaKcomm = 2 * (0.02/power)
119
120op.rayleigh(0.0, 0.0, 0.0, betaKcomm)
121
122op.wipeAnalysis()
123op.constraints('Plain')
124op.numberer('Plain')
125op.system('BandGeneral')
126op.test('NormDispIncr', 1e-8, 10)
127op.algorithm('Newton')
128op.integrator('Newmark', 0.5, 0.25)
129op.analysis('Transient')
130op.analyze(1000, 0.02)
131
132u3 = op.nodeDisp(3, 1)
133print("u2 = ", u3)
134
135op.wipe()