{
 "metadata": {
  "name": "",
  "signature": "sha256:27ff567c9a2bfcc7567440cb0e3cbbe64500e9c89ec5f91d53c57a7d3ff6f06f"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "<h1>Chapter 34: Delta-star and star-delta transformations</h1>"
     ]
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "<h3>Example 1, page no. 605</h3>"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "from __future__ import division\n",
      "import math\n",
      "import cmath\n",
      "#initializing  the  variables:\n",
      "ZA  =  20;#  in  ohm\n",
      "ZB  =  10 + 10j;#  in  ohm\n",
      "ZC  =  -20j;#  in  ohm\n",
      "\n",
      "#calculation:\n",
      "Z1 = ZA*ZB/(ZA+ZB+ZC)\n",
      "Z2 = ZB*ZC/(ZA+ZB+ZC)\n",
      "Z3 = ZA*ZC/(ZA+ZB+ZC)\n",
      "\n",
      "#Results\n",
      "print  \"\\n\\n  Result  \\n\\n\"\n",
      "print  \"\\n  the  Resistances of equivalent star connection are, Z1 =\",round(Z1.real,2),\"  +  (\",round(Z1.imag,2),\")i  ohmn, Z2 =\",round(Z2.real,2),\"  +  (\",round(Z2.imag,2),\")i  Ohm and Z3 =\",round(Z3.real,2),\"  +  (\",round(Z3.imag,2),\")i  Ohm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "\n",
        "  Result  \n",
        "\n",
        "\n",
        "\n",
        "  the  Resistances of equivalent star connection are, Z1 = 4.0   +  ( 8.0 )i  ohmn, Z2 = 8.0   +  ( -4.0 )i  Ohm and Z3 = 4.0   +  ( -12.0 )i  Ohm"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "<h3>Example 2, page no. 606</h3>"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "from __future__ import division\n",
      "import math\n",
      "import cmath\n",
      "#initializing  the  variables:\n",
      "rv  =  40;#  in  volts\n",
      "thetav  =  0;#  in  degrees\n",
      "ZA  =  10j;#  in  ohm\n",
      "ZB  =  15j;#  in  ohm\n",
      "ZC  =  25j;#  in  ohm\n",
      "ZD  =  -8j;#  in  ohm\n",
      "ZE  =  10;#  in  ohm\n",
      "\n",
      " #calculation:  \n",
      " #voltage\n",
      "V  =  rv*math.cos(thetav*math.pi/180)  +  1j*rv*math.sin(thetav*math.pi/180)\n",
      " #The  network  of  Figure  34.7  is  redrawn,  as  in  Figure  34.8,  \n",
      "    #showing  more  clearly  the  part  of  the  network  1,  2,  3  forming  a  delta  connection   \n",
      "    #This  may  he  transformed  into  a  star  connection  as  shown  in  Figure  34.9.\n",
      "Z1  =  ZA*ZB/(ZA  +  ZB  +  ZC)\n",
      "Z2  =  ZC*ZB/(ZA  +  ZB  +  ZC)\n",
      "Z3  =  ZA*ZC/(ZA  +  ZB  +  ZC)\n",
      " #The  equivalent  network  is  shown  in  Figure  34.10  and  is  further  simplified  in  Figure  34.11\n",
      " #(ZE  +  Z3)  in  parallel  with  (Z1  +  ZD)  gives  an  equivalent  impedance  of\n",
      "z  =  (ZE  +  Z3)*(Z1  +  ZD)/(Z1  +  ZD  +  ZE  +  Z3)\n",
      " #Hence  the  total  circuit  equivalent  impedance  across  terminals  AB  is  given  by\n",
      "Zab  =  z  +  Z2\n",
      " #Supply  current  I\n",
      "I  =  V/Zab\n",
      "I1  =  ((Z1  +  ZD)/(Z1  +  ZD  +  ZE  +  Z3))*I\n",
      "I1mag  =  abs(I1)\n",
      " #Power  P  dissipated  in  the  10  ohm  resistance  of  Figure  34.7  is  given  by\n",
      "Pr10  =  ZE*I1mag**2\n",
      "\n",
      "\n",
      "#Results\n",
      "print  \"\\n\\n  Result  \\n\\n\"\n",
      "print  \"\\n  (a)the  equivalent  circuit  impedance  across  terminals  AB  is  \",round(Zab.real,2),\"  +  (\",round(Zab.imag,2),\")i  ohm\"\n",
      "print  \"\\n  (b)supply  current  I  is  \",round(I.real,2),\"  +  (\",round(I.imag,2),\")i  A\"\n",
      "print  \"\\n  (c)power  P  dissipated  in  the  10  ohm  resistor  is  \",round(Pr10,2),\"  W\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "\n",
        "  Result  \n",
        "\n",
        "\n",
        "\n",
        "  (a)the  equivalent  circuit  impedance  across  terminals  AB  is   2.5   +  ( 2.5 )i  ohm\n",
        "\n",
        "  (b)supply  current  I  is   8.0   +  ( -8.0 )i  A\n",
        "\n",
        "  (c)power  P  dissipated  in  the  10  ohm  resistor  is   320.0   W\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "<h3>Example 3, page no. 607</h3>"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "from __future__ import division\n",
      "import math\n",
      "import cmath\n",
      "#initializing  the  variables:\n",
      "V  =  52;#  in  volts\n",
      "ZA  =  8;#  in  ohm\n",
      "ZB  =  16;#  in  ohm\n",
      "ZC  =  40;#  in  ohm\n",
      "ZD  =  1;#  in  ohm\n",
      "ZE  =  4;#  in  ohm\n",
      "\n",
      " #calculation:  \n",
      " #In  Figure  34.12,  no  resistances  are  directly  in  parallel  or  directly  in  series  with  each  other.  \n",
      "    #However,  ACD  and  BCD  are  both  delta  connections  and  either  may  be  converted  into  an  equivalent  star  connection.  The  delta  network  BCD  is  redrawn  in  Figure  34.13(a)  and  is  transformed  into  an  equivalent  star  connection  as  shown  in  Figure  34.13(b),  where\n",
      "Z1  =  ZA*ZB/(ZA  +  ZB  +  ZC)\n",
      "Z2  =  ZC*ZB/(ZA  +  ZB  +  ZC)\n",
      "Z3  =  ZA*ZC/(ZA  +  ZB  +  ZC)\n",
      " #The  network  of  Figure  34.12  may  thus  be  redrawn  as  shown  in  Figure  34.14.  \n",
      "    #The  Z1  and  ZE  are  in  series  with  each  other,  as  are  the  ZD  and  Z3  resistors.  \n",
      "    #Hence  the  equivalent  network  is  as  shown  in  Figure  34.15.  \n",
      "    #The  total  equivalent  resistance  across  terminals  A  and  B  is  given  by\n",
      "Zab  =  (Z1  +  ZE)*(ZD  +  Z3)/(Z1  +  ZE  +  ZD  +  Z3)  +  Z2\n",
      " #Current  supplied  by  the  source,  i.e.,  current  I  in  Figure  34.15,  is  given  by\n",
      "I  =  V/Zab\n",
      " #From  Figure  34.15,  current  I1\n",
      "I1  =  ((ZD  +  Z3)/(Z1  +  ZE  +  ZD  +  Z3))*I\n",
      " #current  I2\n",
      "I2  =  I  -  I1\n",
      " #From  Figure  34.14,  p.d.  across  AC,\n",
      "Vac  =  I1*ZE\n",
      " #p.d.  across  AD\n",
      "Vad  =  I2*ZD\n",
      " #Hence  p.d.  between  C  and  D  is  given\n",
      "Vcd  =  Vac  -  Vad\n",
      " #current  in  the  8  ohm  resistance\n",
      "Ir8  =  Vcd/ZA\n",
      "\n",
      "\n",
      "#Results\n",
      "print  \"\\n\\n  Result  \\n\\n\"\n",
      "print  \"\\n  (a)the  equivalent  circuit  impedance  across  terminals  AB  is  \",round(Zab,2),\"ohm\"\n",
      "print  \"\\n  (b)the  current  supplied  by  the  52  V  source  is  \",round(I,2),\"    A\"\n",
      "print  \"\\n  (c)the  current  flowing  in  the  8  ohm  resistance  is  \",round(Ir8,2),\"  A\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "\n",
        "  Result  \n",
        "\n",
        "\n",
        "\n",
        "  (a)the  equivalent  circuit  impedance  across  terminals  AB  is   13.0 ohm\n",
        "\n",
        "  (b)the  current  supplied  by  the  52  V  source  is   4.0     A\n",
        "\n",
        "  (c)the  current  flowing  in  the  8  ohm  resistance  is   0.75   A"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "<h3>Example 4, page no. 608</h3>"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "from __future__ import division\n",
      "import math\n",
      "import cmath\n",
      "#initializing  the  variables:\n",
      "R2  =  1000;#  in  ohm\n",
      "R3  =  1000;#  in  ohm\n",
      "R4  =  500;#  in  ohm\n",
      "R5  =  200;#  in  ohm\n",
      "C = 2E-6; # in Farad\n",
      "\n",
      "#calculation:\n",
      "Rx = R2*R4/R3\n",
      "Lx = R2*C*(R4 + R5 + R4*R5/R3)\n",
      "\n",
      "#Results\n",
      "print  \"\\n\\n  Result  \\n\\n\"\n",
      "print  \"\\n  (b)Rx is  \",round(Rx,2),\"ohm, Lx is  \",round(Lx,2),\"H\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "\n",
        "  Result  \n",
        "\n",
        "\n",
        "\n",
        "  (b)Rx is   500.0 ohm, Lx is   1.6 H"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "<h3>Example 5, page no. 610</h3>"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "from __future__ import division\n",
      "import math\n",
      "import cmath\n",
      "#initializing  the  variables:\n",
      "rv  =  120;#  in  volts\n",
      "thetav  =  0;#  in  degrees\n",
      "ZA  =  25  - 5j;#  in  ohm\n",
      "ZB  =  15  + 10j;#  in  ohm\n",
      "ZC  =  20  - 30j;#  in  ohm\n",
      "ZD  =  20  + 0j;#  in  ohm\n",
      "ZE  =  0  +  10j;#  in  ohm\n",
      "ZF  =  2.5  - 5j;#  in  ohm\n",
      "\n",
      "#calculation:  \n",
      " #voltage\n",
      "V  =  rv*math.cos(thetav*math.pi/180)  +  1j*rv*math.sin(thetav*math.pi/180)\n",
      " #The  network  may  initially  be  simplified  by  transforming  the  delta  PQR  to  its  equivalent  star  connection  \n",
      "    #as  represented  by  impedances  Z1,  Z2  and  Z3  in  Figure  34.21.  From  equation  (34.7),\n",
      "Z1  =  ZA*ZB/(ZA  +  ZB  +  ZC)\n",
      "Z2  =  ZC*ZB/(ZA  +  ZB  +  ZC)\n",
      "Z3  =  ZA*ZC/(ZA  +  ZB  +  ZC)\n",
      " #The  network  is  shown  redrawn  in  Figure  34.22  and  further  simplified  in  Figure  34.23,  from  which,\n",
      "Zab  =  ((Z3  +  ZE)*(ZD  +  Z2)/(Z2  +  ZE  +  ZD  +  Z3))  +  (Z1  +  ZF)\n",
      " #Current  I1\n",
      "I1  =  V/Zab\n",
      " #current  I2\n",
      "I2  =  ((ZE  +  Z3)/(Z2  +  ZE  +  ZD  +  Z3))*I1\n",
      " #current  I3\n",
      "I3  =  I1  -  I2\n",
      " #The  power  P  dissipated  in  the  ZD  impedance  of  Figure  34.20  is  given  by\n",
      "Pzd  =  ZD*I2**2\n",
      "\n",
      "\n",
      "#Results\n",
      "print  \"\\n\\n  Result  \\n\\n\"\n",
      "print  \"\\n  (a)the  current  flowing  in  the  (0+i10)  ohm  impedance  is  \",round(abs(I3),2),\"    A\"\n",
      "print  \"\\n  (b)  the  power  dissipated  in  the  (20  +  i0)  ohm  impedance  is  \",round(abs(Pzd),2),\"  W\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "\n",
        "  Result  \n",
        "\n",
        "\n",
        "\n",
        "  (a)the  current  flowing  in  the  (0+i10)  ohm  impedance  is   6.0     A\n",
        "\n",
        "  (b)  the  power  dissipated  in  the  (20  +  i0)  ohm  impedance  is   80.0   W\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "<h3>Example 6, page no. 613</h3>"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "from __future__ import division\n",
      "import math\n",
      "import cmath\n",
      "#initializing  the  variables:\n",
      "Z1  =  10;#  in  ohm\n",
      "Z2  =  20;#  in  ohm\n",
      "Z3  =  5j;#  in  ohm\n",
      "\n",
      "#calculation:\n",
      "ZA = (Z1*Z2 + Z2*Z3 + Z3*Z1)/Z2\n",
      "ZB = (Z1*Z2 + Z2*Z3 + Z3*Z1)/Z3\n",
      "ZC = (Z1*Z2 + Z2*Z3 + Z3*Z1)/Z1\n",
      "\n",
      "#Results\n",
      "print  \"\\n\\n  Result  \\n\\n\"\n",
      "print  \"\\n  the  Resistances of equivalent Delta connection are, ZA =\",round(ZA.real,2),\"  +  (\",round(ZA.imag,2),\")i  ohmn, ZB =\",round(ZB.real,2),\"  +  (\",round(ZB.imag,2),\")i  Ohm and ZC =\",round(ZC.real,2),\"  +  (\",round(ZC.imag,2),\")i  Ohm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "\n",
        "  Result  \n",
        "\n",
        "\n",
        "\n",
        "  the  Resistances of equivalent Delta connection are, ZA = 10.0   +  ( 7.5 )i  ohmn, ZB = 30.0   +  ( -40.0 )i  Ohm and ZC = 20.0   +  ( 15.0 )i  Ohm"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "<h3>Example 7, page no. 613</h3>"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "from __future__ import division\n",
      "import math\n",
      "import cmath\n",
      "#initializing  the  variables:\n",
      "Z1r  =  100;#  in  ohm\n",
      "Z1a = 0; # in Deg\n",
      "Z2r  =  63.25;#  in  ohm\n",
      "Z2a = 18.43; # in Deg\n",
      "Z3r  =  100;#  in  ohm\n",
      "Z3a = -90; # in Deg\n",
      "\n",
      "#calculation\n",
      "Z1  =  Z1r*math.cos(Z1a*math.pi/180)  +  1j*Z1r*math.sin(Z1a*math.pi/180)\n",
      "Z2  =  Z2r*math.cos(Z2a*math.pi/180)  +  1j*Z2r*math.sin(Z2a*math.pi/180)\n",
      "Z3  =  Z3r*math.cos(Z3a*math.pi/180)  +  1j*Z3r*math.sin(Z3a*math.pi/180)\n",
      "\n",
      "ZA = (Z1*Z2 + Z2*Z3 + Z3*Z1)/Z2\n",
      "ZB = (Z1*Z2 + Z2*Z3 + Z3*Z1)/Z3\n",
      "ZC = (Z1*Z2 + Z2*Z3 + Z3*Z1)/Z1\n",
      "\n",
      "#Results\n",
      "print  \"\\n\\n  Result  \\n\\n\"\n",
      "print  \"\\n  the  Resistances of equivalent Delta connection are, ZA =\",round(ZA.real,0),\"  +  (\",round(ZA.imag,0),\")i  ohmn, ZB =\",round(ZB.real,0),\"  +  (\",round(ZB.imag,0),\")i  Ohm and ZC =\",round(ZC.real,0),\"  - (\",round(ZC.imag,0),\")i  Ohm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "\n",
        "  Result  \n",
        "\n",
        "\n",
        "\n",
        "  the  Resistances of equivalent Delta connection are, ZA = 50.0   +  ( -250.0 )i  ohmn, ZB = 140.0   +  ( 80.0 )i  Ohm and ZC = 80.0   - ( -140.0 )i  Ohm"
       ]
      }
     ],
     "prompt_number": 3
    }
   ],
   "metadata": {}
  }
 ]
}