{
 "metadata": {
  "name": "",
  "signature": "sha256:b9799d17ce9c5e8acfde2941052198091704f3207bfb93e90879b4a048464a60"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter1-Electrical Fundamentals"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex4-pg3"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "##Exa:1.4\n",
      "import math\n",
      "ang_d=215.;##given\n",
      "ang_r=ang_d*math.pi/180.;\n",
      "print'%s %.2f %s %.2f %s '%(\"%f degree angle is \",ang_d,\" radians\" and \"\",ang_r,\"\");"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "%f degree angle is  215.00  3.75  \n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex5-pg3"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "##Exa:1.5\n",
      "import math\n",
      "ang_r=2.5;##given\n",
      "ang_d=2.5*180./math.pi;##angle in degrees\n",
      "print'%s %.2f %s %.2f %s '%(\"%f degree angle is \",ang_d,\" radians\" and \"\",ang_r,\"\");"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "%f degree angle is  143.24  2.50  \n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex6-pg4"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "##Exa:1.6\n",
      "import math\n",
      "i_amp=0.075;##given\n",
      "i_milamp=i_amp*1000.;##current in milliamp.\n",
      "print'%s %.2f %s'%(\"%f amp current is \",i_milamp,\" mA\");"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "%f amp current is  75.00  mA\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex7-pg4"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "##Exa:1.7\n",
      "import math\n",
      "fq_khz=1495.;##given\n",
      "fq_Mhz=fq_khz/1000.;\n",
      "print'%s %.2f %s'%(\" kHz frequency is \",fq_Mhz,\" MHz\");"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " kHz frequency is  1.50  MHz\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex8-pg4"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "##Exa:1.8\n",
      "import math\n",
      "c_pF=27000.;##given\n",
      "c_uF=c_pF/1000.;\n",
      "print'%s %.2f %s'%(\"picofarad capacitance is \",c_uF,\" microfarad\");"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "picofarad capacitance is  27.00  microfarad\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex9-pg4"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "##Exa:1.9\n",
      "import math\n",
      "c_mA=7.25;##given\n",
      "c_A=c_mA*1000.;\n",
      "print'%s %.2f %s'%(\" milliampere current is \",c_A,\" ampere\");"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " milliampere current is  7250.00  ampere\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex10-pg4"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "##Exa:1.10\n",
      "import math\n",
      "vg_v=3.75*10**-6;##given\n",
      "vg_mv=vg_v*1000.;\n",
      "print'%s %.2e %s'%(\" volt voltage is \",vg_mv,\" mV\");"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " volt voltage is  3.75e-03  mV\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex11-pg5"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "##Ex:1.11\n",
      "import math\n",
      "r=33000.;##in ohms\n",
      "i=0.003;##in amp\n",
      "v=i*r;\n",
      "print'%s %.2f %s'%(\"Voltage dropped = \",v,\" volts\");"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Voltage dropped =  99.00  volts\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex12-pg5"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "##Ex:1.12\n",
      "import math\n",
      "t=20.*10**-3;##in sec\n",
      "i=45.*10**-6;##in amp\n",
      "q=i*t*10**9;\n",
      "print'%s %.2f %s'%(\"Charge transferred = \",q,\" nC\");"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Charge transferred =  900.00  nC\n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex13-pg5"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "##Ex:1.13\n",
      "import math\n",
      "p=0.3;##in watts\n",
      "v=1500.;##in volts\n",
      "i=(p/v)*10**6;\n",
      "print'%s %.2f %s'%(\"Current supplied = \",i,\" microamp\");"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Current supplied =  200.00  microamp\n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex14-pg7"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "##Ex:1.14\n",
      "import math\n",
      "r=12.;##in ohms\n",
      "v=6.;##in volts\n",
      "i=(v/r);\n",
      "print'%s %.2f %s'%(\"Current = \",i,\" Amp\");"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Current =  0.50  Amp\n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex15-pg7"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "##Ex:1.15\n",
      "import math\n",
      "r=56.;##in ohms\n",
      "i=0.1;##in amp\n",
      "v=i*r;\n",
      "print'%s %.2f %s'%(\"Voltage dropped = \",v,\" volts\");"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Voltage dropped =  5.60  volts\n"
       ]
      }
     ],
     "prompt_number": 13
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex16-pg7"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "##Ex:1.16\n",
      "import math\n",
      "v=15.;##in volts\n",
      "i=0.001;##in amp\n",
      "r=v/i;\n",
      "print'%s %.2f %s'%(\"Resistance = \",r,\" ohms\");"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Resistance =  15000.00  ohms\n"
       ]
      }
     ],
     "prompt_number": 14
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex17-pg7"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "##Ex:1.17\n",
      "import math\n",
      "p=1.724*10**-8;##in ohm-meter\n",
      "l=8.;##in meters\n",
      "a=1.*10**-6;##in sq. meter\n",
      "r=(p*l)/a;\n",
      "print'%s %.2f %s'%(\"Resistance = \",r,\" ohms\");"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Resistance =  0.14  ohms\n"
       ]
      }
     ],
     "prompt_number": 15
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex18-pg8"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "##Ex:1.18\n",
      "import math\n",
      "p=1.724*10**-8;##in ohm-meter\n",
      "l=20.;##in meters\n",
      "a=1.*10**-6;##in sq. meter\n",
      "i=5.;##in amperes\n",
      "r=(p*l)/a;\n",
      "v=i*r;\n",
      "print'%s %.2f %s'%(\"Voltage dropped = \",v,\" volts\");"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Voltage dropped =  1.72  volts\n"
       ]
      }
     ],
     "prompt_number": 16
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex19-pg9"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "##Ex:1.19\n",
      "import math\n",
      "v=3.;##in volts\n",
      "i=1.5;##in amperes\n",
      "p=v*i;\n",
      "print'%s %.2f %s'%(\"Power supplied = \",p,\" watts\");"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Power supplied =  4.50  watts\n"
       ]
      }
     ],
     "prompt_number": 17
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex20-pg9"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "##Ex:1.20\n",
      "import math\n",
      "v=4.;##in volts\n",
      "r=100.;##in ohms\n",
      "p=(v**2)/r;\n",
      "print'%s %.2f %s'%(\"Power dissipated = \",p,\" watts\");"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Power dissipated =  0.16  watts\n"
       ]
      }
     ],
     "prompt_number": 18
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex21-pg9"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "##Ex:1.21\n",
      "import math\n",
      "i=20.*10**-3;##in amps\n",
      "r=1000.;##in ohms\n",
      "p=(i**2)*r;\n",
      "print'%s %.2f %s'%(\"Power dissipated = \",p,\" watts\");"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Power dissipated =  0.40  watts\n"
       ]
      }
     ],
     "prompt_number": 19
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex22-pg10"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "##Ex:1.22\n",
      "import math\n",
      "v=600;##in volts\n",
      "d=25*10^-3;##in meters\n",
      "E=(v)/d;\n",
      "print'%s %.2f %s'%(\"Electric Field Strength = \",E/10000,\" kV/m\");"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Electric Field Strength =  -1.00  kV/m\n"
       ]
      }
     ],
     "prompt_number": 20
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex23-pg13"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "##Ex:1.23\n",
      "import math\n",
      "u=4.*math.pi*10**-7;##in H/m\n",
      "i=20.;##in amps\n",
      "d=50.*10**-3;##in meters\n",
      "B=(u*i)/(2.*math.pi*d);\n",
      "print'%s %.2e %s'%(\"Flux Density = \",B,\" Tesla\");"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Flux Density =  8.00e-05  Tesla\n"
       ]
      }
     ],
     "prompt_number": 21
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex24-pg13"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "##Ex:1.24\n",
      "import math\n",
      "B=(2.5*10**-3);##in Tesla\n",
      "a=(20.*10**-4);##in sq. meter\n",
      "flux=B*a;\n",
      "print'%s %.2e %s'%(\"Flux = \",flux,\" webers\");"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Flux =  5.00e-06  webers\n"
       ]
      }
     ],
     "prompt_number": 23
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex25-pg15"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "##Ex:1.25\n",
      "import math\n",
      "B1=0.6;##in Tesla\n",
      "u1=B1/800.;\n",
      "u_r1=u1/(4.*math.pi*10**-7);\n",
      "print'%s %.2f %s'%(\"reltive permitivity at 0.6T = \",u_r1,\"\");\n",
      "B2=1.6;##in Tesla\n",
      "u2=0.2/4000.;\n",
      "u_r2=u2 /(4.*math.pi*10**-7);\n",
      "print'%s %.2f %s'%(\"\\n reltive permitivity at 1.6T = \",u_r2,\"\");"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "reltive permitivity at 0.6T =  596.83 \n",
        "\n",
        " reltive permitivity at 1.6T =  39.79 \n"
       ]
      }
     ],
     "prompt_number": 24
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex26-pg16"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "##Ex:1.26\n",
      "import math\n",
      "flux=0.8*10**-3;\n",
      "a=(500.*10**-6);##in sq. meter\n",
      "l=0.6;##in meter\n",
      "N=800.;\n",
      "B=flux/a;\n",
      "print'%s %.2e %s'%(\"Flux Density = \",B,\" Tesla\");\n",
      "H=3500.;##in A/m\n",
      "i=(H*l)/N;\n",
      "print'%s %.2f %s'%(\"\\n Current required = \",i,\" amp.s\");"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Flux Density =  1.60e+00  Tesla\n",
        "\n",
        " Current required =  2.62  amp.s\n"
       ]
      }
     ],
     "prompt_number": 25
    }
   ],
   "metadata": {}
  }
 ]
}