# 8: Magnetic materials and Spectroscopy¶

## Example number 8.1, Page number 153¶

In [2]:
#importing modules
import math
from __future__ import division

#Variable declaration
mew=0.9*10**-23;             #magnetic dipole moment(J/T)
B=0.72;                     #magnetic field applied(T)
k=1.38*10**-23;             #boltzmann constant

#Calculation
T=(2*mew*B)/(3*k);          #temperature(K)

#Result
print "The temperature is",round(T,2),"K"

The temperature is 0.31 K


## Example number 8.2, Page number 153¶

In [4]:
#importing modules
import math
from __future__ import division

#Variable declaration
#(C=mew0*M*T)/B.
#Therefore M=(C*B)/(mew0*T)
C=2*10**-3;            #C is curies constant(K)
B=0.4;                #applied magnetic field(T)
mew0=4*math.pi*10**-7;
T=300;                #temperature(K)

#Calculation
M=(C*B)/(mew0*T);     #magnetisation(A/m)

#Result
print "magnetisation is",round(M,2),"A/m"

magnetisation is 2.12 A/m


## Example number 8.3, Page number 153¶

In [7]:
#importing modules
import math
from __future__ import division

#Variable declaration
e=1.6*10**-19;
B=0.35;                  #magnetic field(T)
lamda=500*10**-9;       #wavelength(m)
m=9.1*10**-31;
c=3*10**8;         #speed of light

#Calculation
deltalambda=(e*B*(lamda)**2)/(4*(math.pi)*m*c*10**-9);      #Zeeman shift in wave length(nm)

#Result
print "Zeeman shift in wave length is",round(deltalambda,5),"nm"

Zeeman shift in wave length is 0.00408 nm


## Example number 8.4, Page number 154¶

In [9]:
#importing modules
import math
from __future__ import division

#Variable declaration
#T=(C*B)/(mew0*B)
C=2.1*10**-3;           #C is curie's constant(K)
B=0.38;                #magnetic field(T)
mew0=4*math.pi*10**-7;   #molecular magnetic moment
M=2.15;               #magnetisation(A/m)

#Calculation
T=(C*B)/(mew0*M);     #temperature(K)

#Result
print "Temperature is",round(T,1),"K"
print "answer in the book varies due to rounding off errors"

Temperature is 295.4 K
answer in the book varies due to rounding off errors


## Example number 8.5, Page number 154¶

In [11]:
#importing modules
import math
from __future__ import division

#Variable declaration
#(M1*T1)=(M2*T2).Therefore M2=(M1*T1)/T2
M1=2;                 #Initial magnetisation(A/m)
T1=305;               #Initial temperature(K)
T2=321;		      #final temperature(K)

#Calculation
M2=(M1*T1)/T2;        #magnetisation at 321K(A/m)

#Result
print "Magnetisation at 321 K is",round(M2,1),"A/m"

Magnetisation at 321 K is 1.9 A/m


## Example number 8.6, Page number 154¶

In [13]:
#importing modules
import math
from __future__ import division

#Variable declaration
mew0=4*math.pi*10**-7;        #molecular magnetic moment
M=4;                          #magnetisation(A/m)
T=310;                        #temperature(K)
C=1.9*10**-3;                 #Curie's constant(K)

#Calculation
B=(mew0*M*T)/C;              #magnetic field(T)

#Result
print "Magnetic field is",round(B,2),"T"

Magnetic field is 0.82 T


## Example number 8.7, Page number 154¶

In [16]:
#importing modules
import math
from __future__ import division

#Variable declaration
#e/m is gyromagnetic ratio.
deltalambda=0.01*10**-9;                         #Zeeman shift(m)
c=3*10**8;                                       #speed of light in  vacuum(m/s)
lamda=600*10**-9;                              #wavelength(m)
e=1.6*10**-19;
m=9.1*10**-31;

#Calculation
B=(deltalambda*4*math.pi*m*c)/(e*(lamda)**2);    #uniform magnetic field(T)

#Result
print "Magnetic field is",round(B,4),"T"

Magnetic field is 0.5956 T


## Example number 8.8, Page number 154¶

In [21]:
#importing modules
import math
from __future__ import division

#Variable declaration
deltalambda=0.01*10**-9;                           #Zeeman shift(m)
c=3*10**8;                                      #speed of light in vacuum(m/s)
B=0.78;                                          #magnetic field(T)
lamda=550*10**-9;                              #wavelength(m)

#Calculation
Y=(deltalambda*4*math.pi*3*10**8)/(B*(lamda)**2);    #e/m ratio(C/kg)

#Result
print "e/m ratio is",round(Y/10**11,1),"*10**11 C/kg"
print "answer in the book varies due to rounding off errors"

e/m ratio is 1.6 *10**11 C/kg
answer in the book varies due to rounding off errors