{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 7: Magnetic Materials"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "example 7.1, Page No.252"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Horizontal component of magnetic Intensity\n",
      "import math\n",
      "\n",
      "#variable declaration\n",
      "Bo=1.7*10**-5                 #in weber/m^2\n",
      "meu_o=4*math.pi*10**-7        #permeability of free space in weber/amp-meter\n",
      "\n",
      "#Calculations\n",
      "H=Bo/meu_o                    #in A/m\n",
      "\n",
      "#result\n",
      "print(\"Horizontal component of magnetic filed intensity in A/m : %.1f\"%H);"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Horizontal component of magnetic filed intensity in A/m : 13.5\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "exammple 7.2, Page No. 252"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Current through solenoid\n",
      "import math\n",
      "#variable Declaration\n",
      "H=5*10**3                   #in Ampere-turns/m\n",
      "l=10                        #in cm\n",
      "l=l*10**-2                  #in meter\n",
      "N=50                        #no. of turns\n",
      "n=N/l                       #no. of turns per unit length\n",
      "\n",
      "#Calculation\n",
      "#Formula : H=n*i\n",
      "i=H/n                       #in Ampere\n",
      "\n",
      "#Result\n",
      "print(\"Current should be sent through solenoid in Ampere : %.0f\"%i)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Current should be sent through solenoid in Ampere : 10\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "example 7.3, page no.252"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Magnetic moment of rod\n",
      "import math\n",
      "#variable declaration\n",
      "meu_r=1000                           #relative permeability\n",
      "n=5                                  #turns/cm\n",
      "n=n*10**2                            #turns/meter\n",
      "i=0.5                                #in Ampere\n",
      "Volume=10**-4                        #in m^3\n",
      "\n",
      "#calculation\n",
      "I=(meu_r-1)*n*i                      #in Ampere\n",
      "MagneticMoment=I*Volume              #in Ameter^2\n",
      "\n",
      "#Result\n",
      "print(\"Magnetic moment of the rod in Ampere-meter^2 : %.0f\"%(math.ceil(MagneticMoment)))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Magnetic moment of the rod in Ampere-meter^2 : 25\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "example 7.4, Page No.253"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Flux density magnetic intensity and permeability\n",
      "import math\n",
      "#variable Declaration\n",
      "l=30                                         #in cm\n",
      "l=l*10**-2                                   #in meter\n",
      "A=1                                          #in cm^2\n",
      "A=A*10**-4                                   #in meter^2\n",
      "N=300                                        #turns of wire\n",
      "i=0.032                                      #in Ampere\n",
      "FI_B=2*10**-6                                #in weber\n",
      "meu_o=4*math.pi*10**-7                       #permeability of free space in weber/amp-meter\n",
      "\n",
      "#Calculations\n",
      "B=FI_B/A                                     #in weber/meter^2\n",
      "H=N*i/l                                      #in amp-turn/meter\n",
      "meu=B/H                                      #in weber/Amp-meter\n",
      "meu_r=meu/meu_o                              #Relative Permeability\n",
      "\n",
      "#Result\n",
      "print(\"Flux Density in weber/meter^2 :%.2f \"%B)\n",
      "print(\"\\nmagnetic Intensity in amp-turn/meter : %.0f\"%H)\n",
      "print(\"\\nPermeability in weber/amp-meter :%.2f *10^-4\"%(meu*10**4))\n",
      "print(\"\\nRelative Permeability :%.3f \"%meu_r)\n",
      "#Answer of relative permeability is wrong in the book."
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Flux Density in weber/meter^2 :0.02 \n",
        "\n",
        "magnetic Intensity in amp-turn/meter : 32\n",
        "\n",
        "Permeability in weber/amp-meter :6.25 *10^-4\n",
        "\n",
        "Relative Permeability :497.359 \n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "example 7.5, Page No.253"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Relative Permeability\n",
      "import math\n",
      "#variable declaration\n",
      "Xci_m=9.48*10**-9                            #usceptibility of medium(unitless)\n",
      "\n",
      "#calculation\n",
      "meu_r=1+Xci_m                                #relative permeability(unitless)\n",
      "\n",
      "#result\n",
      "print(\"Relative Permeability : %.2f * 10^-9\\n\"%(meu_r*10**9));\n",
      "print(\"i.e, Relative Permeability is sligtly greater than 1.\");"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Relative Permeability : 1000000009.48 * 10^-9\n",
        "\n",
        "i.e, Relative Permeability is sligtly greater than 1.\n"
       ]
      }
     ],
     "prompt_number": 18
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "example 7.6, page No.253"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Magnetising Force and material magnetisation\n",
      "import math\n",
      "\n",
      "#variable declarationm\n",
      "n=10                       #turns/cm\n",
      "n=n*10**2                  #turns/meter\n",
      "i=2                        #in Ampere\n",
      "B=1                        #in weber/meter^2\n",
      "meu_o=4*math.pi*10**-7     #permeability of free space in weber/amp-meter\n",
      "\n",
      "#Calculations\n",
      "H=n*i                      #in amp-turn/meter\n",
      "#Formula : B=meu_o*(H+I)\n",
      "I=B/meu_o-H                #in amp-turn/meter\n",
      "meu_r=B/(meu_o*H)          #relative permeability(unitless)\n",
      "\n",
      "#result\n",
      "print(\"Magnetising Force in amp-turn/meter :%.0f \"%H)\n",
      "print(\"\\nMagn etisation of material in amp-turn/meter %.2f * 10^5:\"%(math.ceil(I/10**3)/100))\n",
      "print(\"\\nRelative Permeability : %.0f\"%(math.floor(meu_r)))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Magnetising Force in amp-turn/meter :2000 \n",
        "\n",
        "Magn etisation of material in amp-turn/meter 7.94 * 10^5:\n",
        "\n",
        "Relative Permeability : 397\n"
       ]
      }
     ],
     "prompt_number": 27
    }
   ],
   "metadata": {}
  }
 ]
}