I tryin to plot the position of electron in the hidrogen atom by Coulomb's law, $F=K \frac{q_1 q_2}{r^3}$
This is mi code
import numpy as np
import matplotlib.pyplot as plt
def coulomb(re, v0):
#Set parameters:
N = 500
dt = 2.2222222 / N # Time Step:
#Create an array, for all variables, of size N with all entries equal to zero:
xe = np.zeros((N,))
ye = np.zeros((N,))
vxe = np.zeros((N,))
vye = np.zeros((N,))
# Initial Conditions:
xe[0] = re # (x0 = r, y0 = 0)
vye[0] = v0 #units in m/s^2
#Implement Verlet Algorithm:
for k in range(0, N-1):
re = (xe[k]*2+ye[k]*2)*0.5
vxe[k+1] = vxe[k] - ((mu * xe[k]) / (re**3)) * dt
xe [k+1] = xe[k] + vxe[k+1]*dt
vye[k+1] = vye[k] - ((mu * ye[k]) / (re**3)) * dt
ye [k+1] = ye[k] + vye[k+1]*dt
#Plot:
xi = plt.plot(xe, ye, 'go', markersize = 1)
plt.plot(0,0,'yo') # yellow marker
plt.plot(xe[0],0,'bo') # dark blue marker
plt.axis('equal')
plt.xlabel ('x')
plt.ylabel ('y')
return xi, xe, ye
# average distance electron-nucleus in meter
r = 5.1e-11
k = 8.9e9
mu = r*3 * 4 * k *np.pi*2 # coulomb parameter
coulomb(r, np.sqrt(mu / r));
This works well, I've try to changing the value of Permittivity in l, but the graph becomes just 2 dots (the values of xe and vye remain constant) instead of a circular orbit and I don't know why this is? this happens
mu
? It should bemu = k*el^2/me
whereel
is the elementary charge andme
the electron mass? What variable is or is influenced by "Permittivity in l"? $\endgroup$ – Lutz Lehmann Jan 30 at 11:09