Analisis Dinamico Eje X

Download as pdf or txt
Download as pdf or txt
You are on page 1of 24

Analisis_Dinamico_Eje_X

December 10, 2022

—————————————————————————————————————————
—————————————
Análisis Dinámico Modal Espectral
Docente: Ing. Omar Caballero Sanchez
Curso: Ingenieria Antisismica
Grupo: 11
Estudiantes:
Carhuapoma Chahuayo, Branny Aldair
Hidalgo Ayaipoma, John Alexander
Huaman Matamoros Jaime
—————————————————————————————————————————
—————————————
[1]: import numpy as np
import pandas as pd
from sympy import *
from funciones import *
import matplotlib.pyplot as plt
from tabulate import tabulate
from IPython.core.interactiveshell import InteractiveShell
from IPython.display import display, Latex
#Configuraciones para grafico
tabulate.PRESERVE_WHITESPACE = True
tabulate.WIDE_CHARS_MODE = False
#-------------------------------------
# Some plot settings
#-------------------------------------
#plt.style.use('ggplot')
plt.rcParams['lines.linewidth'] = 2.0
plt.rcParams['lines.color'] = 'black'
plt.rcParams['legend.frameon'] = True
plt.rcParams['font.family'] = 'serif'
plt.rcParams['legend.fontsize'] = 14
plt.rcParams['font.size'] = 16

1
plt.rcParams['axes.spines.right'] = False
plt.rcParams['axes.spines.top'] = False
plt.rcParams['axes.spines.left'] = True
plt.rcParams['axes.spines.bottom'] = True
plt.rcParams['axes.axisbelow'] = True

#-------------------------------------
# Some plot functions
#-------------------------------------

def graf01(par_x,par_y,factor,color,title,xlabel,ylabel,label):
#Definimos los parametros del plot
plt.rcParams['font.size'] = 14
plt.figure(u'Espectro de Diseño Sismico', figsize=(8, 5), tight_layout =␣
↪True)

#plt.plot(zeros,coory,'b',linewidth=0.8, marker = '^',markersize = 8)


plt.plot(par_x ,par_y,color,linewidth=2, marker = 'o',markersize = 10,label␣
↪=label)

if factor>0:
kk = len(par_y)
aux_factor = factor*np.ones((kk,1))
plt.plot(aux_factor,par_y,'#FF5733',linewidth=2, marker =␣
↪'^',markersize = 10,label ='Deriva permitida')

plt.title(title, fontsize=20, color="black")


plt.grid(linestyle = '--', linewidth = 0.5)
plt.yticks(np.arange(min(par_y), max(par_y)+1, 1.0))
plt.xlabel(xlabel)
plt.ylabel(ylabel)
plt.legend()
plt.show()

[2]: #Vector de pesos y vector de rigideces


k = np.array([202.78, 123.70, 103.12, 103.12, 103.12, 103.12, 103.12, 103.12,␣
↪85.39]) #tonf/cm

pesos =np.array([598.670, 584.184, 420.596, 420.596, 420.596, 420.596, 420.596,␣


↪420.596, 356.836]) #tonf

H = np.array([385, 325, 325, 325, 325, 325, 325, 325, 325]) #cm

#Parametros sismicos
Z = 0.45
U = 1.50
S = 1.10
R = 4.8
TP = 1
TL = 1.6
g = 981 #cm/s

2
[3]: n = len(k)
K = np.zeros((n,n))
for i in range(n-1):
K[i,i] = k[i] + k[i+1]
K[i,i+1] = -k[i+1]
K[i+1,i] = -k[i+1]
if i==(n-2):
K[i+1,i+1] = k[i+1]

