In [6]:

```
from math import sqrt
q=1.6*10**-19 #charge of electron
V=5000 #potential difference
m=9.1*10**-31 #mass of electron
v=sqrt(2*q*V/m) #speed of electron
print "Speed of the electron, v =sqrt(2*q*V/m) = %0.2e m/s"% v
ke=(q*V)/(1.6*10**-9) #kinetic energyin eV
x1=ke*10**10
print "The kinetic energy = q x V = %0.f eV"%x1
```

In [1]:

```
from math import sqrt
me=1000*9.1*10**-31
print "Mass of the charged particle = 1000 times the mass of an electron = %0.2e kg"%me
print "The charge of the partical = 1.6*10**-19 C"
q=1.6*10**-19 #charge of the particle
V=1000 #potential difference
v=sqrt(2*q*V/me)
print "Therefore, The velocity, v = sqrt(2*q*V/me) = %0.2e m/s"%v
ke=(q*V)/(1.6*10**-19) # in eV
print "Kinetic energy = q x V = %0.2f eV"%ke
```

In [2]:

```
from sympy import symbols, solve
from math import sqrt
d=6*10**-3
q=1.6*10**-19
m=9.1*10**-31
vax=3*10**6
E=350/d
print "Therefore, E = V / d = %0.2e "%E
ax=q*E/m
print " ax = qE / m = %0.2e m/s**2"%ax
print "We know that,"
print " x = vox*t + 0.5*a*t**2"
print " vx = vox + ax*t"
print "(i) Consider x = 3*10**-3 m"
print "3*10**-3 = 3*10**6*t + 5.13*10**15*t**2"
print "Solving this equation,"
t=symbols('t')
p1=(5.13*10**15)*t**2+(3*10**6)*t-3*10**-3
t1=solve(p1,t)
ans1=t1[1]
print "t = %0.2e seconds "%ans1
vx=(3*10**6)+((1.026*10**16)*(5.264*10**-10))
print "vx = %0.2e m/s "%vx
print "(ii) Consider x = 6*10**-6 m"
print "t**2+(5.85*10**-10)*t-(1.17*10**-18) = 0"
print "Solving this equation,"
t=symbols('t')
p2=t**2+(5.85*10**-10)*t-1.17*10**-18
t2=solve(p2, t)
ans2=t2[1]
print "t = %0.2e seconds "%ans2
vx1=(3*10**6)+((8.28*10**-10)*(1.026*10**16))
print "vx = %0.2e m/s"%vx1
```

In [3]:

```
from math import sqrt
V=200
m=9.1*10**-31
v=sqrt(2*q*V/m)
print "(i)The electron starts from rest at plate A, therefore, the initial velocity is zero. The velocity of electron on reaching plate B is"
print "v = sqrt(2*q*V/m) = %0.2e m/s"%v
iv=0 #initial velocity
fv=8.38*10**6 #final velocity
va=(iv+fv)/2 #average velocity of electron in transit
print "(ii)Time taken by the electron to travel from plate A to plate B can be calculated from the average velocity of the electron in transit.The average velocity is,"
print "vaverage = (Initial velocity + Final velocity) / 2 = %0.2e m/s"%va
sp=3*10**-3 #separation between the plates
time=sp/va
print "Therefore, time taken for travel is,"
print "Time = Separation between the plates / Average velocity = %0.2e seconds"%time
ke=q*V
print "(iii)Kinetic energy of the electron on reaching the plate B is"
print "Kinetic energy = q V = %0.2e Joules"%ke
```

In [22]:

```
from math import sqrt
vinitial=1*10**6
q=1.6*10**-19
V=300
m=9.1*10**-31
vfinal=10.33*10**6
sp=8*10**-3 #separation between plates
v=sqrt(vinitial**2+(2*q*V/m))
print "The speed acquired by electron due to the applied voltage is"
print "v = sqrt(vinitial**2+(2*q*V/m)) = %0.2e m/s"%v
va=(vinitial+vfinal)/2
print "The average velocity,"
print "vaverage = (vinitial + vfinal) / 2 = %0.2e m/s"%va
time=sp/va
print "Therefore, time for travel = seperation between plates / vaverage = %0.2e seconds"%time
```

In [24]:

```
from math import sqrt
d=(5*10**11*1.76*10**11)*(((1*10**-9)**3)/6)
x1=d*10**6
print "The electric field intensity,"
print "E = -5t / d*10*-9 = -5t / 10**-9*1*10**-2 = 5*10**11*t (for 0 < t < t1)"
print " = 0 (for t1 < t < infinity)"
print "(i) The position of the electron after 1ns,"
print " d(um) = (5*10**11)*(1.76*10**11)*((1*10**-9)**3/6) = %0.2f um"%x1
x2=0.8-(d*10**2)
print "(ii) The rest of the distance to be covered by the electron = 0.8cm - 14.7 um = %0.2f"%x2
print "Since, the potential difference drops to zero volt, after 1ns, the electron will travel the distance of 0.799 cm with a constant velocity of"
vx=(5*10**11*1.76*10**11)*(((1*10**-9)**2)/2)
print "vx = (5*10**11)*(q/m)*(t**2/2) = %0.2e m/s"%vx
x3=(x2/vx)*10**-2
print "Therefore, the time t2 = d / vx = %0.2e seconds"%x3
x4=(1*10**-9)+x3
print "The total time of transit of electron from cathode to anode = %0.2e seconds"%x4
```

In [27]:

