{
 "metadata": {
  "name": "",
  "signature": "sha256:855ede77f42d7d38570b25f9dfe540c158b87984c52d22c6171f4226086950d9"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 7: Supply Systems"
     ]
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 7.1, Page Number: 145"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "from sympy import *\n",
      "\n",
      "#Variable declaration:\n",
      "V1 = 200                            #initial volt of system(V)\n",
      "V2 = 400                            #final volt of the system(V)\n",
      "\n",
      "\n",
      "#Calculation:\n",
      "I1,I2,R1,R2 = symbols('I1 I2 R1 R2')\n",
      "I2 = V1*I1/V2\n",
      "W1 = 2*I1**2*2*R1                        #Power loss in 200 V system\n",
      "W2 = 2*I2**2*2*R2                        #Power loss in 400 V system\n",
      "# As power loss in the two cases is the same,\n",
      "R22 = solve(W1/W2-1,R2)[0]\n",
      "a = R22/R1                               #ratio of cables' cross-section\n",
      "v = 1/a                                  #ratio of cables' volumes\n",
      "s = (1-v)*100\n",
      "\n",
      "#Result:\n",
      "print \"% Saving in feeder copper is \",s,\"%\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "% Saving in feeder copper is  75 %\n"
       ]
      }
     ],
     "prompt_number": 18
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 7.2, Page Number: 146"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "from sympy import *\n",
      "import math\n",
      "\n",
      "#Variable declaration:\n",
      "#P = power upplied,      W = power loss, \n",
      "#I = current,            V = voltage,     R = resistance\n",
      "\n",
      "R,V = symbols('R V')\n",
      "P1,I1,W1 = symbols('P1,I1,W1')    #for 2-wire system\n",
      "P2,I2,W2 = symbols('P2,I2,W2')     #for 3-wire system\n",
      "\n",
      "#Calculation:\n",
      "#Two-wire d.c. system:\n",
      "P1 = V*I1\n",
      "W1 = 2*I1**2*R\n",
      "L1 = W1/P1*100                    #% power loss\n",
      "\n",
      "#3-phase, 3-wire a.c. system:\n",
      "P2 = math.sqrt(3)*V*I2\n",
      "W2 = 3*I2**2*R\n",
      "L2 = W2/P2*100                     #% power loss\n",
      "\n",
      "I2 = solve(L1-L2,I2)[0]\n",
      "#r2 = P2/P1\n",
      "r2 = math.sqrt(3)*I2*V/(I1*V)\n",
      "P1 = 2*P2\n",
      "\n",
      "#Result:\n",
      "print '''Additional power which can be supplied at \n",
      "unity p.f. by 3-phase, 3-wire a.c. system = 100%.'''"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Additional power which can be supplied at \n",
        "unity p.f. by 3-phase, 3-wire a.c. system = 100%.\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 7.3, Page Number: 146"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "from sympy import *\n",
      "\n",
      "#Variable declaration:\n",
      "#Let R be the resistance per conductor in each case\n",
      "\n",
      "R,V = symbols('R V')\n",
      "P1,I1,W1 = symbols('P1,I1,W1')    #for 3-wire dc system\n",
      "P2,I2,W2 = symbols('P2,I2,W2')     #for 4-wire ac system\n",
      "\n",
      "#Calculation:\n",
      "\n",
      "#3-wire d.c. system.:\n",
      "#At balanced loads, implying no power loss in the neutral wire\n",
      "P1 = 2*V*I1\n",
      "W1 = 2*I1**2*R\n",
      "L1 = W1/P1*100                    #% power loss\n",
      "\n",
      "\n",
      "#3-phase, 4-wire a.c. system.:\n",
      "#At balanced loads, implying no power loss in the neutral wire\n",
      "P2 = 3*V*I2\n",
      "W2 = 3*I2**2*R\n",
      "L2 = W2/P2*100                     #% power loss\n",
      "\n",
      "I2 = solve(L1-L2,I2)[0]\n",
      "r = P2/P1\n",
      "#solving r, we get\n",
      "P2 = 1.5*P1\n",
      "\n",
      "#Result:\n",
      "print '''Extra power that can be supplied at unity power \n",
      "factor by 3-phase, 4-wire a.c. system = 50%.'''"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Extra power that can be supplied at unity power \n",
        "factor by 3-phase, 4-wire a.c. system = 50%.\n"
       ]
      }
     ],
     "prompt_number": 19
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 7.4, Page Number: 148"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "from sympy import *\n",
      "\n",
      "#Variable declaration:\n",
      "R,V,phy = symbols('R V phy')       #phy is power factor angle\n",
      "                                   #V is voltage between the conductors\n",
      "                                   #R is resistance per conductor \n",
      "P1,I1,W1 = symbols('P1,I1,W1')    #for Single phase 2-wire system\n",
      "P2,I2,W2 = symbols('P2,I2,W2')     #for 3-phase, 3-wire a.c. system\n",
      "\n",
      "\n",
      "#Calculation:\n",
      "#Single phase 2-wire system\n",
      "P1 = 2*V*I1*math.cos(phy)\n",
      "W1 = 2*I1**2*R\n",
      "L1 = W1/P1*100                    #% power loss\n",
      "\n",
      "#3-phase, 3-wire a.c. system. \n",
      "P2 = math.sqrt(3)*V*I2*math.cos(phy)\n",
      "W2 = 3*I2**2*R\n",
      "L2 = W2/P2*100                     #% power loss\n",
      "\n",
      "I22 = solve(L1-L2,I2)[0]\n",
      "r = P1/(math.sqrt(3)*V*I22*math.cos(phy))\n",
      "#As the power supplied by single phase, 2-wire is 200 kW,\n",
      "P1 = 200\n",
      "\n",
      "#Result:\n",
      "print \"Power supplied by 3-phase, 3-wire a.c. system is\",P1*r,\"kW\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Power supplied by 3-phase, 3-wire a.c. system is 400 kW\n"
       ]
      }
     ],
     "prompt_number": 38
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 7.5, Page Number: 149"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "import math\n",
      "\n",
      "#Variable declaration:\n",
      "MVA = 5                   #power transmitted to load\n",
      "n = 0.9                   #efficiency\n",
      "pf = 0.8                  #power factor\n",
      "V = 33                    #receiving end voltage(V)\n",
      "l = 50*10**3             #length of line(m)\n",
      "s = 2.85*10**-8           #specific resistance of aluminium(ohm-m)\n",
      "\n",
      "#Calculation:\n",
      "P = MVA*pf*10**6                #power transmitted(W)\n",
      "W = 10*P/100                          #line loss(W)\n",
      "\n",
      "\n",
      "#(i) Single phase, 2-wire system:\n",
      "I1 = MVA*10**3/V                        #Apparent power(A)\n",
      "a1 = 2*I1**2*s*l/W                      #area of cross-section(m**2)\n",
      "v1= 2*a1*l                              #volume of conductor required(m**3)\n",
      "\n",
      "#(ii) 3-phase, 3-wire system:\n",
      "I2 = MVA*10**3/(math.sqrt(3)*V)                        #Apparent power(A)\n",
      "a2 = 3*I2**2*s*l/W                      #area of cross-section(m**2)\n",
      "v2 = 3*a2*l                              #volume of conductor required(m**3)\n",
      "\n",
      "#Result:\n",
      "print \"(i) Single phase, 2-wire system, Vol. of conductor required is\",round(v1,2),\"m^3\"\n",
      "print \"(ii)3-phase, 3-wire system, Vol. of conductor required\",round(v2,2),\"m^3\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(i) Single phase, 2-wire system, Vol. of conductor required is 16.36 m^3\n",
        "(ii)3-phase, 3-wire system, Vol. of conductor required 12.27 m^3\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 7.6, Page Number: 149"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "\n",
      "#Variable declaration:\n",
      "V1 = 11*10**3                   #Supply voltage(V)\n",
      "pf = 0.8\n",
      "R1 = 0.15                      #Total resistance in ac system(ohm)\n",
      "R2 = 0.05                      #Total resistance in dc system(ohm)\n",
      "r1 = 0.15                     #voltage drop in ac system(%)\n",
      "r2 = 0.25                     #voltage drop in dc system(%)\n",
      "\n",
      "#Calculation:\n",
      "#Single phase system:\n",
      "I1 = r1*V1/R1                   #line current(A)\n",
      "P1 = V1*I1*pf/1000              #power received by consumer(kW)\n",
      "\n",
      "#D.C. two-wire system:\n",
      "P2 = P1\n",
      "V2 = (P2*10**3*R2/r2)**0.5             #supply voltage(V)\n",
      "\n",
      "#Result:\n",
      "print \"The supply voltage is\",V2,\"V\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The supply voltage is 4400.0 V\n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 7.7, Page Number: 153"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "from sympy import *\n",
      "\n",
      "#Variable declaration:\n",
      "I = 200                      #current(A)\n",
      "l = 1                      #length of cable(km)\n",
      "c1 = 5                         #cost per unit(paise/kWh)\n",
      "r1 = 10                        #interrest & depreciation(%)\n",
      "ro = 1.73*10**-6              #resistivity(ohm-m)\n",
      "\n",
      "#Calculation:\n",
      "#If 'a' is the area os cross-section of the cnductor,\n",
      "#cost of cable including installation = (20*a + 20)    Rs./m.\n",
      "\n",
      "a = symbols('a')\n",
      "R = ro*l*10**5/a\n",
      "E = 2*I**2*R*8760/1000           #energy lost per annum\n",
      "C = c1/100*E                  #cost of energy lost(Rs)\n",
      "\n",
      "#capital cost for 1 km length of the cable is = Rs. 20,000*a.\n",
      "\n",
      "V = r1/100*20000*a             #Variable annual charge(Rs)\n",
      "a1 = solve(C-V,a)[1]\n",
      "\n",
      "#Result:\n",
      "print \"The most economical conductor size is\",round(a1,2),\"cm**2\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The most economical conductor size is 1.74 cm**2\n"
       ]
      }
     ],
     "prompt_number": 22
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 7.8, Page Number: 153"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "from sympy import *\n",
      "\n",
      "#Variable declaration:\n",
      "P = 5                           #line load(MW)]\n",
      "V = 33                          #kV\n",
      "pf = 0.8                        #power factor\n",
      "c1 = 4                          #paise/kWh\n",
      "r1 = 10                         #interest and depreciation(%)\n",
      "ro = 10**-6                     #ohm-cm\n",
      "\n",
      "\n",
      "#Calculation:\n",
      "a = symbols('a')                #size of conductor(cm**2)\n",
      "R = ro*l*10**5/a                #ohm\n",
      "I = P*10**3/(math.sqrt(3)*V*pf)            #current (A)\n",
      "E = 3*I**2*R*8760/1000           #kWh\n",
      "C = c1/100*E                        #Annual cost of energy lost(R)\n",
      "#The capital cost (variable) of the cable = 25000*a Rs/km\n",
      "V = r1/100*25000*a                 #Rs\n",
      "a1 = solve(C-V,a)[1]\n",
      "\n",
      "#Result:\n",
      "print \"The most economical size of conductor is\",round(a1,2),\"cm**2\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The most economical size of conductor is 0.71 cm**2\n"
       ]
      }
     ],
     "prompt_number": 14
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 7.9, Page Number: 154"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "from sympy import *\n",
      "\n",
      "#Variable declaration:\n",
      "I = 250                         #current through the feeder(A)\n",
      "c1 = 5                          #Rs/kg\n",
      "r1 = 10                         #interest and depreciation(%)\n",
      "c2 = 5                          #paise/kWh\n",
      "d = 8.93                        #density of wire(gm/cm**3)\n",
      "ro = 1.73*10**-8                #speciafic resistance(ohm-m)\n",
      "\n",
      "\n",
      "#Calculation:\n",
      "l = 1                           #length of wire(1 m say)\n",
      "a = symbols('a')                #conductor size(m**2)\n",
      "R = ro*l/a                      #ohm\n",
      "E = 2*I**2*R*8760/1000          #kWh\n",
      "C = c2/100*E                   #annual cost os energy lost(Rs)\n",
      "m = 2*a*1*d*10**3                     #Mass of 1 metre feeder\n",
      "CC = c1*m                    #capital cost(Rs)\n",
      "V = r1*CC/100                    #Variable Annual charge(Rs)\n",
      "a1 = solve(C-V)[1]\n",
      "\n",
      "#Result:\n",
      "print \"The most economic size of conductor is\",round(a1*10000,2),\"cm**2\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The most economic size of conductor is 3.26 cm**2\n"
       ]
      }
     ],
     "prompt_number": 23
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 7.10, Page Number: 154"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "from sympy import *\n",
      "\n",
      "#Variable declaration:\n",
      "l = 1                           #line length(km)\n",
      "V = 110                         #supply voltage(kV)\n",
      "\n",
      "#Working hours(hrs)          Load(MW)       Power factor\n",
      "t1 = 6;               P1 = 20 ;            pf1 = 0.8\n",
      "t2 = 12;              P2 = 5 ;             pf2 = 0.8\n",
      "t3 = 6;                P3 = 6 ;             pf3 = 0.8\n",
      "\n",
      "c1 = 6                  #\n",
      "n = 365                 #no.of days used\n",
      "r1 = 10                 #interest and dep-reciation(%)\n",
      "\n",
      "#Calculation:\n",
      "a = symbols(\"a\")                #cross-section of conductor(cm**2)\n",
      "R = 0.176/a                    #Resistance per km of each conductor(ohm)\n",
      "#The load currents at various loads are :\n",
      "#At 20 MW,\n",
      "I1 = P1*1000/(math.sqrt(3)*V*pf1)                #A\n",
      "I2 = P2*1000/(math.sqrt(3)*V*pf2)                #A\n",
      "I3 = P3*1000/(math.sqrt(3)*V*pf3)                #A\n",
      "\n",
      "E1= 3*R*1/1000*(I1**2*t1+I2**2*t2+I3**2*t3)      #Energy loss per day in 3-phase line(kWh)\n",
      "E = E1*n                        #energy lost per annum(kWh)\n",
      "C = c1*E/100                   #Annual cost of energy(Rs)\n",
      "v = r1*6000*a/100                  #variable annual charge(Rs/kWh)\n",
      "a1 = solve(C-v,a)[1]\n",
      "\n",
      "\n",
      "#Result:\n",
      "print \"THe most economical size of the conductor is\",round(a1,2),\"cm**2\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "THe most economical size of the conductor is 1.56 cm**2\n"
       ]
      }
     ],
     "prompt_number": 24
    }
   ],
   "metadata": {}
  }
 ]
}