# Interpolation of Ground Acceleration

There was a question on GitHub a few months about whether or not OpenSees uses linear interpolation when the analysis time step is smaller than the time step (digitization) of an input ground acceleration.

This is a good question as I’ve used other software that does not interpolate and instead uses the acceleration of the closest data point, turning the acceleration record into a bar chart instead of a line graph. However, this is not a big deal for practically all ground motion records.

Anyway, the short answer is “Yes, OpenSees uses linear interpolation”.

This post provides the long answer though, i.e., “Yes, and here’s one way to figure it out”.

Ground acceleration records end up in a Path time series in OpenSees, so all we have to do is define a linear ground acceleration using two temporally distant points, e.g., (0,0) and (2,-g), then see if the response is the expected oscillation about a ramp function, or something else.

``````import openseespy.opensees as ops

ops.wipe()
ops.model('basic','-ndm',1,'-ndf',1)

g = 386.4
m = 1.0
Tn = 0.2
k = m*(2*3.14159/Tn)**2

ops.node(1,0); ops.fix(1,1)
ops.node(2,0); ops.mass(2,m)

ops.uniaxialMaterial('Elastic',1,k)
ops.element('zeroLength',1,1,2,'-mat',1,'-dir',1)

time = [0,2]
accel = [0,-g]

ops.timeSeries('Path',1,'-time',*time,'-values',*accel)
ops.pattern('UniformExcitation',1,1,'-accel',1)

ops.analysis('Transient')

Tf = 1.0
dt = 0.02
Nsteps = int(Tf/dt)

for i in range(Nsteps):
ops.analyze(1,dt)``````

Using an analysis time step much smaller than the time between the ground acceleration data points, the results show the dynamic response oscillates about the static solution for a linearly increasing load.

Thus, OpenSees linearly interpolates the ground acceleration between the two points that define the time series.

This site uses Akismet to reduce spam. Learn how your comment data is processed.