File size: 1,753 Bytes
157a87e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import streamlit as st
import plotly.graph_objects as go
import numpy as np

# Set page configuration
st.set_page_config(page_title="Pesadillas episodio ocho Broma de ingeniería eléctrica", layout="wide")

# Title of the app
st.title("Pesadillas episodio ocho Broma de ingeniería eléctrica")

# Display images
st.image('pesadillas.png', caption='Pesadillas')
st.image('pesadillas_electrical_engineering_joke.png', caption='Pesadillas broma de ingeniería eléctrica')

# Load and display the concatenated video
st.subheader("Video de Análisis")

# Define the filename of the concatenated video
video_filename = 'final_analisis_video.mp4'

# Display the video
st.video(video_filename)

# Plotly visualization
st.subheader("Visualización de Voltajes Primarios y Secundarios")

# Time array
t = np.linspace(0, 2 * np.pi, 1000)

# Define primary and secondary voltages for each example
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}
]

# Create a figure
fig = go.Figure()

# Add traces for each example
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'))

# Update layout for better visualization
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"
)

# Display the Plotly figure in the Streamlit app
st.plotly_chart(fig, use_container_width=True)