When I use truss, the result is weird. But when truss element is changed to elastic beam, there is no such probelem. How can I get the correct output on the truss element. Thank you in advance.
Code: Select all
import vfo.vfo as vfo
from openseespy.opensees import *
import numpy as np
from math import asin, sqrt
# units
N = 1;sec = 1;m = 1;m2 = m*m;m3 = m**3
kg = 1;pa = N /m2;Gpa = 1e9*pa
#properties
L = 0.4
H = 0.4
W = 0.4
#material
Density = 2700*kg/m3
E=69.5*Gpa
#
wipe()
model('Basic','-ndm',3,'-ndf',3)
for i in range(9):
node(i+1,float(i*L),0,W)
node(i+10,float(i*L),0,0)
for i in range(7):
node(i+19,float((i+1)*L),H,W)
node(i+26,float((i+1)*L),H,0)
#
fix(1, 1, 1,1,1,1,1)
fix(9, 1, 1,1,1,1,1)
fix(10, 1, 1,1,1,1,1)
fix(18, 1, 1,1,1,1,1)
#
mass(1, 3.47, 3.47, 3.47, 1.0e-10, 1.0e-10, 1.0e-10)
mass(2, 8.3, 8.3, 8.3, 1.0e-10, 1.0e-10, 1.0e-10)
mass(3, 5.4, 5.4, 5.4, 1.0e-10, 1.0e-10, 1.0e-10)
mass(4, 8.3, 8.3, 8.3, 1.0e-10, 1.0e-10, 1.0e-10)
mass(5,4 , 4, 8.3, 1.0e-10, 1.0e-10, 1.0e-10)
mass(6, 8.3, 8.3, 8.3, 1.0e-10, 1.0e-10, 1.0e-10)
mass(7, 5.4, 5.4, 8.3, 1.0e-10, 1.0e-10, 1.0e-10)
mass(8, 8.3, 8.3, 8.3, 1.0e-10, 1.0e-10, 1.0e-10)
mass(9, 3.47, 3.47, 8.3, 1.0e-10, 1.0e-10, 1.0e-10)
mass(10, 8.3, 8.3, 8.3, 1.0e-10, 1.0e-10, 1.0e-10)
mass(11, 5.4, 5.4, 8.3, 1.0e-10, 1.0e-10, 1.0e-10)
mass(12, 8.3, 8.3, 8.3, 1.0e-10, 1.0e-10, 1.0e-10)
mass(13, 5.4, 5.4, 8.3, 1.0e-10, 1.0e-10, 1.0e-10)
mass(14, 8.3, 8.3,8.3, 1.0e-10, 1.0e-10, 1.0e-10)
mass(15, 5.4, 5.4, 8.3, 1.0e-10, 1.0e-10, 1.0e-10)
mass(16, 8.3, 8.3,8.3, 1.0e-10, 1.0e-10, 1.0e-10)
mass(17, 5.4, 5.4, 8.3, 1.0e-10, 1.0e-10, 1.0e-10)
mass(18, 5.4, 5.4, 8.3, 1.0e-10, 1.0e-10, 1.0e-10)
mass(19, 5.4, 5.4, 8.3, 1.0e-10, 1.0e-10, 1.0e-10)
mass(20, 3.47, 3.47, 8.3, 1.0e-10, 1.0e-10, 1.0e-10)
mass(21, 5.4, 5.4, 8.3, 1.0e-10, 1.0e-10, 1.0e-10)
mass(22, 6, 6, 8.3, 1.0e-10, 1.0e-10, 1.0e-10)
mass(23, 7, 7, 8.3, 1.0e-10, 1.0e-10, 1.0e-10)
mass(24, 5, 5, 8.3, 1.0e-10, 1.0e-10, 1.0e-10)
mass(25, 5, 5, 8.3, 1.0e-10, 1.0e-10, 1.0e-10)
mass(26, 5, 5, 8.3, 1.0e-10, 1.0e-10, 1.0e-10)
mass(27, 7 ,7, 8.3, 1.0e-10, 1.0e-10, 1.0e-10)
mass(28, 5, 5, 8.3, 1.0e-10, 1.0e-10, 1.0e-10)
mass(29, 7, 7, 8.3, 1.0e-10, 1.0e-10, 1.0e-10)
mass(30, 5,5, 8.3, 1.0e-10, 1.0e-10, 1.0e-10)
mass(31, 7, 7, 8.3, 1.0e-10, 1.0e-10, 1.0e-10)
mass(32, 5, 5, 8.3, 1.0e-10, 1.0e-10, 1.0e-10)
#
ops.uniaxialMaterial("Elastic", 1, E)
A = 1.88e-3
#
element('Truss',1,1,2,A, 1)
element('Truss',2, 2,3,A,1,)
element('Truss', 3, 3,4,A,1)
element('Truss',4, 4,5,A,1,)
element('Truss',5, 5,6,A,1,)
element('Truss',6, 6,7,A,1,)
element('Truss',7, 7,8,A,1,)
element('Truss',8, 8,9,A,1,)
element('Truss',9, 10,11,A,1)
element('Truss',10,11,12,A,1)
element('Truss',11,12,13,A,1)
element('Truss',12,13,14,A,1)
element('Truss',13,14,15,A,1)
element('Truss',14,15,16,A,1)
element('Truss',15,16,17,A,1)
element('Truss',16,17,18,A,1)
element('Truss',17,19,20,A, 1)
element('Truss', 18,20,21,A, 1)
element('Truss',19,21,22,A, 1)
element('Truss',20,22,23,A, 1)
element('Truss',21,23,24,A, 1)
element('Truss',22,24,25,A, 1)
element('Truss',23,26,27,A, 1)
element('Truss', 24,27,28,A,1)
element('Truss',25,28,29,A, 1)
element('Truss',26,29,30,A,1)
element('Truss',27,30,31,A,1)
element('Truss',28,31,32,A,1)
element('Truss',29,2,19,A, 1)
element('Truss',30,3,20,A, 1)
element('Truss',31,4,21,A, 1)
element('Truss',32,5,22,A, 1)
element('Truss',33,6,23,A, 1)
element('Truss',34,7,24,A, 1)
element('Truss',35,8,25,A, 1)
element('Truss',36,11,26,A,1)
element('Truss',37,12,27,A,1)
element('Truss',38,13,28,A,1)
element('Truss',39,14,29,A,1)
element('Truss',40,15,30,A,1)
element('Truss',41,16,31,A,1)
element('Truss',42,17,32,A,1)
element('Truss',43,1,19,A, 1)
element('Truss',44,2,20,A, 1)
element('Truss',45,3,21,A, 1)
element('Truss',46,4,22,A, 1)
element('Truss',47,6,22,A, 1)
element('Truss',48,7,23,A, 1)
element('Truss',49,8,24,A, 1)
element('Truss',50,9,25,A, 1)
element('Truss',51,10,26,A,1)
element('Truss',52,11,27,A,1)
element('Truss',53,12,28,A, 1)
element('Truss',54,13,29,A, 1)
element('Truss',55,15,29,A, 1)
element('Truss',56,16,30,A, 1)
element('Truss',57,17,31,A, 1)
element('Truss',58,18,32,A, 1)
element('Truss',59,1,10,A, 1)
element('Truss',60,2,11,A, 1)
element('Truss',61,3,12,A, 1)
element('Truss',62,4,13,A, 1)
element('Truss',63,5,14,A, 1)
element('Truss',64,6,15,A, 1)
element('Truss',65,7,16,A, 1)
element('Truss',66,8,17,A, 1)
element('Truss',67,9,18,A, 1)
element('Truss',68,2,10,A, 1)
element('Truss',69,2,12,A, 1)
element('Truss',70,4,12,A, 1)
element('Truss',71,4,14,A, 1)
element('Truss',72,6,14,A, 1)
element('Truss',73,6,16,A, 1)
element('Truss',74,8,16,A, 1)
element('Truss',75,8,18,A, 1)
element('Truss',76,19,26,A, 1)
element('Truss',77,20,27,A, 1)
element('Truss',78,21,28,A, 1)
element('Truss',79,22,29,A, 1)
element('Truss',80,23,30,A, 1)
element('Truss',81,24,31,A, 1)
element('Truss',82,25,32,A, 1)
element('Truss',83,19,27,A, 1)
element('Truss',84,27,21,A, 1)
element('Truss',85,21,29,A, 1)
element('Truss',86,29,23,A, 1)
element('Truss',87,23,31,A, 1)
element('Truss',88,31,25,A, 1)
element('Truss',89,10,25,A,1)
eigenvalues = eigen('-fullGenLapack',5)
G = 1
filepath = '../whitenoiseAcceleration_10.dat'
dtAccFile=0.02 # 50 Hz
nPtsAccFile=15001
ops.timeSeries('Path', 2, '-dt', dtAccFile, '-filePath', filepath, '-factor',G)
ops.pattern('MultipleSupport', 1)
ops.groundMotion(1,'Plain','-accel',2)
ops.imposedMotion(1, 1, 1)
#
Omega = eigenvalues[0]**0.5
betaKcomm = 2 * (0.02/Omega)
xDamp = 0.05
alphaM = 0.0
betaKcurr = 0.0
betaKinit = 0.0
ops.rayleigh(0,0,0,betaKcomm)
#
recorder('Node', '-file', 'nodes_B.txt', '-time', '-dT', 0.002, '-node',4,5,6, '-dof',1, 'accel')
#
ops.wipeAnalysis()
ops.constraints('Transformation')
ops.numberer('Plain')
ops.system('BandGeneral')
ops.test('EnergyIncr', 1.0e-12, 200 )
ops.algorithm('Newton')
ops.integrator('Newmark', 0.5, 0.25)
ops.analysis('Transient')
ops.analyze(100000, 0.002)
Truss output
Elasticbeam output