{
 "metadata": {
  "name": "",
  "signature": "sha256:1e02413599230fcf3193c09944545ea5772a7d8e9a89055fec5a43dcb6e7435b"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "13: Magnetic properties of solids"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 13.1, Page number 256"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#importing modules\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "chi=-4.2*10**-6;    #magnetic susceptibility\n",
      "H=1.2*10**5;    #magnetic field(A/m)\n",
      "mew0=4*math.pi*10**-7;   #permitivity of free space(H/m)\n",
      "\n",
      "#Calculation\n",
      "M=chi*H;    #magnetisation(A/m)\n",
      "B=mew0*(H+M);   #flux density(T)\n",
      "mewr=(M/H)+1;   #relative permeability\n",
      "\n",
      "#Result\n",
      "print \"magnetisation is\",M,\"A/m\"\n",
      "print \"flux density is\",round(B,3),\"T\"\n",
      "print \"relative permeability is\",round(mewr,6)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "magnetisation is -0.504 A/m\n",
        "flux density is 0.151 T\n",
        "relative permeability is 0.999996\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 13.2, Page number 258"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#importing modules\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "Z=2;   #atomic number\n",
      "mew0=4*math.pi*10**-7;   #permitivity of free space(H/m)\n",
      "e=1.6*10**-19;   #conversion factor from J to eV\n",
      "m=9.1*10**-31;    #mass of electron(kg)\n",
      "N=28*10**26;   #number of atoms(per m**3)\n",
      "r=0.6*10**-10;   #mean radius(m)\n",
      "\n",
      "#Calculation\n",
      "chi=-mew0*Z*e**2*N*r**2/(6*m);   #diamagnetic susceptibility\n",
      "\n",
      "#Result\n",
      "print \"diamagnetic susceptibility is\",round(chi*10**8,3),\"*10**-8\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "diamagnetic susceptibility is -11.878 *10**-8\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 13.3, Page number 259"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#importing modules\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "n=2;\n",
      "a=2.55*10**-10;   #lattice constant(m)\n",
      "chi=5.6*10**-6;   #susceptibility\n",
      "Z=1;\n",
      "mew0=4*math.pi*10**-7;   #permitivity of free space(H/m)\n",
      "e=1.6*10**-19;   #conversion factor from J to eV\n",
      "m=9.1*10**-31;    #mass of electron(kg)\n",
      "\n",
      "#Calculation\n",
      "N=n/(a**3);    #number of electrons per unit volume(per m**3)\n",
      "rbar=math.sqrt(chi*6*m/(mew0*Z*e**2*N));    #radius of atom(m)\n",
      "\n",
      "#Result\n",
      "print \"radius of atom is\",round(rbar*10**10,3),\"angstrom\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "radius of atom is 0.888 angstrom\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 13.4, Page number 260"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#importing modules\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "mew0=4*math.pi*10**-7;   #permitivity of free space(H/m)\n",
      "k=1.38*10**-23;   #boltzmann constant(J/K)\n",
      "T=300;     #temperature(K)\n",
      "N=6.5*10**25;   #number of atoms(per m**3)\n",
      "mew=9.27*10**-24;    \n",
      "\n",
      "#Calculation\n",
      "chi=mew0*N*mew**2/(3*k*T);    #susceptibility\n",
      "\n",
      "#Result\n",
      "print \"susceptibility is\",round(chi*10**7,2),\"*10**-7\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "susceptibility is 5.65 *10**-7\n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 13.5, Page number 260"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#importing modules\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "rho=4370;    #density(kg/m**3)\n",
      "NA=6.02*10**26;   #avagadro number(k/mole)\n",
      "M=168.5;    #molecular weight(kg/kmol)\n",
      "mew0=4*math.pi*10**-7;   #permitivity of free space(H/m)\n",
      "k=1.38*10**-23;   #boltzmann constant(J/K)\n",
      "T=300;     #temperature(K)\n",
      "H=2*10**5;   #electric field(A/m)\n",
      "mew=2*9.27*10**-24; \n",
      "\n",
      "#Calculation\n",
      "N=rho*NA/M;   \n",
      "chi=mew0*N*mew**2/(3*k*T);    #susceptibility\n",
      "M=chi*H;   #magnetisation(A/m)\n",
      "\n",
      "#Result\n",
      "print \"susceptibility is\",round(chi*10**4,4),\"*10**-4\"\n",
      "print \"magnetisation is\",round(M,3),\"A/m\"\n",
      "print \"answer varies due to rounding off errors\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "susceptibility is 5.4298 *10**-4\n",
        "magnetisation is 108.596 A/m\n",
        "answer varies due to rounding off errors\n"
       ]
      }
     ],
     "prompt_number": 17
    }
   ],
   "metadata": {}
  }
 ]
}