0% found this document useful (0 votes)
9 views5 pages

Homework 10 - Sowers

The document details a dynamics homework assignment involving the analysis of structural response to earthquakes using numerical methods, specifically the Newmark Method. It includes calculations for displacement, acceleration, and shear forces based on the El Centro 1940 Earthquake data, as well as modal analysis using eigenvalues and eigenvectors. The results include maximum displacements, accelerations, and base shears for a two-story structure, along with a discussion on the accuracy of the methods used.

Uploaded by

lcs501
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views5 pages

Homework 10 - Sowers

The document details a dynamics homework assignment involving the analysis of structural response to earthquakes using numerical methods, specifically the Newmark Method. It includes calculations for displacement, acceleration, and shear forces based on the El Centro 1940 Earthquake data, as well as modal analysis using eigenvalues and eigenvectors. The results include maximum displacements, accelerations, and base shears for a two-story structure, along with a discussion on the accuracy of the methods used.

Uploaded by

lcs501
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

In [514… #Dynamics Homework

#Lucy Sowers and Robbie Humrich

In [515… # Modules
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import scipy
from scipy import linalg as lg
wn, phi = lg.eigh(K,M)

In [516… m = 160/386.4 #kip/g


k = 10 #kipzs/in
h = 12 #ft
xi = 0.05 #damping ratio

In [517… def NewmarkMethod(m, c, k, u0, v0, t, dt, p, beta=1/4, gamma=1/2):

# default Average Acceleration beta = 1/4, gamma = 1/2


u = np.zeros(len(t)) # displacement
v = np.zeros(len(t)) # velocity
a = np.zeros(len(t)) # acceleration

# 1.0 Initialization
u[0] = u0
v[0] = v0
a[0] = (p[0] - c*v0 - k*u0)/m
a1 = m/(beta*dt**2) + gamma*c/(beta*dt)
a2 = m/(beta*dt) + (gamma/beta - 1)*c
a3 = (1/(2*beta) - 1)*m + dt*(gamma/(2*beta) - 1)*c
kh = k + a1

# 2.0 Time step calculations


for i in range(len(t)-1):
ph = p[i+1] + a1*u[i] + a2*v[i] + a3*a[i]
u[i+1] = ph/kh
v[i+1] = gamma/(beta*dt)*(u[i+1] - u[i]) + (1 - gamma/beta)*v[i] + dt*(1 -
a[i+1] = 1/(beta*dt**2)*(u[i+1] - u[i]) - 1/(beta*dt)*v[i] - (1/(2*beta) -

return u

In [518… # Import El Centro 1940 Earthquake ground acceleration record


g = 386.1 #in/s^2
fileName = 'elcentro.txt'
gm = np.genfromtxt('elcentro.txt', delimiter = '\t')
t = gm[:,0]
ag = gm[:,1]*g # ground acceleration

In [519… # Response Spectra


def responseSpectra(T_list, t, ag, xi):
# 1.0 Initialization
m = 1 #k-s^2/in.
p = -m*ag # earthquake equivalent force
xi = 0.05 # damping ratio
u0 = 0
v0 = 0
dt = t[1]-t[0] #time step (s)

Sd = np.zeros((np.size(T_list)))

# 2.0 Obtain the response for each period using Newmark's method
for i in range(0,np.size(T_list)):

# structural properties
Tn = T_list[i] #s
wn = 2*np.pi/Tn
c = 2*m*wn*xi
k = m*wn**2

# Get time response u(t) using Newmark's Method:


u = NewmarkMethod(m, c, k, u0, v0, t, dt, p)

# Get peak displacement response Sd = max(abs(u(t)))


Sd[i] = np.max(np.abs(u))

# Pseudo-velocity and pseudo-acceleration response spectra


Sv = Sd*2*np.pi/T_list
Sa = (Sv*2*np.pi/T_list)/g

return Sd, Sv, Sa

In [520… # Compute Elastic Response Spectra


T_list = np.linspace(0, 10, 1001)
T_list[0] = 1e-12
Sd, Sv, Sa = responseSpectra(T_list, t, ag, xi)

In [521… #Solve for Dn(t)


#1. Set up maass, stiffness and damping matrices
k1 = 4*k
k2 = 2*k

M = np.array([[2*m, 0 ], [0, m]])


K = np.array([[(k1+k2), -k2],[-k2, k2]])

In [522… #Eighen values


wn, phi = lg.eigh(K,M)

print (wn)

[24.15 96.6 ]

In [523… freqNat = np.sqrt(wn)


print (freqNat)
wn1 = np.sqrt(wn[0])
wn2 = np.sqrt(wn[1])
[4.91426495 9.8285299 ]

In [524… #phis = modes


phi1 = phi[:,0]
phi2= phi[:,1]

print ('Mode 1', phi1)


print ('Mode 2', phi2)

Mode 1 [-0.63442888 -1.26885775]


Mode 2 [-0.89721792 0.89721792]

In [525… T = 2*np.pi*np.sqrt(m/k)
print(Sa[np.abs(T-T_list).argmin()].round(3))

0.224

In [526… def Dmotion (phi, M_matrix, influ_v, Sa):


Gamma = ((np.transpose(phi)@M_matrix@influ_v)/(np.transpose(phi)@M_matrix@phi))
print (Gamma)
q_n = (Sa*Gamma)
print (q_n)
D = q_n*phi
print (D)
Dmax = np.max(D)
print (Dmax, 'in')
return D

In [527… def gamma (phi, M_matrix, influence_line):


Gamma = ((np.transpose(phi)@M_matrix@influ_v)/(np.transpose(phi)@M_matrix@phi))
print (Gamma)
return Gamma

In [528… #Mn star

def Mn(phi, M_matrix, influence_line):


Gamma = ((np.transpose(phi)@M_matrix@influ_v)/(np.transpose(phi)@M_matrix@phi))

L = np.transpose(phi)@M@influence_line

Mn = Gamma*L
print ('Mn_star', Mn)
return Mn

In [529… influ_v = np.array([[1],[1]])


Sa1 = np.max(Sa)

In [530… #Problem 2 Part A#

In [590… D1 = Dmotion(phi1, M, influ_v, Sa1)


D1max = np.max(D1)
[-1.05081387]
[-0.96341791]
[0.61122014 1.22244028]
1.2224402846902762 in
1.2224402846902762

In [592… D2 = Dmotion(phi2, M, influ_v, Sa1)


D2max = np.max(D2)

[-0.37151881]
[-0.34061967]
[ 0.30561007 -0.30561007]
0.30561007117256894 in

In [533… def AccelMax (D, wn):


A =wn**2 * D
Amax = np.max(A)
print ('Max Acceleration =', Amax, 'in/s^2')
return A

In [534… A1 = AccelMax(D1, wn1)

Max Acceleration = 29.52193287527018 in/s^2

In [535… A2 = AccelMax(D1, wn2)

Max Acceleration = 118.0877315010807 in/s^2

In [536… #Problem 2 part b#

In [537… #i) Displacements at each floor

print ('Displacement at floor 1', D1[1])


print ('Displacement at floor 2', D2[0])

Displacement at floor 1 1.2224402846902762


Displacement at floor 2 0.30561007117256894

In [538… #Shear Story


def ShearStory (gamma, M, phi):
S = gamma*M@phi
print ('Story Shear =', S)
return S

In [539… #iia) Story Shear


gamma1 = gamma(phi1,M, influ_v)
gamma2 = gamma(phi2,M, influ_v)

S1 = ShearStory(gamma1, M, phi1)
S2 = ShearStory(gamma2, M, phi2)

[-1.05081387]
[-0.37151881]
Story Shear = [0.5521049 0.5521049]
Story Shear = [ 0.27605245 -0.13802622]

In [540… #iib) Base Shear


In [600… Mn1 = Mn(phi1, M, influ_v)
Mn2 = Mn(phi2, M,influ_v)

Vb1 = Mn1*(k1/2)*D1max
print ('Base Shear from first floor', Vb1)
Vb2 = Mn2*(k2/2)*D2max
print ('Base Shear from second floor', Vb2)

Mn_star [1.1042098]
Mn_star [0.13802622]
Base Shear from first floor [26.99661084]
Base Shear from second floor [0.42182204]

In [622… #iii) Base overturnibg moment

OTM1 = Vb1*h
OTM2 = Vb2*2*h
BaseOTM = OTM1 + OTM2
print ('Base overturning moment =', BaseOTM)

Base overturning moment = [334.08305917]

In [ ]: #Problem 2 part c

In [624… #Modal Combination using SRSS


#i floor displacement
D_av = np.sqrt(D1[1]**2 + D2[0]**2)
print ('Average Floor displacement',D_av ,'in')

#ii Average base Shear


Vb_av = np.sqrt(Vb1**2 + Vb2**2)
print ('Average base shear', Vb_av, 'k')

#iii Average Base overturning moment


OTM_av = np.sqrt(OTM1**2 + OTM2**2)
print ('Average Overturning Moment', OTM_av, 'k-ft')

Average Floor displacement 1.260062603697033 in


Average base shear [26.99990613] k
Average Overturning Moment [324.11747477] k-ft

In [ ]: #Problem 2 part d

In [ ]: #To honestly comment on the accuracy is to assume either of the


#solutions are correct. Given the margin of uncertainty in both
#computations the variation of the numbers are closer than excpeted.
#the displacements are the most off with one solving with a maximum
#displacement of 5 and 3 inches while using the response spectrum
#gave 1.2 and 0.3 in.The maximum acceleration is actually the most
#dissimilar bewtween the two methods.
#There error is probably from miscalculations in one method or the other.

You might also like