{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 12: Magnetic Properties of Materials"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.1, Page 603"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "H = 5e+3;   # Coercivity of a bar magnet, A/m\n",
      "L = 0.1;   # Length of the solenoid, m\n",
      "N = 50;   # Turns in solenoid\n",
      "n = 500;   # Turns/m\n",
      "\n",
      "#Calculations\n",
      "# Using the relation\n",
      "I = H/n;   # where I is the current through the solenoid\n",
      "\n",
      "#Result\n",
      "print \"The current through the solenoid is = %2d A\"%I\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The current through the solenoid is = 10 A\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 10.2, Page 603"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "n = 500;   # Number of turns wound per metre on the solenoid\n",
      "i = 0.5;   # Current through the solenoid, A\n",
      "V = 1e-03;   # Volume of iron rod, per metre cube\n",
      "mu_r = 1200;    # Relative permeability of the iron\n",
      "\n",
      "#Calculations&Results\n",
      "H = n*i;    # Magnetic intensity inside solenoid, ampere-turn per metre\n",
      "# As B = mu_o * (H + I) => I = B/mu_o -  H \n",
      "# But B = mu_o * mu_r * H and solving for I \n",
      "I = (mu_r - 1) * H;\n",
      "print \"The Intensity of magnetisation inside the solenoid, I = %5.3e A/m\"%I\n",
      "M = I * V;    # Magnetic moment of the rod, ampere metre square \n",
      "print \"The magnetic moment of the rod, M = %3d ampere metre square\"%M\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The Intensity of magnetisation inside the solenoid, I = 2.998e+05 A/m\n",
        "The magnetic moment of the rod, M = 299 ampere metre square\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 10.3, Page 604"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "n = 300;   # Number of turns wound per metre on the solenoid\n",
      "i = 0.5;   # Current through the solenoid, A\n",
      "V = 1e-03;   # Volume of iron rod, per metre cube\n",
      "mu_r = 100;    # Relative permeability of the iron\n",
      "\n",
      "#Calculations&Results\n",
      "H = n*i;    # Magnetic intensity inside solenoid, ampere-turn per metre\n",
      "# As, I = (B-mu_o* H)/mu_o\n",
      "#But, B= mu * H = mu_r * mu_o * H and I = (mu_r-1)* H\n",
      "I = (mu_r-1)*n*i; \n",
      "print \"The Intensity of magnetisation inside the solenoid, I = %5.3e A/m\"%I\n",
      "l = 0.2;   #length of the rod,m\n",
      "r = 5e-3;   #radius of the rod,m\n",
      "V = 1.57e-5;   #V=%pi*r^2*l where the volume of the rod having radius r and length,m\n",
      "M = I * V ;    # Magnetic moment of the rod, ampere metre square\n",
      "print \"The magnetic moment of the rod, M = %5.3f ampere metre square\"%M\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The Intensity of magnetisation inside the solenoid, I = 1.485e+04 A/m\n",
        "The magnetic moment of the rod, M = 0.233 ampere metre square\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.4, Page 605"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import *\n",
      "\n",
      "#Variable declaration\n",
      "B = 0.0044;   # Magnetic flux density, weber/meter square\n",
      "mu_o = 4*pi*1e-07;   # Relative permeability of the material, henery/m \n",
      "I = 3300;   # Magnetization of a magnetic material, A/m\n",
      "\n",
      "#Calculations&Results\n",
      "#B = mu_o*(I+H), solving for H  \n",
      "H = (B/mu_o)- I;   # Magnetizing force ,A/m\n",
      "print \"The magnetic intensity,H = %3d A/m\"%H\n",
      "# Relation between intensity of magnetization and relative permeability \n",
      "mu_r = (I/H)+1;   #substitute the value of I and H \n",
      "print \"The relative permeability, mu_r = %5.2f\"%mu_r\n",
      "\n",
      "#Incorrect answers in the textbook"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The magnetic intensity,H = 201 A/m\n",
        "The relative permeability, mu_r = 17.38\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.5, Page 605"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import *\n",
      "\n",
      "#Variable declaration\n",
      "mu_o = 4*pi*1e-07;   # Magnetic permeability of the free space, henery/m\n",
      "mu_r = 600;\n",
      "mu = mu_o*mu_r;     # Magnetic permeability of the medium, henery/m\n",
      "n = 500;   # Turns in a wire\n",
      "i = 0.3;   # Current flows through a ring,amp\n",
      "r = 12e-02/2;   # Mean radius of a ring, m\n",
      "\n",
      "#Calculations&Results\n",
      "B = mu_o*mu_r*n*i/(2*pi*r);\n",
      "print \"The magnetic flux density = %2.1f weber/meter-square\"%B\n",
      "H = B/mu;   # Magnetic intensity, ampere-turns/m\n",
      "print \"The magnetic intensity = %5.1f ampere-turns/m\"%H\n",
      "mui = B -mu_o\n",
      "per = mui/i*100\n",
      "print \"The percentage magnetic flux density due to electronic loop currents = \",per,\"%\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The magnetic flux density = 0.3 weber/meter-square\n",
        "The magnetic intensity = 397.9 ampere-turns/m\n",
        "The percentage magnetic flux density due to electronic loop currents =  99.999581121 %\n"
       ]
      }
     ],
     "prompt_number": 16
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.6, Page 606"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "M_i = 4.5;   # Intial value of total dipole moment of the sample\n",
      "H_i = 0.84;   # External magnetic field, tesla\n",
      "T_i = 4.2;   # Cooling temerature of the sample, K\n",
      "H_f = 0.98;   # External magnetic field, tesla\n",
      "T_f = 2.8;   # Cooling temerature of the sample, K\n",
      "\n",
      "#Calculations\n",
      "# According to the curie's law, Mf/Mi = (Hf/Hi)*(Ti/Tf)\n",
      "M_f = M_i*H_f/H_i*T_i/T_f;\n",
      "\n",
      "#Result\n",
      "print \"The total dipole moment of the sample = %5.3f joule/tesla\"%M_f\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The total dipole moment of the sample = 7.875 joule/tesla\n"
       ]
      }
     ],
     "prompt_number": 17
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.7, Page 606"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import *\n",
      "\n",
      "#Variable declaration\n",
      "mu_o = 4*pi*1e-07;   # Magnetic permeability of free space, henry/m\n",
      "n = 1e+29;   # Number density of atoms of iron, per metre cube \n",
      "p_m = 1.8e-23;   # Magnetic moment of each atom, ampere-metre square  \n",
      "k_B = 1.38e-23;   # Boltzmann constant, J/K\n",
      "B = 0.1;    # Magnetic flux density, weber per metre square\n",
      "T = 300;   # Absolute room temperature, K\n",
      "l = 10e-02; # Length of the iron bar, m\n",
      "a = 1e-04;  # Area of cross-section of the iron bar, metre square\n",
      "\n",
      "#Calculations&Results\n",
      "V = l*a;    # Voluem of the iron bar, metre cube\n",
      "chi = n*p_m**2*mu_o/(3*k_B*T);\n",
      "print \"The paramagnetic susceptibility of a material = %5.3e\"%chi\n",
      "pm_mean = p_m**2*B/(3*k_B*T); # Mean dipole moment of an iron atom, ampere metre-square\n",
      "P_m = n*pm_mean;  # Dipole moment of the bar, ampere metre-square\n",
      "I = n*p_m;  # Magnetization of the bar in one domain, ampere/metre\n",
      "M = I*V;    # Magnetic moment of the bar, ampere metre-square\n",
      "print \"The dipole moment of the bar = %5.3e ampere metre-square\"%P_m\n",
      "print \"The magnetization of the bar in one domain = %3.1e ampere/metre\"%I\n",
      "print \"The magnetic moment of the bar = %2d ampere metre-square\"%M\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The paramagnetic susceptibility of a material = 3.278e-03\n",
        "The dipole moment of the bar = 2.609e+02 ampere metre-square\n",
        "The magnetization of the bar in one domain = 1.8e+06 ampere/metre\n",
        "The magnetic moment of the bar = 18 ampere metre-square\n"
       ]
      }
     ],
     "prompt_number": 18
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.8, Page 607"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "A = 500;   # Area of the B-H loop, joule per metre cube\n",
      "n = 50;   # Total number of cycles, Hz\n",
      "m = 9;   # Mass of the core, kg\n",
      "d = 7.5e+3;   # Density of the core, kg/metre cube\n",
      "t = 3600;   # Time during which the energy loss takes place, s\n",
      "\n",
      "#Calculations\n",
      "V = m/d;   # Volume of the core, metre cube\n",
      "E = n*V*A*t;   # Hystersis loss of energy per hour, joule\n",
      "\n",
      "#Result\n",
      "print \"The hystersis loss per hour = %5.2eJ\"%E\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The hystersis loss per hour = 1.08e+05J\n"
       ]
      }
     ],
     "prompt_number": 19
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.9, Page 607"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "n = 50;   # Total number of cycles per sec, Hz\n",
      "V = 1e-03;   # Volume of the specimen, metre cube\n",
      "t = 1;   # Time during which the loss occurs, s\n",
      "A = 0.25e+03;   # Area of B-H loop, joule per metre cube\n",
      "\n",
      "#Calculations\n",
      "E = n*V*A*t;    # Energy loss due to hysteresis, J/s\n",
      "\n",
      "#Result\n",
      "print \"The hystersis loss = %4.1f J/s\"%E\n",
      "#incorrect answer in the textbook"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The hystersis loss = 12.5 J/s\n"
       ]
      }
     ],
     "prompt_number": 20
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.10, Page 608"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "e = 1.6e-19;   # Charge on anlectron, C\n",
      "m = 9.1e-31;   # Mass of the electron, kg\n",
      "r = 5.1e-11;   # Radius of the electronic orbit, m\n",
      "B = 2.0;   # Applied magnetic field, weber per metre-square\n",
      "\n",
      "#Calculations\n",
      "delta_pm = e**2*r**2*B/(4*m);\n",
      "\n",
      "#Result\n",
      "print \"The change in the magnetic dipole moment of the electron = %3.1e A-metre square\"%delta_pm\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The change in the magnetic dipole moment of the electron = 3.7e-29 A-metre square\n"
       ]
      }
     ],
     "prompt_number": 21
    }
   ],
   "metadata": {}
  }
 ]
}