Repository navigation
Expand file tree
/
Copy pathapp.py
More file actions
207 lines (171 loc) · 5.41 KB
/
Copy pathapp.py
File metadata and controls
207 lines (171 loc) · 5.41 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
import streamlit as st
from modules.mechanics import projectile_motion, oscillations, orbital_motion, fluid_flow
from modules.electrodynamics import electric_field, lorentz_force
from modules.nuclear import radioactive_decay, binding_energy
from modules.atomic_physics import atomic_physics
from modules.modern_physics import double_slit
st.set_page_config(
page_title="Interactive Physics Lab",
page_icon="🧪",
layout="wide"
)
def show_home():
st.title("Interactive Physics Lab")
st.markdown(
"""
Welcome to the **Interactive Physics Lab** — an interactive simulation platform
built to help students understand physics visually, intuitively, and in real time.
Instead of only reading equations, users can explore how physical systems behave
by adjusting parameters, observing animations, and connecting theory with motion,
fields, and measurable quantities.
"""
)
st.markdown("## Explore Physics by Category")
col1, col2, col3 = st.columns(3)
with col1:
st.markdown(
"""
### Mechanics
- Projectile Motion
- Oscillations
- Orbital Motion
- Fluid Flow
"""
)
with col2:
st.markdown(
"""
### Electrodynamics
- Electric Field
- Lorentz Force
"""
)
with col3:
st.markdown(
"""
### Modern and Atomic Physics
- Atomic Transitions
- Double Slit
- Nuclear Simulations
"""
)
st.markdown("---")
st.markdown("## What this project offers")
st.markdown(
"""
- Real-time interactive simulations
- Physics-based visualisation of equations
- Adjustable parameters and live plots
- A clean learning environment for school and undergraduate students
"""
)
st.markdown("## How to use")
st.markdown(
"""
Use the sidebar to move from the **Home** page into the simulation sections.
Select a physics category, then choose a simulation to interact with.
"""
)
st.markdown("---")
st.info(
"This lab is designed as a visual learning space where equations, graphs, and motion work together."
)
st.markdown("---")
st.markdown(
"""
### About the developer
**Cherian P Ittyipe**
Physics & Astrophysics Graduate
This project reflects my broader interest in computational physics, scientific
visualisation, and building interactive tools for understanding physical systems.
While my primary academic focus is cosmology, this lab reflects a
broader approach to connecting theory, simulation, and physical understanding through
interactive tools.
[GitHub](https://github.com/Cherian-pi) •
[LinkedIn](https://www.linkedin.com/in/cherianpittyipe/) •
[Email](mailto:cherianpittyipe@outlook.com)
"""
)
st.sidebar.title("Interactive Physics Lab")
main_page = st.sidebar.radio(
"Navigate",
[
"Home",
"Simulations"
]
)
if main_page == "Home":
show_home()
elif main_page == "Simulations":
category = st.sidebar.selectbox(
"Choose a physics category",
[
"Mechanics",
"Electrodynamics",
"Nuclear Physics",
"Atomic Physics",
"Modern Physics"
]
)
if category == "Mechanics":
simulation = st.sidebar.radio(
"Choose a simulation",
[
"Projectile Motion",
"Oscillations",
"Orbital Motion",
"Fluid Flow"
]
)
if simulation == "Projectile Motion":
projectile_motion.run()
elif simulation == "Oscillations":
oscillations.run()
elif simulation == "Orbital Motion":
orbital_motion.run()
elif simulation == "Fluid Flow":
fluid_flow.run()
elif category == "Electrodynamics":
simulation = st.sidebar.radio(
"Choose a simulation",
[
"Electric Field",
"Lorentz Force",
]
)
if simulation == "Electric Field":
electric_field.render()
elif simulation == "Lorentz Force":
lorentz_force.run()
# elif simulation == "Circuits":
# circuits.run()
elif category == "Nuclear Physics":
simulation = st.sidebar.radio(
"Choose a simulation",
[
"Radioactive Decay",
"Binding Energy"
]
)
if simulation == "Radioactive Decay":
radioactive_decay.run()
elif simulation == "Binding Energy":
binding_energy.run()
elif category == "Atomic Physics":
simulation = st.sidebar.radio(
"Choose a simulation",
[
"Atomic Transitions"
]
)
if simulation == "Atomic Transitions":
atomic_physics.run()
elif category == "Modern Physics":
simulation = st.sidebar.radio(
"Choose a simulation",
[
"Double Slit"
]
)
if simulation == "Double Slit":
double_slit.run()