{
 "metadata": {
  "name": "",
  "signature": "sha256:fbb68fbb0713029438d419fcf28fa2bcf0bc60f8a093b90691d3e7397e7a942d"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 8:Magnetic Properties"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.1, Page number 8.3"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#Variable declaration\n",
      "M = 1.4        #value of magnetic field when filled with iron\n",
      "H = 6.5*10**-4 #value of magnetic field in the interior\n",
      "\n",
      "#Calculations\n",
      "x = M/H\n",
      "ur = 1+x\n",
      "\n",
      "#Result\n",
      "print \"Relative permeability of iron is\",round(ur,2),\"(Calculation mistake in textbook)\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Relative permeability of iron is 2154.85 (Calculation mistake in textbook)\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.2, Page number 8.3"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#Variable declaration\n",
      "M = 3300    #value of magnetic filed(amp/m) \n",
      "H = 220     #strength of magnetic filed(amp/m)\n",
      "\n",
      "#Calculations\n",
      "x = (M/H)+1\n",
      "\n",
      "#Result\n",
      "print \"Relative permeability of iron is\",round(x,2)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Relative permeability of iron is 16.0\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.3, Page number 8.4"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "from math import pi\n",
      "\n",
      "#Variable declaration\n",
      "H = 10**6        #magnetic field intensity(amp/m)\n",
      "x = 1.5*10**-3   #susceptibility\n",
      "Uo = 4*pi*10**-7 \n",
      "\n",
      "#Calculations\n",
      "M = x*H       #magnetization of material\n",
      "B = Uo*(M+H)  #flux density\n",
      "\n",
      "#Result\n",
      "print \"Magnetization =\",round((M/1E+3),1),\"*10^3 A/m\"\n",
      "print \"Flux density =\",round(B,3),\"T\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Magnetization = 1.5 *10^3 A/m\n",
        "Flux density = 1.259 T\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.4, Page number 8.4"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "from math import pi\n",
      "\n",
      "#Variable declaration\n",
      "H = 10**4        #magnetic field intensity(amp/m)\n",
      "x = 3.7*10**-3   #susceptibility\n",
      "Uo = 4*pi*10**-7 \n",
      "\n",
      "#Calculations\n",
      "M = x*H       #magnetization of material\n",
      "B = Uo*(M+H)  #flux density\n",
      "\n",
      "#Result\n",
      "print \"Magnetization =\",M,\"A/m\"\n",
      "print \"Flux density =\",round(B,4),\"wb/m^2\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Magnetization = 37.0 A/m\n",
        "Flux density = 0.0126 wb/m^2\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.5, Page number 8.14"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "from math import pi\n",
      "\n",
      "#Variable declaration\n",
      "I = 500*10**-3  #current(A)\n",
      "d = 10*10**-2   #diameter of loop(m)\n",
      "\n",
      "#Calculations\n",
      "r = d/2         #radius(m)\n",
      "A = 2*pi*r**2   #area(m^2)\n",
      "Um = I*A\n",
      "\n",
      "#Result\n",
      "print \"Magnetic moment =\",round((Um/1E-3),3),\"*10^-3 A-m^2\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Magnetic moment = 7.854 *10^-3 A-m^2\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.6, Page number 8.18"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#Variable declaration\n",
      "r = 5.29*10**-11  #radius of the orbit(m)\n",
      "B = 2             #field strength(Tesla)\n",
      "e = 1.602*10**-19 #charge of an electron(C)\n",
      "m = 9.108*10**-31 #mass of an electron(kg)\n",
      "\n",
      "#Calculation\n",
      "Uind = (e**2*r**2*B)/(4*m)\n",
      "\n",
      "#Result\n",
      "print \"Change in magnetic moment =\",round((Uind/1E-29),3),\"*10^-29 A-m^2\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Change in magnetic moment = 3.943 *10^-29 A-m^2\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.7, Page number 8.22"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#Varaible declaration\n",
      "T1 = 350         #temperature(K)\n",
      "x1 = 2.8*10**-4  #susceptibility at T1\n",
      "T2 = 300         #temperature(K)\n",
      "\n",
      "#Calculation\n",
      "x2 = (x1*T1)/T2\n",
      "\n",
      "#Result\n",
      "print \"Susceptibility at 300k is\",round((x2/1E-4),3),\"*10^-4\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Susceptibility at 300k is 3.267 *10^-4\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.8, Page number 8.27"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "from math import pi \n",
      "\n",
      "#Variable declaration\n",
      "den = 8906          #density of nickel(kg/m^3)\n",
      "N = 6.025*10**26    #Avogadro's number\n",
      "Ma = 58.7           #atomic weight\n",
      "Bs = 0.65           #magnetic induction(wb/m^2)\n",
      "Uo = 4*pi*10**-7\n",
      "\n",
      "#Calculations\n",
      "n = (den*N)/Ma      #no. of nickel atoms per m^3\n",
      "\n",
      "#Since x is very large, B = n*Uo*Um\n",
      "Um = Bs/(n*Uo))\n",
      "\n",
      "#Result\n",
      "print \"Magnetic moment =\",Um,\"A-m^2\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Magnetic moment = 5.65850692635e-24 A-m^2\n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.9, Page number 8.28"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "H = 2         #magnetic filed intensity(wb/m^2)\n",
      "U = 9.4*10**-24\n",
      "k = 1.38*10**-23\n",
      "\n",
      "#Calculations\n",
      "'''\n",
      "n = c*no*exp(-Eg/kT)   #no. of electrons\n",
      "where Eg = -U*H\n",
      "For parallel orientation,Eg = -U*H\n",
      "For antiparallel orientation, Eg = U*H\n",
      "therefore,\n",
      "np = c*no*exp(U*H/kT)  ---(1)\n",
      "na = c*no*exp(-U*H/kT) ---(2)\n",
      "Dividing (1) by (2), we get,'''\n",
      "\n",
      "T = (2*U*H)/(math.log(2)*k)\n",
      "\n",
      "#Result\n",
      "print \"T=\",round(T,1),\"K\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "T= 3.9 K\n"
       ]
      }
     ],
     "prompt_number": 34
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.10, Page number 8.29"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "from math import pi\n",
      "\n",
      "#Variable declaration\n",
      "Uo = 4*pi*10**-7\n",
      "Ma = 157.26       #atomic weight og gadolinium\n",
      "den = 7.8*10**3   #density(kg/m^3)\n",
      "N = 6.025*10**26  #Avogadro's number\n",
      "x = 7.1           #Bohr magnetron per atom\n",
      "Um = 9.27*10**-24\n",
      "\n",
      "#Calculations\n",
      "n = (den*N)/Ma    #no. of atoms in 1 kg\n",
      "n1 = n*10**-3     #no. of atoms in 1 gm\n",
      "M = n1*x*Um         #magnetic moment per gram(a-m^2)\n",
      "\n",
      "Bs = n*Uo*Um      #saturization magnetization\n",
      "\n",
      "#Result\n",
      "print \"Magnetic moment per gram =\",round(M,3),\"Am^2\"\n",
      "print \"Saturization magnetization =\",round(Bs,3),\"Wb/m^2(Calculation mistake in textbok)\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Magnetic moment per gram = 1966.851 Am^2\n",
        "Saturization magnetization = 0.348 Wb/m^2(Calculation mistake in textbok)\n"
       ]
      }
     ],
     "prompt_number": 41
    }
   ],
   "metadata": {}
  }
 ]
}