Matrix(np.round(K,3))
[3]: 326.48 −123.7 0 0 0 0 0 0 0
⎡−123.7 226.82 −103.12 0 0 0 0 0 0 ⎤
⎢ ⎥
⎢ 0 −103.12 206.24 −103.12 0 0 0 0 0 ⎥
⎢ 0 0 −103.12 206.24 −103.12 0 0 0 0 ⎥
⎢ 0 0 0 −103.12 206.24 −103.12 0 0 0 ⎥
⎢ ⎥
⎢ 0 0 0 0 −103.12 206.24 −103.12 0 0 ⎥
⎢ 0 0 0 0 0 −103.12 206.24 −103.12 0 ⎥
⎢ 0 0 0 0 0 0 −103.12 188.51 −85.39⎥
⎣ 0 0 0 0 0 0 0 −85.39 85.39 ⎦

[4]: m = pesos/g #tonf-seg2/cm


M = np.zeros((n,n))
for i in range(n):
M[i,i] = m[i]
Matrix(np.round(M,4))
[4]: 0.6103 0 0 0 0 0 0 0 0
⎡ 0 0.5955 0 0 0 0 0 0 0 ⎤
⎢ ⎥
⎢ 0 0 0.4287 0 0 0 0 0 0 ⎥
⎢ 0 0 0 0.4287 0 0 0 0 0 ⎥
⎢ 0 0 0 0 0.4287 0 0 0 0 ⎥
⎢ ⎥
⎢ 0 0 0 0 0 0.4287 0 0 0 ⎥
⎢ 0 0 0 0 0 0 0.4287 0 0 ⎥
⎢ 0 0 0 0 0 0 0 0.4287 0 ⎥
⎣ 0 0 0 0 0 0 0 0 0.3637⎦

[5]: #Manipulación algebraica de las raices


B = manipulacionAlgebraica(K,M)
val2 = algoritmoQR(B,M)
val = (np.sqrt(val2))
TT = (2*np.pi)/val

#Mostramos los valores obtenidos en pantalla


aux = np.zeros((n,3))
index = []
head_modos = []
head_modos_norm = []

3
list_niveles = []
for i in range(n):
head_modos.append("Modo " + str(i+1))
head_modos_norm.append("Modo norm " + str(i+1))
list_niveles.append("Nivel " + str(i+1))
index.append("")
aux[i,0] = val2[i]
aux[i,1] = val[i]
aux[i,2] = TT[i]

print("\033[1;34m" + " ")


print("\nFrecuencias modales y Periodos de Vibración")

column_values = ['�i²', '�i', 'Ti']


df = pd.DataFrame(np.round(aux,5),head_modos, column_values)
df.style.set_table_attributes('style="font-size: 16px"')
#pd.set_option('display.float_format', '{:,.2f}'.format
df

Frecuencias modales y Periodos de Vibración

[5]: �i² �i Ti
Modo 1 7.77174 2.78778 2.25383
Modo 2 64.37125 8.02317 0.78313
Modo 3 158.52849 12.59081 0.49903
Modo 4 284.68904 16.87273 0.37239
Modo 5 438.76785 20.94679 0.29996
Modo 6 593.30781 24.35791 0.25795
Modo 7 705.47871 26.56085 0.23656
Modo 8 819.76494 28.63154 0.21945
Modo 9 922.79988 30.37762 0.20684

[6]: n = len(K)
formas = np.zeros((n,n))
KT = K[1:,1:]
AT = K[1:,0]
MT = M[1:,1:]
for j in range(n):
aux = np.dot(np.linalg.inv(KT - val2[j] * MT),(-AT))
#ordenar valores
for i in range(n):
if i==0:
formas[i,j]=1
else:
formas[i,j]=aux[i-1]

4
print("\033[1;34m" + " ")
print("\nMatriz de formas modales")

#Matriz de formals modales


df = pd.DataFrame(np.round(formas,4), list_niveles , head_modos)
df.style.set_table_attributes('style="font-size: 14px"')
df

Matriz de formas modales

[6]: Modo 1 Modo 2 Modo 3 Modo 4 Modo 5 Modo 6 Modo 7 Modo 8 \


