Viscous damper under sinusoidal displacement

Forum for asking and answering questions related to use of the OpenSeesPy module

Moderators: silvia, selimgunay, Moderators

Post Reply
toopchi
Posts: 3
Joined: Mon Aug 18, 2014 4:26 am
Location: Razi

Viscous damper under sinusoidal displacement

Post by toopchi »

Dear friends,
I am trying to simulate a viscous damper's experimental load-displacement hysteresis loops. The damper is subjected to a sinusoidal displacement with a given amplitude and frequency. I have written the following code. However, I am unsure what is wrong with it as the analysis is not performed and I don't get any result. It is interesting that the program doesn't show any error or warning too. I appreciate your help.

wipe()
model('basic', '-ndm', 3, '-ndf', 6)

print("node")
node(1, 0, 0, 0)
node(2, 1, 0, 0)
fix(1, 1, 1, 1, 1, 1, 1)
fix(2, 0, 1, 1, 1, 1, 1)

print("element")
K = 500.0
Cd = 200.0
alpha = 1.0
uniaxialMaterial('ViscousDamper', 1, K, Cd, alpha)
element('twoNodeLink', 1, 1, 2, '-mat', 1, '-dir', 1)

print("recorder")
recorder('Node', '-file', 'node2_disp.out', '-time', '-node', 2, '-dof', 1, 'disp')
recorder('Node', '-file', 'node2_vel.out', '-time', '-node', 2, '-dof', 1, 'vel')
recorder('Element', '-file', 'ele1_f.out', '-time', '-ele', 1, '-dof', 1, 'force')

print("timeseries")
#timeSeries('Trig', tag, tStart, tEnd, period, '-factor', factor=1.0, '-shift', shift=0.0, '-zeroShift', zeroShift=0.0)
timeSeries('Trig', 1, 0, 10, 2)

print("load")
pattern('MultipleSupport', 1)
groundMotion(1,'Plain', '-disp',1)
# imposedMotion(nodeTag, dof, gmTag)
imposedMotion (2, 1, 1)

print("Dynamic Analysis Parameters")
DtAnalysis = 0.01 # time-step Dt in Sec.
constraints('Transformation')
numberer('RCM')
system('BandSPD')
test('RelativeNormDispIncr', 0.005, 20)
algorithm('Newton')
integrator('Newmark', 0.5, 0.25)
analysis('Transient')

y = nodeDisp(2)
print(y)
X= nodeVel(2)
print(X)
analyze(1000,0.01)
mhscott
Posts: 880
Joined: Tue Jul 06, 2004 3:38 pm
Location: Corvallis, Oregon USA
Contact:

Re: Viscous damper under sinusoidal displacement

Post by mhscott »

Print the nodal response after the analyze command
toopchi
Posts: 3
Joined: Mon Aug 18, 2014 4:26 am
Location: Razi

Re: Viscous damper under sinusoidal displacement

Post by toopchi »

Dear mhscoth

Thanks for your reply. I fixed that, however, I got the following warning that seems to be serious as it won't let the program continue.

WARNING TwoNodeLink::setUp() - element: 1
no local y vector specified

Any comments?
toopchi
Posts: 3
Joined: Mon Aug 18, 2014 4:26 am
Location: Razi

Re: Viscous damper under sinusoidal displacement

Post by toopchi »

I reduced the dimension of the problem in a 2D space and changed the type of "constraints" and "system" and it worked. I can run the model now and get some outputs. However, the nodal response at node 2 (the free end of the element) shows zero displacements, whereas I imposed sinusoidal displacement, velocity, and acceleration on that node. This problem does not apply to the velocity and acceleration outputs as they perfectly match with what I imposed on node 2. Any idea what could be wrong with the following code?

wipe()
model('basic', '-ndm', 2, '-ndf', 3)

print("node")
node(1, 0, 0)
node(2, 1, 0)
fix(1, 1, 1, 1,)
fix(2, 0, 1, 1)

print("element")
K = 500.0
Cd = 200.0
alpha = 1.0
uniaxialMaterial('ViscousDamper', 1, K, Cd, alpha)
element('twoNodeLink', 1, 1, 2, '-mat', 1, '-dir', 1)

print("recorder")
recorder('Node', '-file', 'node2_disp.out', '-time', '-node', 2, '-dof', 1, 'disp')
recorder('Node', '-file', 'node2_vel.out', '-time', '-node', 2, '-dof', 1, 'vel')
recorder('Element', '-file', 'ele1_f.out', '-time', '-ele', 1, '-dof', 1, 'force')

print("timeseries")
timeSeries('Trig', 1, 0, 10, 3.14, '-factor',10.0)
timeSeries('Trig', 2, 0, 10, -(3.14/2), '-factor',10.0*3.14)
timeSeries('Trig', 3, 0, 10, PI, '-factor',-10.0*3.14*3.14)

print("load")
pattern('MultipleSupport', 1)
groundMotion(1,'Plain', '-disp',1)
# imposedMotion(nodeTag, dof, gmTag)
imposedMotion (2, 1, 1)

print("Dynamic Analysis Parameters")
DtAnalysis = 0.01 # time-step Dt in Sec.
constraints('Plain') #ops.constraints('Transformation') # how it handles boundary conditions
numberer('RCM') # renumber dof's to minimize band-width (optimization), if you want to
system('UmfPack') # how to store and solve the system of equations in the analysis (large model: try UmfPack)
test('EnergyIncr',1.0e-10 ,100) # test Eneregy incerment
algorithm('KrylovNewton') # use Kyrlow-Newton algorithm
integrator('Newmark',0.5 ,0.25) # determine the next time step for an analysis
analysis('Transient')

disp = []
time = []
for i in range(1000):
analyze(1,0.01)
x = nodeDisp(2)
v = nodeVel(2)
f = eleForce(1)
a = nodeResponse(2,1,3)
disp.append(f)
time.append(getTime())
plt.plot(time, disp)
plt.show()
Post Reply