Merge branch 'master' of https://git.keydev.me/edwin/ideas
commit
205f151165
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,57 @@
|
|||||||
|
import numpy as np
|
||||||
|
from scipy import constants as cs
|
||||||
|
import matplotlib.pyplot as plt
|
||||||
|
|
||||||
|
def amuToKg(amu):
|
||||||
|
return amu * 1.66054e-27
|
||||||
|
|
||||||
|
def get_a(U,m,omega,r0):
|
||||||
|
return 4*cs.e*U/(m*omeag**2*r0**2)
|
||||||
|
|
||||||
|
def get_q(V,m,omega,r0):
|
||||||
|
return 2*cs.e*V/(m*omeag**2*r0**2)
|
||||||
|
|
||||||
|
def get_U(a,m,omega,r0):
|
||||||
|
return a * m * omega**2 * r0**2 / (4*cs.e)
|
||||||
|
|
||||||
|
def get_V(q,m,omega,r0):
|
||||||
|
return q * m * omega**2 * r0**2 / (2*cs.e)
|
||||||
|
|
||||||
|
amu_mass = 100
|
||||||
|
|
||||||
|
mass = amuToKg(amu_mass)
|
||||||
|
|
||||||
|
a = 0
|
||||||
|
q = 0.7
|
||||||
|
|
||||||
|
f = 100e6
|
||||||
|
omega = 2*np.pi*f
|
||||||
|
r0 = 0.007
|
||||||
|
|
||||||
|
U = get_U(a,mass,omega,r0)
|
||||||
|
V = get_V(q,mass,omega,r0)
|
||||||
|
|
||||||
|
print(mass)
|
||||||
|
print(U)
|
||||||
|
print(V)
|
||||||
|
|
||||||
|
|
||||||
|
N = 1000
|
||||||
|
|
||||||
|
t_start = 0
|
||||||
|
t_stop = 1e0
|
||||||
|
|
||||||
|
t = np.linspace(t_start, t_stop, N)
|
||||||
|
|
||||||
|
|
||||||
|
func = -q/r0**2*mass*(t**2*U*0.5+V*np.sin(omega*t)/omega**2)
|
||||||
|
|
||||||
|
x = func
|
||||||
|
y = -func
|
||||||
|
|
||||||
|
plt.close('all')
|
||||||
|
plt.plot(x,y,'ro')
|
||||||
|
plt.show()
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in new issue