```
from math import pi,sqrt
q=1.6*10**-19
Va=40
m=9.1*10**-31
B=0.91
ve=sqrt(2*q*Va/m)
print "The velocity of the electron is = sqrt(2qVa/m) = %0.2e m/s"%ve
tt=(2*pi*m)/(B*q)
print "The time taken for one revolution is T = 2*pi*m / B*q = %0.2e seconds"%tt
p=tt*ve*(sqrt(3)/2) #cos(30)=sqrt(3)/2
print "The pitch = T*v*cos(theta) = %0.2e meters"%p
print "Thus, the electron has travelled = %0.2e meters"%p
```

In [30]:

```
from math import radians as rdn, sin,pi,sqrt
radians=rdn(25)
q=1.6*10**-19
m=9.1*10**-31
V=50
Q=3*q
M=2*m
v=sqrt(2*Q*V/M)
print "(i) The velocity of the charged particle before entering the field is,"
print "v = sqrt(2aV/m) * sqrt(2(3q)V/2m) = sqrt(6qV/2m) = %0.2e m/s"%v
B=0.02
r=(M*v*sin(radians))/(Q*B)
r1=r*10**3
print "(ii) The radius of the helical path is"
print "r = Mvsine(theta) / QB = 2mvsine(theta) / 3qB = %0.2f mm"%r1
T=(2*pi*M)/(B*Q)
print "(iii) Time for one revolution,"
print "T = 2*pi*M / B*Q = 2*pi*(2m) / B(3q) = %0.2e seconds"%T
```

In [32]:

```
from math import pi,sqrt
print "Given, T = 35.5/B *10**-12 s, B = 0.01 Wb/m**3, Va = 900V"
print "Therefore, T = 3.55*10**-9 s"
T = 3.55*10**-9
Va=900
v=sqrt(2*(1.76*10**11)*900)
print "Velocity, v(m/s) = sqrt(2qVa/m) = %0.2e m/s"%v
r=(17.799*10**6)/(0.01*1.76*10**11)
x1=r*10**3
print "Radius, r(mm) = mv/qB = v/(q/m)B = %0.2f mm"%x1
```

In [33]:

```
from math import pi,sqrt
Va=600
l=3.5
d=0.8
L=20
Vd=20
format(9)
q=1.6*10**-19
m=9.1*10**-31
v=sqrt(2*q*Va/m)
print "(i) The velocity of the electron, v = %0.2e m/s"%v
a=(q/m)*(Vd/d)
a1=a*10**2
print "(ii) ma = qE"
print "Thus, acceleration, a(m/s)= qE / m = (q/m)(Vd/d) = %0.2e m/s"%a1
D=(l*L*Vd)/(2*Va*d)
print"(iii) The deflection on the screen, D(cm)= ILVd / 2Vad = %0.2f cm"% D
Ds=D/Vd
print "(iv) Deflection sensitivity(cm/V)= D / Vd = %0.2f cm/V"%Ds
```

In [34]:

```
from math import pi,sqrt
q=1.6*10**-19
m=9.1*10**-31
Va=800
l=2
d=0.5
L=20
D=1
v=sqrt(2*q*Va/m)
print "(i) The velocity of the beam, v = sqrt(2qVa / m) = %0.2e m/s"%v
Vd=(D*2*d*Va)/(l*L)
print "(ii) The deflection of the beam, D = lLVd / 2dVa"
print "Therefore, the voltage that must be applied to the plates, Vd = %0.2f V"%Vd
```

In [50]:

```
from __future__ import division
from math import degrees, atan
v=sqrt((2*(1.6*10**-19)*1000)/(9.1*10**-31))
print "(i) Velocity of beam, v = sqrt(2qVa/m) = %0.2e m/s"%v
D=((2*10**-2)*(20*10**-2)*25)/(2*1000*(0.5*10**-2))
print "(ii) Deflection sensitivity = D/Vd"
print "where D = l*L*Vd / 2*Va*d = %0.2f cm"%D
ds=D/25
print "Therefore, the deflection sensitivity = %0.2e cm/V"%ds
theta=degrees(atan(1/1800))
print "(iii) To find the angle of deflection, theta :"
print " tan(theta) = D/L-l"
print "Therefore, theta = tan**-1(D/L-l) = %0.3f degrees"%theta
```

In [52]:

```
from math import cos,pi
v0=3*10**5
E=910
theta=60
m=9.109*10**-31
q=1.6*10**-19
print "The electron starts moving in the +y direction, but, since acceleration is along the -y direction, its velocity isreduced to zero at time t=t''"
v0y=v0*cos(theta*pi/180)
print "v0y = v0 * cos(theta) = %0.2e m/s"%v0y
ay=(q*E)/m
print "ay = qE / m = %0.2e m/s**2"%ay
tdash=v0y/ay
x1=tdash*10**9
print "t'' = v0y / ay = %0.2f ns"%x1
```

In [43]:

```
from math import pi,sqrt
D=(((2*10**-2)*(1*10**-4)*(20*10**-2))/sqrt(800))*sqrt((1.6*10**-19)/(2*9.1*10**-31))
x1=D*10**2
print "The deflection of the spot,"
print "D = (IBL/sqrt(Va))*sqrt(q/2m) = %0.2f cm"%x1
```

In [4]:

```
from math import pi,sqrt
print "The magnetostatic deflection, D = (IBL/sqrt(Va))*sqrt(q/2m)"
print "The electrostatic deflection, D = lLVd / 2dVa"
print "For returning the beam back to the centre, the electrostatic deflection and the magnetostatic deflection must be equal, i.e.,"
print "(IBL/sqrt(Va))*sqrt(q/2m) = lLVd / 2dVa"
print "Therefore,"
Vd=(1*10**-2*2*10**-4)*sqrt((2*800*1.6*10**-19)/(9.1*10**-31))
print "Vd = dB*sqrt(2*Va*q/m) = %0.2f V"%Vd
```