Skip to content

Commit da7fafa

Browse files
authored
Add files via upload
1 parent 0729e15 commit da7fafa

File tree

3 files changed

+58
-18
lines changed

3 files changed

+58
-18
lines changed

fun_SPEC_NEC/SpecNec_executable_streamlit.py

Lines changed: 56 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,58 @@
1+
import streamlit as st
12
import numpy as np
23
import pandas as pd
34
import matplotlib.pyplot as plt
45

5-
# Define input parameters
6-
# Ratio entre ordenadas espectrales Sa(T = 0.1 s) y el PGA para el periodo de retorno seleccionado
7-
n = 2.48
8-
# Aceleración máxima esperada en el estrato competente para el evento sísmico de diseño, expresada como fracción de la aceleración de la gravedad
9-
z = 0.4
10-
I = 1 # Coeficiente de Importancia
11-
# fa, fd, fs = Coeficiente de amplificación de suelo. Amplifica las ordenadas del espectro elástico de respuesta considerando los efectos de sitio
12-
fads = [1.2, 1.11, 1.11]
13-
r = 1 # Amplificación según ubicación geografica
14-
R = 6 # Factor de Reducción de respuesta sísmica
15-
# Coeficiente de castigo por irregularidad en planta
16-
fip = 1
17-
# Coeficiente de castigo por irregularidad en elevación
18-
fie = 1
196

7+
# Load and display the image
8+
image_path = 'logo_TorreFuerte.png'
9+
st.image(image_path, use_column_width=True)
10+
11+
12+
13+
# Título de la aplicación
14+
st.markdown("<h4 style='text-align: center;'>Simple App: Seismic Response Spectrum [Normative Ecuadorian Spectrum]</h4>", unsafe_allow_html=True)
15+
16+
17+
st.markdown(
18+
"""
19+
* Author: [Msc. Ing. Carlos Andrés Celi Sánchez](https://fragrant-knight-4af.notion.site/Main-Page-5c5f007b3f3f4c76a604960d9dbffca7?pvs=4)
20+
* Course: Structural Dynamics
21+
"""
22+
)
23+
24+
st.markdown('* You can find me on : [![Web Page](https://img.shields.io/badge/Web%20Page-caceli.net-blue)](https://fragrant-knight-4af.notion.site/Main-Page-5c5f007b3f3f4c76a604960d9dbffca7?pvs=4)[![GitHub Carlos Celi](https://img.shields.io/github/followers/Normando1945?label=follow&style=social)](https://github.com/Normando1945)[![ResearchGate](https://img.shields.io/badge/-ResearchGate-00CCBB?style=social&logo=researchgate)](https://www.researchgate.net/profile/Carlos-Celi)[![Google Scholar](https://img.shields.io/badge/-Google%20Scholar-4285F4?style=social&logo=google)](https://scholar.google.com.ec/citations?hl=es&user=yR4Gz7kAAAAJ)')
25+
26+
st.markdown('This simple app performs spectral calculations using the NEC-SE-DS-2015 Ecuadorian Code. It computes the Elastic and Inelastic Acceleration Response Spectra for a range of structural periods and visualizes the results.')
27+
28+
st.markdown("#### **Parameters**")
29+
30+
31+
n = st.number_input('**n**: Ratio between spectral ordinates **Sa(T = 0.1 s)** and **PGA**:', value=2.48, step=0.1)
32+
z = st.number_input('**z**: Maximum expected acceleration (fraction of gravitational acceleration):', value=0.4, step=0.1)
33+
34+
# Create a grid layout with a maximum of 5 columns
35+
col1, col2, col3, col4 = st.columns(4)
36+
37+
# User input for parameters with descriptions
38+
with col1:
39+
fa = st.number_input('**fa**: Short period amplification factor:', value=1.2, step=0.1)
40+
fip = st.number_input('**Φp**: Penalty coefficient for plan irregularity:', value=1.0, step=0.1)
41+
42+
with col2:
43+
fd = st.number_input('**fd**: Velocity amplification factor:', value=1.11, step=0.1)
44+
fie = st.number_input('**Φe**: Penalty coefficient for elevation irregularity:', value=1.0, step=0.1)
45+
46+
with col3:
47+
fs = st.number_input('**fs**: Soil non-linearity amplification factor:', value=1.11, step=0.1)
48+
R = st.number_input('**R**: Seismic response reduction factor:', value=6.0, step=0.1)
49+
50+
with col4:
51+
I = st.number_input('**I**: Importance coefficient [for different structures]:', value=1.0, step=0.1)
52+
r = st.number_input('**r**: Geographic zone factor [for Ecuador]:', value=1.0, step=0.1)
53+
54+
55+
fads = [fa, fd, fs]
2056
To = 0.10 * fads[2] * fads[1] / fads[0]
2157
Tc = 0.55 * fads[2] * fads[1] / fads[0]
2258

@@ -63,7 +99,10 @@
6399
legend = plt.legend(fontsize=10)
64100
legend.get_frame().set_edgecolor('none')
65101
ax1.grid(which='both', axis='x', alpha=0.5)
66-
plt.show()
67102

68-
69-
# return Resul, fig1, folder_path
103+
st.pyplot(fig1)
104+
105+
106+
st.markdown("##### **Response Spectra [Elastic and Inelastic]**")
107+
st.write(Resul)
108+

fun_SPEC_NEC/logo_TorreFuerte.png

95.2 KB
Loading

fun_SPEC_NEC/requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1+
streamlit
12
numpy
23
pandas
34
matplotlib
4-
streamlit
5+

0 commit comments

Comments
 (0)