b_m=9.27*10**-24 #ampere*m**2 (Bohr Magneton)
Na=6.023*10**23 #atoms/mol (Avogadro's No.)
d=8.9*10**6 #g/m**3 (density)
uo=4*math.pi*10**-7 #Permitivity of free space
A=58.71 #g/mol (Atomic weigth of Nickel)
N=d*Na/A #No. of atoms per cubic meter
M=0.6*b_m*N #0.6= Bohr Magneton/atom
B=uo*M
print"Saturation Magnetisation is ",M,"A/m"
print"Saturation Flux Density is ",round(B,2),"Tesla"
a=0.839*10**-9 #a is edge length in m
b_m=9.27*10**-24 #ampere*m**2 (Bohr Magneton)
nb=8*4 #8 is no. of Fe++ ions per unit cell
#4 is Bohr magnetons per Fe++ ion
M=nb*b_m/a**3 #M is Saturation magnetisation
print"Saturation Magnetisation is ",round(M,0),"A/m"
Ms_Fe=5.25*10**5 #Required saturation Magnetisation
b_m=9.27*10**-24 #ampere*m**2 (Bohr Magneton)
a=0.839*10**-9 #a is edge length in m
M=5*10**5 #From previous question result
nb=Ms_Fe*a**3/b_m
i=8 # No of Divalent ions per unit cell
j=4 #4 is Bohr magnetons per Mn++ ion
n=nb/(i)-j
print"Replacing percent of Fe++ with Mn++ would produce the required saturation magnetisation",round(n*100,2)