from math import sqrt
# Given
V = 500 # voltage across the electrode in eV
m = 9e-31 # mass of electron in kg
e = 1.6e-19 # charge on an electron in coulomb
#Calculations
E = e * V
v = sqrt((2 * e * V) / m)
p = m * v
#Result
print "Energy gained by electron = %.e J\nSpeed of electron = %.2e meter/sec\nMomentum of electron = %.2e kg-meter/sec"%(E,v,p)
# Given
v = 2.5e6 # speed of electron in meter/sec
B = 2e-4 # magnetic field in tesla
r = 1.76e11 # ratio of charge on electron to the mass of electron in C/kg
#Calculations
a = (B * r * v)
#Result
print "Momentum of acceleration = %.2e meter/square sec."%a
# Given that
v = 5.2e6 # speed of electron in meter/sec
B = 1.3e-4 # magnetic field in tesla
r = 1.76e11 # ratio of charge on electron to the mass of electron in C/kg
E = 3.2e-12 # energy of the electron beam in J
M = 9e-31 # mass of an electron in kg
R = v / (r * B)
v_ = sqrt((2 * E) / M )
print "Radius of circle traced by the beam = %.1f cm. \nSpeed of beam in second case = %.2e meter/sec"%(R*100,v_)
print "Speed of beam in second case is greater than speed of light so we cannot use above formula."
# Given
V = 2.500e3 # voltage across the electrode in V
E = 3.6e4 # strength of electric field in V/m
B = 1.2e-3 # magnetic field in tesla
#Calculation
r = (E / B)**2 / (2 * V)#calculation for ratio of the charge on an electron to the mass of an electron
#Result
print "Ratio of the charge on an electron to the mass of an electron = %.1e C/kg."%r
from math import sqrt
# Given
M = 9.1e-31 # mass of electron in kg
E = 1.6e-15 # energy of electron in J
B = 5e-5 # magnetic field in tesla
e = 1.6e-19 # charge on an electron in coulomb
#Calculations
v = sqrt((2 * E) / M)
r = (M * v) / (e * B)
#Result
print "Larmoure radius = %.2f meter"%r
# Given
Mp = 1.67e-27 # mass of proton in kg
v = 3e5 # speed of proton in meter/sec
B = 5e-9 # magnetic field in tesla
e = 1.6e-19 # charge on a proton in coulomb
#Calculation
r = (Mp * v) / (e * B)#calculation for Larmour radius
#Result
print "Larmour radius = %.2e meter"%r
from math import sqrt, pi
# Given
M = 6.68e-27 # mass of helium ion in kg
E = 1.6e-16 # energy of helium ion in J
B = 5e-2 # magnetic field in tesla
e = 1.6e-19 # charge on helium ion in coulomb
#calculations
v = sqrt((2 * E) / M)#calculation for velocity
r = (M * v) / (e * B)#calculation for Larmour radius
A = pi * r**2#calculation for area traced by the trajectory of helium ion
#Result
print "Area traced by the trajectory of helium ion = %.3f square meter"%A
# Given
E = 100 # strength of electric field in V/m
B = 1e-3 # magnetic field in tesla
#Calculation
v = E / B
#Result
print "The drift of the guiding center = %.e m/sec"%v
# Given
v = 1e6 # velocity of ion beam in m/sec
B = 1 # magnetic field in tesla
#Calculation
E = B * v
#Result
print "Internal electric field = %.e V/m"%E
# Given
r = 1.1 # ratio of new number of turns to the initial number of turns
#Calculation
r_ = (1 / r)**2
#Result
print "Ratio of the new focus length to the initial focus length = %.3f "%r_