Nivel 1 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000
Nivel 2 2.6009 2.3217 1.8572 1.2348 0.4747 -0.2878 -0.8411 -1.4050
Nivel 3 4.4047 3.0442 1.1853 -0.5136 -1.3582 -0.8466 0.3771 2.3612
Nivel 4 6.0661 2.9519 -0.2679 -1.6541 -0.7133 0.6829 0.4893 -1.9204
Nivel 5 7.5315 2.0696 -1.5445 -0.8367 1.2329 0.5278 -0.8336 0.3434
Nivel 6 8.7535 0.6334 -1.8031 0.9710 0.9300 -0.9293 0.2887 1.4368
Nivel 7 9.6927 -0.9724 -0.8732 1.6294 -1.0694 -0.0940 0.5643 -2.3669
Nivel 8 10.3186 -2.3178 0.6322 0.3591 -1.1179 0.9732 -0.8152 1.8965
Nivel 9 10.6719 -3.1935 1.9470 -1.6882 1.2863 -0.6372 0.4066 -0.7610

Modo 9
Nivel 1 1.0000
Nivel 2 -1.9133
Nivel 3 4.7879
Nivel 4 -6.8807
Nivel 5 7.8502
Nivel 6 -7.5378
Nivel 7 5.9948
Nivel 8 -3.4729
Nivel 9 1.1849

[7]: #Obtenemos los valores


coorx = np.array([])
coory = np.arange(0,n+1,1)
zeros = np.zeros(n+1)

#Lineas en el texto
#Coordenadas
coor = []
coorx = []
for i in range(n):
coorxaux = np.append([0],formas[:,i])
#print(coorxaux)

5
coorx.append(coorxaux)
coord = np.zeros((n,4))
for j in range(n):
coord[j,0] = 0
coord[j,1] = coorxaux[j+1]
coord[j,2] = coory[j+1]
coord[j,3] = coory[j+1]
#print(j)
coor.append(coord)

#Grafico modos de vibracion


filas = int(np.ceil(n/3))
fig1 = plt.figure(u'Modos de vibración', figsize=(15,filas*7), tight_layout =␣
↪True)

fig1.tight_layout()
plt.suptitle(u'Modos de Vibración\n', fontsize=40, color="black")
#Realizamos los subplots
for i in range(1,n+1):
ax = plt.subplot(filas,3,i)
ax.plot(coorx[i-1],coory,'b', marker = 'o',markersize = 8)
ax.plot(zeros,coory,'b',linewidth=0.8, marker = '^',markersize = 12)
#Agregamos grafico de lineas
x,y = transform_xy(coor[i-1])
plt.plot(x, y,'b-',linewidth = 0.8)
#Agregamos las etiquetas al texto
aux = coorx[i-1]
for j in range(n+1):
ax.text(aux[j]+0.08,coory[j]+0.03,"({:.3f})".format(aux[j]),fontsize=11)
ax.set_title('Modo ' + str(i))
plt.show()

del aux

6
7
[8]: #Variables usadas
# n: tamaño de elementos
#formas_norm : Matriz de formas normalizadas
#phi : Matriz para extraer los modos
#aux : Variable auxiliar para calcular
#res : Variables de resultados

n = len(K)
formas_norm = np.zeros((n,n))
res = []
for i in range(n):
phi = formas[:,i:i+1]
aux = np.sqrt(phi.transpose() @ M @ phi)
res.append(aux[0,0])
aux = phi/res[i]
for j in range(n):
formas_norm[j,i] = aux[j,0]
#Limpieza de variables
del aux
#Valores de sqrt(Si)
#Matrix(np.round(res,3))

[9]: #Mostramos en pantalla


df = pd.DataFrame(res,head_modos,['Si'])
df.style.set_table_attributes('style="font-size: 14px"')
df

[9]: Si
Modo 1 14.603462
Modo 2 4.467210
Modo 3 2.755189
Modo 4 2.395626
Modo 5 2.098587
Modo 6 1.487976
Modo 7 1.417899
Modo 8 3.293558
Modo 9 10.236653

[10]: #Matriz de modos normalizados


df = pd.DataFrame(np.round(formas_norm,4), index , head_modos_norm)
df.style.set_table_attributes('style="font-size: 13px"')
df

