Hitheshrai commited on
Commit
3258bc7
·
verified ·
1 Parent(s): d1295a2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -4,7 +4,7 @@ import numpy as np
4
  import matplotlib.animation as animation
5
 
6
  # Set up page configuration
7
- st.set_page_config(page_title="Hithesh Rai - Interactive Physics Model", page_icon="🔬")
8
 
9
  # Header
10
  st.title("Interactive Bohr Model of the Atom")
@@ -50,7 +50,7 @@ def update(frame):
50
  radius = 2 + 2 * i
51
  x = radius * np.cos(frame * 0.1 + i * np.pi / num_electrons)
52
  y = radius * np.sin(frame * 0.1 + i * np.pi / num_electrons)
53
- electron.set_data(x, y)
54
  return electrons
55
 
56
  # Animation
 
4
  import matplotlib.animation as animation
5
 
6
  # Set up page configuration
7
+ st.set_page_config(page_title="Hithesh Rai - Interactive Bohr Model of the Atom", page_icon="🔬")
8
 
9
  # Header
10
  st.title("Interactive Bohr Model of the Atom")
 
50
  radius = 2 + 2 * i
51
  x = radius * np.cos(frame * 0.1 + i * np.pi / num_electrons)
52
  y = radius * np.sin(frame * 0.1 + i * np.pi / num_electrons)
53
+ electron.set_data([x], [y]) # Wrap x and y in lists to avoid RuntimeError
54
  return electrons
55
 
56
  # Animation