Code: Select all
# =============================================================================
# III. MATERIAL DEFINITIONS
# =============================================================================
# Materials -----
# 1: Cover Concrete (Unconfined)
ops.uniaxialMaterial('Concrete01', 1, -fpcu*1e6, -epsc0, 0, -epsU)
# 2: Core Concrete (Confined)
ops.uniaxialMaterial('Concrete01', 2, -fpcc*1e6, -eps_cc, -fcu*1e6, -ecu)
# 3: Reinforcing Steel
ops.uniaxialMaterial('ReinforcingSteel', 3, fyBars*1e6, fuBars*1e6, Es*1e6,
Esh*1e6, eps_sh, eps_ult, '-CMFatigue', cf, alpha,
cd,'-MPCurveParams', R1, R2, R3)
print('Materials and Element Properties Done!'); print('\n')
# =============================================================================
# IV. DOF AND NODES
# =============================================================================
# Model Bulder -----
ops.model("basic","-ndm", 2,"-ndf", 3)
# Create Nodes -----
ops.node(1, 0.0, 0.0)
ops.node(2, 0.0, LCol/1000)
# Add Mass -----
mass = SS_W*1000/(g/1000)
ops.mass(2, *[mass, mass, 0])
# Constraints -----
ops.fix(1,*[1,1,1])
print('Nodal Coords., Boundary Cond., and Mass Done!'); print('\n')
# =============================================================================
# V. SECTION AND ELEMENTS
# =============================================================================
# Section Definition -----
ops.section('Fiber', 1)
# 1: Patches
# A: Cover Concrete
ops.patch('circ', 1, 3, 40, *[0 , 0], *[Ds/(2*1000), DCol/(2*1000)], *[0, 360])
# B: Core Concrete
ops.patch('circ', 2, 20, 40, *[0 , 0], *[0 , Ds/(2*1000)], *[0, 360])
# C: Reinforcing Steel (using layer)
rBars = Ds/2-0.5*DHoops-0.5*DBars # Radius to center of long rebar
theta = 360.0/NumBars # Angle increments to long rebar
ops.layer('circ', 3, NumBars, ABars/1000**2, *[0.0 ,0.0], rBars/1000, *[10, 350])
# Coordinates of rebars ----
xBar = np.zeros([NumBars]) # array with x-coord of rebars
yBar = np.zeros([NumBars]) # array with y-coord of rebars
for i in range(NumBars):
xBar[i], yBar[i] = [rBars/1000*np.cos((10+i*theta)*np.pi/180),rBars/1000*np.sin((10+i*theta)*np.pi/180)]
# Geometric Transformation ----
ops.geomTransf('PDelta', 1)
# Beam Integration -----
ops.beamIntegration('HingeRadau', 1, 1, (Lp/1000), 1, 0, 1)
# Element Definition
ops.element('forceBeamColumn', 1, *[1, 2], 1, 1)
print('Section and Element Generation Done!'); print('\n')
# =============================================================================
# VI. GRAVITY ANALYSIS
# =============================================================================
# Define Gravity ----
ops.timeSeries('Linear', 1)
ops.pattern('Plain', 1, 1)
ops.load(2, *[0, -SS_W*1000, 0])
# Parameters (Load Controlled Static Analysis)
ops.constraints('Plain')
ops.numberer('Plain')
ops.system('BandGeneral')
ops.test('NormDispIncr',1e-10, 6)
ops.algorithm("Newton")
ops.integrator('LoadControl', 1/10)
ops.analysis("Static")
ops.analyze(10)
ops.loadConst('-time', 0.0)
ops.wipeAnalysis()
print('Gravity Analysis Done!'); print('\n');
print('Model Built!'); print('\n'); print('\n');
I get these: [-2756711.363215994, -8.805447541750114e-05]
Now when I try the 3d...
Code: Select all
# =============================================================================
# III. MATERIAL DEFINITIONS
# =============================================================================
# Materials -----
# 1: Cover Concrete (Unconfined)
ops.uniaxialMaterial('Concrete01', 1, -fpcu*1e6, -epsc0, 0, -epsU)
# 2: Core Concrete (Confined)
ops.uniaxialMaterial('Concrete01', 2, -fpcc*1e6, -eps_cc, -fcu*1e6, -ecu)
# 3: Reinforcing Steel
ops.uniaxialMaterial('ReinforcingSteel', 3, fyBars*1e6, fuBars*1e6, Es*1e6,
Esh*1e6, eps_sh, eps_ult, '-CMFatigue', cf, alpha,
cd,'-MPCurveParams', R1, R2, R3)
print('Materials and Element Properties Done!'); print('\n')
# =============================================================================
# IV. DOF AND NODES
# =============================================================================
# Model Bulder -----
ops.model("basic","-ndm", 3,"-ndf", 6)
# Create Nodes -----
ops.node(1, 0.0, 0.0, 0.0)
ops.node(2, 0.0, LCol/1000, 0.0)
# Add Mass -----
mass = SS_W*1000/(g/1000)
ops.mass(2, *[mass, 0.0, mass])
# Constraints -----
ops.fix(1,*[1,1,1,1,1,1])
print('Nodal Coords., Boundary Cond., and Mass Done!'); print('\n')
# =============================================================================
# V. SECTION AND ELEMENTS
# =============================================================================
# Section Definition -----
ops.section('Fiber', 1, '-GJ', 1e100)
# 1: Patches
# A: Cover Concrete
ops.patch('circ', 1, 3, 40, *[0 , 0], *[Ds/(2*1000), DCol/(2*1000)], *[0, 360])
# B: Core Concrete
ops.patch('circ', 2, 20, 40, *[0 , 0], *[0 , Ds/(2*1000)], *[0, 360])
# C: Reinforcing Steel
rBars = Ds/2-0.5*DHoops-0.5*DBars # Radius to center of long. rebar
theta = 360.0/NumBars # Angle increments to long. rebar
ops.layer('circ', 3, NumBars, ABars/1000**2, *[0.0 ,0.0], rBars/1000, *[10, 350])
# Coordinates of rebars (for later use) ----
xBar = np.zeros([NumBars]) # array with x-coord of rebars
yBar = np.zeros([NumBars]) # array with y-coord of rebars
for i in range(NumBars):
xBar[i], yBar[i] = [rBars/1000*np.cos((10+i*theta)*np.pi/180),
rBars/1000*np.sin((10+i*theta)*np.pi/180)]
# Geometric Transformation ----
ops.geomTransf('PDelta', 1, *[0, 0 , 1])
# Beam Integration -----
ops.beamIntegration('HingeRadau', 1, 1, (Lp/1000), 1, 0, 1)
# Element Definition
ops.element('forceBeamColumn', 1, *[1, 2], 1, 1)
print('Section and Element Generation Done!'); print('\n')
# =============================================================================
# VI. GRAVITY ANALYSIS
# =============================================================================
# Define Gravity ----
ops.timeSeries('Linear', 1)
ops.pattern('Plain', 1, 1)
ops.load(2, *[0.0, -SS_W*1000, 0.0, 0.0, 0.0, 0.0])
# Parameters (Load Controlled Static Analysis)
ops.constraints('Plain')
ops.numberer('Plain')
ops.system('BandGeneral')
ops.test('NormDispIncr',1e-10, 6)
ops.algorithm("Newton")
ops.integrator('LoadControl', 1/10)
ops.analysis("Static")
ops.analyze(10)
ops.loadConst('-time', 0.0)
ops.wipeAnalysis()
print('Gravity Analysis Done!'); print('\n');
print('Model Built!'); print('\n'); print('\n');
# Beam Integration -----
ops.beamIntegration('HingeRadau', 1, 1, (Lp/1000), 1, 0, 1)
# Element Definition
ops.element('forceBeamColumn', 1, *[1, 2], 1, 1)
print('Section and Element Generation Done!'); print('\n')
ops.recorder('Element', '-file', 'ForcaeColSec12.out','-time', '-ele', 1, 'section', 1, 'force')
# =============================================================================
# VI. GRAVITY ANALYSIS
# =============================================================================
# Define Gravity ----
ops.timeSeries('Linear', 1)
ops.pattern('Plain', 1, 1)
ops.load(2, *[0.0, -SS_W*1000, 0.0, 0.0, 0.0, 0.0])
# Parameters (Load Controlled Static Analysis)
ops.constraints('Plain')
ops.numberer('Plain')
ops.system('BandGeneral')
ops.test('NormDispIncr',1e-10, 6)
ops.algorithm("Newton")
ops.integrator('LoadControl', 1/10)
ops.analysis("Static")
ops.analyze(10)
ops.loadConst('-time', 0.0)
ops.wipeAnalysis()
print('Gravity Analysis Done!'); print('\n');
print('Model Built!'); print('\n'); print('\n');
ops.eleResponse(1, '-section','1', '-fiber','-.6095','0','1','stressStrain')