[10]: Modo norm 1 Modo norm 2 Modo norm 3 Modo norm 4 Modo norm 5 \
0.0685 0.2239 0.3630 0.4174 0.4765
0.1781 0.5197 0.6741 0.5154 0.2262
0.3016 0.6814 0.4302 -0.2144 -0.6472

8
0.4154 0.6608 -0.0972 -0.6905 -0.3399
0.5157 0.4633 -0.5606 -0.3493 0.5875
0.5994 0.1418 -0.6544 0.4053 0.4432
0.6637 -0.2177 -0.3169 0.6802 -0.5096
0.7066 -0.5189 0.2294 0.1499 -0.5327
0.7308 -0.7149 0.7067 -0.7047 0.6130

Modo norm 6 Modo norm 7 Modo norm 8 Modo norm 9


0.6721 0.7053 0.3036 0.0977
-0.1934 -0.5932 -0.4266 -0.1869
-0.5690 0.2659 0.7169 0.4677
0.4590 0.3451 -0.5831 -0.6722
0.3547 -0.5879 0.1043 0.7669
-0.6246 0.2036 0.4362 -0.7364
-0.0632 0.3980 -0.7186 0.5856
0.6540 -0.5750 0.5758 -0.3393
-0.4282 0.2867 -0.2311 0.1158

[11]: #Calculo de C
C = np.array([])
n = len(K)
for i in range(n):
if (TT[i] <= TP):
C = np.append(C,[2.5])
elif (TP < TT[i]) and (TT[i]< TL):
C = np.append(C,2.5*(TP/TT[i]))
else:
C = np.append(C,2.5*(TP*TL/(TT[i]**2)))

#Calculo de Sa
Sa = Z * U * C * S / R * g

#Calculo de Sd
Sd = Sa/val**2
#Sd = np.array([])
#for i in range(n):
# Sd = np.append(Sd, Sa[i]/(val[i]**2) )

[12]: aux = np.zeros((n,5))


index = []
for i in range(n):
aux[i,0] = TT[i]
aux[i,1] = val[i]
aux[i,2] = C[i]
aux[i,3] = Sa[i]
aux[i,4] = Sd[i]
index.append("")

9
#Pseudoaceleraciones y desplazamientos
print("\033[1;34m" + " ")
print("Tabla pseudoaceleraciones y desplazamientos espectrales")
#Matriz de modos normalizados
column_values = ['Ti', '�i', 'C', 'Sa', 'Sd']
df = pd.DataFrame(aux,index, column_values)
df.style.set_table_attributes('style="font-size: 16px"')
#pd.set_option('display.float_format', '{:,.2f}'.format)
df

Tabla pseudoaceleraciones y desplazamientos espectrales

[12]: Ti �i C Sa Sd
2.253828 2.787783 0.787442 119.493018 15.375331
0.783130 8.023169 2.500000 379.371094 5.893487
0.499029 12.590810 2.500000 379.371094 2.393078
0.372387 16.872731 2.500000 379.371094 1.332581
0.299959 20.946786 2.500000 379.371094 0.864628
0.257953 24.357911 2.500000 379.371094 0.639417
0.236558 26.560849 2.500000 379.371094 0.537750
0.219450 28.631538 2.500000 379.371094 0.462780
0.206836 30.377621 2.500000 379.371094 0.411109

[13]: InteractiveShell.ast_node_interactivity = "all"


�i = np.transpose(formas_norm) @ M @ np.ones((n,1))
sum_square=0

#Sumna de cuadrados
for i in range(n):
sum_square += �i[i,0]**2

percent = np.array([])
for i in range(n):
percent = np.append(percent, �i[i]**2/sum_square )

[14]: #Motrar los valores en pantalla


aux = np.zeros((n,2))
for i in range(n):
aux[i,0] = �i[i]
aux[i,1] = percent[i]*100

