from __future__ import division
import math
K=5*10**6 #ev
e=1.6*10**-19 #in coul
K1=K*e #in joules
m=1.7*10**-27 #in kg
B=1.5 #wb/m
theta=math.pi/2
v=math.sqrt(2*K1/m)
print("Speed of the proton in meters/sec is %.2f"%v)
F=e*v*B*math.sin(theta)
print("Force acting on proton in nt is %.3e"%F)
from __future__ import division
import math
N=250 #turns in coil
i=1.0*10**-4 #in amp
B=0.2 #wb/m2
h=2*10**-2 #coil height in m
w=1.0*10**-2 #width of coil in m
Q=30 #angular deflectin in degrees
theta=math.pi/2
A=h*w
k=N*i*A*B*math.sin(theta)/Q
print("Torssional constant in nt-m/deg is %.3e"%k)
from __future__ import division
import math
N=100 #turns in circular coil
i=0.10 #in amp
B=1.5 #in wb/m2
a=5*10**-2 #radius of coil in meter
u=N*i*math.pi*(a**2) #u is dipole moment
U1=(-u*B*math.cos(0))
U2=-u*B*math.cos(math.pi)
W=U2-U1
print("Work required to turn current in an external magnetic field from theta=0 to theta=180 degree in joule is ",W)
from __future__ import division
i=200 #current in the strip in amp
B=1.5 #magnetic field in wb/m2
n=8.4*10**28 #in m-3
e=1.6*10**-19 #in coul
h=1.0*10**-3 #thickness of copper strip in metre
w=2*10**-2 #width of copper strip in meter
Vxy=i*B/(n*e*h)
print("Hall potential difference aross strip in volt is",Vxy,"or","%.7f"%Vxy)
from __future__ import division
import math
m=9.1*10**-31 # in kg
v=1.9*10**6 #in m/sec
q=1.6*10**-19 #charge in coul
B=1.0*10**-4 #in wb/m2
#(A)
r=m*v/(q*B)
print("(A) Orbit radius in meter is %.7f"%r)
#(B)
f=q*B/(2*math.pi*m)
print("(B) Cyclotron frequency in rev/sec is %.1f"%f)
#(C)
T=1/f
print("(C) Period of revolution in sec is %.7f"%T)
from __future__ import division
import math
f0=12*10**6 #cyclotron frequency in cycles/sec
r=21#dee radius in inches
R=r*0.0254 #dee radius in meter
q=1.6*10**-19 #charge in coul
m=3.3*10**-27 #in kg
#(A)
B=2*math.pi*f0*m/q
print("(A) Magnetic induction needed to accelerate deuterons in wb/m2 is",B)
#(B)
K=((q**2*B**2*R**2)/(2*m))
print("(B) Deuteron energy in joule is %.3e"%K)
K1=K*(1/(1.6*10**-19))
print(" Deuteron energy in ev is %d"%K1)