## Calculate the net magnetic moment per iron atom in crystal
import math
a = 2.87 ## lattice parameter in angstrom
n = 2. ## number of atoms per unit cell
m = 1750. ## Saturation magnetization in kAm^-1
mu = 9.273e-24 ## bohr magneton
print("\n Example 16.1")
m_atom = m*1e3*(a*1e-10)**3. /n
mu_b = m_atom/mu
print'%s %.2e %s '%("\n Net magnetic moment per iron atom in crystal is ",m_atom," Am^2")
print'%s %.2f %s '%("\n In unit of mu_b, Net magnetic moment per iron atom in crystal is ",mu_b,"")
#due to round of error
## Comparison of saturation temperatures
import math
t1 = 0. ## temperature in kelvin
t2 = 300. ## temperature in kelvin
m_net_Gd = 7. ## net magnetic moment of gadolinium
m_net_Co = 1.7 ## net magnetic moment of cobalt
t_c_Gd = 289. ## curie temperature for Gd
print("\n Example 16.2")
print("\n Part A:")
if m_net_Gd> m_net_Co :
print'%s %.2f %s %.2f %s %.2f %s '%("\n At",t1," K" and " Net magnetic moment of gadolinium i.e. ",m_net_Gd," is greater than net magnetic moment of cobalt i.e. " and "",m_net_Co,"")
print("\n So, Gd will have higher saturation magnetization")
print("\n\n Part B:")
if t_c_Gd<t2 :
print'%s %.2f %s %.2f %s '%("\n At temperature ",t2," K, Gd is above its curie temperature of ",t_c_Gd,"K")
print'%s %.2f %s '%("\n Gd will be paramagnetic at ",t2," K and will have negligible magnetization\n as compared to Co, which has higher curie temperature")
## Calculation of hysteresis loss
import math
v = 0.01 ## volume in m**3
x = 1e-4 ## axis intercept
y = 1e2 ## axis intercept
a = 60000. ## Hysteresis loop area
f = 50. ## frequency in Hz
print("\n Example 16.4")
e = x*y*a ## Energy loss in one loop
E = e*v ## energy loss in core in one cycle
P = E*f ## Power loss
print'%s %.2f %s '%("\n Power loss due to hysteresis is",P," W")
## Calculation of eddy current loss at normal voltage and frequency
import math
Total1 = 2300. ## total iron loss in W at 440 V and 50 Hz
Total2 = 750. ## total iron loss in W at 220 V and 25 Hz
print("\n Example 16.5")
W_e = 1./2.*(Total1-2.*Total2)
print'%s %.2f %s '%("\n Eddy current loss at normal voltage and frequency is ",4*W_e,"W")