{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Chapter 14: Inductance and Magnetic Fields"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 14.1, Page 280"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Magnetic Field Strength, H = 7.96 A/m\n"
     ]
    }
   ],
   "source": [
    "#Initialization\n",
    "i=5                          #current in ampere\n",
    "l=0.628                      #circumference\n",
    "\n",
    "\n",
    "#Calculation\n",
    "h=i/l                           #magnetic field strength\n",
    "\n",
    "#Results\n",
    "print'Magnetic Field Strength, H = %.2f A/m'%h"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 14.2, Page 283"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(a) Magnetomotive Force, H = 3000.00 ampere-turns\n",
      "(b) Magnetic Field Strength, H = 7500.00 A/m\n",
      "(c) B = 9.42 mT\n",
      "(d) Toal Flux, phi = 2.83 uWb\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "#Initialization\n",
    "i=6                          #current in ampere\n",
    "n=500                       #turns\n",
    "l=0.4                      #circumference\n",
    "uo=4*math.pi*10**-7          #epsilon zero constant\n",
    "a=300*10**-6                 #area\n",
    "\n",
    "#Calculation\n",
    "f=n*i                          #Magnetomotive Force\n",
    "h=f/l                           #magnetic field strength\n",
    "b=uo*h                          #magnetic induction\n",
    "phi=b*a                          #flux\n",
    "\n",
    "#Results\n",
    "print'(a) Magnetomotive Force, H = %.2f ampere-turns'%f\n",
    "print'(b) Magnetic Field Strength, H = %.2f A/m'%h\n",
    "print'(c) B = %.2f mT'%(b*10**3)\n",
    "print'(d) Toal Flux, phi = %.2f uWb'%(phi*10**6)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 14.3, Page 285"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Voltage, V = 30 mV\n"
     ]
    }
   ],
   "source": [
    "#Initialization\n",
    "l=10*10**-3                   #inductance in henry\n",
    "di=3\n",
    "\n",
    "\n",
    "#Calculation\n",
    "v=l*di                            #voltage         \n",
    "\n",
    "#Results\n",
    "print'Voltage, V = %d mV'%(v*10**3)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 14.4, Page 287"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Inductance,L = 30 uH\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "#Initialization\n",
    "n=400                        #turns\n",
    "l=200*10**-3                 #circumference\n",
    "uo=4*math.pi*10**-7          #epsilon zero constant\n",
    "a=30*10**-6                 #area\n",
    "\n",
    "#Calculation\n",
    "L=(uo*a*n**2)/l                #Inductance in henry               \n",
    "\n",
    "#Results\n",
    "print'Inductance,L = %d uH'%(L*10**6)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 14.5, Page 289"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(a) Inductance in series,L = 30 uH\n",
      "(b) Inductance in parallel,L = 6.67 uH\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "#Initialization\n",
    "l1=10                #Inductance in henry       \n",
    "l2=20                #Inductance in henry       \n",
    "\n",
    "#Calculation\n",
    "ls=l1+l2                #Inductance in henry               \n",
    "lp=((l1*l2)*(l1+l2)**-1)    #Inductance in henry       \n",
    "#Results\n",
    "print'(a) Inductance in series,L = %d uH'%ls\n",
    "print'(b) Inductance in parallel,L = %.2f uH'%lp"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 14.6, Page 293"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Stored Energy = 125 mJ\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "#Initialization\n",
    "l=10**-2                #Inductance in henry       \n",
    "i=5                  #current in ampere    \n",
    "\n",
    "#Calculation\n",
    "s=0.5*l*i**2           #stored energy\n",
    "\n",
    "#Results\n",
    "print'Stored Energy = %d mJ'%(s*10**3)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "anaconda-cloud": {},
  "kernelspec": {
   "display_name": "Python [Root]",
   "language": "python",
   "name": "Python [Root]"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}