{
 "metadata": {
  "name": "",
  "signature": "sha256:354118d2fca7350165cb8c5d000bd36293e8da69f0cbb274034a02640d69b2e6"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 4: Magnetic Fields and Circuits"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.1, Page 116"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "A = 6e-04;                  # Cross-sectional area of pole face, metre-square\n",
      "phi = 30e-06;              # Flux, Wb\n",
      "\n",
      "#Calculations\n",
      "B = phi/A;                  # Flux density, T\n",
      "\n",
      "#Result\n",
      "print \"The flux density at the pole face = %2d mT\"%(B/1e-03)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The flux density at the pole face = 50 mT\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.2, Page 116"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "A = 45e-06;                    # Cross sectional area of pole face, metre-square\n",
      "B = 0.6;                      # Flux density, T\n",
      "\n",
      "#Calculations\n",
      "# Using formula B = phi/A, solving for phi\n",
      "phi = B*A;                   # Flux, Wb\n",
      "\n",
      "#Result\n",
      "print \"The flux produced by pole face = %2d micro-wWb\"%(phi/1e-06);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The flux produced by pole face = 27 micro-wWb\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.3, Page 117"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "N = 1500;                      # Number of turns in a coil\n",
      "A = 5e-04;                     # Cross- sectional area of of coil, metre-square\n",
      "phi = 0.2e-03;                 # Flux, Wb\n",
      "I = 0.75;                      # Coil-current, A\n",
      "\n",
      "#Calculations\n",
      "# Since m.m.f is the product of the current and the number of turns, therefore, we have\n",
      "F = N*I;                      # Magnetomotive force, At\n",
      "B = phi/A;                    # Flux density, T\n",
      "\n",
      "#Result\n",
      "print \"The m.m.f and flux density produced are %4d At and %3.1f T respectively\"%(F, B);\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The m.m.f and flux density produced are 1125 At and 0.4 T respectively\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.4, Page 117"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "N = 600;                      # Number of turns in a coil\n",
      "F = 1500.;                      # Magnetomotive force, At\n",
      "\n",
      "#Calculations\n",
      "# Since magnetomotive force,F = N*I, solving for I\n",
      "I = F/N;                      # Excitation-current, A\n",
      "\n",
      "#Result\n",
      "print \"The excitation current required = %3.1f A\"%I;\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The excitation current required = 2.5 A\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.5, Page 118"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "I = 0.4;                  # Current, A\n",
      "N = 550;                  # Number of turns in a coil\n",
      "d = 8e-02;                # Diameter, m\n",
      "l = (math.pi*d);              # Average length of the magnetic circuit, m\n",
      "\n",
      "#Calculations\n",
      "# Since magnetic field strength is defined as the mmf per metre length of the magnetic circuit, therefore, we have\n",
      "H = (N*I)/l;                # Magnetic field strength, At/m\n",
      "\n",
      "#Result\n",
      "print \"The magnetic field strength inside the toroid = %6.2f At/m\"%H\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The magnetic field strength inside the toroid = 875.35 At/m\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.6, Page 120"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "A = 15e-04;                   # Cross-sectional area of core, metre-square\n",
      "mew_r1 = 65;                  # Relative permeability of core\n",
      "phi_1 = 2e-04;                # Flux, Wb\n",
      "mew_r2 = 800.;                 # Changed relative permeability of core\n",
      "\n",
      "#Calculations\n",
      "B_1 = phi_1/A;                # Flux density, T\n",
      "mew_r = mew_r2/mew_r1;        # Relative permeability of core\n",
      "# Since cross-sectional area of core A remains constant, therefore, we have mew_r = B_1/B_2 , solving for B_2\n",
      "B_2 = mew_r*B_1;              #  New flux density, T\n",
      "# Since B_2 = phi_2/A, solving for phi_2\n",
      "phi_2 = B_2*A;                # New flux, Wb\n",
      "\n",
      "#Result\n",
      "print \"The new flux and flux density are %5.3f mWb and %5.3f T respectively\"%(phi_2/1e-03, B_2);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The new flux and flux density are 2.462 mWb and 1.641 T respectively\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.7, Page 120"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "r = 0.04;                           # Mean radius of torod, m\n",
      "A = 3e-04;                          # Csa of toroid, m^2\n",
      "mew_o = 4*(math.pi)*1e-07;              # Permeability of free space\n",
      "mew_r = 150;                        # Relative permeability of toroid\n",
      "N = 900;                            # Number of turns on coil\n",
      "I = 1.5;                            # Coil current, A\n",
      "l = 2*(math.pi)*r;                      # Effective length of toroid, m\n",
      "\n",
      "#Calculations&Results\n",
      "# Part (a)\n",
      "# Since m.m.f is the product of the current and the number of turns, therefore, we have\n",
      "F = N*I;                            # Magnetomotive force, At\n",
      "print \"The m.m.f of toroid = %4d At\"%F\n",
      "\n",
      "# Part (b)\n",
      "# Since magnetic field strength is defined as the mmf per metre length of the magnetic circuit, therefore, we have\n",
      "H = F/l;                               # Magnetic field strength, At/m\n",
      "print \"The magnetic field strength = %6.1f At/m\"%H;\n",
      "\n",
      "# Part (c)\n",
      "B = (mew_r*mew_o*H);                   # Flux density, T\n",
      "phi = B*A;                             # Flux, Wb\n",
      "print \"The flux and flux density are %6.2f micro-weber and %6.4f T respectively\"%(phi/1e-06,B)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The m.m.f of toroid = 1350 At\n",
        "The magnetic field strength = 5371.5 At/m\n",
        "The flux and flux density are 303.75 micro-weber and 1.0125 T respectively\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.8, Page 120"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "r = 3e-02;                            # Radius of toroid, m\n",
      "A = 4.5e-04;                          # Cross-sectional area of toroid, metre-square\n",
      "N = 500;                              # Number of turns \n",
      "phi = 250e-06;                        # Flux, Wb\n",
      "mew_o = 4*(math.pi)*(1e-07);              # Permeability of free space\n",
      "mew_r = 300;                          # Relative permeability\n",
      "\n",
      "#Calculations\n",
      "l = 2*(math.pi)*r;                        # Effective length, m\n",
      "B = phi/A;                            # Flux density, T\n",
      "# Since B = (mew_r)*(mew_o)*H, solving for H\n",
      "H = B /((mew_r)*(mew_o));              # Magnetic field strength, At/m\n",
      "# Since H = F/l, solving for F\n",
      "F = H*l;                               # Magnetomotive force, At\n",
      "# Since mmf,F = N*I, solving for I\n",
      "I = F/N;                               # Electric current, A\n",
      "\n",
      "#Result\n",
      "print \"The value of current needs to be passed through the coil = %4.2f A\"%I\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The value of current needs to be passed through the coil = 0.56 A\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.9, Page 121"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "# Part (a)\n",
      "I = 0.2;                    # Electric current, A\n",
      "l = 5e-02;                  # Effective length, m\n",
      "A = 7e-04;                  # Cross-sectional area, metre-square\n",
      "d = 0.5e-03;                # Diameter, m\n",
      "mew_r = 1;                  #Relative permeability for wood\n",
      "\n",
      "#Calculations\n",
      "mew_o = 4*(math.pi)*1e-07;      # Permeability for free space\n",
      "N = l/d;                    # Number of turns \n",
      "# Since mmf is the product of the current and the number of turns, therefore, we have\n",
      "F = N*I;                     # Magnetomotive force, At\n",
      "# Part (b)\n",
      "# Since magnetic field strength is defined as the mmf per metre length of the magnetic circuit, therefore, we have\n",
      "H = F/l;                               # Magnetic field strength, At/m\n",
      "B = ( mew_r * mew_o * H );             #  Flux density, T\n",
      "# Part (c)\n",
      "phi = B * A;                           # Flux, Wb\n",
      "\n",
      "#Result\n",
      "print \"The mmf produced = %2d At\"%F\n",
      "print \"The flux density produced = %3d micro-tesla\"%(B/1e-06);\n",
      "print \"The flux produced = %5.3f micro-weber\"%(phi/1e-06);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The mmf produced = 20 At\n",
        "The flux density produced = 502 micro-tesla\n",
        "The flux produced = 0.352 micro-weber\n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.10, Page 125"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "N = 1000;                                     # Number of turns on coil\n",
      "r = 0.1;                                      # Mean radius of toroid, m\n",
      "phi = 0.1775e-03;                             # Flux density(value from graph), Wb\n",
      "A = math.pi*1e-04;                               # Csa of toroid, m^2\n",
      "H = 88;                                       # Magnetic field strength(value from graph), At/m\n",
      "B = phi/A;                                    # Flux density, T\n",
      "\n",
      "#Calculations&Results\n",
      "# Part (a)\n",
      "l = 2*math.pi*r;                                  # Effective length of toroid, m\n",
      "# Since H = (N*I)/l, solving for I\n",
      "I = (H*l)/N ;                                 # Electric current in coil, A\n",
      "print \"Coil current = %4.1f mA\"%(I/1e-03);\n",
      "\n",
      "# Part (b)\n",
      "mew_o = 4*(math.pi)*1e-07;                        # Permeability for free space\n",
      "# Since B = mew_o * mew_r * H, solving for mew_r\n",
      "mew_r = B/(mew_o*H);                         #Relative permeability of toroid\n",
      "print \"The relative permeability of toroid = %4d\"%mew_r;\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Coil current = 55.3 mA\n",
        "The relative permeability of toroid = 5109\n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.11, Page 125"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "mew_o = 4*(math.pi)*1e-07;          # Permeability for free space\n",
      "l = 0.15;                       # Mean length, m\n",
      "N = 2500;                      # Number of turns\n",
      "I = 0.3;                       # Electric current, A\n",
      "\n",
      "#Calculations\n",
      "# Since magnetic field strength is defined as the mmf per metre length of the magnetic circuit, therefore, we have\n",
      "H = (N*I)/l;                   # Magnetic field strength, At/m\n",
      "B = 0.75;                      # Flux density( value taken from graph ), T\n",
      "# Since B = ( mew_r * mew_o * H ), solving for mew_r\n",
      "mew_r = B/(mew_o * H);               # Relative permeability\n",
      "\n",
      "#Results\n",
      "print \"The flux density of given toroid = %3.2f T \"%B\n",
      "print \"The relative permeability of given toroid = %5.1f\"%mew_r\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The flux density of given toroid = 0.75 T \n",
        "The relative permeability of given toroid = 119.4\n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.12, Page 126"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "mew_o = 4*(math.pi)*1e-07;              # Permeability for free space\n",
      "l = 0.1875;                         # Mean length, m\n",
      "A = 8e-05;                          # Cross- sectional area of of coil, metre-square\n",
      "N = 750;                            # Number of turns\n",
      "phi = 112e-06;                      # Flux, Wb\n",
      "l_gap = 0.5e-03;                    # Average length of the magnetic circuit,m\n",
      "B = phi/A;                          # Flux density, Wb\n",
      "H = 2000;                           # Magnetic field strength( value taken from graph ), At/m\n",
      "\n",
      "#Calculations\n",
      "F_Fe = H*l;                         # The m.m.f in the iron part of the circuit, At\n",
      "# Since F = I*N, solving for I\n",
      "I = F_Fe/N;                         # Coil current under normal conditions, A\n",
      "# Since B = mew_o * H_gap, solving for H_gap\n",
      "H_gap = B/mew_o;                    # Magnetic field strength, At/m\n",
      "# Since H_gap = F_gap/l_gap, solving for F_gap\n",
      "F_gap = H_gap * l_gap;              # The mmf in the air part of the circuit, At\n",
      "F = F_Fe + F_gap;                  # Total circuit mmf, At\n",
      "I_new = F/N;                       # Current required to maintain the flux at its original value, A\n",
      "\n",
      "#Results\n",
      "print \"The coil current required to produce a flux of %3d micro-weber in the toroid = %3.1f A \"%(phi/1e-06, I);\n",
      "print \"Current required to maintain the flux at its original value = %5.3f A\"%(I_new);\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The coil current required to produce a flux of 112 micro-weber in the toroid = 0.5 A \n",
        "Current required to maintain the flux at its original value = 1.243 A\n"
       ]
      }
     ],
     "prompt_number": 13
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.13, Page 127"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "l_A = 0.25;                  # Mean length of circuit A, m\n",
      "l_B = 0.15;                  # Mean length of circuit A, m\n",
      "A_A = 11.5e-04;              # Cross-sectional area of circuit A, metre-square\n",
      "A_B = 12e-04;                # Cross-sectional area of circuit B, metre-square\n",
      "phi = 1.5e-03;               # Flux, Wb\n",
      "N = 1000;                    # Number of turns\n",
      "\n",
      "#Calculations\n",
      "B_A = phi/A_A;              # Flux density linked with circuit A, T\n",
      "B_B = phi/A_B;              # Flux density linked with circuit B, T\n",
      "H_A = 1470;                 # Magnetic field strength of circuit A( value taken from graph ), At/m\n",
      "H_B = 845;                  # Magnetic field strength of circuit B( value taken from graph ), At/m\n",
      "# Since H = F/l, solving for F \n",
      "F_A = H_A * l_A;                # Magnetic field strength of circuit A, At/m\n",
      "F_B = H_B * l_B;                # Magnetic field strength of circuit B, At/m\n",
      "F = F_A + F_B;                   # Total circuit m.m.f, At/m\n",
      "I = F/N;                          # Coil current, A\n",
      "\n",
      "#Result\n",
      "print \"Coil current in the magnetic circuit = %5.3f A\"%I\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Coil current in the magnetic circuit = 0.494 A\n"
       ]
      }
     ],
     "prompt_number": 14
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.14, Page 130"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "A = 8e-04;                                # Cross-sectional area, metre-square\n",
      "d = 24e-02;                               # Mean diameter of iron ring, m \n",
      "phi = 1.2e-03;                            # Flux, Wb\n",
      "mew_r = 1200;                             # Relative permeability\n",
      "mew_o = 4*(math.pi)*1e-07;                   # Permeability for free space\n",
      "mew_air = 1;                             # Permeability for air\n",
      "l_gap = 3e-03;                           # Mean length, m\n",
      "\n",
      "#Calculations\n",
      "l_Fe = (math.pi) * d;                        # Mean length of iron circuit, m\n",
      "S_Fe = l_Fe/(mew_r * mew_o *A);          # Reluctance of iron circuit, At/Wb\n",
      "S_gap = l_gap/(mew_air * mew_o *A);        # Reluctance of gap, At/Wb\n",
      "S = S_Fe + S_gap;                        # Total circuit reluctance, At/Wb\n",
      "# Since phi = F/S, solving for F\n",
      "F = phi*S;                               # Magnetomotive force, At\n",
      "\n",
      "#Result\n",
      "print \"The required mmf = %5.1f At\"%F\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The required mmf = 4331.0 At\n"
       ]
      }
     ],
     "prompt_number": 15
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.15, Page 130"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "N = 500;                                       # Number of turns on first section's coil\n",
      "phi = 2e-03;                                   # Flux produced by first section, Wb\n",
      "l_1 = 85e-02;                                  # Length of first section, m\n",
      "l_2 = 65e-02;                                  # Length of second section, m\n",
      "l_3 = 0.1e-02;                                 # Length of third section, m\n",
      "A_1 = 10e-04;                                  # Csa of first section, m^2\n",
      "A_2 = 15e-04;                                  # Csa of second section, m^2\n",
      "A_3 = 12.5e-04;                                # Csa of second section, m^2\n",
      "mew_o = 4*(math.pi)*1e-07;                         # Permeability for free space\n",
      "mew_r1 = 600;                                  # Relative permeability of first section\n",
      "mew_r2 = 950;                                  # Relative permeability of second section\n",
      "mew_r3 = 1;                                    # Relative permeability of third section\n",
      "\n",
      "#Calculations&Results\n",
      "# Part (a)\n",
      "S_1 = l_1/(mew_r1 * mew_o * A_1);              # Reluctance of first section, At/Wb\n",
      "S_2 = l_2/(mew_r2 * mew_o * A_2);              # Reluctance of first section, At/Wb\n",
      "S_3 = l_3/(mew_r3 * mew_o * A_3);              # Reluctance of first section, At/Wb\n",
      "S = S_1 + S_2 + S_3;                           # Total reluctance of the circuit, At/Wb\n",
      "print \"Total reluctance of the circuit = %4.2fe+06 At/Wb\"%(S*1e-06);\n",
      "\n",
      "# Part (b)\n",
      "# Since phi = F/S, solving for F\n",
      "F = phi*S;                                    # Magnetomotive force, At\n",
      "# Since F = N*I, solving for I\n",
      "I = F/N;                                      # Electric current in first section, A\n",
      "print \"Electric current in first section = %4.2f A\"%I\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Total reluctance of the circuit = 2.13e+06 At/Wb\n",
        "Electric current in first section = 8.51 A\n"
       ]
      }
     ],
     "prompt_number": 16
    }
   ],
   "metadata": {}
  }
 ]
}