|
import streamlit as st |
|
import plotly.graph_objects as go |
|
import numpy as np |
|
|
|
|
|
st.set_page_config(page_title="Pesadillas episodio ocho Broma de ingeniería eléctrica", layout="wide") |
|
|
|
|
|
st.title("Pesadillas episodio ocho Broma de ingeniería eléctrica") |
|
|
|
|
|
st.image('pesadillas.png', caption='Pesadillas') |
|
st.image('pesadillas_electrical_engineering_joke.png', caption='Pesadillas broma de ingeniería eléctrica') |
|
|
|
|
|
st.subheader("Video de Análisis") |
|
|
|
|
|
video_filename = 'final_analisis_video.mp4' |
|
|
|
|
|
st.video(video_filename) |
|
|
|
|
|
st.subheader("Visualización de Voltajes Primarios y Secundarios") |
|
|
|
|
|
t = np.linspace(0, 2 * np.pi, 1000) |
|
|
|
|
|
examples = [ |
|
{"ep": 30, "es": 60}, |
|
{"ep": 35, "es": 70}, |
|
{"ep": 40, "es": 80}, |
|
{"ep": 45, "es": 90}, |
|
{"ep": 50, "es": 100}, |
|
{"ep": 60, "es": 120} |
|
] |
|
|
|
|
|
fig = go.Figure() |
|
|
|
|
|
for i, example in enumerate(examples): |
|
ep = example["ep"] * np.sin(t) |
|
es = example["es"] * np.sin(t) |
|
|
|
fig.add_trace(go.Scatter(x=t, y=ep, mode='lines', name=f'Ejemplo {i+1} - e_p')) |
|
fig.add_trace(go.Scatter(x=t, y=es, mode='lines', name=f'Ejemplo {i+1} - e_s')) |
|
|
|
|
|
fig.update_layout( |
|
title="Voltajes Primarios (e_p) y Secundarios (e_s) en el Tiempo", |
|
xaxis_title="Tiempo", |
|
yaxis_title="Voltaje (V)", |
|
legend_title="Leyenda", |
|
template="plotly_white" |
|
) |
|
|
|
|
|
st.plotly_chart(fig, use_container_width=True) |