{
 "metadata": {
  "name": "",
  "signature": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter7 - Distribution systems"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 7.1 - page 174"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "import cmath\n",
      "#Given data : \n",
      "l=1 #in km\n",
      "I=100 #in Ampere\n",
      "cosfi=0.8 #Power factor(lag) unitless\n",
      "VC=200 #in volt\n",
      "IL=60 #in Ampere\n",
      "cosfi_load=0.9 #Power factor(lag) unitless\n",
      "R=0.6 #in ohm\n",
      "XL=0.08 #in ohm\n",
      "IC=I*complex(0.8,-0.6) #in Ampere\n",
      "z=complex(0.06,0.08)/2 #in ohm\n",
      "VD_BC=z*IC #in volt\n",
      "VB=VC+VD_BC #in volt\n",
      "IB=IL*complex(0.9,-0.4357)+IC #in Ampere\n",
      "VD_AB=z*IB #in volt\n",
      "VD_AB=round(VD_AB.real,2)+round(VD_AB.imag,2)*1J\n",
      "print \"V.D. from sending end to mid point =\" ,VD_AB,\"Volt\"\n",
      "print \"V.D. from mid point to the far end =\",VD_BC,\"Volt\" "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "V.D. from sending end to mid point = (7.47+2.78j) Volt\n",
        "V.D. from mid point to the far end = (4.8+1.4j) Volt\n"
       ]
      }
     ],
     "prompt_number": 19
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 7.2 - page 175"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "from sympy import symbols\n",
      "#Given data : \n",
      "l=500 #in meter\n",
      "i=1 #in Ampere/meter\n",
      "IL1=200;IL2=150;IL3=50;IL4=100 #in Ampere\n",
      "l1=100;l2=200;l3=300;l4=400 #in meter\n",
      "r=0.1 #in ohm/km\n",
      "Vd=250 #in volt\n",
      "I=symbols('I')\n",
      "Drop_AC=100*(r/10**3)*(I-i*l1/2) \n",
      "Drop_CD=I \n",
      "Drop_DE=100*r*(I-550)-I*100/2 \n",
      "Drop_EF=100*r*(I-700-I*100/2) \n",
      "Drop_FB=100*r*(I-900-I*100/2) \n",
      "VD_tot=0.05*I-27 #in volts\n",
      "#both ends are fed with same voltage,\n",
      "#VD_tot should be equal to zero.\"\n",
      "I=27/0.05 #in Ampere\n",
      "print \"Curent = %0.2f Ampere\" %I\n",
      "Drop_AD=(0.01*I-0.5)+(0.01*I-3.5) \n",
      "print \"Value at minimum potential at D = %0.2f V\" %(Vd-Drop_AD)\n",
      "#Note : Ans in the book is wrong as 27/0.05 gives 540 instead of 54."
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Curent = 540.00 Ampere\n",
        "Value at minimum potential at D = 243.20 V\n"
       ]
      }
     ],
     "prompt_number": 26
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 7.3 - page 176"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "#Given data : \n",
      "l=250 #in meter\n",
      "VA=230 #in volt\n",
      "VB=232 #in volt\n",
      "r=0.5 #in ohm/km\n",
      "r=0.5/10**3 #in ohm/m\n",
      "RAC=r*50*2 #in ohm\n",
      "RCD=RAC;RDE=RAC;REF=RAC;RFB=RAC #in ohm\n",
      "#VA-VB=VAC+VCD+VDE+VEF+VFB #in volt\n",
      "Ia=(VA-VB+15)/(5*RAC) #Ampere\n",
      "IAC=Ia;ICD=IAC-20;IDE=IAC-60;IED=-IDE;IEF=IAC-100;IFE=-IEF;IFB=IAC-120;IBF=-IFB #in Ampere\n",
      "print \"IAC = %0.f A\" %IAC\n",
      "print \"ICD = %0.f A\" %ICD\n",
      "print \"IDE = %0.f A\" %IDE\n",
      "print \"IED = %0.f A\" %IED\n",
      "print \"IEF = %0.f A\" %IEF\n",
      "print \"IFE = %0.f A\" %IFE\n",
      "print \"IFB = %0.f A\" %IFB\n",
      "print \"IBF = %0.f A\" %IBF\n",
      "VAC=IAC*RAC #in volt\n",
      "VCD=ICD*RCD #in volt\n",
      "VD=VA-VAC-VCD #in volt\n",
      "print \"The minimum potential = %0.1f Volt\" %(VD)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "IAC = 52 A\n",
        "ICD = 32 A\n",
        "IDE = -8 A\n",
        "IED = 8 A\n",
        "IEF = -48 A\n",
        "IFE = 48 A\n",
        "IFB = -68 A\n",
        "IBF = 68 A\n",
        "The minimum potential = 225.8 Volt\n"
       ]
      }
     ],
     "prompt_number": 32
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 7.4 - page 177"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "#Given data : \n",
      "VA=235 #in volt\n",
      "VB=236 #in volt\n",
      "l=200 #in meter\n",
      "IL1=20;IL2=40;IL3=25;IL4=30 #in Ampere\n",
      "l1=50;l2=75;l3=100;l4=50 #in meter\n",
      "r=0.4 #in ohm/km\n",
      "r=0.4/10**3 #in ohm/m\n",
      "RAC=r*l1*2 #in ohm\n",
      "RCD=r*(l2-l1)*2*RAC;RDE=r*(l2-l1)*2*RAC;REF=r*l1*2*RAC;RFB=r*l1*2*RAC #in ohm\n",
      "#VA-VB=VAC+VCD+VDE+VEF+VFB #in volt\n",
      "IA=(VA-VB+9.6)/(0.16) #in Ampere\n",
      "IAC=IA;ICD=IA-IL1;IDE=IA-IL1-IL2;IEF=IA-IL1-IL2-IL3;IFB=IA-IL1-IL2-IL3-IL4 #in Ampere\n",
      "print \"IAC = %0.2f A\" %IAC\n",
      "print \"ICD = %0.2f A\" %ICD\n",
      "print \"IED = %0.2f A\" %(-IDE)\n",
      "print \"IFE = %0.2f A\" %-IEF\n",
      "print \"IFB = %0.2f A\" %-IFB\n",
      "VAC=IAC*RAC #in volt\n",
      "VCD=ICD*RCD #in volt\n",
      "VD=VA-VAC-VCD #in volt\n",
      "print \"The minimum potential = %0.3f Volt\" %VD\n",
      "# Answer wrong in the textbook due to accuracy."
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "IAC = 53.75 A\n",
        "ICD = 33.75 A\n",
        "IED = 6.25 A\n",
        "IFE = 31.25 A\n",
        "IFB = 61.25 A\n",
        "The minimum potential = 232.823 Volt\n"
       ]
      }
     ],
     "prompt_number": 43
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 7.5 - page 179"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "#Given data : \n",
      "VA=400 #in volt\n",
      "r=0.03 #in ohm/km\n",
      "r=0.03/1000 #in ohm/m\n",
      "RAB=r*500*2 #in ohm\n",
      "RBC=r*300*2 #in ohm\n",
      "RAB=r*700*2 #in ohm\n",
      "RAB=r*500*2 #in ohm\n",
      "#VA-VB=VAC+VCD+VDE+VEF+VFB #in volt\n",
      "IA=(17.4)/(0.09) #in Ampere\n",
      "VAB=(RAB)*IA #in volt\n",
      "VB=VA-VAB #in volt\n",
      "print \"Voltage at B = %0.2f Volts\" %VB\n",
      "VBC=(RBC)*(IA-150) #in volt\n",
      "VC=VB-VBC #in volt\n",
      "print \"Voltage at C = %0.2f Volts\" %VC\n",
      "IBC=IA-150 #in A\n",
      "print \"Current in section BC = %0.2f A \"%IBC \n",
      "#Note : Answer of VB is wrong in the book."
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Voltage at B = 394.20 Volts\n",
        "Voltage at C = 393.42 Volts\n",
        "Current in section BC = 43.33 A \n"
       ]
      }
     ],
     "prompt_number": 46
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 7.6 - page 180"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "#Given data : \n",
      "VA=240 #in volt\n",
      "MAxVDrop=VA*5/100 #in volt\n",
      "rho=2.87*10**-6 #in ohm-cm \n",
      "#VAB+VBC+VCA=0 #in volt\n",
      "IA=(3200)/(26) #in Ampere\n",
      "IAB=IA #in Ampere\n",
      "IBC=IA-100 #in Ampere\n",
      "#Allowed voltage drop: IAB*RAB+IBC*RBC=12\n",
      "R=12/(1015.26) #in ohm\n",
      "RAB=R*300*2/100 #in ohm\n",
      "RBC=R*600*2/100 #in ohm\n",
      "RCA=R*400*2/100 #in ohm\n",
      "#formula : R=rho*l/a\n",
      "a=rho*(100*100)/R #in cm**2\n",
      "print \"Cross section area = %0.2f cm2 \" %a"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Cross section area = 2.43 cm2 \n"
       ]
      }
     ],
     "prompt_number": 47
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 7.7 - page 182"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "from numpy import sqrt\n",
      "#Given data : \n",
      "R=0.2 #in ohm/km\n",
      "X=0.1 #in ohm/km\n",
      "ZAM=((R+X*1J)/1000)*200 #in ohm\n",
      "ZMB=((R+X*1J)/1000)*100 #in ohm\n",
      "I1=100*(0.707-0.707*1J) #in A\n",
      "I2=200*(0.8-0.6*1J) #in A\n",
      "IAM=I1+I2 #in Ampere\n",
      "VAM=ZAM*IAM #in volts\n",
      "VMB=ZMB*I2 #in volts\n",
      "VAB=VAM+VMB #in volts\n",
      "magVAB=sqrt(VAB.real**2+VAB.imag**2) \n",
      "print \"Total voltage drop = %0.2f Volts\" %magVAB"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Total voltage drop = 17.85 Volts\n"
       ]
      }
     ],
     "prompt_number": 50
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 7.8 - page 183"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "from numpy import sqrt, sin, pi, arctan, arccos, cos\n",
      "import cmath\n",
      "#Given data : \n",
      "VB=200 #in volts\n",
      "R=0.2 #in ohm/km\n",
      "X=0.3 #in ohm/km\n",
      "I=100 #in Ampere\n",
      "ZAB=(R+X*1J) #in ohm\n",
      "ZMB=ZAB/2 #in ohm\n",
      "ZAM=ZMB #in ohm\n",
      "cosfi_1=0.6 #unitless\n",
      "cosfi_2=0.8 #unitless\n",
      "IMB=I*(cosfi_2-cosfi_1*1J) #in A\n",
      "I2=IMB #in Ampere\n",
      "VMB=IMB*ZMB #in volts\n",
      "VM=VB+VMB #in volts\n",
      "print \"Voltage at M = %.2f\u2220%.2f\u00b0\" %(abs(VM),cmath.phase(VM)*180/pi)\n",
      "#print('Sending end voltage , V_S = %.2f\u2220%.2f\u00b0 kV/phase' %(abs(V_S*10**-3),cmath.phase(V_S)*180/math.pi))\n",
      "fi=arctan(VM.imag/VM.real)*180/pi #in degree\n",
      "fi_1=arccos(cosfi_1)*180/pi #in degree\n",
      "fi_VBandI1=fi_1-fi #in degree\n",
      "I1=I*(cos(fi_VBandI1*pi/180)-sin(fi_VBandI1*pi/180))*1J #in Ampere\n",
      "IAM=I1+I2 #inA Ampere\n",
      "VAM=ZAM*IAM #in volts\n",
      "VA=VM+VAM #in volts\n",
      "magVA=sqrt(VA.real**2+VA.imag**2) \n",
      "print \"Voltage at A, standing end voltage = %0.2f Volts\" %magVA\n",
      "#Answer wrong in the textbook."
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Voltage at M = 217.08\u22201.58\u00b0\n",
        "Voltage at A, standing end voltage = 236.65 Volts\n"
       ]
      }
     ],
     "prompt_number": 63
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 7.9 - page 184"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given data : \n",
      "l=500 #in meter\n",
      "VA=200 #in volt\n",
      "MAxVDrop=6 #in % of declared voltage \n",
      "rho=0.014 #in ohm/m \n",
      "#VD in the distributor=53*10**3*r\n",
      "AllowedVD=VA*(6/100) #in volts\n",
      "r=AllowedVD*10**6/(53*10**3) #in ohm/meter\n",
      "#formula : R=rho*l/a\n",
      "a=rho*(2*l)/r #in m**2\n",
      "print \"Cross section area = %0.2f m2 \" %(a)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Cross section area = 0.06 m2 \n"
       ]
      }
     ],
     "prompt_number": 64
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 7.10 - page 185"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given data : \n",
      "l=300 #in meter\n",
      "I=0.75 #in A/m\n",
      "R=0.00018 #in ohm/m\n",
      "x=200 #in meter\n",
      "Vs=250 #in volt\n",
      "VD=I*R*(l*x-x**2/2) #in volt\n",
      "V_A=Vs-VD #in volt(Voltage at 200m from end A)\n",
      "print \"Voltage as 200m from supply end A = %0.1f Volts\" %V_A"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Voltage as 200m from supply end A = 244.6 Volts\n"
       ]
      }
     ],
     "prompt_number": 66
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 7.11 - page 185"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given data : \n",
      "l=600 #in meter\n",
      "VA=440 #in volt\n",
      "VB=400 #in volt\n",
      "R=0.01 #in ohm/100m\n",
      "RAC=(R/100)*300 #in ohm\n",
      "RCD=(R/100)*300 #in ohm\n",
      "RDE=(R/100)*100 #in ohm\n",
      "REF=(R/100)*200 #in ohm\n",
      "RFB=(R/100)*300 #in ohm\n",
      "#VA-VB=VAC+VCD+VDE+VEF+VFB #in volt\n",
      "IA=(VA-VB+42.5)/(0.12) #in Ampere\n",
      "IAC=IA;ICD=IA-100;IDE=IA-300;IFE=IA-550;IFB=IA-850 #in Ampere\n",
      "print \"Current fed at A, IA = %0.1f A  \"%IAC \n",
      "print \"Current fed at B, IB = %0.1f A  \"%-IFB"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Current fed at A, IA = 687.5 A  \n",
        "Current fed at B, IB = 162.5 A  \n"
       ]
      }
     ],
     "prompt_number": 69
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 7.12 - page 187"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given data : \n",
      "VA=220 #in volt\n",
      "VB=200 #in volt\n",
      "R=0.1 #in ohm/km\n",
      "I=1 #in A/m\n",
      "l=500 #in meter\n",
      "R=2*R/1000 #in ohm/m\n",
      "x=(VA-VB)/(I*R*l)+l/2 #in meter\n",
      "Vmin=VA-I*R*x**2/2 #in volts\n",
      "print \"Value of minimum potential = %0.2f V  \"%Vmin \n",
      "IA=I*x #in A\n",
      "print \"Current supplied from end A = %0.f A   \" %IA \n",
      "IB=I*(l-x) #in A\n",
      "print \"Current supplied from end B = %0.f A\"%IB"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Value of minimum potential = 199.75 V  \n",
        "Current supplied from end A = 450 A   \n",
        "Current supplied from end B = 50 A\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 7.13 - page 187"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given data : \n",
      "VL=240 #in volt\n",
      "Router=0.2 #in ohm\n",
      "I1=VL/5 #in Ampere\n",
      "I2=VL/6 #in Ampere\n",
      "Ineutral=I1-I2 #in Ampere\n",
      "#Applying KVL on +ve side\n",
      "V1=VL+I1*0.2+8*0.4 #in volt\n",
      "print \"Voltage at +ve side = %0.1f V\" %V1\n",
      "#Applying KVL on +ve side\n",
      "V2=VL-(8*0.4)+I2*0.2 #in volt\n",
      "print \"Voltage at -ve side = %0.1f V\" %V2"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Voltage at +ve side = 252.8 V\n",
        "Voltage at -ve side = 244.8 V\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 7.14 - page 188"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given data : \n",
      "#Applying KVL on +ve side\n",
      "V1=200-(600*0.015)-(100)*0.03 #in volt\n",
      "print \"Voltage at +ve side = %0.f V\" %V1\n",
      "#Applying KVL on -ve side\n",
      "V2=200-(-100*0.03)-500*0.0015 #in volt\n",
      "print \"Voltage at -ve side = %0.1f V\" %V2\n",
      "#Note : answer of 2nd part is wrong in the book."
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Voltage at +ve side = 188 V\n",
        "Voltage at -ve side = 202.2 V\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 7.15 - page 189"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from sympy import symbols\n",
      "x=symbols('x')\n",
      "#Given data : \n",
      "#VD in section AC from RHS: \n",
      "VD1=(40+x)*0.02+0.17*x\n",
      "#VD in section AC from LHS: \n",
      "VD2=(350-x)*0.015+(150-x)*0.03\n",
      "#Equating two VDs we get\n",
      "#x*0.02+0.17*x+0.015*x+x*0.03=350*0.015+150*0.03-40*0.02\n",
      "x=(350*0.015+150*0.03-40*0.02)/0.082 #in A\n",
      "VB=500-(x+40)*0.02 #in volts\n",
      "print \"Potential at point B = %0.2f V\" %VB\n",
      "VC=VB-(x*0.017) #in volts\n",
      "print \"Potential at point C = %0.2f V\" %VC\n",
      "VD=500-(350-x)*0.015 #in volts\n",
      "print \"Potential at point D = %0.2f V\" %VD\n",
      "#Note : Answer of 3rd part is given wrong in the book."
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Potential at point B = 497.02 V\n",
        "Potential at point C = 495.16 V\n",
        "Potential at point D = 496.39 V\n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 7.16 - page 190"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from sympy import symbols\n",
      "x=symbols('x')\n",
      "#Given data : \n",
      "#Applying KVL in loop AFEDA: \n",
      "p1=((0.016*x)+0.09*(x-30)+0.14*(x-17)-0.1*y) #eqn(1) \n",
      "#Applying KVL in loop ADCBA: \n",
      "p2=(0.1*y-0.12*(95-x-y)-.01*(145-x-y)-0.008*(165-x-y)) #eqn(2)\n",
      "#Equating two equtions we get\n",
      "#3.9*x-125=97.75-0.75*x\n",
      "x=(97.75+125)/(3.9+0.75) #in A\n",
      "y=97.75-0.75*x #in A\n",
      "print \"x = %0.f A\" %x \n",
      "print \"y = %0.2f A\"%y \n",
      "print \"Point of minimum ppotential is E.\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "x = 48 A\n",
        "y = 61.82 A\n",
        "Point of minimum ppotential is E.\n"
       ]
      }
     ],
     "prompt_number": 14
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 7.17 - page 190"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given data : \n",
      "V=200 #in volt\n",
      "I=1 #in A/m\n",
      "R=2*0.05/1000 #in ohm/m\n",
      "l=1*1000 #in meter\n",
      "IT=I*l #in Ampere\n",
      "RT=R*l #in ohm\n",
      "VD=IT*RT/8 #in volt\n",
      "Vmin=V-VD #in volt\n",
      "print \"Minimum potential occurs at mid point. It is %0.2f V\" %Vmin"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Minimum potential occurs at mid point. It is 187.50 V\n"
       ]
      }
     ],
     "prompt_number": 15
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 7.19 - page 191"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given data : \n",
      "VB=400 #in volt\n",
      "ZAC=0.04+0.08*1J #in ohm\n",
      "ZCB=0.08+1J*0.12 #in ohm\n",
      "I1=60*(0.8-1J*0.6) \n",
      "I2=120*(0.8-1J*0.6) \n",
      "VCB=I2*ZCB #in Volt\n",
      "VAC=(I1+I2)*ZAC #in volt\n",
      "VC=VB+I2*ZCB #in Volt\n",
      "print \"Voltage at C =\",VC,\"Volt\"\n",
      "VA=VC+(I1+I2)*ZAC #in volt\n",
      "print \"Voltage at A =\",VA,\"Volt\"\n",
      "#Answer not accurate in the textbook."
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Voltage at C = (416.32+5.76j) Volt\n",
        "Voltage at A = (430.72+12.96j) Volt\n"
       ]
      }
     ],
     "prompt_number": 20
    }
   ],
   "metadata": {}
  }
 ]
}