{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Chapter 10 - Dielectric and Magnetic Materials"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 1 - pg 312"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "R : 0.6  x 10^-10 m\n"
     ]
    }
   ],
   "source": [
    "#pg 312\n",
    "#calculate the radius of atom\n",
    "#Given:\n",
    "import math\n",
    "er = 1.0000684; # relative dielectric constant\n",
    "N = 2.7*10**25; # atoms/m^3\n",
    "#We know, er - 1 = 4*pi*N*R^3\n",
    "#calculations\n",
    "R = ((er-1)/(4*math.pi*N))**(1./3) ; # in m\n",
    "#results\n",
    "print\"R :\",round(R*10**10,1),\" x 10^-10 m\"\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 2 - pg 313"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Susceptibility of diamagnetic materials  is -1.0 x 10^-5\n"
     ]
    }
   ],
   "source": [
    "#pg 313\n",
    "#calculate the Susceptibility \n",
    "#Given :\n",
    "import math\n",
    "R = 1; # radius in A\n",
    "N = 5*10**28 ; #  atoms/m**3\n",
    "mu_0 = 4*math.pi*10**-7; # permeability of free space in H/m\n",
    "mu_r = 1;#relative permiability\n",
    "m = 9.1*10**-31 # electron mass in kg\n",
    "e = 1.6*10**-19 ; # charge of an electron in C\n",
    "# R = 1*10**-10 m  because 1 A = 1.0*10**-10 m\n",
    "#calculations\n",
    "chi = -(N*e**2*(R*10**-10)**2*mu_0*mu_r)/(4*m); #Susceptibility of diamagnetic material\n",
    "#results\n",
    "print \"Susceptibility of diamagnetic materials  is\",math.floor(chi*10**5), \"x 10^-5\"\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 3 - pg 320"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Dipole moment (debye) =  0.96\n",
      "Sum = 1.6 x 10**-39 farad m^2\n"
     ]
    }
   ],
   "source": [
    "#pg 320\n",
    "#calculate the dipole moment and Sum\n",
    "#Given :\n",
    "import math\n",
    "e0 = 8.85*10**-12 ; # dielectric constant in farad/m\n",
    "er1 = 1.006715 ; #relative dielectric constant\n",
    "er2 = 1.005970;# relative dielectric constant\n",
    "T1 = 300. ; # Temperature in K  (273+27 = 300 K)\n",
    "T2 = 450.; # Temperature in K  (273 + 177 = 450 K)\n",
    "k = 1.38*10**-23; # in J/K\n",
    "N = 2.44*10**25 ; # molecules/m**3\n",
    "#calculations\n",
    "#e0*(er1 - er2)= ((N*mu_p**2)/(3*k))*((1/T1)- (1/T2))\n",
    "mu_p = math.sqrt((e0*(er1 - er2)*3*k)/(((1/T1)-(1/T2))* N)); #dipole moment in C m\n",
    "D = 3.3*10**-30; # dipole of 1 Debye is equal to 3.33 x 10**-30 C m \n",
    "#e0*(er1 - 1) = N*(alpha_e + alpha_i + (mu_p**2/3*k*T1))\n",
    "Sum = ((e0*(er1 - 1))/N) - ((mu_p)**2/(3*k*T1)); # alpha_e + alpha_i   in farad m**2\n",
    "#results\n",
    "print \"Dipole moment (debye) = \",round(mu_p/D,2)\n",
    "print \"Sum =\",round(Sum*10**39,1),\"x 10**-39 farad m^2\"\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 4 - pg 321"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " E = 1.55 x 10^7 V/m\n"
     ]
    }
   ],
   "source": [
    "#pg 321\n",
    "#calculate the value of E\n",
    "#Given :\n",
    "mu_p = 1.2 ;# dipole moment in debye units\n",
    "T = 300 ; # Temperature in Kelvin ( 273+27 = 300 K)\n",
    "k = 1.38*10**-23 ; #  in J/K\n",
    "per = 0.5/100 ; # percentage of saturated polarisation\n",
    "# 0.05*N*mu_p = (N*(mu_p)**2*E/(3*k*T))\n",
    "#calculations\n",
    "E = (3*k*T*per)/(mu_p*3.33*10**-30); # External field in V/m\n",
    "#results\n",
    "print \" E =\",round(E*10**-7,2),\"x 10^7 V/m\"\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 5 - pg 321"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Susceptibility = 1.0 x 10**-3\n",
      "Result obtained differs from that in textbook, because in textbook only the order is considered\n"
     ]
    }
   ],
   "source": [
    "#pg 321\n",
    "#calculate the Susceptibility\n",
    "import math\n",
    "#Given :\n",
    "N = 5*10**28 ;# number of dipoles per m**3\n",
    "betaa = 1;# Bohr magneton\n",
    "T = 300 ; # Room temperature in k\n",
    "k = 1.38*10**-23 ; #  in J/K\n",
    "mu_0 = 4*math.pi*10**-7 ; #Magnetic permeability in H/m\n",
    "#calculations\n",
    "chi = (N*mu_0*betaa*(1*9.27*10**-24)**2)/(k*T);\n",
    "#results\n",
    "print \"Susceptibility =\",round(chi*10**3,0),\"x 10**-3\"\n",
    "print 'Result obtained differs from that in textbook, because in textbook only the order is considered'\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 6 - pg 324"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Relative dielectric constant =  3.81\n"
     ]
    }
   ],
   "source": [
    "#pg 324\n",
    "#calculate the Relative dielectric constant\n",
    "#Given :\n",
    "M = 32.; # Atomic weight in kg/kmole\n",
    "Na =6.023*10**26 ; # Avogadro constant in atoms/kmole\n",
    "alpha_e = 3.28*10**-40; # electronic polarisability in farad/m**2\n",
    "rho = 2.08; #density in gm/cm**3\n",
    "e0 = 8.85*10**-12 ; # dielectric constant in farad/m\n",
    "# (er - 1)/(er + 2)  = (N*alpha_e/3*e0)\n",
    "#1 gm = 1.0*10**-3 kg , 1 cm**3 = 1.0*10**-6 m**3\n",
    "#calculations\n",
    "N = (Na*(rho*10**3))/M; #  atoms/m**3\n",
    "er =( 2*((N*alpha_e)/(3*e0)) + 1 )/(1 - ((N*alpha_e)/(3*e0)));\n",
    "#results\n",
    "print \"Relative dielectric constant = \",round(er,2)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 7 - pg 326"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Power loss (W) =   250.0\n"
     ]
    }
   ],
   "source": [
    "#pg 326\n",
    "#calculate the Power loss\n",
    "#Given :\n",
    "area = 50000.; # area of hysteresis on a graph\n",
    "axis1 = 10**-4 ; # units of scale in Wb/m**2\n",
    "axis2 = 10**2; # units of scale in A/m\n",
    "vol = 0.01; # volume in m**3\n",
    "F = 50; #frequency in Hz\n",
    "#calculations\n",
    "E1 = area*axis1*axis2; # Energy lost per cycle in J/m**3\n",
    "E2 = E1*vol ; # Energy lost in core per cycle in J\n",
    "P = E2*F; # Power loss in W\n",
    "#results\n",
    "print \"Power loss (W) =  \",P\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 8 - pg 328"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "U = 21.5 x 10^-25 \n"
     ]
    }
   ],
   "source": [
    "#pg 328\n",
    "#calculate the value of energy \n",
    "import math\n",
    "#Given :\n",
    "mu_d = 9.27*10**-24; # Bhor magneton in Am**2\n",
    "mu_0 = 4*math.pi*10**-7; # Magnetic permiability in H/m\n",
    "r = 2; # dipoles distance in A\n",
    "#U = mu_d*B = -( mu_0*mu_d**2)/(2*pi*r)\n",
    "#r = 2*10**-10 m , 1 A = 1.0*10**-10 m\n",
    "#calculations\n",
    "U = ( mu_0*mu_d**2)/(2*math.pi*(r*10**-10)**3); # Energy \n",
    "print \"U =\",round(U*10**25,1),\"x 10^-25 \"\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 9 - pg 329"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " Saturation Magnetisation = 3.14 x 10^6 A/m\n"
     ]
    }
   ],
   "source": [
    "#pg 329\n",
    "#calculate the Saturation magnetisation\n",
    "#Given :\n",
    "a = 2.87; # lattice constant in A\n",
    "mu = 4.; # 4 Bohr magnetons/atom\n",
    "# BCC = 2 atoms/unit cell , 1 A = 1.0*10**-10 m\n",
    "N = 2./(2.87*10**-10)**3; # atoms/m**3\n",
    "#calculations\n",
    "#1 Bohr magneton = 9.27*10**-24 Am**2\n",
    "Msat = N*mu*9.27*10**-24;# Saturation in magnetisation in A/m\n",
    "#results\n",
    "print \" Saturation Magnetisation =\",round(Msat*10**-6,2),\"x 10^6 A/m\"\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 10 - pg 338"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Percentage =  78.3\n"
     ]
    }
   ],
   "source": [
    "#pg 338\n",
    "#calculate the percentage attributed to polarisability\n",
    "#Given :\n",
    "er = 6.75 ; # relative dielectric constant for glass\n",
    "f = 10**9 ;# frequency in Hz\n",
    "n = 1.5;# refractive index of glass\n",
    "e0 = 8.85*10**-12; # dielectric constant in farad/m\n",
    "#Pe = e0*(n**2 - 1)*E  , Pi = e0*(er - n**2)*E ,  P = Pi + Pe = e0*(er - 1)*E\n",
    "#Percentage = [(e0*(er - n**2)*E)/(e0*(er -1)*E)]*100 , both the E's cancel each other\n",
    "#calculations\n",
    "per = (e0*(er - n**2))/(e0*(er -1))*100;# percentage\n",
    "print \"Percentage = \",round(per,1)\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