head_1 = ['Τ','%']
df = pd.DataFrame(aux,head_modos,head_1)
#df.style.set_table_attributes('style="font-size: 16px"')

10
df
print("\033[1;30m" + " ")
print("Nota: La tabla nos indica la cantidad de masa que participa en cada modo␣
↪y que tan importante es ese modo ")

[14]: Τ %
Modo 1 1.786698 77.071932
Modo 2 0.705175 12.005695
Modo 3 0.464266 5.203872
Modo 4 0.297328 2.134345
Modo 5 0.220223 1.170901
Modo 6 0.229694 1.273774
Modo 7 0.202720 0.992169
Modo 8 0.075105 0.136187
Modo 9 0.021466 0.011125

Nota: La tabla nos indica la cantidad de masa que participa en cada modo y que
tan importante es ese modo

[15]: UD = []
for i in range(n):
phi_norm = formas_norm[:,i:i+1]
UD.append(�i[i]*Sd[i]*phi_norm)

[16]: #Mostramos los textos en pantalla


for i in range(n):
print("\033[1;34m" + "\nModo " + str(i+1))
print("------------------------")
df = pd.DataFrame(np.round(UD[i],8),list_niveles,['Umax [cm]'])
#df.style.set_table_attributes('style="font-size: 14px"')
df

Modo 1
------------------------

[16]: Umax [cm]


Nivel 1 1.881135
Nivel 2 4.892732
Nivel 3 8.285777
Nivel 4 11.411087
Nivel 5 14.167676
Nivel 6 16.466471

11
Nivel 7 18.233192
Nivel 8 19.410753
Nivel 9 20.075374

Modo 2
------------------------

[16]: Umax [cm]


Nivel 1 0.930321
Nivel 2 2.159942
Nivel 3 2.832044
Nivel 4 2.746188
Nivel 5 1.925352
Nivel 6 0.589222
Nivel 7 -0.904606
Nivel 8 -2.156327
Nivel 9 -2.971011

Modo 3
------------------------

[16]: Umax [cm]


Nivel 1 0.403248
Nivel 2 0.748912
Nivel 3 0.477953
Nivel 4 -0.108031
Nivel 5 -0.622810
Nivel 6 -0.727087
Nivel 7 -0.352130
Nivel 8 0.254920
Nivel 9 0.785107

Modo 4
------------------------

[16]: Umax [cm]


Nivel 1 0.165390
Nivel 2 0.204223
Nivel 3 -0.084942
Nivel 4 -0.273565
Nivel 5 -0.138383
Nivel 6 0.160597

12
Nivel 7 0.269486
Nivel 8 0.059397
Nivel 9 -0.279217

Modo 5
------------------------

[16]: Umax [cm]


Nivel 1 0.090733
Nivel 2 0.043067
Nivel 3 -0.123235
Nivel 4 -0.064724
Nivel 5 0.111861
Nivel 6 0.084382
Nivel 7 -0.097032
Nivel 8 -0.101434
Nivel 9 0.116714

Modo 6
------------------------

[16]: Umax [cm]


Nivel 1 0.098705
Nivel 2 -0.028403
Nivel 3 -0.083563
Nivel 4 0.067409
Nivel 5 0.052097
Nivel 6 -0.091728
Nivel 7 -0.009278
Nivel 8 0.096059
Nivel 9 -0.062891

Modo 7
------------------------

[16]: Umax [cm]


Nivel 1 0.076883
Nivel 2 -0.064669
Nivel 3 0.028992
Nivel 4 0.037615
Nivel 5 -0.064093
Nivel 6 0.022194

13
Nivel 7 0.043382
Nivel 8 -0.062677
Nivel 9 0.031257

Modo 8
------------------------

[16]: Umax [cm]


Nivel 1 0.010553
Nivel 2 -0.014827
Nivel 3 0.024918
Nivel 4 -0.020266
Nivel 5 0.003624
Nivel 6 0.015163
Nivel 7 -0.024978
Nivel 8 0.020014
Nivel 9 -0.008031

Modo 9
------------------------

[16]: Umax [cm]


Nivel 1 0.000862
Nivel 2 -0.001649
Nivel 3 0.004128
Nivel 4 -0.005932
Nivel 5 0.006768
Nivel 6 -0.006498
Nivel 7 0.005168
Nivel 8 -0.002994
Nivel 9 0.001022

[17]: Dr = []
for i in range(n):
indi = 0
dif = 0
aux_matrix = np.zeros((n,1))
aux = UD[i]
for j in range(n):
indi = n-j-1
if indi==0:
dif = aux[indi]
else:

14
dif = aux[indi] - aux[indi-1]
aux_matrix[indi,0] = dif
Dr.append(aux_matrix)

del aux,aux_matrix,indi,dif

Δ = []
for i in range(n):
aux_matrix = np.zeros((n,1))
aux_derivas = Dr[i]
for j in range(n):
aux_matrix[j,0] = aux_derivas[j,0]/H[i]
Δ.append(aux_matrix)

[18]: #Mostramos los textos en pantalla


for i in range(n):
aux = np.zeros((n,2))
print("\033[1;34m" + "\nModo " + str(i+1))
print("---------------------------")
#Llenamos de datos la variable auxiliar aux
for k in range(n):
aux[k,0] = Dr[i][k,0]
aux[k,1] = Δ[i][k,0]

#Motramos en pantalla cada tabla


df = pd.DataFrame(aux,list_niveles,['Dr [cm]','Δ [cm]'])
#df.style.set_table_attributes('style="font-size: 14px"')
df

Modo 1
---------------------------

[18]: Dr [cm] Δ [cm]


Nivel 1 1.881135 0.004886
Nivel 2 3.011598 0.007822
Nivel 3 3.393045 0.008813
Nivel 4 3.125310 0.008118
Nivel 5 2.756589 0.007160
Nivel 6 2.298795 0.005971
Nivel 7 1.766721 0.004589
Nivel 8 1.177560 0.003059
Nivel 9 0.664621 0.001726

15
Modo 2
---------------------------

[18]: Dr [cm] Δ [cm]


Nivel 1 0.930321 0.002863
Nivel 2 1.229621 0.003783
Nivel 3 0.672102 0.002068
Nivel 4 -0.085856 -0.000264
Nivel 5 -0.820836 -0.002526
Nivel 6 -1.336130 -0.004111
Nivel 7 -1.493827 -0.004596
Nivel 8 -1.251722 -0.003851
Nivel 9 -0.814683 -0.002507

Modo 3
---------------------------

[18]: Dr [cm] Δ [cm]


Nivel 1 0.403248 0.001241
Nivel 2 0.345664 0.001064
Nivel 3 -0.270958 -0.000834
Nivel 4 -0.585984 -0.001803
Nivel 5 -0.514779 -0.001584
Nivel 6 -0.104276 -0.000321
Nivel 7 0.374957 0.001154
Nivel 8 0.607051 0.001868
Nivel 9 0.530187 0.001631

Modo 4
---------------------------

[18]: Dr [cm] Δ [cm]


Nivel 1 0.165390 0.000509
Nivel 2 0.038833 0.000119
Nivel 3 -0.289165 -0.000890
Nivel 4 -0.188623 -0.000580
Nivel 5 0.135183 0.000416
Nivel 6 0.298980 0.000920
Nivel 7 0.108889 0.000335
Nivel 8 -0.210088 -0.000646
Nivel 9 -0.338614 -0.001042

16
Modo 5
---------------------------

[18]: Dr [cm] Δ [cm]


Nivel 1 0.090733 0.000279
Nivel 2 -0.047666 -0.000147
Nivel 3 -0.166303 -0.000512
Nivel 4 0.058511 0.000180
Nivel 5 0.176585 0.000543
Nivel 6 -0.027479 -0.000085
Nivel 7 -0.181414 -0.000558
Nivel 8 -0.004402 -0.000014
Nivel 9 0.218148 0.000671

Modo 6
---------------------------

[18]: Dr [cm] Δ [cm]


Nivel 1 0.098705 0.000304
Nivel 2 -0.127107 -0.000391
Nivel 3 -0.055160 -0.000170
Nivel 4 0.150972 0.000465
Nivel 5 -0.015313 -0.000047
Nivel 6 -0.143824 -0.000443
Nivel 7 0.082450 0.000254
Nivel 8 0.105337 0.000324
Nivel 9 -0.158950 -0.000489

Modo 7
---------------------------

[18]: Dr [cm] Δ [cm]


Nivel 1 0.076883 0.000237
Nivel 2 -0.141553 -0.000436
Nivel 3 0.093661 0.000288
Nivel 4 0.008624 0.000027
Nivel 5 -0.101708 -0.000313
Nivel 6 0.086287 0.000265
Nivel 7 0.021188 0.000065
Nivel 8 -0.106059 -0.000326
Nivel 9 0.093934 0.000289

17
Modo 8
---------------------------

[18]: Dr [cm] Δ [cm]


Nivel 1 0.010553 0.000032
Nivel 2 -0.025380 -0.000078
Nivel 3 0.039745 0.000122
Nivel 4 -0.045184 -0.000139
Nivel 5 0.023889 0.000074
Nivel 6 0.011539 0.000036
Nivel 7 -0.040141 -0.000124
Nivel 8 0.044992 0.000138
Nivel 9 -0.028046 -0.000086

Modo 9
---------------------------

[18]: Dr [cm] Δ [cm]


Nivel 1 0.000862 0.000003
Nivel 2 -0.002512 -0.000008
Nivel 3 0.005777 0.000018
Nivel 4 -0.010060 -0.000031
Nivel 5 0.012700 0.000039
Nivel 6 -0.013266 -0.000041
Nivel 7 0.011667 0.000036
Nivel 8 -0.008162 -0.000025
Nivel 9 0.004016 0.000012

[19]: ccU = np.array([])


for i in range(n):
sum = 0
for j in range(n):
aux = UD[j]
sum += aux[i,0]**2
ccU = np.append(ccU, np.sqrt(sum))
del aux

#Mostramos en pantalla
df = pd.DataFrame(ccU,list_niveles,['C²U [cm]'])
#df.style.set_table_attributes('style="font-size: 14px"')
df

#Mostramos el grafico en pantalla


aux_ccU = np.concatenate(([0],ccU))

18
aux_H = np.concatenate(([0],H))
graf01(aux_ccU,coory,0,'#008080',u'Gráfico de␣
↪Desplazamientos\n','Desplazamientos(cm)','Piso','Desplazamientos')

[19]: C²U [cm]


Nivel 1 2.148982
Nivel 2 5.404981
Nivel 3 8.771196
Nivel 4 11.741021
Nivel 5 14.312808
Nivel 6 16.494320
Nivel 7 18.261333
Nivel 8 19.532523
Nivel 9 20.311586

[20]: ccΔ = np.array([])


for i in range(n):
sum = 0
for j in range(n):
aux = Δ[j]
sum += aux[i,0]**2
ccΔ = np.append(ccΔ, np.sqrt(sum))
del aux

#Mostramos en pantalla

19
df = pd.DataFrame(ccΔ,list_niveles,[' C²Δ [cm]'])
#df.style.set_table_attributes('style="font-size: 14px"')
df

#Mostramos el grafico en pantalla


aux_ccΔ = np.concatenate(([0],ccΔ ))
graf01(aux_ccΔ,coory,0,'#AA5442',u'Gráfico de Derivas\n','Derivas␣
↪elasticas(cm)','Piso','Derivas elasticas')

[20]: C²Δ [cm]


Nivel 1 0.005839
Nivel 2 0.008776
Nivel 3 0.009155
Nivel 4 0.008356
Nivel 5 0.007793
Nivel 6 0.007333
Nivel 7 0.006635
Nivel 8 0.005322
Nivel 9 0.003714

[21]: #Factores
drift_max = 0.007
factor_der = 0.75

#Calculos

20
Δine = factor_der * R * ccΔ
condition = []
for i in range(n):
if Δine[i] < drift_max:
condition.append('Accepted')
else:
condition.append('Rejected')

df = pd.DataFrame()
df['Δine = 0.75R'] = Δine
df['Limite'] = drift_max
df['Condición'] = condition
#Mostramos en pantalla
#df.style.set_table_attributes('style="font-size: 14px"')
df

#Mostramos el grafico en pantalla


aux_Δine = np.concatenate(([0],Δine))
graf01(aux_Δine,coory,0.007,'#FFC300',u'Gráfico de Derivas\n','Derivas␣
↪elasticas(cm)','Piso','Derivas inelasticas')

[21]: Δine = 0.75R Limite Condición


0 0.021020 0.007 Rejected
1 0.031594 0.007 Rejected
2 0.032960 0.007 Rejected
3 0.030082 0.007 Rejected
4 0.028054 0.007 Rejected
5 0.026400 0.007 Rejected
6 0.023886 0.007 Rejected
7 0.019160 0.007 Rejected
8 0.013369 0.007 Rejected

21
[22]: InteractiveShell.ast_node_interactivity = "last_expr"
#Funcion para calculo de C
def values_C(T,TP,TL):
C = np.array([])
n = len(T)
for i in range(n):
if (T[i] <= TP):
C = np.append(C,[2.5])
elif (TP < T[i]) and (T[i]< TL):
C = np.append(C,2.5*(TP/T[i]))
else:
C = np.append(C,2.5*(TP*TL/(T[i]**2)))
return C

#Obtenemos los valores


LT = np.arange(0,6+0.1,0.1)
LC = values_C(LT,TP,TL)
LSa = Z * U * LC * S / R * g

[23]: #Obtenemos las coordenadas


#[xi,xj,yi,yj]
nn = len(K) + 2
aux = np.append([TP,TL],TT)
acele = Z * U * values_C(aux,TP,TL) * S / R * g
coord = np.zeros((nn,4))

22
for i in range(nn):
coord[i,0] = aux[i]
coord[i,1] = aux[i]
coord[i,2] = 0
coord[i,3] = acele[i]

tt,aa = transform_xy(coord[0:2,:])
xx,yy = transform_xy(coord[2:nn,:])

#Obtenemos las etiquetas de coordenadas


labx = np.array([])
laby = np.array([])
lab = np.array([])
for j in range(2):
labx = np.append(labx,tt[1,j])
laby = np.append(laby,aa[1,j])
lab = np.append(lab,"({:.2f},{:.2f})".format(tt[1,j],aa[1,j]))

#Obtenemos las etiquetas de ejes


et_xx = np.array([])
et_yy = np.array([])
et = np.array(["Tp","TL"])
for j in range(2):
et_xx = np.append(et_xx ,tt[0,j])
et_yy = np.append(et_yy,aa[0,j])

%matplotlib inline
plt.rcParams['font.size'] = 16
#Definimos los parametros del plot
plt.figure(u'Espectro de Diseño Sismico', figsize=(15, 7.5), tight_layout =␣
↪True)

plt.plot(LT, LSa,'r-',linewidth = 2, label='Espectro')


plt.plot(xx, yy,'k',linewidth = 0.6,linestyle='solid')
plt.plot(tt, aa,'b',linewidth = 0.6,linestyle='solid')
plt.title(u'Espectro de Diseño Sismico\n', fontsize=30, color="black")
plt.grid(linestyle = '--', linewidth = 0.5)
plt.legend()
plt.xlabel('Periodo')
plt.ylabel('Pseudo Aceleración')
#texto en matplotlib
for i in range(2):
plt.text(labx[i],laby[i] + 8,lab[i],ha = "center",fontsize= 12)
plt.text(et_xx[i],et_yy[i] -4,et[i],ha = "center",fontsize= 10,bbox =␣
↪{'facecolor':'cyan', 'alpha':0.5 })

plt.show()

23
24

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy