diff options
Diffstat (limited to 'Electrical_Network_by_R._Singh')
-rw-r--r-- | Electrical_Network_by_R._Singh/Chapter1.ipynb | 634 | ||||
-rw-r--r-- | Electrical_Network_by_R._Singh/Chapter10.ipynb | 119 | ||||
-rw-r--r-- | Electrical_Network_by_R._Singh/Chapter11.ipynb | 996 | ||||
-rw-r--r-- | Electrical_Network_by_R._Singh/Chapter12.ipynb | 516 | ||||
-rw-r--r-- | Electrical_Network_by_R._Singh/Chapter2.ipynb | 1930 | ||||
-rw-r--r-- | Electrical_Network_by_R._Singh/Chapter3.ipynb | 2941 | ||||
-rw-r--r-- | Electrical_Network_by_R._Singh/Chapter4.ipynb | 1846 | ||||
-rw-r--r-- | Electrical_Network_by_R._Singh/Chapter6.ipynb | 1092 | ||||
-rw-r--r-- | Electrical_Network_by_R._Singh/Chapter7.ipynb | 844 | ||||
-rw-r--r-- | Electrical_Network_by_R._Singh/Chapter8.ipynb | 124 | ||||
-rw-r--r-- | Electrical_Network_by_R._Singh/screenshots/chapter4.png | bin | 0 -> 162269 bytes | |||
-rw-r--r-- | Electrical_Network_by_R._Singh/screenshots/chapter6.png | bin | 0 -> 172065 bytes | |||
-rw-r--r-- | Electrical_Network_by_R._Singh/screenshots/chapter7.png | bin | 0 -> 179721 bytes |
13 files changed, 11042 insertions, 0 deletions
diff --git a/Electrical_Network_by_R._Singh/Chapter1.ipynb b/Electrical_Network_by_R._Singh/Chapter1.ipynb new file mode 100644 index 00000000..1f66c550 --- /dev/null +++ b/Electrical_Network_by_R._Singh/Chapter1.ipynb @@ -0,0 +1,634 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:d23c488e06827cad82da0b4ae722d620d666ee7bafdcca01ad1272abc13ad886"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter1-Basic Circuit Concepts"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg1.9"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Basic Circuit Concepts\n",
+ "##page no-1.9\n",
+ "##example1.1\n",
+ "print(\"Current through 15Ohm resistor is given by:\");\n",
+ "print(\"I1=30/15\");\n",
+ "I1=30/15\n",
+ "print\"%s %.2f %s \"%(\"current through 15Ohm resistor = \",I1,\" Ampere\")\n",
+ "print(\"Current through 5Ohm resistor is given by:\")\n",
+ "print(\"I2=5+2\");\n",
+ "I2=5+2\n",
+ "print\"%s %.2f %s \"%(\"current through 5ohm resistor = \",I2,\" Ampere\")\n",
+ "print(\"R=100-30-5*I2/I1\");\n",
+ "R=(100-30-5*I2)/I1\n",
+ "print\"%s %.2f %s \"%(\"R = \",R,\" Ohm\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current through 15Ohm resistor is given by:\n",
+ "I1=30/15\n",
+ "current through 15Ohm resistor = 2.00 Ampere \n",
+ "Current through 5Ohm resistor is given by:\n",
+ "I2=5+2\n",
+ "current through 5ohm resistor = 7.00 Ampere \n",
+ "R=100-30-5*I2/I1\n",
+ "R = 17.00 Ohm \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg1.10"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Basic Circuit Concepts\n",
+ "##page no-1.10\n",
+ "##example1.2\n",
+ "import math\n",
+ "import numpy\n",
+ "print(\"from the given fig:\")\n",
+ "print(\"I2-I3=13\");\n",
+ "print(\"-20*I1+8*I2=0\");\n",
+ "print(\"-12*I1-16*I3=0\");\n",
+ "##solving these equations in the matrix form\n",
+ "A=numpy.matrix([[0, 1 ,-1],[-20, 8, 0],[-12 ,0 ,-16]])\n",
+ "B=numpy.matrix([[13], [0] ,[0]])\n",
+ "print(\"A=\")\n",
+ "print[A]\n",
+ "print(\"B=\")\n",
+ "print[B]\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B)\n",
+ "print(\"X=\")\n",
+ "print[X]\n",
+ "print(\"I1 = 4Ampere\")\n",
+ "print(\"I2 = 10Ampere\")\n",
+ "print(\"I3 = -3Ampere\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "from the given fig:\n",
+ "I2-I3=13\n",
+ "-20*I1+8*I2=0\n",
+ "-12*I1-16*I3=0\n",
+ "A=\n",
+ "[matrix([[ 0, 1, -1],\n",
+ " [-20, 8, 0],\n",
+ " [-12, 0, -16]])]\n",
+ "B=\n",
+ "[matrix([[13],\n",
+ " [ 0],\n",
+ " [ 0]])]\n",
+ "X=\n",
+ "[matrix([[ 4.],\n",
+ " [ 10.],\n",
+ " [ -3.]])]\n",
+ "I1 = 4Ampere\n",
+ "I2 = 10Ampere\n",
+ "I3 = -3Ampere\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg1.11"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Basic Circuit Concepts\n",
+ "##pg no-1.11\n",
+ "##example 1.3\n",
+ "print(\"Iaf=x\")\n",
+ "print(\"Ife=x-30\")\n",
+ "print(\"Ied=x+40\")\n",
+ "print(\"Idc=x-80\")\n",
+ "print(\"Icb=x-20\")\n",
+ "print(\"Iba=x-80\")\n",
+ "print(\"Applying KVL to the closed path AFEDCBA:\")##Applying KVL to the path AFEDCBA\n",
+ "print(\"x=4.1/0.1\")\n",
+ "x=4.1/0.1;\n",
+ "Iaf=x;\n",
+ "print\"%s %.2f %s \"%(\"\\nIaf = \",Iaf,\" Ampere\");\n",
+ "Ife=x-30.\n",
+ "print\"%s %.2f %s \"%(\"\\nIfe = \",Ife,\" Ampere\");\n",
+ "Ied=x+40.;\n",
+ "print\"%s %.2f %s \"%(\"\\nIed = \",Ied,\" Ampere\");\n",
+ "Idc=x-80;\n",
+ "print\"%s %.2f %s \"%(\"\\nIdc = \",Idc,\" Ampere\");\n",
+ "Icb=x-20.;\n",
+ "print\"%s %.2f %s \"%(\"\\nIcb = \",Icb,\" Ampere\");\n",
+ "Iba=x-80.;\n",
+ "print\"%s %.2f %s \"%(\"\\nIba = \",Iba,\" Ampere\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Iaf=x\n",
+ "Ife=x-30\n",
+ "Ied=x+40\n",
+ "Idc=x-80\n",
+ "Icb=x-20\n",
+ "Iba=x-80\n",
+ "Applying KVL to the closed path AFEDCBA:\n",
+ "x=4.1/0.1\n",
+ "\n",
+ "Iaf = 41.00 Ampere \n",
+ "\n",
+ "Ife = 11.00 Ampere \n",
+ "\n",
+ "Ied = 81.00 Ampere \n",
+ "\n",
+ "Idc = -39.00 Ampere \n",
+ "\n",
+ "Icb = 21.00 Ampere \n",
+ "\n",
+ "Iba = -39.00 Ampere \n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg1.12"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Basic Circuit Concepts\n",
+ "##pg no- 1.12\n",
+ "##example 1.4\n",
+ "import math\n",
+ "import numpy\n",
+ "print(\"Applying KVL to the closed path OBAO\");##Applying KVL to the closed path OBAO\n",
+ "print(\"3*x-3*y=2\");\n",
+ "print(\"Applying KVL to the closed path ABCA\");##Applying KVL to the closed path ABCA\n",
+ "print(\"9*x+12*y=4\");\n",
+ "a=numpy.matrix([[3, -3],[9, 12]]);\n",
+ "b=([[2] ,[4]])\n",
+ "print(\"a=\")\n",
+ "print[a]\n",
+ "print(\"b=\")\n",
+ "print[b]\n",
+ "X=numpy.dot(numpy.linalg.inv(a),b)\n",
+ "\n",
+ "print(X)\n",
+ "print(\"x=0.5714286 Ampere\");\n",
+ "print(\"y=-0.095238 Ampere\");\n",
+ "print(\"Ioa=0.57A\")\n",
+ "print(\"Iob=1-0.57\")\n",
+ "Iob=1-0.57;\n",
+ "print\"%s %.2f %s \"%(\"\\nIob = \",Iob,\" A\");\n",
+ "print(\"Iab = 0.095\");\n",
+ "Iac=0.57-0.095;\n",
+ "print\"%s %.2f %s \"%(\"\\nIac =\",Iac,\" A\");\n",
+ "print(\"Iab=1-0.57 + 0.095\")\n",
+ "Iab=1-0.57 + 0.095;\n",
+ "print\"%s %.2f %s \"%(\"\\nIob = \",Iab,\" A\") "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Applying KVL to the closed path OBAO\n",
+ "3*x-3*y=2\n",
+ "Applying KVL to the closed path ABCA\n",
+ "9*x+12*y=4\n",
+ "a=\n",
+ "[matrix([[ 3, -3],\n",
+ " [ 9, 12]])]\n",
+ "b=\n",
+ "[[[2], [4]]]\n",
+ "[[ 0.57142857]\n",
+ " [-0.0952381 ]]\n",
+ "x=0.5714286 Ampere\n",
+ "y=-0.095238 Ampere\n",
+ "Ioa=0.57A\n",
+ "Iob=1-0.57\n",
+ "\n",
+ "Iob = 0.43 A \n",
+ "Iab = 0.095\n",
+ "\n",
+ "Iac = 0.47 A \n",
+ "Iab=1-0.57 + 0.095\n",
+ "\n",
+ "Iob = 0.53 A \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5-pg1.12"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Basic Circuit Concepts\n",
+ "##pg no-1.12\n",
+ "##example 1.5\n",
+ "I1=2./5.;\n",
+ "print\"%s %.2f %s \"%(\"I1=2/5= \",I1,\" Ampere\")\n",
+ "I2=4./8.;\n",
+ "print\"%s %.2f %s \"%(\"\\nI2=4/8= \",I2,\" Ampere\")\n",
+ "print(\"\\nPotential difference between points x and y = Vxy = Vx-Vy\")\n",
+ "print(\"\\nWriting KVL equations for the path x to y\")##Writing KVL equation from x to y\n",
+ "print(\"\\nVs+3*I1+4-3*I2-Vy=0\")\n",
+ "print(\"\\nVs+3*(0.4) + 4- 3*(0.5) -Vy = 0\")\n",
+ "print(\"\\nVs+3*I1+4-3*I2-Vy = 0\")\n",
+ "print(\"\\nVx-Vy = -3.7\")\n",
+ "print(\"\\nVxy = -3.7V\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "I1=2/5= 0.40 Ampere \n",
+ "\n",
+ "I2=4/8= 0.50 Ampere \n",
+ "\n",
+ "Potential difference between points x and y = Vxy = Vx-Vy\n",
+ "\n",
+ "Writing KVL equations for the path x to y\n",
+ "\n",
+ "Vs+3*I1+4-3*I2-Vy=0\n",
+ "\n",
+ "Vs+3*(0.4) + 4- 3*(0.5) -Vy = 0\n",
+ "\n",
+ "Vs+3*I1+4-3*I2-Vy = 0\n",
+ "\n",
+ "Vx-Vy = -3.7\n",
+ "\n",
+ "Vxy = -3.7V\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6-pg1.13"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Basic Circuit Concepts\n",
+ "##pg no-1.13\n",
+ "##example 1.6\n",
+ "import math\n",
+ "#calculate the \n",
+ "I1=20/15.;\n",
+ "print'%s %.2f %s'%(\"I1=2/5= \",I1,\" Ampere\")\n",
+ "I2=15./10.;\n",
+ "print'%s %.2f %s'%(\"\\nI2=4/8= \",I2,\" Ampere\")\n",
+ "print(\"Voltage between points A and B = VAB = VA-VB\");\n",
+ "print(\"Writing KVL equations for the path A to B:\");##Writing KVL equations for the path A to B\n",
+ "print(\"VA - 5*I1 - 5 - 15 + 6*I2 - VB = 0\");\n",
+ "print(\"VA - VB = 5*1.33 + 5 + 15 + 6*1.5\");\n",
+ "VAB=(5*1.33)+5.+15.-(6*1.5);\n",
+ "print'%s %.2f %s'%(\"VAB = \",VAB,\" Volt\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "I1=2/5= 1.33 Ampere\n",
+ "\n",
+ "I2=4/8= 1.50 Ampere\n",
+ "Voltage between points A and B = VAB = VA-VB\n",
+ "Writing KVL equations for the path A to B:\n",
+ "VA - 5*I1 - 5 - 15 + 6*I2 - VB = 0\n",
+ "VA - VB = 5*1.33 + 5 + 15 + 6*1.5\n",
+ "VAB = 17.65 Volt\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7-pg1.13"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Basic Circuit Concepts\n",
+ "##page no-1.13\n",
+ "##example1.7\n",
+ "import math\n",
+ "#calculate the \n",
+ "I1=5./2.;\n",
+ "print'%s %.2f %s'%(\"I1=2/5= \",I1,\" Ampere\")\n",
+ "I2=2.;\n",
+ "print'%s %.2f %s'%(\"\\nI2=4/8= \",I2,\" Ampere\")\n",
+ "print(\"Potential difference VAB = VA - VB\");\n",
+ "print(\"Writing KVL equations for path A to B\") ##Writing KVL equations for path A to B\n",
+ "print(\"VA - 2*I1 + 8 - 5*I2 - VB = 0\");\n",
+ "print(\"VA - VB = (2*2.5) - 8 5 + (5*2)\");\n",
+ "VAB=(2.*2.5)-8.+(5.*2.)\n",
+ "print'%s %.2f %s'%(\"VAB = \",VAB,\" Volt\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "I1=2/5= 2.50 Ampere\n",
+ "\n",
+ "I2=4/8= 2.00 Ampere\n",
+ "Potential difference VAB = VA - VB\n",
+ "Writing KVL equations for path A to B\n",
+ "VA - 2*I1 + 8 - 5*I2 - VB = 0\n",
+ "VA - VB = (2*2.5) - 8 5 + (5*2)\n",
+ "VAB = 7.00 Volt\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex8-pg1.14"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Basic Circuit Concepts\n",
+ "##page no-1.14\n",
+ "##example1.8\n",
+ "import math\n",
+ "#calculate the \n",
+ "I1=10./8.;\n",
+ "print'%s %.2f %s'%(\"I1=2/5= \",I1,\" Ampere\")\n",
+ "I2=5.;\n",
+ "print'%s %.2f %s'%(\"\\nI2=4/8= \",I2,\" Ampere\")\n",
+ "print(\"Applying KVL to the path from A to B\") ##Applying KVL to the path from A to B\n",
+ "print(\"VA - 3*I1 - 8 + 3*I2 - VB = 0\");\n",
+ "print(\"VA - VB = 3*1.25 + 8 - 3*5\")\n",
+ "VAB= (3*1.25)+8.-(3.*5.);\n",
+ "print'%s %.2f %s'%(\"VAB = \",VAB,\" Volt\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "I1=2/5= 1.25 Ampere\n",
+ "\n",
+ "I2=4/8= 5.00 Ampere\n",
+ "Applying KVL to the path from A to B\n",
+ "VA - 3*I1 - 8 + 3*I2 - VB = 0\n",
+ "VA - VB = 3*1.25 + 8 - 3*5\n",
+ "VAB = -3.25 Volt\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.12-pg1.17"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Basic Circuit Concepts\n",
+ "##page no-1.17\n",
+ "##example1.12\n",
+ "print(\"Applying KVL to the circuit :\");\n",
+ "print(\"50 - 5*I - 1.2*I - 16 = 0\")\n",
+ "I=(50.-16.)/6.2;\n",
+ "print'%s %.2f %s'%(\"I= \",I,\" Amp\");\n",
+ "P=50.*I;\n",
+ "print'%s %.2f %s'%(\"\\nPower delivered 50 V source = 50 * 5.48= \",P,\" W\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Applying KVL to the circuit :\n",
+ "50 - 5*I - 1.2*I - 16 = 0\n",
+ "I= 5.48 Amp\n",
+ "\n",
+ "Power delivered 50 V source = 50 * 5.48= 274.19 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.13-pg1.18"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Basic Circuit Concepts\n",
+ "##page no-1.18\n",
+ "##example1.13\n",
+ "print(\"By Current Division formula ;\");\n",
+ "I4=4.*(2./(2.+4.));\n",
+ "print'%s %.2f %s'%(\"I4 = 4 * (2/(2+4)) = \",I4,\" Amp\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "By Current Division formula ;\n",
+ "I4 = 4 * (2/(2+4)) = 1.33 Amp\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.14-pg1.19"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Basic Circuit Concepts\n",
+ "##page no-1.19\n",
+ "##example1.14\n",
+ "print(\"Applying KVL to the mesh\");\n",
+ "print(\"15 - 50*I - 50*I - 5*I\");\n",
+ "I=15./105.;\n",
+ "print'%s %.2f %s'%(\"I=15/105 = \",I,\" Amp\");\n",
+ "V=15-(50*0.143);\n",
+ "print'%s %.2f %s'%(\"\\nVoltage at node 2 = 15 - 50*I = \",V,\" Volt\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Applying KVL to the mesh\n",
+ "15 - 50*I - 50*I - 5*I\n",
+ "I=15/105 = 0.14 Amp\n",
+ "\n",
+ "Voltage at node 2 = 15 - 50*I = 7.85 Volt\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.15-pg1.20"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Basic Circuit Concepts\n",
+ "##pg no.-1.20\n",
+ "##example 1.15\n",
+ "r1=3.;\n",
+ "r2=2.33;\n",
+ "r3=6.;\n",
+ "v1=18.;\n",
+ "v2=5.985;\n",
+ "print(\"\\nApplying KCL at the node, \\n(Va-18)/3+(Va-5.985)/2.33+Va/6 = 0\");\n",
+ "Va=((v1*r2*r3)+(v2*r1*r3))/((r2*r3)+(r1*r3)+(r1*r2));\n",
+ "print'%s %.2f %s'%(\"\\nSolving the equation,we get, \\nVa = \",Va,\" V\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Applying KCL at the node, \n",
+ "(Va-18)/3+(Va-5.985)/2.33+Va/6 = 0\n",
+ "\n",
+ "Solving the equation,we get, \n",
+ "Va = 9.22 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electrical_Network_by_R._Singh/Chapter10.ipynb b/Electrical_Network_by_R._Singh/Chapter10.ipynb new file mode 100644 index 00000000..6306573f --- /dev/null +++ b/Electrical_Network_by_R._Singh/Chapter10.ipynb @@ -0,0 +1,119 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:9cb18a31e319c2d8b43a0064401876d651a2153725c525211c52ac1687dd288c"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter10-Network Functions"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex35-pg10.35"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "## Network Functions : example 10.35 : (pg 10.35)\n",
+ "import math\n",
+ "m=(2./(math.sqrt(2.)*math.sqrt(10.)));\n",
+ "a=90.;\n",
+ "x=(a-math.atan(3.)*57.3-math.atan(1)*57.3);\n",
+ "print(\"\\nF(s) =(4s/s^2+2s+2) = 4s/(s+1-j)*(s+1-j)\");\n",
+ "print(\"\\n At s=j2\");\n",
+ "##pmag = phasor magnitudes\n",
+ "print(\"\\n|F(j2)|=Product of pmag from all zeros to j2/Product of pmag from all poles to j2\");\n",
+ "print\"%s %.2f %s\"%(\"\\n = \",m,\"\");\n",
+ "print\"%s %.2f %s\"%(\"\\nf(w) = atand(2/0)-atand(3)-atand(1)= \",x,\" degrees\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "F(s) =(4s/s^2+2s+2) = 4s/(s+1-j)*(s+1-j)\n",
+ "\n",
+ " At s=j2\n",
+ "\n",
+ "|F(j2)|=Product of pmag from all zeros to j2/Product of pmag from all poles to j2\n",
+ "\n",
+ " = 0.45 \n",
+ "\n",
+ "f(w) = atand(2/0)-atand(3)-atand(1)= -26.57 degrees\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex36-pg10.35"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "## Network Functions : example 10.36 : (pg 10.35 & 10.36)\n",
+ "\n",
+ "import math\n",
+ "m=((5.*math.sqrt(17.))/(math.sqrt(20.)*4.));\n",
+ "a=90.;\n",
+ "w=(math.atan(4.)*57.3+math.atan(4/3.)*57.3-(a)-math.atan(4/2.)*57.3);\n",
+ "print(\"\\nF(s) = (s+1)(s+3)/s(s+2))\");\n",
+ "print(\"\\nAt s=j4\");\n",
+ "##vmag = vector magnitudes\n",
+ "print(\"\\nPrduct of vmag from all zeros to j4/ Product of vmag from all poles to j4\");\n",
+ "print\"%s %.2f %s\"%(\"\\n =\",m,\"\");\n",
+ "print(\"\\nphi(w)= atand(4)+atand(4/3)-atand(4/0)-atand(4/2)\");\n",
+ "print\"%s %.2f %s\"%(\"\\n = \",w,\" degrees\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "F(s) = (s+1)(s+3)/s(s+2))\n",
+ "\n",
+ "At s=j4\n",
+ "\n",
+ "Prduct of vmag from all zeros to j4/ Product of vmag from all poles to j4\n",
+ "\n",
+ " = 1.15 \n",
+ "\n",
+ "phi(w)= atand(4)+atand(4/3)-atand(4/0)-atand(4/2)\n",
+ "\n",
+ " = -24.34 degrees\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electrical_Network_by_R._Singh/Chapter11.ipynb b/Electrical_Network_by_R._Singh/Chapter11.ipynb new file mode 100644 index 00000000..7477df52 --- /dev/null +++ b/Electrical_Network_by_R._Singh/Chapter11.ipynb @@ -0,0 +1,996 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:ddb3981597525229ad0e3a4e8d351738f910ed199ce10833b7bffa5c5e341de3"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter11-Two-Port Networks"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex16-pg11.29"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Two-Port Networks : example 11.16 :(pg11.39 )\n",
+ "V1s=25.;\n",
+ "import math\n",
+ "I1s=1.;\n",
+ "I2s=2.;\n",
+ "V1o=10.;\n",
+ "V2o=50.;\n",
+ "I2o=2.;\n",
+ "h11=(V1s/I1s);\n",
+ "h21=(I2s/I1s);\n",
+ "h12=(V1o/V2o);\n",
+ "h22=(I2o/V2o);\n",
+ "print\"%s %.2f %s\"%(\"\\nh11 = V1/I1 = \",h11,\" Ohm\");##when V2=0\n",
+ "print\"%s %.2f %s\"%(\"\\nh21= I2/I1 = \",h21,\"\");##when V2=0\n",
+ "print\"%s %.2f %s\"%(\"\\nh12 = V1/V2 =\",h12,\"\");##when I1=0\n",
+ "print\"%s %.2f %s\"%(\"\\nh22 = I2/V2 = \",h22,\" mho\");##when I1=0\n",
+ "print(\"\\nth h-parameters are\");\n",
+ "print([[h11 ,h12],[h21, h22]]);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "h11 = V1/I1 = 25.00 Ohm\n",
+ "\n",
+ "h21= I2/I1 = 2.00 \n",
+ "\n",
+ "h12 = V1/V2 = 0.20 \n",
+ "\n",
+ "h22 = I2/V2 = 0.04 mho\n",
+ "\n",
+ "th h-parameters are\n",
+ "[[25.0, 0.2], [2.0, 0.04]]\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex19-pg11.49"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Two-Port Networks : example 11.19 :(pg11.49 & 11.50)\n",
+ "Z11=20.;\n",
+ "import math\n",
+ "Z22=30.;\n",
+ "Z12=10.;\n",
+ "Z21=10.;\n",
+ "dZ=((Z11*Z22)-(Z12*Z21));\n",
+ "Y11=(Z22/dZ);\n",
+ "Y12=(-Z12/dZ);\n",
+ "Y21=(-Z21/dZ);\n",
+ "Y22=(Z11/dZ);\n",
+ "A=(Z11/Z21);\n",
+ "B=(dZ/Z21);\n",
+ "C=(1./Z21);\n",
+ "D=(Z22/Z21);\n",
+ "print(\"\\nY-parameters\");\n",
+ "print\"%s %.2f %s\"%(\"\\nY11 = Z22/dZ = \",Y11,\" mho\");\n",
+ "print\"%s %.2f %s\"%(\"\\nY12 = -Z12/dZ = \",Y12,\" mho\");\n",
+ "print\"%s %.2f %s\"%(\"\\nY21 = -Z21/dZ = \",Y21,\" mho\");\n",
+ "print\"%s %.2f %s\"%(\"\\nY22 = Z11/dZ = \",Y22,\" mho\");\n",
+ "print(\"\\n Y-parameters are:\");\n",
+ "print([[Y11, Y12],[Y21, Y22]]);##Y-parameters in matrix form\n",
+ "print(\"\\nABCD parameters\");\n",
+ "print\"%s %.2f %s\"%(\"\\nA = Z11/Z21 = \",A,\"\");\n",
+ "print\"%s %.2f %s\"%(\"\\nB = dZ/Z21 = \",B,\"\");\n",
+ "print\"%s %.2f %s\"%(\"\\nC = 1/Z21 = \",C,\"\");\n",
+ "print\"%s %.2f %s\"%(\"\\nD = Z22/Z21 = \",D,\"\");\n",
+ "print(\"\\n ABCD parameters are:\");\n",
+ "print([[A ,B],[C ,D]]);##ABCD parameters in matrix form\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Y-parameters\n",
+ "\n",
+ "Y11 = Z22/dZ = 0.06 mho\n",
+ "\n",
+ "Y12 = -Z12/dZ = -0.02 mho\n",
+ "\n",
+ "Y21 = -Z21/dZ = -0.02 mho\n",
+ "\n",
+ "Y22 = Z11/dZ = 0.04 mho\n",
+ "\n",
+ " Y-parameters are:\n",
+ "[[0.06, -0.02], [-0.02, 0.04]]\n",
+ "\n",
+ "ABCD parameters\n",
+ "\n",
+ "A = Z11/Z21 = 2.00 \n",
+ "\n",
+ "B = dZ/Z21 = 50.00 \n",
+ "\n",
+ "C = 1/Z21 = 0.10 \n",
+ "\n",
+ "D = Z22/Z21 = 3.00 \n",
+ "\n",
+ " ABCD parameters are:\n",
+ "[[2.0, 50.0], [0.1, 3.0]]\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex20-pg11.50"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Two-Port Networks : example 11.20 :(pg11.50 & 11.51)\n",
+ "a=0.5;\n",
+ "import math\n",
+ "b=-0.2;\n",
+ "d=1.\n",
+ "print(\"\\nI1 =0.5V1-0.2V2 \\nI2=-0.2V1+V2\");\n",
+ "print\"%s %.2f %s\"%(\"\\n Y11 =I1/V1 = \",a,\"mho\");##when V2 is 0 in the 1st eqn\n",
+ "print\"%s %.2f %s\"%(\"\\n Y21 =I2/V1 = \",b,\" mho\");##when V2 is 0 in the 1st eqn\n",
+ "print\"%s %.2f %s\"%(\"\\n Y12 =I1/V2 = \",b,\" mho\");##when V1 is 0 in the 2nd eqn\n",
+ "print\"%s %.2f %s\"%(\"\\n Y22 =I2/V2 = \",d,\" mho\");##when V1 is 0 in the 2nd eqn\n",
+ "print(\"\\nY-parameters are\");\n",
+ "print([[a, b],[b ,d]]);\n",
+ "dY=((a*d)-(b*b));\n",
+ "Z11=(d/dY);\n",
+ "Z12=(-b/dY);\n",
+ "Z21=(-b/dY);\n",
+ "Z22=(a/dY);\n",
+ "A=(-d/b);\n",
+ "C=(-dY/b);\n",
+ "D=(-a/b);\n",
+ "print\"%s %.2f %s\"%(\"\\ndY=Y11.Y22-Y12.Y21 =\",dY,\"\");\n",
+ "print\"%s %.2f %s\"%(\"\\nZ11 = Y22/dY = \",Z11,\" Ohm\");\n",
+ "print\"%s %.2f %s\"%(\"\\nZ12 = -Y12/dY = \",Z12,\" Ohm\");\n",
+ "print\"%s %.2f %s\"%(\"\\nZ21 = -Y21/-dY = \",Z21,\" Ohm\");\n",
+ "print\"%s %.2f %s\"%(\"\\nZ22 = Y11/dY = \",Z22,\" Ohm\");\n",
+ "print(\"\\nZ-parameters :\");\n",
+ "\n",
+ "x=([[Z11, Z12],[Z21, Z22]])\n",
+ "\n",
+ "print(x)\n",
+ "print\"%s %.2f %s\"%(\"\\nA =-Y22/Y21 =\",A,\"\");\n",
+ "print\"%s %.2f %s\"%(\"\\nB = -1/Y21 =\",A,\"\");\n",
+ "print\"%s %.2f %s\"%(\"\\nC = -dY/Y21 =\",C,\"\");\n",
+ "print\"%s %.2f %s\"%(\"\\nD = -Y11/Y21 =\",D,\"\");\n",
+ "print(\"\\nABCD parameters :\");\n",
+ "print([[A, A],[C ,D]]);\n",
+ "\n",
+ "\n",
+ "\n",
+ "#due to round off error\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "I1 =0.5V1-0.2V2 \n",
+ "I2=-0.2V1+V2\n",
+ "\n",
+ " Y11 =I1/V1 = 0.50 mho\n",
+ "\n",
+ " Y21 =I2/V1 = -0.20 mho\n",
+ "\n",
+ " Y12 =I1/V2 = -0.20 mho\n",
+ "\n",
+ " Y22 =I2/V2 = 1.00 mho\n",
+ "\n",
+ "Y-parameters are\n",
+ "[[0.5, -0.2], [-0.2, 1.0]]\n",
+ "\n",
+ "dY=Y11.Y22-Y12.Y21 = 0.46 \n",
+ "\n",
+ "Z11 = Y22/dY = 2.17 Ohm\n",
+ "\n",
+ "Z12 = -Y12/dY = 0.43 Ohm\n",
+ "\n",
+ "Z21 = -Y21/-dY = 0.43 Ohm\n",
+ "\n",
+ "Z22 = Y11/dY = 1.09 Ohm\n",
+ "\n",
+ "Z-parameters :\n",
+ "[[2.173913043478261, 0.4347826086956522], [0.4347826086956522, 1.0869565217391306]]\n",
+ "\n",
+ "A =-Y22/Y21 = 5.00 \n",
+ "\n",
+ "B = -1/Y21 = 5.00 \n",
+ "\n",
+ "C = -dY/Y21 = 2.30 \n",
+ "\n",
+ "D = -Y11/Y21 = 2.50 \n",
+ "\n",
+ "ABCD parameters :\n",
+ "[[5.0, 5.0], [2.3, 2.5]]\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex22-pg11.52"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Two-Port Networks : example 11.22 :(pg11.52 & 11.53)\n",
+ "print(\"\\nApplying KVL to Mesh 1 \\nV1 = I1 - I3 - - - -(i)\");\n",
+ "print(\"\\nApplying KVL to Mesh 2 \\nV2 = -4I2 + 2I3 - - - -(ii)\");\n",
+ "print(\"\\nApplying KVL to Mesh 3 \\nI3 = (1/5)I1 + (4/5)I2 - - - -(iii)\");\n",
+ "##substituting (iii) in (i) & (ii),we get\n",
+ "print(\"\\nV1 = (4/5)I1 - (4/5)I2 \\nV2 = (2/5)I1 - (12/5)I2\");\n",
+ "print(\"\\nZ-parameters:\");\n",
+ "a=4./5.;b=-4/5.;c=2/5.;d=-12/5.;\n",
+ "print([[a, b],[c, d]]);\n",
+ "dZ=(a*d)-(b*c);\n",
+ "Y11=(d/dZ);\n",
+ "Y12=(-b/dZ);\n",
+ "Y21=(-c/dZ);\n",
+ "Y22=(a/dZ);\n",
+ "print(\"\\nY-parameters are:\");\n",
+ "print\"%s %.2f %s\"%(\"\\ndZ = Z11.Z22 - Z12.Z21 = \",dZ,\"\");\n",
+ "print\"%s %.2f %s\"%(\"\\nY11 = Z22/dZ = \",Y11,\" mho\");\n",
+ "print\"%s %.2f %s\"%(\"\\nY12 = -Z12/dY = \",Y12,\" mho\");\n",
+ "print\"%s %.2f %s\"%(\"\\nY21 = -Z21/-dY = \",Y21,\" mho\");\n",
+ "print\"%s %.2f %s\"%(\"\\nY22 = Z11/dY = \",Y22,\" mho\");\n",
+ "print([[Y11, Y12],[Y21, Y22]]); \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Applying KVL to Mesh 1 \n",
+ "V1 = I1 - I3 - - - -(i)\n",
+ "\n",
+ "Applying KVL to Mesh 2 \n",
+ "V2 = -4I2 + 2I3 - - - -(ii)\n",
+ "\n",
+ "Applying KVL to Mesh 3 \n",
+ "I3 = (1/5)I1 + (4/5)I2 - - - -(iii)\n",
+ "\n",
+ "V1 = (4/5)I1 - (4/5)I2 \n",
+ "V2 = (2/5)I1 - (12/5)I2\n",
+ "\n",
+ "Z-parameters:\n",
+ "[[0.8, -0.8], [0.4, -2.4]]\n",
+ "\n",
+ "Y-parameters are:\n",
+ "\n",
+ "dZ = Z11.Z22 - Z12.Z21 = -1.60 \n",
+ "\n",
+ "Y11 = Z22/dZ = 1.50 mho\n",
+ "\n",
+ "Y12 = -Z12/dY = -0.50 mho\n",
+ "\n",
+ "Y21 = -Z21/-dY = 0.25 mho\n",
+ "\n",
+ "Y22 = Z11/dY = -0.50 mho\n",
+ "[[1.5, -0.5000000000000001], [0.25000000000000006, -0.5000000000000001]]\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex23-pg11.53"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Two-Port Networks : example 11.23 :(pg11.53 & 11.54)\n",
+ "print(\"\\nApplying KVL to Mesh 1 \\nV1 = 4I1 - 2I3 - - - -(i)\");\n",
+ "print(\"\\nApplying KVL to Mesh 2 \\nV2 = 4I2 + 2I3 - - - -(ii)\");\n",
+ "print(\"\\nApplying KVL to Mesh 3 \\n-2I3 = I1 + I2 - - - -(iii)\");\n",
+ "##substituting (iii) in (i) & (ii),we get\n",
+ "print(\"\\nV1 = 5I1 + I2 \\nV2 = -I1 + 3I2\");\n",
+ "print(\"\\nZ-parameters:\");\n",
+ "a=5.;b=1.;c=-1.;d=3.;\n",
+ "print([[a, b],[c ,d]]);\n",
+ "dZ=(a*d)-(b*c);\n",
+ "h11=(dZ/d);\n",
+ "h12=(b/d);\n",
+ "h21=(-c/d);\n",
+ "h22=(.1/d);\n",
+ "print\"%s %.2f %s\"%(\"\\ndZ = Z11.Z22 - Z12.Z21 =\",dZ,\"\");\n",
+ "print\"%s %.2f %s\"%(\"\\nh11 = dZ/Z22 = \",h11,\"\");\n",
+ "print\"%s %.2f %s\"%(\"\\nh12 = Z12/Z22 = \",h12,\"\");\n",
+ "print\"%s %.2f %s\"%(\"\\nh21 = -Z21/Z22 = \",h21,\"\");\n",
+ "print\"%s %.2f %s\"%(\"\\nh22 = 1/Z22 = \",h22,\"\");\n",
+ "print(\"\\nh-parameters are:\");\n",
+ "print([[h11 ,h12],[h21 ,h22]]); "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Applying KVL to Mesh 1 \n",
+ "V1 = 4I1 - 2I3 - - - -(i)\n",
+ "\n",
+ "Applying KVL to Mesh 2 \n",
+ "V2 = 4I2 + 2I3 - - - -(ii)\n",
+ "\n",
+ "Applying KVL to Mesh 3 \n",
+ "-2I3 = I1 + I2 - - - -(iii)\n",
+ "\n",
+ "V1 = 5I1 + I2 \n",
+ "V2 = -I1 + 3I2\n",
+ "\n",
+ "Z-parameters:\n",
+ "[[5.0, 1.0], [-1.0, 3.0]]\n",
+ "\n",
+ "dZ = Z11.Z22 - Z12.Z21 = 16.00 \n",
+ "\n",
+ "h11 = dZ/Z22 = 5.33 \n",
+ "\n",
+ "h12 = Z12/Z22 = 0.33 \n",
+ "\n",
+ "h21 = -Z21/Z22 = 0.33 \n",
+ "\n",
+ "h22 = 1/Z22 = 0.03 \n",
+ "\n",
+ "h-parameters are:\n",
+ "[[5.333333333333333, 0.3333333333333333], [0.3333333333333333, 0.03333333333333333]]\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex24-pg11.54"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Two-Port Networks : example 11.24 :(pg11.54 & 11.55)\n",
+ "print(\"\\nApplying KCL to Node 3 \\nV3 = V2/3 - - - -(i)\");\n",
+ "print(\"\\nI1 = 2V1 - (2/3)V2 - - - -(ii)\");\n",
+ "print(\"\\nI2 = 3V2 - (V2/3) = (8/3)V2 - - - -(iii)\");\n",
+ "##Comparing (iii) & (ii) ,we get\n",
+ "print(\"\\nY-parameters:\");\n",
+ "a=2;b=(-2/3.);c=0;d=(8/3.);\n",
+ "print([[a, b],[b ,d]]);\n",
+ "dY=((a*d)-(b*c));\n",
+ "Z11=(d/dY);\n",
+ "Z12=(-b/dY);\n",
+ "Z21=(c/dY);\n",
+ "Z22=(a/dY);\n",
+ "print\"%s %.2f %s\"%(\"\\ndY=Y11.Y22-Y12.Y21 =\",dY,\"\");\n",
+ "print\"%s %.2f %s\"%(\"\\nZ11 = Y22/dY =\",Z11,\" Ohm\");\n",
+ "print\"%s %.2f %s\"%(\"\\nZ12 = -Y12/dY = \",Z12,\" Ohm\");\n",
+ "print\"%s %.2f %s\"%(\"\\nZ21 = -Y21/-dY = \",Z21,\" Ohm\");\n",
+ "print\"%s %.2f %s\"%(\"\\nZ22 = Y11/dY = \",Z22,\" Ohm\");\n",
+ "print(\"\\nZ-parameters :\");\n",
+ "print([[Z11, Z12],[Z21, Z22]]);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Applying KCL to Node 3 \n",
+ "V3 = V2/3 - - - -(i)\n",
+ "\n",
+ "I1 = 2V1 - (2/3)V2 - - - -(ii)\n",
+ "\n",
+ "I2 = 3V2 - (V2/3) = (8/3)V2 - - - -(iii)\n",
+ "\n",
+ "Y-parameters:\n",
+ "[[2, -0.6666666666666666], [-0.6666666666666666, 2.6666666666666665]]\n",
+ "\n",
+ "dY=Y11.Y22-Y12.Y21 = 5.33 \n",
+ "\n",
+ "Z11 = Y22/dY = 0.50 Ohm\n",
+ "\n",
+ "Z12 = -Y12/dY = 0.12 Ohm\n",
+ "\n",
+ "Z21 = -Y21/-dY = 0.00 Ohm\n",
+ "\n",
+ "Z22 = Y11/dY = 0.38 Ohm\n",
+ "\n",
+ "Z-parameters :\n",
+ "[[0.5, 0.125], [0.0, 0.375]]\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex25-pg11.55"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Two-Port Networks : example 11.25 :(pg11.55 & 11.56)\n",
+ "print(\"\\nApplying KCL to Node 1 \\nI1 = (-3/2)V1 - V2- - -(i)\");\n",
+ "print(\"\\nApplying KCL to Node 2 \\nI2 = 2V1 + 2V2 - - - -(ii)\");\n",
+ "##observing (i) & (ii)\n",
+ "print(\"\\nY-parameters:\");\n",
+ "a=(-3/2.);b=(-1);c=2.;d=2.;\n",
+ "print([[a, b],[c ,d]]);\n",
+ "dY=((a*d)-(b*c));\n",
+ "Z11=(d/dY);\n",
+ "Z12=(-b/dY);\n",
+ "Z21=(-c/dY);\n",
+ "Z22=(a/dY);\n",
+ "print\"%s %.2f %s\"%(\"\\ndY=Y11.Y22-Y12.Y21 =\",dY,\"\");\n",
+ "print\"%s %.2f %s\"%(\"\\nZ11 = Y22/dY = \",Z11,\" Ohm\");\n",
+ "print\"%s %.2f %s\"%(\"\\nZ12 = -Y12/dY =\",Z12,\" Ohm\");\n",
+ "print\"%s %.2f %s\"%(\"\\nZ21 = -Y21/-dY = \",Z21,\" Ohm\");\n",
+ "print\"%s %.2f %s\"%(\"\\nZ22 = Y11/dY = \",Z22,\" Ohm\");\n",
+ "print(\"\\nZ-parameters :\");\n",
+ "print([[Z11 ,Z12],[Z21, Z22]]);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Applying KCL to Node 1 \n",
+ "I1 = (-3/2)V1 - V2- - -(i)\n",
+ "\n",
+ "Applying KCL to Node 2 \n",
+ "I2 = 2V1 + 2V2 - - - -(ii)\n",
+ "\n",
+ "Y-parameters:\n",
+ "[[-1.5, -1], [2.0, 2.0]]\n",
+ "\n",
+ "dY=Y11.Y22-Y12.Y21 = -1.00 \n",
+ "\n",
+ "Z11 = Y22/dY = -2.00 Ohm\n",
+ "\n",
+ "Z12 = -Y12/dY = -1.00 Ohm\n",
+ "\n",
+ "Z21 = -Y21/-dY = 2.00 Ohm\n",
+ "\n",
+ "Z22 = Y11/dY = 1.50 Ohm\n",
+ "\n",
+ "Z-parameters :\n",
+ "[[-2.0, -1.0], [2.0, 1.5]]\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex26-pg11.56"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Two-Port Networks : example 11.22 :(pg11.52 & 11.53)\n",
+ "print(\"\\nApplying KVL to Mesh 1 \\nV1 = 2I1 + I2 - - - -(i)\");\n",
+ "print(\"\\nApplying KVL to Mesh 2 \\nV2 = 10I1 + 11I2 - - - -(ii)\");\n",
+ "##observing (i) & (ii)\n",
+ "print(\"\\nV1 = (4/5)I1 - (4/5)I2 \\nV2 = (2/5)I1 - (12/5)I2\");\n",
+ "print(\"\\nZ-parameters:\");\n",
+ "a=2.;b=1.;c=10.;d=11.;\n",
+ "print([[a, b],[c ,d]]);\n",
+ "dZ=(a*d)-(b*c);\n",
+ "Y11=(d/dZ);\n",
+ "Y12=(-b/dZ);\n",
+ "Y21=(-c/dZ);\n",
+ "Y22=(a/dZ);\n",
+ "print(\"\\nY-parameters are:\");\n",
+ "print\"%s %.2f %s\"%(\"\\ndZ = Z11.Z22 - Z12.Z21 = \",dZ,\"\");\n",
+ "print\"%s %.2f %s\"%(\"\\nY11 = Z22/dZ = \",Y11,\" mho\");\n",
+ "print\"%s %.2f %s\"%(\"\\nY12 = -Z12/dY = \",Y12,\" mho\");\n",
+ "print\"%s %.2f %s\"%(\"\\nY21 = -Z21/-dY = \",Y21,\" mho\");\n",
+ "print\"%s %.2f %s\"%(\"\\nY22 = Z11/dY = \",Y22,\" mho\");\n",
+ "print([[Y11, Y12],[Y21, Y22]]); \n",
+ "\n",
+ "h11=(dZ/d);\n",
+ "h12=(b/d);\n",
+ "h21=(-c/d);\n",
+ "h22=(1/d);\n",
+ "\n",
+ "print\"%s %.2e %s\"%(\"\\ndZ = Z11.Z22 - Z12.Z21 =\",dZ,\"\");\n",
+ "print\"%s %.2e %s\"%(\"\\nh11 = dZ/Z22 = \",h11,\"\");\n",
+ "print\"%s %.2f %s\"%(\"\\nh12 = Z12/Z22 = \",h12,\"\");\n",
+ "print\"%s %.2e %s\"%(\"\\nh21 = -Z21/Z22 = \",h21,\"\");\n",
+ "print\"%s %.2e %s\"%(\"\\nh22 = 1/Z22 = \",h22,\"\");\n",
+ "print(\"\\nh-parameters are:\");\n",
+ "print([[h11 ,h12],[h21 ,h22]]); "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Applying KVL to Mesh 1 \n",
+ "V1 = 2I1 + I2 - - - -(i)\n",
+ "\n",
+ "Applying KVL to Mesh 2 \n",
+ "V2 = 10I1 + 11I2 - - - -(ii)\n",
+ "\n",
+ "V1 = (4/5)I1 - (4/5)I2 \n",
+ "V2 = (2/5)I1 - (12/5)I2\n",
+ "\n",
+ "Z-parameters:\n",
+ "[[2.0, 1.0], [10.0, 11.0]]\n",
+ "\n",
+ "Y-parameters are:\n",
+ "\n",
+ "dZ = Z11.Z22 - Z12.Z21 = 12.00 \n",
+ "\n",
+ "Y11 = Z22/dZ = 0.92 mho\n",
+ "\n",
+ "Y12 = -Z12/dY = -0.08 mho\n",
+ "\n",
+ "Y21 = -Z21/-dY = -0.83 mho\n",
+ "\n",
+ "Y22 = Z11/dY = 0.17 mho\n",
+ "[[0.9166666666666666, -0.08333333333333333], [-0.8333333333333334, 0.16666666666666666]]\n",
+ "\n",
+ "dZ = Z11.Z22 - Z12.Z21 = 1.20e+01 \n",
+ "\n",
+ "h11 = dZ/Z22 = 1.09e+00 \n",
+ "\n",
+ "h12 = Z12/Z22 = 0.09 \n",
+ "\n",
+ "h21 = -Z21/Z22 = -9.09e-01 \n",
+ "\n",
+ "h22 = 1/Z22 = 9.09e-02 \n",
+ "\n",
+ "h-parameters are:\n",
+ "[[1.0909090909090908, 0.09090909090909091], [-0.9090909090909091, 0.09090909090909091]]\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex27-pg11.58"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Two-Port Networks : example 11.27 :(pg11.58)\n",
+ "print(\"\\nApplying KCL to Node 1 \\nI1 = 4V1 - 3V2- - -(i)\");\n",
+ "print(\"\\nApplying KCL to Node 2 \\nI2 = -3V1 + 1.5V2 - - - -(ii)\");\n",
+ "##observing (i) & (ii)\n",
+ "print(\"\\nY-parameters:\");\n",
+ "a=4.;b=(-3);c=(-3);d=1.5;\n",
+ "print([[a ,b],[c ,d]]);\n",
+ "dY=((a*d)-(b*c));\n",
+ "Z11=(d/dY);\n",
+ "Z12=(-b/dY);\n",
+ "Z21=(-c/dY);\n",
+ "Z22=(a/dY);\n",
+ "print\"%s %.2f %s\"%(\"\\ndY=Y11.Y22-Y12.Y21 =\",dY,\"\");\n",
+ "print\"%s %.2f %s\"%(\"\\nZ11 = Y22/dY = \",Z11,\" Ohm\");\n",
+ "print\"%s %.2f %s\"%(\"\\nZ12 = -Y12/dY =\",Z12,\" Ohm\");\n",
+ "print\"%s %.2f %s\"%(\"\\nZ21 = -Y21/-dY = \",Z21,\" Ohm\");\n",
+ "print\"%s %.2f %s\"%(\"\\nZ22 = Y11/dY = \",Z22,\" Ohm\");\n",
+ "print(\"\\nZ-parameters :\");\n",
+ "print([[Z11 ,Z12],[Z21, Z22]]);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Applying KCL to Node 1 \n",
+ "I1 = 4V1 - 3V2- - -(i)\n",
+ "\n",
+ "Applying KCL to Node 2 \n",
+ "I2 = -3V1 + 1.5V2 - - - -(ii)\n",
+ "\n",
+ "Y-parameters:\n",
+ "[[4.0, -3], [-3, 1.5]]\n",
+ "\n",
+ "dY=Y11.Y22-Y12.Y21 = -3.00 \n",
+ "\n",
+ "Z11 = Y22/dY = -0.50 Ohm\n",
+ "\n",
+ "Z12 = -Y12/dY = -1.00 Ohm\n",
+ "\n",
+ "Z21 = -Y21/-dY = -1.00 Ohm\n",
+ "\n",
+ "Z22 = Y11/dY = -1.33 Ohm\n",
+ "\n",
+ "Z-parameters :\n",
+ "[[-0.5, -1.0], [-1.0, -1.3333333333333333]]\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex28-pg11.58"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Two-Port Networks : example 11.28 :(pg11.58 & 11.59)\n",
+ "(\"\\nApplying KCL to Node 1 \\nI1 = 1.5V1 - 0.5V2- - -(i)\");\n",
+ "print(\"\\nApplying KCL to Node 2 \\nI2 = 4V1 - 0.5V2 - - - -(ii)\");\n",
+ "##observing (i) & (ii)\n",
+ "print(\"\\nY-parameters:\");\n",
+ "a=1.5;b=(-0.5);c=(4);d=(-0.5);\n",
+ "print([[a ,b],[c ,d]]);\n",
+ "dY=((a*d)-(b*c));\n",
+ "Z11=(d/dY);\n",
+ "Z12=(-b/dY);\n",
+ "Z21=(-c/dY);\n",
+ "Z22=(a/dY);\n",
+ "print\"%s %.2f %s\"%(\"\\ndY=Y11.Y22-Y12.Y21 =\",dY,\"\");\n",
+ "print\"%s %.2f %s\"%(\"\\nZ11 = Y22/dY = \",Z11,\" Ohm\");\n",
+ "print\"%s %.2f %s\"%(\"\\nZ12 = -Y12/dY =\",Z12,\" Ohm\");\n",
+ "print\"%s %.2f %s\"%(\"\\nZ21 = -Y21/-dY = \",Z21,\" Ohm\");\n",
+ "print\"%s %.2f %s\"%(\"\\nZ22 = Y11/dY = \",Z22,\" Ohm\");\n",
+ "print(\"\\nZ-parameters :\");\n",
+ "print([[Z11 ,Z12],[Z21, Z22]]);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Applying KCL to Node 2 \n",
+ "I2 = 4V1 - 0.5V2 - - - -(ii)\n",
+ "\n",
+ "Y-parameters:\n",
+ "[[1.5, -0.5], [4, -0.5]]\n",
+ "\n",
+ "dY=Y11.Y22-Y12.Y21 = 1.25 \n",
+ "\n",
+ "Z11 = Y22/dY = -0.40 Ohm\n",
+ "\n",
+ "Z12 = -Y12/dY = 0.40 Ohm\n",
+ "\n",
+ "Z21 = -Y21/-dY = -3.20 Ohm\n",
+ "\n",
+ "Z22 = Y11/dY = 1.20 Ohm\n",
+ "\n",
+ "Z-parameters :\n",
+ "[[-0.4, 0.4], [-3.2, 1.2]]\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex29-pg11.59"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Two-Port Networks : example 11.29 :(pg11.59 & 11.60)\n",
+ "print(\"\\nApplying KCL to Node 1 \\nI1 = 3V1 - 2V2- - -(i)\");\n",
+ "print(\"\\nApplying KCL to Node 2 \\nI2 = 3V2 - V3 - - - -(ii)\");\n",
+ "print(\"\\nApplying KCL to Node 3 \\nV3 = (1/3)V2 - - - -(ii)\");\n",
+ "##substituting (iii) in (i) & (ii),we get\n",
+ "print(\"\\nI1 = 3V1 - (2/3)V2 \\nI2 = 0V1 + (8/3)V2\");\n",
+ "print(\"\\nY-parameters:\");\n",
+ "a=3.;b=(-2/3.);c=(0.);d=(8/3.);\n",
+ "print([[a ,b],[c ,d]]);\n",
+ "\n",
+ "dY=((a*d)-(b*c));\n",
+ "Z11=(d/dY);\n",
+ "Z12=(-b/dY);\n",
+ "Z21=(c/dY);\n",
+ "Z22=(a/dY);\n",
+ "\n",
+ "\n",
+ "\n",
+ "print\"%s %.2f %s\"%(\"\\ndY=Y11.Y22-Y12.Y21 =\",dY,\"\");\n",
+ "print\"%s %.2f %s\"%(\"\\nZ11 = Y22/dY = \",Z11,\" Ohm\");\n",
+ "print\"%s %.2f %s\"%(\"\\nZ12 = -Y12/dY =\",Z12,\" Ohm\");\n",
+ "print\"%s %.2f %s\"%(\"\\nZ21 = -Y21/-dY = \",Z21,\" Ohm\");\n",
+ "print\"%s %.2f %s\"%(\"\\nZ22 = Y11/dY = \",Z22,\" Ohm\");\n",
+ "print(\"\\nZ-parameters :\");\n",
+ "print([[Z11 ,Z12],[Z21, Z22]]);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Applying KCL to Node 1 \n",
+ "I1 = 3V1 - 2V2- - -(i)\n",
+ "\n",
+ "Applying KCL to Node 2 \n",
+ "I2 = 3V2 - V3 - - - -(ii)\n",
+ "\n",
+ "Applying KCL to Node 3 \n",
+ "V3 = (1/3)V2 - - - -(ii)\n",
+ "\n",
+ "I1 = 3V1 - (2/3)V2 \n",
+ "I2 = 0V1 + (8/3)V2\n",
+ "\n",
+ "Y-parameters:\n",
+ "[[3.0, -0.6666666666666666], [0.0, 2.6666666666666665]]\n",
+ "\n",
+ "dY=Y11.Y22-Y12.Y21 = 8.00 \n",
+ "\n",
+ "Z11 = Y22/dY = 0.33 Ohm\n",
+ "\n",
+ "Z12 = -Y12/dY = 0.08 Ohm\n",
+ "\n",
+ "Z21 = -Y21/-dY = 0.00 Ohm\n",
+ "\n",
+ "Z22 = Y11/dY = 0.38 Ohm\n",
+ "\n",
+ "Z-parameters :\n",
+ "[[0.3333333333333333, 0.08333333333333333], [0.0, 0.375]]\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex30-pg11.60"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Two-Port Networks : example 11.30 :(pg11.60 & 11.561)\n",
+ "print(\"\\nApplying KVL to Mesh 1 \\nV1 = 4I1 + (0.05)I2 - - - -(i)\");\n",
+ "print(\"\\nApplying KVL to Mesh 2 \\nV2 = 2I1 - 10I2 - - - -(ii)\");\n",
+ "##substituting (i) in (ii),\n",
+ "print(\"\\nV2 = -40I1 + (1.5)I2\");\n",
+ "print(\"\\nZ-parameters:\");\n",
+ "a=4;b=0.05;c=-40;d=1.5;\n",
+ "print([[a ,b],[c ,d]]);\n",
+ "dZ=(a*d)-(b*c);\n",
+ "Y11=(d/dZ);\n",
+ "Y12=(b/dZ);\n",
+ "Y21=(-c/dZ);\n",
+ "Y22=(a/dZ);\n",
+ "print(\"\\nY-parameters are:\");\n",
+ "print\"%s %.2f %s\"%(\"\\ndZ = Z11.Z22 - Z12.Z21 = \",dZ,\"\");\n",
+ "print\"%s %.2f %s\"%(\"\\nY11 = Z22/dZ = \",Y11,\" mho\");\n",
+ "print\"%s %.2f %s\"%(\"\\nY12 = -Z12/dY = \",Y12,\" mho\");\n",
+ "print\"%s %.2f %s\"%(\"\\nY21 = -Z21/-dY = \",Y21,\" mho\");\n",
+ "print\"%s %.2f %s\"%(\"\\nY22 = Z11/dY = \",Y22,\" mho\");\n",
+ "print([[Y11, Y12],[Y21, Y22]]); \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Applying KVL to Mesh 1 \n",
+ "V1 = 4I1 + (0.05)I2 - - - -(i)\n",
+ "\n",
+ "Applying KVL to Mesh 2 \n",
+ "V2 = 2I1 - 10I2 - - - -(ii)\n",
+ "\n",
+ "V2 = -40I1 + (1.5)I2\n",
+ "\n",
+ "Z-parameters:\n",
+ "[[4, 0.05], [-40, 1.5]]\n",
+ "\n",
+ "Y-parameters are:\n",
+ "\n",
+ "dZ = Z11.Z22 - Z12.Z21 = 8.00 \n",
+ "\n",
+ "Y11 = Z22/dZ = 0.19 mho\n",
+ "\n",
+ "Y12 = -Z12/dY = 0.01 mho\n",
+ "\n",
+ "Y21 = -Z21/-dY = 5.00 mho\n",
+ "\n",
+ "Y22 = Z11/dY = 0.50 mho\n",
+ "[[0.1875, 0.00625], [5.0, 0.5]]\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex31-pg11.61"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Two-Port Networks : example 11.31 :(pg11.61 & 11.62)\n",
+ "print(\"\\nApplying KVL to Mesh 1 \\nV1 = 3I1 + 5I2 - - - -(i)\");\n",
+ "print(\"\\nApplying KVL to Mesh 2 \\nV2 = 2I1 + 4I2 - 2I3 - - - -(ii)\");\n",
+ "print(\"\\nApplying KVL to Mesh 3 \\nI3 = 2V3 - - - -(iii)\");\n",
+ "##substituting (iii) in (i) & (ii),we get\n",
+ "print(\"\\n2V3 = 4I1 + 4I2 \\nV2 = -6I1 + 4I2\");\n",
+ "print(\"\\nZ-parameters:\");\n",
+ "a=3.;b=5.;c=-6.;d=-4.;\n",
+ "print([[a ,b],[c ,d]]);\n",
+ "dZ=(a*d)-(b*c);\n",
+ "Y11=(d/dZ);\n",
+ "Y12=(-b/dZ);\n",
+ "Y21=(-c/dZ);\n",
+ "Y22=(a/dZ);\n",
+ "print(\"\\nY-parameters are:\");\n",
+ "print\"%s %.2f %s\"%(\"\\ndZ = Z11.Z22 - Z12.Z21 = \",dZ,\"\");\n",
+ "print\"%s %.2f %s\"%(\"\\nY11 = Z22/dZ = \",Y11,\" mho\");\n",
+ "print\"%s %.2f %s\"%(\"\\nY12 = -Z12/dY = \",Y12,\" mho\");\n",
+ "print\"%s %.2f %s\"%(\"\\nY21 = -Z21/-dY = \",Y21,\" mho\");\n",
+ "print\"%s %.2f %s\"%(\"\\nY22 = Z11/dY = \",Y22,\" mho\");\n",
+ "print([[Y11, Y12],[Y21, Y22]]);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Applying KVL to Mesh 1 \n",
+ "V1 = 3I1 + 5I2 - - - -(i)\n",
+ "\n",
+ "Applying KVL to Mesh 2 \n",
+ "V2 = 2I1 + 4I2 - 2I3 - - - -(ii)\n",
+ "\n",
+ "Applying KVL to Mesh 3 \n",
+ "I3 = 2V3 - - - -(iii)\n",
+ "\n",
+ "2V3 = 4I1 + 4I2 \n",
+ "V2 = -6I1 + 4I2\n",
+ "\n",
+ "Z-parameters:\n",
+ "[[3.0, 5.0], [-6.0, -4.0]]\n",
+ "\n",
+ "Y-parameters are:\n",
+ "\n",
+ "dZ = Z11.Z22 - Z12.Z21 = 18.00 \n",
+ "\n",
+ "Y11 = Z22/dZ = -0.22 mho\n",
+ "\n",
+ "Y12 = -Z12/dY = -0.28 mho\n",
+ "\n",
+ "Y21 = -Z21/-dY = 0.33 mho\n",
+ "\n",
+ "Y22 = Z11/dY = 0.17 mho\n",
+ "[[-0.2222222222222222, -0.2777777777777778], [0.3333333333333333, 0.16666666666666666]]\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electrical_Network_by_R._Singh/Chapter12.ipynb b/Electrical_Network_by_R._Singh/Chapter12.ipynb new file mode 100644 index 00000000..83ceaa1b --- /dev/null +++ b/Electrical_Network_by_R._Singh/Chapter12.ipynb @@ -0,0 +1,516 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:22eee2ba9d1da7cc9449ec91cc33a421ca03a319ba4cd73132a5cc29034c4568"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter12-Network Synthesis"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg12.2"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Network Synthesis : example 12.2 : (pg 12.2)\n",
+ "import numpy\n",
+ "p1 = numpy.array([1,0,5,0,4])\n",
+ "p2 = numpy.array([1,0,3,0])\n",
+ "[q,r]=numpy.polydiv(p1,p2);\n",
+ "[q1,r1]=numpy.polydiv(p2,r);\n",
+ "[q2,r2]=numpy.polydiv(r,r1);\n",
+ "[q3,r3]=numpy.polydiv(r1,r2);\n",
+ "print \"\\nEven part of P(s) = (s^4)+(5s^3)+4\"\n",
+ "print \"\\nOdd part of P(s) = (s^3)+(3s)\"\n",
+ "print \"\\nQ(s)= m(s)/n(s)\"\n",
+ "# values of quotients in continued fraction expansion\n",
+ "print (q);\n",
+ "print (q1);\n",
+ "print (q2);\n",
+ "print (q3);\n",
+ "print \"Since all the quotient terms are positive, P(s) is hurwitz\";\n",
+ "\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Even part of P(s) = (s^4)+(5s^3)+4\n",
+ "\n",
+ "Odd part of P(s) = (s^3)+(3s)\n",
+ "\n",
+ "Q(s)= m(s)/n(s)\n",
+ "[ 1. 0.]\n",
+ "[ 0.5 0. ]\n",
+ "[ 2. 0.]\n",
+ "[ 0.25 0. ]\n",
+ "Since all the quotient terms are positive, P(s) is hurwitz\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg12.2"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Network Synthesis : example 12.3 : (pg 12.2 & 12.3)\n",
+ "import numpy\n",
+ "p1=numpy.array([1,0,5,0]) \n",
+ "p2=numpy.array([4,0,2])\n",
+ "[q,r]=numpy.polydiv(p1,p2);\n",
+ "[q1,r1]=numpy.polydiv(p2,r);\n",
+ "[q2,r2]=numpy.polydiv(r,r1);\n",
+ "print(\"\\nEven part of P(s) = ((4*s^2)+(2))\");\n",
+ "print(\"\\nOdd part of P(s) = ((s^3)+(5*(s)))\");\n",
+ "print(\"\\nQ(s)= n(s)/m(s)\");\n",
+ "# values of quotients in continued fraction expansion\n",
+ "print(q);\n",
+ "print(q1);\n",
+ "print(q2);\n",
+ "print(\"\\nSince all the quotient terms are positive, P(s) is hurwitz\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Even part of P(s) = ((4*s^2)+(2))\n",
+ "\n",
+ "Odd part of P(s) = ((s^3)+(5*(s)))\n",
+ "\n",
+ "Q(s)= n(s)/m(s)\n",
+ "[ 0.25 0. ]\n",
+ "[ 0.88888889 0. ]\n",
+ "[ 2.25 0. ]\n",
+ "\n",
+ "Since all the quotient terms are positive, P(s) is hurwitz\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg12.3"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "## Network Synthesis : example 12.4 : (pg 12.3)\n",
+ "import numpy\n",
+ "p1=numpy.array([1,0,3,0,12])\n",
+ "p2=numpy.array([1,0,2,0])\n",
+ "[q,r]=numpy.polydiv(p1,p2);\n",
+ "[q1,r1]=numpy.polydiv(p2,r);\n",
+ "[q2,r2]=numpy.polydiv(r,r1);\n",
+ "[q3,r3]=numpy.polydiv(r1,r2);\n",
+ "print(\"\\nEven part of P(s) = ((s^4)+(3*(s)^2)+12)\");\n",
+ "print(\"\\nOdd part of P(s) = ((s^3)+(2*s))\");\n",
+ "print(\"\\nQ(s)= m(s)/n(s)\");\n",
+ "## values of quotients in continued fraction expansion\n",
+ "print(q);\n",
+ "print(q1);\n",
+ "print(q2);\n",
+ "print(q3);\n",
+ "print(\"\\nSince two quotient terms are negative, P(s) is not hurwitz\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Even part of P(s) = ((s^4)+(3*(s)^2)+12)\n",
+ "\n",
+ "Odd part of P(s) = ((s^3)+(2*s))\n",
+ "\n",
+ "Q(s)= m(s)/n(s)\n",
+ "[ 1. 0.]\n",
+ "[ 1. 0.]\n",
+ "[-0.1 -0. ]\n",
+ "[-0.83333333 0. ]\n",
+ "\n",
+ "Since two quotient terms are negative, P(s) is not hurwitz\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5-pg12.3"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "## Network Synthesis : example 12.5 : (pg 12.3 & 12.4)\n",
+ "import numpy\n",
+ "p1=numpy.array([1,0,2,0,2])\n",
+ "p2=numpy.array([1,0,3,0])\n",
+ "[q,r]=numpy.polydiv(p1,p2);\n",
+ "[q1,r1]=numpy.polydiv(p2,r);\n",
+ "[q2,r2]=numpy.polydiv(r,r1);\n",
+ "[q3,r3]=numpy.polydiv(r1,r2);\n",
+ "print(\"\\nEven part of P(s) = ((s^4)+(2*(s)^2)+2)\");\n",
+ "print(\"\\nOdd part of P(s) = (s^3)+(3s)\");\n",
+ "print(\"\\nQ(s)= m(s)/n(s)\");\n",
+ "## values of quotients in continued fraction expansion\n",
+ "print(q);\n",
+ "print(q1);\n",
+ "print(q2);\n",
+ "print(q3);\n",
+ "print(\"\\nSince two terms are negative, P(s) is not hurwitz\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Even part of P(s) = ((s^4)+(2*(s)^2)+2)\n",
+ "\n",
+ "Odd part of P(s) = (s^3)+(3s)\n",
+ "\n",
+ "Q(s)= m(s)/n(s)\n",
+ "[ 1. 0.]\n",
+ "[-1. -0.]\n",
+ "[-0.2 0. ]\n",
+ "[ 2.5 0. ]\n",
+ "\n",
+ "Since two terms are negative, P(s) is not hurwitz\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6-pg12.4"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "## Network Synthesis : example 12.6 : (pg 12.4)\n",
+ "import numpy\n",
+ "p1=numpy.array([2,0,6,0,1])\n",
+ "p2=numpy.array([5,0,3,0])\n",
+ "[q,r]=numpy.polydiv(p1,p2);\n",
+ "[q1,r1]=numpy.polydiv(p2,r);\n",
+ "[q2,r2]=numpy.polydiv(r,r1);\n",
+ "[q3,r3]=numpy.polydiv(r1,r2);\n",
+ "print(\"\\nEven part of P(s) = ((2*s^4)+(6*(s)^2)+1)\");\n",
+ "print(\"\\nOdd part of P(s) = ((5*s^3)+(3*s))\");\n",
+ "print(\"\\nQ(s)= m(s)/n(s)\");\n",
+ "## values of quotients in continued fraction expansion\n",
+ "print(q);\n",
+ "print(q1);\n",
+ "print(q2);\n",
+ "print(q3);\n",
+ "print(\"\\nSince all the quotient terms are positive, P(s) is hurwitz\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Even part of P(s) = ((2*s^4)+(6*(s)^2)+1)\n",
+ "\n",
+ "Odd part of P(s) = ((5*s^3)+(3*s))\n",
+ "\n",
+ "Q(s)= m(s)/n(s)\n",
+ "[ 0.4 0. ]\n",
+ "[ 1.04166667 0. ]\n",
+ "[ 2.45106383 0. ]\n",
+ "[ 1.95833333 0. ]\n",
+ "\n",
+ "Since all the quotient terms are positive, P(s) is hurwitz\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7-pg12.4"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "## Network Synthesis : example 12.7 : (pg 12.4 & 12.5)\n",
+ "import numpy\n",
+ "p1=numpy.array([1,0,6,0,8])\n",
+ "\n",
+ "p2=numpy.array([7,0,21,0])\n",
+ "[q,r]=numpy.polydiv(p1,p2);\n",
+ "[q1,r1]=numpy.polydiv(p2,r);\n",
+ "[q2,r2]=numpy.polydiv(r,r1);\n",
+ "[q3,r3]=numpy.polydiv(r1,r2);\n",
+ "print(\"\\nEven part of P(s) = ((s^4)+(6*(s)^2)+8)\");\n",
+ "print(\"\\nOdd part of P(s) = (7*(s^3)+(21*s))\");\n",
+ "print(\"\\nQ(s)= m(s)/n(s)\");\n",
+ "## values of quotients in continued fraction expansion\n",
+ "print(q);\n",
+ "print(q1);\n",
+ "print(q2);\n",
+ "print(q3);\n",
+ "print(\"\\nSince all the quotient terms are positive, P(s) is hurwitz\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Even part of P(s) = ((s^4)+(6*(s)^2)+8)\n",
+ "\n",
+ "Odd part of P(s) = (7*(s^3)+(21*s))\n",
+ "\n",
+ "Q(s)= m(s)/n(s)\n",
+ "[ 0.14285714 0. ]\n",
+ "[ 2.33333333 0. ]\n",
+ "[ 1.28571429 0. ]\n",
+ "[ 0.29166667 0. ]\n",
+ "\n",
+ "Since all the quotient terms are positive, P(s) is hurwitz\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex8-pg12.5"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "## Network Synthesis : example 12.8 : (pg 12.5)\n",
+ "import numpy\n",
+ "p1=numpy.array([1,0,5,0,10])\n",
+ "\n",
+ "p2=numpy.array([5,0,4,0])\n",
+ "[q,r]=numpy.polydiv(p1,p2);\n",
+ "[q1,r1]=numpy.polydiv(p2,r);\n",
+ "[q2,r2]=numpy.polydiv(r,r1);\n",
+ "[q3,r3]=numpy.polydiv(r1,r2);\n",
+ "print(\"\\nEven part of P(s) = ((s^4)+(5*(s)^2)+10)\");\n",
+ "print(\"\\nOdd part of P(s) = (5*(s^3)+(4*s))\");\n",
+ "print(\"\\nQ(s)= m(s)/n(s)\");\n",
+ "## values of quotients in continued fraction expansion\n",
+ "print(q);\n",
+ "print(q1);\n",
+ "print(q2);\n",
+ "print(q3);\n",
+ "print(\"\\nSince two terms are negative, P(s) is not hurwitz\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Even part of P(s) = ((s^4)+(5*(s)^2)+10)\n",
+ "\n",
+ "Odd part of P(s) = (5*(s^3)+(4*s))\n",
+ "\n",
+ "Q(s)= m(s)/n(s)\n",
+ "[ 0.2 0. ]\n",
+ "[ 1.19047619 0. ]\n",
+ "[-0.5313253 -0. ]\n",
+ "[-0.79047619 0. ]\n",
+ "\n",
+ "Since two terms are negative, P(s) is not hurwitz\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex9-pg12.6"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "## Network Synthesis : example 12.9 : (pg 12.6)\n",
+ "import numpy\n",
+ "p1=numpy.array([1,0,3,0,2,0])\n",
+ "p2=numpy.array([5,0,9,0,2])\n",
+ "[q,r]=numpy.polydiv(p1,p2);\n",
+ "[q1,r1]=numpy.polydiv(p2,r);\n",
+ "[q2,r2]=numpy.polydiv(r,r1);\n",
+ "[q3,r3]=numpy.polydiv(r1,r2);\n",
+ "[q4,r4]=numpy.polydiv(r2,r3);\n",
+ "print(\"\\n P(s) = ((s^5)+(3*(s^3))+(2*s))\");\n",
+ "print(\"\\n d/ds.P(s)= ((5*(s^4))+9*(s^2)+2)\");\n",
+ "print(\"\\nQ(s)=P(s)/d/ds.P(s)\");\n",
+ "## values of quotients in continued fraction expansion\n",
+ "print(q);\n",
+ "print(q1);\n",
+ "print(q2);\n",
+ "print(q3);\n",
+ "print(q4);\n",
+ "print(\"\\nSince all the quotient terms are positive, P(s) is hurwitz\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " P(s) = ((s^5)+(3*(s^3))+(2*s))\n",
+ "\n",
+ " d/ds.P(s)= ((5*(s^4))+9*(s^2)+2)\n",
+ "\n",
+ "Q(s)=P(s)/d/ds.P(s)\n",
+ "[ 0.2 0. ]\n",
+ "[ 4.16666667 0. ]\n",
+ "[ 0.51428571 0. ]\n",
+ "[ 4.08333333 0. ]\n",
+ "[ 0.28571429 0. ]\n",
+ "\n",
+ "Since all the quotient terms are positive, P(s) is hurwitz\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex10-pg12.6"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "## Network Synthesis : example 12.10 : (pg 12.6 & 12.7)\n",
+ "import numpy\n",
+ "p1=numpy.array([1,0,1,0,1,0])\n",
+ "p2=numpy.array([5,0,3,0,1])\n",
+ "[q,r]=numpy.polydiv(p1,p2);\n",
+ "[q1,r1]=numpy.polydiv(p2,r);\n",
+ "[q2,r2]=numpy.polydiv(r,r1);\n",
+ "[q3,r3]=numpy.polydiv(r1,r2);\n",
+ "[q4,r4]=numpy.polydiv(r2,r3);\n",
+ "print(\"\\n P(s) = ((s^5)+((s^3))+(s))\");\n",
+ "print(\"\\n d/ds.P(s)= ((5*(s^4))+3*(s^2)+1)\");\n",
+ "print(\"\\nQ(s)=P(s)/d/ds.P(s)\");\n",
+ "## values of quotients in continued fraction expansion\n",
+ "print(q);\n",
+ "print(q1);\n",
+ "print(q2);\n",
+ "print(q3);\n",
+ "print(q4);\n",
+ "print(\"\\nSince two quotient terms are negative, P(s) is not hurwitz\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " P(s) = ((s^5)+((s^3))+(s))\n",
+ "\n",
+ " d/ds.P(s)= ((5*(s^4))+3*(s^2)+1)\n",
+ "\n",
+ "Q(s)=P(s)/d/ds.P(s)\n",
+ "[ 0.2 0. ]\n",
+ "[ 12.5 0. ]\n",
+ "[-0.05714286 -0. ]\n",
+ "[-8.16666667 0. ]\n",
+ "[ 0.85714286 0. ]\n",
+ "\n",
+ "Since two quotient terms are negative, P(s) is not hurwitz\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electrical_Network_by_R._Singh/Chapter2.ipynb b/Electrical_Network_by_R._Singh/Chapter2.ipynb new file mode 100644 index 00000000..36560017 --- /dev/null +++ b/Electrical_Network_by_R._Singh/Chapter2.ipynb @@ -0,0 +1,1930 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:d1464aa1fb482c82a4f4b18b57f643d245349558049b46b3e2b63e138d20bd57"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter2-Network Theorem 1"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg2.4"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem-1\n",
+ "##pg no.-2.4\n",
+ "##example2.1\n",
+ "print(\"\\nConverting the two delta networks formed by resistors 4.5 Ohm, 3Ohm, and 7.5Ohm into equivalent star networks\");\n",
+ "a=4.5;\n",
+ "b=3.;\n",
+ "c=7.5;\n",
+ "R1= (a*c)/(a+b+c);\n",
+ "R2= (c*b)/(c+b+a);\n",
+ "R3= (a*b)/(a+b+c);\n",
+ "print'%s %.2f %s %.2f %s %.2f %s '%(\"\\nR1=R6 = \",R1,\" Ohm\" and \"\\nR2=R5 =\",R2,\" Ohm\" and \"\\nR3=R4 =\" ,R3,\" Ohm\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Converting the two delta networks formed by resistors 4.5 Ohm, 3Ohm, and 7.5Ohm into equivalent star networks\n",
+ "\n",
+ "R1=R6 = 2.25 \n",
+ "R2=R5 = 1.50 \n",
+ "R3=R4 = 0.90 Ohm \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg2.5"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem-1\n",
+ "##pg no.-2.2\n",
+ "##example2.5\n",
+ "##converting delta network to star network\n",
+ "a=10.;\n",
+ "b=10.;\n",
+ "c=10.;\n",
+ "R=(a*b)/(a+b+c);\n",
+ "print(\"\\nConverting the delta formed by three resistors of 10 Ohm into an equivalent star network\");\n",
+ "print'%s %.2f %s'%(\"\\nR1=R2=R3= \",R,\" Ohm\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Converting the delta formed by three resistors of 10 Ohm into an equivalent star network\n",
+ "\n",
+ "R1=R2=R3= 3.33 Ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg2.7"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem-1\n",
+ "##pg no.-2.7\n",
+ "##example2.3\n",
+ "a=4.;\n",
+ "b=3.;\n",
+ "c=6.;\n",
+ "##star to delta conversion\n",
+ "R1=c+a+((a*c)/b);\n",
+ "R2=c+b+((c*b)/a);\n",
+ "R3=a+b+((a*b)/c);\n",
+ "x=1.35;\n",
+ "y=0.9;\n",
+ "RAB=(c*(x+y))/(c+x+y);\n",
+ "print'%s %.2f %s'%(\"\\nR1 = \",R1,\" Ohm\");\n",
+ "print'%s %.2f %s'%(\"\\nR2 = \",R2,\" Ohm\");\n",
+ "print'%s %.2f %s'%(\"\\nR3 = \",R3,\" Ohm\");\n",
+ "print'%s %.2f %s'%(\"\\nThe network can be simplified as, \\nRAB = \",RAB,\" Ohm\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "R1 = 18.00 Ohm\n",
+ "\n",
+ "R2 = 13.50 Ohm\n",
+ "\n",
+ "R3 = 9.00 Ohm\n",
+ "\n",
+ "The network can be simplified as, \n",
+ "RAB = 1.64 Ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5-pg2.9"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem-1\n",
+ "##pg no.-2.9\n",
+ "##example2.5\n",
+ "##converting delta network to star network\n",
+ "a=25.;\n",
+ "b=20.;\n",
+ "c=35.;\n",
+ "R1=(b*c)/(a+b+c);\n",
+ "R2=(a*b)/(a+b+c);\n",
+ "R3=(a*c)/(a+b+c);\n",
+ "print(\"\\nConverting the delta formed by resistors 20 Ohm ,25 Ohm, 35 Ohm into an equivalent star network\");\n",
+ "print'%s %.2f %s'%(\"\\nR1= \",R1,\" Ohm\");\n",
+ "print'%s %.2f %s'%(\"\\nR2= \",R2,\" Ohm\");\n",
+ "print'%s %.2f %s'%(\"\\nR3= \",R3,\" Ohm\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Converting the delta formed by resistors 20 Ohm ,25 Ohm, 35 Ohm into an equivalent star network\n",
+ "\n",
+ "R1= 8.75 Ohm\n",
+ "\n",
+ "R2= 6.25 Ohm\n",
+ "\n",
+ "R3= 10.94 Ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex8-pg2.15"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem-1\n",
+ "##pg no.-2.15\n",
+ "##example2.8\n",
+ "a=5;\n",
+ "b=4;\n",
+ "c=3;\n",
+ "##Star to delta conversion\n",
+ "R1=a+b+((a*b)/c);\n",
+ "R2=c+b+((c*b)/a);\n",
+ "R3=a+c+((a*c)/b);\n",
+ "a1=6;\n",
+ "b1=4;\n",
+ "c1=8;\n",
+ "##Satr to delta conversion\n",
+ "R4=a1+b1+((a1*b1)/c1);\n",
+ "R5=c1+b1+((c1*b1)/a1);\n",
+ "R6=a1+c1+((a1*c1)/b1);\n",
+ "x=6.17;\n",
+ "y=9.78;\n",
+ "RAB=(x*y)/(x+y);\n",
+ "print(\"\\nConverting star network formed by 3 Ohm,4 Ohm ,5 Ohm into equivalent delta network \");\n",
+ "print'%s %.2f %s %.2f %s %.2f %s'%(\"\\nR1= \",R1,\" Ohm\" and \" \\nR2= \",R2,\" Ohm\" and \" \\nR3 = \",R3,\" Ohm\");\n",
+ "print(\"\\nSimilarly, converting star network formed by 6 Ohm,4 Ohm ,8 Ohm into equivalent delta network\");\n",
+ "print'%s %.2f %s %.2f %s %.2f %s '%(\"\\nR4= \",R4,\" Ohm\" and \" \\nR5= \",R5,\" Ohm \" and \"\\nR6 =\",R6,\" Ohm\");\n",
+ "print'%s %.2f %s'%(\"\\n Simplifying the parallel networks, we get \\nRAB = \",RAB,\" Ohms\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Converting star network formed by 3 Ohm,4 Ohm ,5 Ohm into equivalent delta network \n",
+ "\n",
+ "R1= 15.00 \n",
+ "R2= 9.00 \n",
+ "R3 = 11.00 Ohm\n",
+ "\n",
+ "Similarly, converting star network formed by 6 Ohm,4 Ohm ,8 Ohm into equivalent delta network\n",
+ "\n",
+ "R4= 13.00 \n",
+ "R5= 17.00 \n",
+ "R6 = 26.00 Ohm \n",
+ "\n",
+ " Simplifying the parallel networks, we get \n",
+ "RAB = 3.78 Ohms\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex9-pg2.18"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 1\n",
+ "##page no-2.18\n",
+ "##example2.9\n",
+ "import math\n",
+ "import numpy\n",
+ "print(\"Applying KVL to mesh 1\");\n",
+ "print(\"10*I1-3*I2-6*I3=0\")##equation 1\n",
+ "print(\"Applying KVL to mesh 2\");\n",
+ "print(\"-3*I1+10*I2=-5\");##equation 2\n",
+ "print(\"Applying KVL to mesh 3\");\n",
+ "print(\"-6*I1+10*I3=25\");##equation 3\n",
+ "print(\"Solving the three equations\");\n",
+ "A=numpy.matrix([[10, -3, -6],[-3 ,10 ,0],[-6, 0, 10]]) ##solving the equations in matrix form\n",
+ "B=numpy.matrix([[10], [-5], [25]])\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B)\n",
+ "\n",
+ "print[X];\n",
+ "print(\"I1=4.27 A\");\n",
+ "print(\"I2=0.78 A\");\n",
+ "print(\"I3=5.06 A\");\n",
+ "print(\"I5ohm=4.27 A\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Applying KVL to mesh 1\n",
+ "10*I1-3*I2-6*I3=0\n",
+ "Applying KVL to mesh 2\n",
+ "-3*I1+10*I2=-5\n",
+ "Applying KVL to mesh 3\n",
+ "-6*I1+10*I3=25\n",
+ "Solving the three equations\n",
+ "[matrix([[ 4.27272727],\n",
+ " [ 0.78181818],\n",
+ " [ 5.06363636]])]\n",
+ "I1=4.27 A\n",
+ "I2=0.78 A\n",
+ "I3=5.06 A\n",
+ "I5ohm=4.27 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex10-pg2.19"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 1\n",
+ "##page no-2.19\n",
+ "##example 2.10\n",
+ "import math\n",
+ "import numpy\n",
+ "from numpy import linalg\n",
+ "print(\"Applying KVL to mesh 1\");\n",
+ "print(\"7*I1-I2=10\")##equation 1\n",
+ "print(\"Applying KVL to mesh 2\");\n",
+ "print(\"-I1+6*I2-3*I3=0\");##equation 2\n",
+ "print(\"Applying KVL to mesh 3\");\n",
+ "print(\"-3*I2+13*I3=-20\");##equation 3\n",
+ "print(\"Solving the three equations\");\n",
+ "A=numpy.matrix([[7 ,-1, 0],[-1, 6, -3],[0 ,-3, 13]]);##solving the equations in matrix form\n",
+ "B=numpy.matrix([[10], [0], [-20]])\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B);\n",
+ "print[X];\n",
+ "print(\"I1=1.34 A\");\n",
+ "print(\"I1=-0.62 A\");\n",
+ "print(\"I3=-1.68 A\");\n",
+ "print(\"I2ohm=1.34 A\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Applying KVL to mesh 1\n",
+ "7*I1-I2=10\n",
+ "Applying KVL to mesh 2\n",
+ "-I1+6*I2-3*I3=0\n",
+ "Applying KVL to mesh 3\n",
+ "-3*I2+13*I3=-20\n",
+ "Solving the three equations\n",
+ "[matrix([[ 1.34042553],\n",
+ " [-0.61702128],\n",
+ " [-1.68085106]])]\n",
+ "I1=1.34 A\n",
+ "I1=-0.62 A\n",
+ "I3=-1.68 A\n",
+ "I2ohm=1.34 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex11-pg2.20"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 1\n",
+ "##page no-2.20\n",
+ "##example 2.11\n",
+ "import math\n",
+ "import numpy\n",
+ "print(\"Applying KVL to mesh 1\");\n",
+ "print(\"3*I1-I2-2*I3=8\");##equation 1\n",
+ "print(\"Applying KVL to mesh 2\");\n",
+ "print(\"-I1+8*I2-3*I3=10\");##equation 2\n",
+ "print(\"Applying KVL to mesh 3\");\n",
+ "print(\"-2*I1-3*I2+10*I3=12\");##equation 3\n",
+ "print(\"Solving the three equations\");\n",
+ "A=numpy.matrix([[3 ,-1 ,-2],[-1, 8 ,-3],[-2 ,-3 ,10]]);##solving the equations in matrix form\n",
+ "B=numpy.matrix([[8], [10] ,[12]])\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B);\n",
+ "print[X];\n",
+ "print(\"I1=6.01 A\");\n",
+ "print(\"I1=3.27 A\");\n",
+ "print(\"I3=3.38 A\");\n",
+ "print(\"I5ohm=3.38 A\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Applying KVL to mesh 1\n",
+ "3*I1-I2-2*I3=8\n",
+ "Applying KVL to mesh 2\n",
+ "-I1+8*I2-3*I3=10\n",
+ "Applying KVL to mesh 3\n",
+ "-2*I1-3*I2+10*I3=12\n",
+ "Solving the three equations\n",
+ "[matrix([[ 6.01257862],\n",
+ " [ 3.27044025],\n",
+ " [ 3.3836478 ]])]\n",
+ "I1=6.01 A\n",
+ "I1=3.27 A\n",
+ "I3=3.38 A\n",
+ "I5ohm=3.38 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex12-pg2.21"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 1\n",
+ "##page no-2.21\n",
+ "##example 2.12\n",
+ "import numpy\n",
+ "print(\"Applying KVL to mesh 1\");\n",
+ "print(\"8*I1-I2-4*I3=4\");##equation 1\n",
+ "print(\"Applying KVL to mesh 2\");\n",
+ "print(\"-I1+8*I2-5*I3=0\");##equation 2\n",
+ "print(\"Applying KVL to mesh 3\");\n",
+ "print(\"-4*I1-5*I2+15*I3=0\");##equation 3\n",
+ "print(\"Solving the three equations\");\n",
+ "A=numpy.matrix([[8 ,-1 ,-4],[-1 ,8 ,-5],[-4 ,-5 ,15]]);##solving the equations in matrix form\n",
+ "B=numpy.matrix([[4] ,[0], [0]])\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B);\n",
+ "print[X];\n",
+ "print(\"I1=0.66\");\n",
+ "print(\"I1=0.24 A\");\n",
+ "print(\"I3=0.26 A\");\n",
+ "print(\"current supplied by the battery = 0.66 A\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Applying KVL to mesh 1\n",
+ "8*I1-I2-4*I3=4\n",
+ "Applying KVL to mesh 2\n",
+ "-I1+8*I2-5*I3=0\n",
+ "Applying KVL to mesh 3\n",
+ "-4*I1-5*I2+15*I3=0\n",
+ "Solving the three equations\n",
+ "[matrix([[ 0.65857886],\n",
+ " [ 0.24263432],\n",
+ " [ 0.25649913]])]\n",
+ "I1=0.66\n",
+ "I1=0.24 A\n",
+ "I3=0.26 A\n",
+ "current supplied by the battery = 0.66 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex13-pg2.22"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 1\n",
+ "##page no-2.22\n",
+ "##example 2.13\n",
+ "import math\n",
+ "import numpy\n",
+ "print(\"Applying KVL to mesh 1\");\n",
+ "print(\"V+13*I1-2*I2-5*I3=20\");##mesh equation 1\n",
+ "print(\"Applying KVL to mesh 2\");\n",
+ "print(\"2*I1-6*I2+I3=0\");##mesh equation 2\n",
+ "print(\"Applying KVL to mesh 3\");\n",
+ "print(\"V+5*I1+I2-10*I3=0\");##mesh equation 3\n",
+ "print(\"putting I1=0 in equation 1, 2 and 3 we get\"); \n",
+ "print(\"V-2*I2-5*I3=20\");##equation 1\n",
+ "print(\"-6*I2+I3=0\");##equation 2\n",
+ "print(\"V+I2-10*I3=0\");##equation 3\n",
+ "print(\"Solving the three equations\");\n",
+ "A=numpy.matrix([[1 ,-2 ,-5],[0 ,-6 ,1],[1 ,1 ,-10]]);##solving the equations in matrix form\n",
+ "B=numpy.matrix([[20], [0] ,[0]])\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B);\n",
+ "print[X];\n",
+ "print(\"V=43.7 V\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Applying KVL to mesh 1\n",
+ "V+13*I1-2*I2-5*I3=20\n",
+ "Applying KVL to mesh 2\n",
+ "2*I1-6*I2+I3=0\n",
+ "Applying KVL to mesh 3\n",
+ "V+5*I1+I2-10*I3=0\n",
+ "putting I1=0 in equation 1, 2 and 3 we get\n",
+ "V-2*I2-5*I3=20\n",
+ "-6*I2+I3=0\n",
+ "V+I2-10*I3=0\n",
+ "Solving the three equations\n",
+ "[matrix([[ 43.7037037 ],\n",
+ " [ 0.74074074],\n",
+ " [ 4.44444444]])]\n",
+ "V=43.7 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex14-pg2.22"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 1\n",
+ "##page no-2.13\n",
+ "##example2.14\n",
+ "import math\n",
+ "import numpy\n",
+ "print(\"Mesh 1 contains a current source of 6A.Hence, we cannot write KVL equation for Mesh 1.direction of current source and mesh current I1 are same,\");\n",
+ "print(\"I1=6A\");##equation 1\n",
+ "print(\"Applying KVL to mesh 2\");\n",
+ "print(\"18*I2-6*I3=108\");##equation 2\n",
+ "print(\"Applying KVL to mesh 3\");\n",
+ "print(\"6*I2-11*I3=9\");##equation 3\n",
+ "print(\"Solving the three equations\");\n",
+ "A=numpy.matrix([[18, -6],[6 ,-11]])##solving the equations in matrix form\n",
+ "B=numpy.matrix([[108] ,[9]])\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B);\n",
+ "print[X];\n",
+ "print(\"I3 = 3A\");\n",
+ "print(\"I2ohm = 3A\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mesh 1 contains a current source of 6A.Hence, we cannot write KVL equation for Mesh 1.direction of current source and mesh current I1 are same,\n",
+ "I1=6A\n",
+ "Applying KVL to mesh 2\n",
+ "18*I2-6*I3=108\n",
+ "Applying KVL to mesh 3\n",
+ "6*I2-11*I3=9\n",
+ "Solving the three equations\n",
+ "[matrix([[ 7.],\n",
+ " [ 3.]])]\n",
+ "I3 = 3A\n",
+ "I2ohm = 3A\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex15-pg2.23"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 1\n",
+ "##page no-2.23\n",
+ "##example2.15\n",
+ "print(\"from the fig,\");\n",
+ "print(\"IA=I1\");##equation 1\n",
+ "print(\"IB=I2\");##equation 2\n",
+ "print(\"Applying Kvl to mesh 1:\");\n",
+ "print(\"5-5*I1-10*IB-10*(I1-I2)-5*IA=0\");\n",
+ "print(\"5-5*I1-10*I2-10*I1+10*I2-5*I1=0\");\n",
+ "print(\"-20*I1=-5\");\n",
+ "I1=5./20.;\n",
+ "print'%s %.2f %s'%(\"I1= \",I1,\" A\");##equation 3\n",
+ "print(\"Applying Kvl to mesh 2:\");\n",
+ "print(\"15*I1-15*I2=10\");##equation 4\n",
+ "print(\"Put I1=0.25 A in equation 4\");\n",
+ "print(\"-6.25=15*I2\");\n",
+ "I2=-6.25/15.;\n",
+ "print'%s %.2f %s '%(\"I2= \",I2,\" A\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "from the fig,\n",
+ "IA=I1\n",
+ "IB=I2\n",
+ "Applying Kvl to mesh 1:\n",
+ "5-5*I1-10*IB-10*(I1-I2)-5*IA=0\n",
+ "5-5*I1-10*I2-10*I1+10*I2-5*I1=0\n",
+ "-20*I1=-5\n",
+ "I1= 0.25 A\n",
+ "Applying Kvl to mesh 2:\n",
+ "15*I1-15*I2=10\n",
+ "Put I1=0.25 A in equation 4\n",
+ "-6.25=15*I2\n",
+ "I2= -0.42 A \n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex17-pg2.24"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 1\n",
+ "##page no-2.25\n",
+ "##example2.17\n",
+ "import math\n",
+ "import numpy\n",
+ "print(\"from the fig,\");\n",
+ "print(\"V1=-5*I1\");##equation 1\n",
+ "print(\"V2=2*I2\");##equation 2\n",
+ "print(\"Applying Kvl to mesh 1:\");\n",
+ "print(\"20*I1+3*I2=-5\");##equation 3\n",
+ "print(\"Applying Kvl to mesh 2:\");\n",
+ "print(\"11*I1-3*I2=10\");##equation 4\n",
+ "print(\"Solving equations 3 and 4\");##solving equations in matrix form\n",
+ "A=numpy.matrix([[20, 3],[11, -3]]);\n",
+ "B=numpy.matrix([[-5], [10]])\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B);\n",
+ "print[X];\n",
+ "print(\"I1=0.161 A\");\n",
+ "print(\"I2=-2.742 A\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "from the fig,\n",
+ "V1=-5*I1\n",
+ "V2=2*I2\n",
+ "Applying Kvl to mesh 1:\n",
+ "20*I1+3*I2=-5\n",
+ "Applying Kvl to mesh 2:\n",
+ "11*I1-3*I2=10\n",
+ "Solving equations 3 and 4\n",
+ "[matrix([[ 0.16129032],\n",
+ " [-2.74193548]])]\n",
+ "I1=0.161 A\n",
+ "I2=-2.742 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex18-pg2.25"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem-1\n",
+ "##pg no.-2.25\n",
+ "##example2.18\n",
+ "import numpy\n",
+ "print(\"from the fig,\");\n",
+ "print(\"Iy=I1\");##equation 1\n",
+ "print(\"Ix=I1-I2\");##equation 2\n",
+ "print(\"Applying Kvl to mesh 1:\");\n",
+ "print(\"-10*I1+3*I2=5\");##equation 3\n",
+ "print(\"Applying Kvl to mesh 2:\");\n",
+ "print(\"-I1-3*I2=10\");##equation 4\n",
+ "print(\"Solving equations 3 and 4\");##solving equations in matrix form\n",
+ "A=numpy.matrix([[-10 ,3],[-1, -3]]);\n",
+ "B=numpy.matrix([[5] ,[10]])\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B);\n",
+ "print[X];\n",
+ "print(\"I1=-1.364 A\");\n",
+ "print(\"I2=-2878 A\");\n",
+ "x=-1.364;\n",
+ "y=-2.878;\n",
+ "Ix=x-y;\n",
+ "print'%s %.2f %s %.2f %s '%(\"\\nIy = \",x,\" A\" and \" \\nIx = \",Ix,\" A\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "from the fig,\n",
+ "Iy=I1\n",
+ "Ix=I1-I2\n",
+ "Applying Kvl to mesh 1:\n",
+ "-10*I1+3*I2=5\n",
+ "Applying Kvl to mesh 2:\n",
+ "-I1-3*I2=10\n",
+ "Solving equations 3 and 4\n",
+ "[matrix([[-1.36363636],\n",
+ " [-2.87878788]])]\n",
+ "I1=-1.364 A\n",
+ "I2=-2878 A\n",
+ "\n",
+ "Iy = -1.36 \n",
+ "Ix = 1.51 A \n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex19-pg2.26"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 1\n",
+ "##page no-2.26\n",
+ "##example2.19\n",
+ "import math\n",
+ "import numpy\n",
+ "print(\"Applying KVL to mesh 1:\");\n",
+ "print(\"11*I1-10*I2=2\");##equation 1\n",
+ "print(\"Writing current equation to supermesh:\")\n",
+ "print(\"I3-I2=4\");##equation 2\n",
+ "print(\"Applying KVL to outer path of supermesh:\");\n",
+ "print(\"2*I1-3*I2-3*I3=0\");##equation 3\n",
+ "print(\"solving these equations we get :\");##solving equations in matrix form\n",
+ "A=numpy.matrix([[11, -10, 0],[0 ,-1 ,1],[2 ,-3, -3]]);\n",
+ "B=numpy.matrix([[2] ,[4] ,[0]])\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B);\n",
+ "print[X];\n",
+ "I1=-2.35\n",
+ "I2=-2.78\n",
+ "I3=1.22\n",
+ "I4=I1-I2;\n",
+ "print'%s %.2f %s'%(\"\\ncurrent through the 10 ohm resistor = I1-I2 = \",I4,\" A\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Applying KVL to mesh 1:\n",
+ "11*I1-10*I2=2\n",
+ "Writing current equation to supermesh:\n",
+ "I3-I2=4\n",
+ "Applying KVL to outer path of supermesh:\n",
+ "2*I1-3*I2-3*I3=0\n",
+ "solving these equations we get :\n",
+ "[matrix([[-2.34782609],\n",
+ " [-2.7826087 ],\n",
+ " [ 1.2173913 ]])]\n",
+ "\n",
+ "current through the 10 ohm resistor = I1-I2 = 0.43 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex20-pg2.26"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 1\n",
+ "##page no-2.26\n",
+ "##example2.20\n",
+ "import math\n",
+ "import numpy\n",
+ "print(\"writing equation for supermesh,\");\n",
+ "print(\"I1-I3=7\");##equation 1\n",
+ "print(\"Applying Kvl to the outer path of the supermesh:\");\n",
+ "print(\"-I1+4*I2-4*I3 = -7\");##equation 2\n",
+ "print(\"Applying Kvl to mesh 2:\");\n",
+ "print(\"I1-6*I2+3*I3 = 0\");##equation 3\n",
+ "print(\"Solving equations 1 ,2 and 3\");##solving equations in matrix form\n",
+ "A=numpy.matrix([[1 ,0 ,-1],[-1 ,4 ,-4],[1 ,-6 ,3]]);\n",
+ "B=numpy.matrix([[7], [-7], [0]])\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B);\n",
+ "print[X];\n",
+ "print(\"I1=9 A\");\n",
+ "print(\"I2=-2.5 A\");\n",
+ "print(\"I3=-2 A\");\n",
+ "x=2.5;\n",
+ "y=2;\n",
+ "z=x-y;\n",
+ "print'%s %.2f %s'%(\"\\nCurrent through the 3-Ohm resistor = I2-I3 =\",z,\" A\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "writing equation for supermesh,\n",
+ "I1-I3=7\n",
+ "Applying Kvl to the outer path of the supermesh:\n",
+ "-I1+4*I2-4*I3 = -7\n",
+ "Applying Kvl to mesh 2:\n",
+ "I1-6*I2+3*I3 = 0\n",
+ "Solving equations 1 ,2 and 3\n",
+ "[matrix([[ 9. ],\n",
+ " [ 2.5],\n",
+ " [ 2. ]])]\n",
+ "I1=9 A\n",
+ "I2=-2.5 A\n",
+ "I3=-2 A\n",
+ "\n",
+ "Current through the 3-Ohm resistor = I2-I3 = 0.50 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex21-pg2.27"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 1\n",
+ "##page no-2.27\n",
+ "##example2.21\n",
+ "import math\n",
+ "import numpy\n",
+ "print(\"Applying KVL to mesh 1:\");\n",
+ "print(\"15*I1-10*I2-5*I3=50\");##equation 1\n",
+ "print(\"Writing current equation to supermesh:\")\n",
+ "print(\"I2-I3=2 A\");##equation 2\n",
+ "print(\"Applying KVL to outer path of supermesh:\");\n",
+ "print(\"-15*I1+12*I2+6*I3=0\");##equation 3\n",
+ "print(\"solving these equations we get :\");##solving equations in matrix form\n",
+ "A=numpy.matrix([[15, -10, -5],[0 ,1 ,-1],[-15, 12, 6]]);\n",
+ "B=numpy.matrix([[50] ,[2] ,[0]])\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B);\n",
+ "print[X];\n",
+ "I1=20.\n",
+ "I2=17.33\n",
+ "I3=15.33\n",
+ "I4=I1-I3;\n",
+ "print'%s %.2f %s'%(\"\\ncurrent through the 5 ohm resistor = I1-I3 = \",I4,\" A\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Applying KVL to mesh 1:\n",
+ "15*I1-10*I2-5*I3=50\n",
+ "Writing current equation to supermesh:\n",
+ "I2-I3=2 A\n",
+ "Applying KVL to outer path of supermesh:\n",
+ "-15*I1+12*I2+6*I3=0\n",
+ "solving these equations we get :\n",
+ "[matrix([[ 20. ],\n",
+ " [ 17.33333333],\n",
+ " [ 15.33333333]])]\n",
+ "\n",
+ "current through the 5 ohm resistor = I1-I3 = 4.67 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex22-pg2.28"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 1\n",
+ "##page no-2.28\n",
+ "##example2.22\n",
+ "import math\n",
+ "import numpy\n",
+ "print(\"from the fig,\");\n",
+ "print(\"I4=40\");##equation 1\n",
+ "print(\"\\nmeshes 2 and 3 form a supermesh. current equation for supermesh,\")\n",
+ "print(\"-I1+2*I2-I3 = 0\");##equation 2\n",
+ "print(\"Applying Kvl to supermesh:\");\n",
+ "print(\"-1/5(I2-I1)-1/20*I2-1/15*I3-1/2(I3-I4)=0\");##equation 3\n",
+ "print(\"applying KVL to mesh 1\");\n",
+ "print(\"-1/10*I1-1/5(I1-I2)-1/6(I1-I4)=6\");##equation 4\n",
+ "print(\"Solving equations 1 ,2 ,3 and 4\");##solving equations in matrix form\n",
+ "A=numpy.matrix([[0 ,0 ,0 ,1],[-1, 2 ,-1 ,0],[0.2, -0.25, -17/30, 0.5],[-7/15, 0.2, 0 ,1/6]]);\n",
+ "B=numpy.matrix([[40], [0] ,[0], [6]])\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B);\n",
+ "print[X];\n",
+ "print(\"I1=10 A\");\n",
+ "print(\"I2=-20 A\");\n",
+ "print(\"I3=30 A\");\n",
+ "print(\"I4=40 A\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "from the fig,\n",
+ "I4=40\n",
+ "\n",
+ "meshes 2 and 3 form a supermesh. current equation for supermesh,\n",
+ "-I1+2*I2-I3 = 0\n",
+ "Applying Kvl to supermesh:\n",
+ "-1/5(I2-I1)-1/20*I2-1/15*I3-1/2(I3-I4)=0\n",
+ "applying KVL to mesh 1\n",
+ "-1/10*I1-1/5(I1-I2)-1/6(I1-I4)=6\n",
+ "Solving equations 1 ,2 ,3 and 4\n",
+ "[matrix([[ -4.72636816],\n",
+ " [ 6.3681592 ],\n",
+ " [ 17.46268657],\n",
+ " [ 40. ]])]\n",
+ "I1=10 A\n",
+ "I2=-20 A\n",
+ "I3=30 A\n",
+ "I4=40 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex24-pg2.29"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 1\n",
+ "##page no-2.29\n",
+ "import numpy\n",
+ "##example2.24\n",
+ "print(\"Applying KCL to node 1:\");\n",
+ "print(\"2*V1-V2 = 2\");##equation 1\n",
+ "print(\"Applying KCL to node 2:\");\n",
+ "print(\"3*V2-V1 = 4\");##equation 2\n",
+ "print(\"Solving equations 1 and 2\");##solving equations in matrix form\n",
+ "A=([[2 ,-1],[-1 ,3]]);\n",
+ "B=([[2] ,[4]])\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B);\n",
+ "print[X];\n",
+ "print(\"V1= 2 V\");\n",
+ "print(\"V2=-2 V\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Applying KCL to node 1:\n",
+ "2*V1-V2 = 2\n",
+ "Applying KCL to node 2:\n",
+ "3*V2-V1 = 4\n",
+ "Solving equations 1 and 2\n",
+ "[array([[ 2.],\n",
+ " [ 2.]])]\n",
+ "V1= 2 V\n",
+ "V2=-2 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex25-pg2.30"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 1\n",
+ "##page no-2.30\n",
+ "##example2.25\n",
+ "import numpy\n",
+ "print(\"Applying KCL to node 1:\");\n",
+ "print(\"8*VA-2*VB = 50\");##equation 1\n",
+ "print(\"Applying KCL to node 2:\");\n",
+ "print(\"-3*VA+9*VB = 85\");##equation 2\n",
+ "print(\"Solving equations 1 and 2\");##solving equations in matrix form\n",
+ "A=([[8 ,-2],[-3 ,9]]);\n",
+ "B=([[50], [85]])\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B);\n",
+ "print[X];\n",
+ "print(\"VA= 9.39 V\");\n",
+ "print(\"VB= 12.58 V\");\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Applying KCL to node 1:\n",
+ "8*VA-2*VB = 50\n",
+ "Applying KCL to node 2:\n",
+ "-3*VA+9*VB = 85\n",
+ "Solving equations 1 and 2\n",
+ "[array([[ 9.39393939],\n",
+ " [ 12.57575758]])]\n",
+ "VA= 9.39 V\n",
+ "VB= 12.58 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex26-pg2.30"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 1\n",
+ "##page no-2.30\n",
+ "import numpy\n",
+ "##example2.26\n",
+ "print(\"Applying KCL to node 1:\");\n",
+ "print(\"5*V1-2*V2 = -24\");##equation 1\n",
+ "print(\"Applying KCL to node 2:\");\n",
+ "print(\"10*V1-31*V2+6*V3 = 300\");##equation 2\n",
+ "print(\"Applying KCL to node 3:\");\n",
+ "print(\"-4*V2 +9*V3 = 160\");##equation 3\n",
+ "print(\"Solving equations 1,2 and 3\");##solving equations in matrix form\n",
+ "A=([[5, -2 ,0],[10, -31, 6],[0, -4, 9]]);\n",
+ "B=([[-24] ,[300] ,[160]])\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B);\n",
+ "print[X];\n",
+ "print(\"V1= -8.77 V\");\n",
+ "print(\"V2= -9.92 V\");\n",
+ "print(\"V3= 13.37 V\");\n",
+ "x=13.37;\n",
+ "y=-9.92;\n",
+ "z=(x-y)/5.;\n",
+ "print'%s %.2f %s'%(\"\\ncurrent through the 5 ohm resistor = V3-V2/5 = \",z,\" A\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Applying KCL to node 1:\n",
+ "5*V1-2*V2 = -24\n",
+ "Applying KCL to node 2:\n",
+ "10*V1-31*V2+6*V3 = 300\n",
+ "Applying KCL to node 3:\n",
+ "-4*V2 +9*V3 = 160\n",
+ "Solving equations 1,2 and 3\n",
+ "[array([[ -8.76712329],\n",
+ " [ -9.91780822],\n",
+ " [ 13.36986301]])]\n",
+ "V1= -8.77 V\n",
+ "V2= -9.92 V\n",
+ "V3= 13.37 V\n",
+ "\n",
+ "current through the 5 ohm resistor = V3-V2/5 = 4.66 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex27-pg2.31"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 1\n",
+ "##page no-2.31\n",
+ "##example2.27\n",
+ "import numpy\n",
+ "print(\"Applying KCL to node 1:\");\n",
+ "print(\"50*V1-20*V2 = 2400\");##equation 1\n",
+ "print(\"Applying KCL to node 2:\");\n",
+ "print(\"-10*V1+19*V2 = 240\");##equation 2\n",
+ "print(\"Solving equations 1 and 2\");##solving equations in matrix form\n",
+ "A=([[50, -20],[-10, 19]]);\n",
+ "B=([[2400] ,[240]])\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B);\n",
+ "print[X];\n",
+ "print(\"V1= 67.2 V\");\n",
+ "print(\"V2=-48 V\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Applying KCL to node 1:\n",
+ "50*V1-20*V2 = 2400\n",
+ "Applying KCL to node 2:\n",
+ "-10*V1+19*V2 = 240\n",
+ "Solving equations 1 and 2\n",
+ "[array([[ 67.2],\n",
+ " [ 48. ]])]\n",
+ "V1= 67.2 V\n",
+ "V2=-48 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex28-pg2.32"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 1\n",
+ "##page no-2.32\n",
+ "##example2.28\n",
+ "import numpy\n",
+ "print(\"Applying KCL to node 1:\");\n",
+ "print(\"4*VA-2*VB = 5\");##equation 1\n",
+ "print(\"Applying KCL to node 2:\");\n",
+ "print(\"-2*VA+3*VB = 4\");##equation 2\n",
+ "print(\"Solving equations 1 and 2\");##solving equations in matrix form\n",
+ "A=([[4, -2],[-2 ,3]]);\n",
+ "B=([[5], [4]])\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B);\n",
+ "\n",
+ "print(X);\n",
+ "print(\"VA= 2.88 V\");\n",
+ "print(\"VB= 3.25 V\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Applying KCL to node 1:\n",
+ "4*VA-2*VB = 5\n",
+ "Applying KCL to node 2:\n",
+ "-2*VA+3*VB = 4\n",
+ "Solving equations 1 and 2\n",
+ "[[ 2.875]\n",
+ " [ 3.25 ]]"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "VA= 2.88 V\n",
+ "VB= 3.25 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex29-pg2.33"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import numpy\n",
+ "##Network Theorem 1\n",
+ "##page no-2.33\n",
+ "##example2.29\n",
+ "print(\"Applying KCL to node 1:\");\n",
+ "print(\"4*V1-2*V2-V3 = -24\");##equation 1\n",
+ "print(\"Applying KCL to node 2:\");\n",
+ "print(\"-50*V1+71*V2-20*V3 = 0\");##equation 2\n",
+ "print(\"Applying KCL to node 3:\");\n",
+ "print(\"-5V1-4*V2 +10*V3 = 180\");##equation 3\n",
+ "print(\"Solving equations 1,2 and 3\");##solving equations in matrix form\n",
+ "A=numpy.matrix([[4, -2, -1],[-50 ,71 ,-20],[-5, -4 ,10]]);\n",
+ "B=numpy.matrix([[-24], [0], [180]])\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B);\n",
+ "print[X];\n",
+ "print(\"V1= 6.35 V\");\n",
+ "print(\"V2= 11.76 V\");\n",
+ "print(\"V3= 25.88 V\");\n",
+ "x=25.88;\n",
+ "y=11.76;\n",
+ "z=(x-y);\n",
+ "print'%s %.2f %s'%(\"\\ncurrent through the 5 ohm resistor = V3-V2/5 = \",z,\" A\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Applying KCL to node 1:\n",
+ "4*V1-2*V2-V3 = -24\n",
+ "Applying KCL to node 2:\n",
+ "-50*V1+71*V2-20*V3 = 0\n",
+ "Applying KCL to node 3:\n",
+ "-5V1-4*V2 +10*V3 = 180\n",
+ "Solving equations 1,2 and 3\n",
+ "[matrix([[ 6.35294118],\n",
+ " [ 11.76470588],\n",
+ " [ 25.88235294]])]\n",
+ "V1= 6.35 V\n",
+ "V2= 11.76 V\n",
+ "V3= 25.88 V\n",
+ "\n",
+ "current through the 5 ohm resistor = V3-V2/5 = 14.12 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex30-pg2.34"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 1\n",
+ "##page no-2.34\n",
+ "##example2.30\n",
+ "import numpy\n",
+ "print(\"Applying KCL to node 1:\");\n",
+ "print(\"8*V1-V2 = 50\");##equation 1\n",
+ "print(\"Applying KCL to node 2:\");\n",
+ "print(\"-2*V1+11*V2 = -500\");##equation 2\n",
+ "print(\"Solving equations 1 and 2\");##solving equations in matrix form\n",
+ "A=([[8, -1],[-2, 17]]);\n",
+ "B=([[50] ,[-500]])\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B);\n",
+ "print[X];\n",
+ "print(\"V1= 2.61 V\");\n",
+ "print(\"V2=-29.1 V\");\n",
+ "x=2.61;\n",
+ "y=-29.1;\n",
+ "I1=-x/2.;\n",
+ "I2=(x-y)/10.;##current through 10 Ohm resistor\n",
+ "I3=(y+50)/2.;##50 volts is the supply to the circuit\n",
+ "print'%s %.2f %s %.2f %s %.2f %s '%(\"\\nI1= \",I1,\" A\" and \"\\nI2= \",I2,\"A\" and \" \\nI3= \",I3,\" A\");\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Applying KCL to node 1:\n",
+ "8*V1-V2 = 50\n",
+ "Applying KCL to node 2:\n",
+ "-2*V1+11*V2 = -500\n",
+ "Solving equations 1 and 2\n",
+ "[array([[ 2.6119403 ],\n",
+ " [-29.10447761]])]\n",
+ "V1= 2.61 V\n",
+ "V2=-29.1 V\n",
+ "\n",
+ "I1= -1.30 \n",
+ "I2= 3.17 \n",
+ "I3= 10.45 A \n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex31-pg2.34"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 1\n",
+ "##page no-2.34\n",
+ "##example2.31\n",
+ "import numpy\n",
+ "print(\"Applying KCL to node a:\");\n",
+ "print(\"0.5*Va-0.2*Vb = 34.2\");#equation 1\n",
+ "print(\"Applying KCL to node b:\");\n",
+ "print(\"0.1*Va-0.4*Vb = -32.4\");##equation 2\n",
+ "print(\"Solving equations 1 and 2\");##solving equations in matrix form\n",
+ "A=numpy.matrix([[0.5,0.2],[0.1, -0.4]]);\n",
+ "B=numpy.matrix([[34.2], [-32.4]])\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B);\n",
+ "print[X];\n",
+ "print(\"Va= 112 V\");\n",
+ "print(\"Vb= 109 V\");\n",
+ "x=112.;\n",
+ "y=109.;\n",
+ "I1=(120.-x)/0.2;\n",
+ "I2=(x-y)/0.3;\n",
+ "I3=(110-y)/0.1;\n",
+ "print'%s %.2f %s %.2f %s %.2f %s '%(\"\\nI1=\",I1,\" A \" and \"\\nI2= \",I2,\" A\" and \" \\nI3= \",I3,\" A\");\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Applying KCL to node a:\n",
+ "0.5*Va-0.2*Vb = 34.2\n",
+ "Applying KCL to node b:\n",
+ "0.1*Va-0.4*Vb = -32.4\n",
+ "Solving equations 1 and 2\n",
+ "[matrix([[ 32.72727273],\n",
+ " [ 89.18181818]])]\n",
+ "Va= 112 V\n",
+ "Vb= 109 V\n",
+ "\n",
+ "I1= 40.00 \n",
+ "I2= 10.00 \n",
+ "I3= 10.00 A \n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex32-pg2.35"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 1\n",
+ "##page no-2.35\n",
+ "##example2.35\n",
+ "import numpy\n",
+ "print(\"Applying KCL to node 1:\");\n",
+ "print(\"V1 = 50\");##equation 1\n",
+ "print(\"Applying KCL to node 2:\");\n",
+ "print(\"-2*V1+17*V2 = 50\");#equation 2\n",
+ "print(\"Solving equations 1 and 2\");##solving equations in matrix form\n",
+ "A=([[1, 0],[-2, 17]]);\n",
+ "B=([[50] ,[50]])\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B);\n",
+ "print[X];\n",
+ "print(\"V1= 50 V\");\n",
+ "print(\"V2= 8.82 V\");\n",
+ "x=8.82;\n",
+ "y=(x/10.);\n",
+ "print'%s %.2f %s'%(\"\\ncurrent in the 10-Ohm resistor =V2/10 =\",y,\" A\");\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Applying KCL to node 1:\n",
+ "V1 = 50\n",
+ "Applying KCL to node 2:\n",
+ "-2*V1+17*V2 = 50\n",
+ "Solving equations 1 and 2\n",
+ "[array([[ 50. ],\n",
+ " [ 8.82352941]])]\n",
+ "V1= 50 V\n",
+ "V2= 8.82 V\n",
+ "\n",
+ "current in the 10-Ohm resistor =V2/10 = 0.88 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 35
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex33-pg2.36"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 1\n",
+ "##page no-2.36\n",
+ "##example2.33\n",
+ "import numpy\n",
+ "print(\"Applying KCL to node a:\");\n",
+ "print(\"6*Va-5*Vb = -20\");##equation 1\n",
+ "print(\"Applying KCL to node b:\");\n",
+ "print(\"-10*Va+17*Vb-5*Vc = 0\");##equation 2\n",
+ "print(\"At node c\");\n",
+ "print(\"Vc = 20\");\n",
+ "print(\"Solving equations 1,2 and 3\");##solving equations in matrix form\n",
+ "A=numpy.matrix([[6 ,-5 ,0],[-10 ,17 ,-5],[0, 0, 1]]);\n",
+ "B=numpy.matrix([[-20], [0] ,[20]])\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B);\n",
+ "print[X];\n",
+ "print(\"Va= 3.08 V\");\n",
+ "print(\"Vb= 7.69 V\");\n",
+ "x=3.08;\n",
+ "y=7.69;\n",
+ "z=20.;\n",
+ "Va = x-y;\n",
+ "Vb = y-z;\n",
+ "print'%s %.2f %s %.2f %s '%(\"\\nV1 = Va-Vb = \",Va,\"V\" and \"\\nV2 = Vb-Vc = \",Vb,\" V\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Applying KCL to node a:\n",
+ "6*Va-5*Vb = -20\n",
+ "Applying KCL to node b:\n",
+ "-10*Va+17*Vb-5*Vc = 0\n",
+ "At node c\n",
+ "Vc = 20\n",
+ "Solving equations 1,2 and 3\n",
+ "[matrix([[ 3.07692308],\n",
+ " [ 7.69230769],\n",
+ " [ 20. ]])]\n",
+ "Va= 3.08 V\n",
+ "Vb= 7.69 V\n",
+ "\n",
+ "V1 = Va-Vb = -4.61 \n",
+ "V2 = Vb-Vc = -12.31 V \n"
+ ]
+ }
+ ],
+ "prompt_number": 33
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex34-pg2.37"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 1\n",
+ "##page no-2.37\n",
+ "##example2.334\n",
+ "import math\n",
+ "import numpy\n",
+ "print(\"At node A:\");\n",
+ "print(\"VA = 60\");##equation 1\n",
+ "print(\"Applying KCL to node B:\");\n",
+ "print(\"-VA+3*VB-VC = 12\");##equation 2\n",
+ "print(\"Applying KCL to node C:\");\n",
+ "print(\"-2*VA-5*VB+10*VC\");##equation 3\n",
+ "print(\"Solving equations 1,2 and 3\");##solving equations in matrix \n",
+ "A=numpy.matrix([[1 ,0 ,0],[-1 ,3 ,-1],[-2 ,-5 ,10]]);\n",
+ "B=numpy.matrix([[60], [12], [24]])\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B)\n",
+ "print[X];\n",
+ "print(\"VC= 31.68 V\");\n",
+ "print(\"Voltage across the 100 Ohm resistor = 31.68 V\");\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "At node A:\n",
+ "VA = 60\n",
+ "Applying KCL to node B:\n",
+ "-VA+3*VB-VC = 12\n",
+ "Applying KCL to node C:\n",
+ "-2*VA-5*VB+10*VC\n",
+ "Solving equations 1,2 and 3\n",
+ "[matrix([[ 60. ],\n",
+ " [ 34.56],\n",
+ " [ 31.68]])]\n",
+ "VC= 31.68 V\n",
+ "Voltage across the 100 Ohm resistor = 31.68 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex35-pg2.38"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 1\n",
+ "##page no-2.38\n",
+ "##example2.35\n",
+ "import math\n",
+ "import numpy\n",
+ "print(\"Applying KCL to node 1:\");\n",
+ "print(\"2.5*V1-0.5*V2 = 5\");##equation 1\n",
+ "print(\"Applying KCL to node 2:\");\n",
+ "print(\"V1-V2 = 0\");##equation 2\n",
+ "print(\"Solving equations 1 and 2\");##solving equations in matrix form\n",
+ "A=numpy.matrix([[2.5, -0.5],[1 ,-1]]);\n",
+ "B=numpy.matrix([[5] ,[0]])\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B);\n",
+ "print[X];\n",
+ "print(\"V1= 2.5 V\");\n",
+ "print(\"V2=-2.5 V\");\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Applying KCL to node 1:\n",
+ "2.5*V1-0.5*V2 = 5\n",
+ "Applying KCL to node 2:\n",
+ "V1-V2 = 0\n",
+ "Solving equations 1 and 2\n",
+ "[matrix([[ 2.5],\n",
+ " [ 2.5]])]\n",
+ "V1= 2.5 V\n",
+ "V2=-2.5 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex37-pg2.39"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 1\n",
+ "##page no-2.39\n",
+ "##example2.37\\\n",
+ "import math\n",
+ "import numpy\n",
+ "print(\"Applying KCL to node 1:\");\n",
+ "print(\"2*V1+17*V2 = 0\")##equation 1\n",
+ "print(\"Applying KCL to node 2:\");\n",
+ "print(\"V1+6V2 = 0\");##equation 2\n",
+ "print(\"Solving equations 1 and 2\")##solving equations in matrix form\n",
+ "A=numpy.matrix([[2 ,17],[1, 6]]);\n",
+ "B=numpy.matrix([[0], [0]])\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B)\n",
+ "print(X);\n",
+ "print(\"V1= 0 V\");\n",
+ "print(\"V2= 0 V\");\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Applying KCL to node 1:\n",
+ "2*V1+17*V2 = 0\n",
+ "Applying KCL to node 2:\n",
+ "V1+6V2 = 0\n",
+ "Solving equations 1 and 2\n",
+ "[[ 0.]\n",
+ " [ 0.]]\n",
+ "V1= 0 V\n",
+ "V2= 0 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex38-pg2.40"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 1\n",
+ "##page no-2.40\n",
+ "##example2.38\n",
+ "import numpy\n",
+ "import math\n",
+ "print(\"Applying KCL to node a:\");\n",
+ "print(\"2*Va-0.5*Vb-0.5*Vc = 5\");##equation 1\n",
+ "print(\"Applying KCL to node b:\");\n",
+ "print(\"-3/2*Va+5/6*Vb+2/3*Vc = -1\");##equation 2\n",
+ "print(\"Applying KCL to node c:\");\n",
+ "print(\"1/2*Va+1/3*Vb-31/30*Vc = -1\");##equation 3\n",
+ "print(\"Solving equations 1,2 and 3\");##solving equations in matrix form\n",
+ "A=numpy.matrix([[2, -0.5, -0.5],[-3/2, 5/6, 2/3],[0.5 ,1/3 ,-31/30 ]]);\n",
+ "B=numpy.matrix([[5], [-1], [0]])\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B)\n",
+ "print[X];\n",
+ "\n",
+ "print(\"Va= 4.303 V\");\n",
+ "print(\"Vb= 3.87 V\");\n",
+ "print(\"Vc= 3.33 V\");\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex39-pg2.41"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 1\n",
+ "##page no-2.41\n",
+ "##example2.39\n",
+ "import math\n",
+ "import numpy\n",
+ "print(\"from the figure\");\n",
+ "print(\"V4= 40 V\");##equation 1\n",
+ "print(\"nodes 2 and 3 form suoernode:\");\n",
+ "print(\"V1-2*V2+V3 = 0\");##equation 2\n",
+ "print(\"Applying KCL to node 1:\");\n",
+ "print(\"7/15*V1-1/5*V2 = 2/3\");##equation 3\n",
+ "print(\"Applying KCL to supernode :\");\n",
+ "print(\"-23/30*V1 +83/60*V3 = 20\");##equation 4\n",
+ "print(\"Solving equations 1,2,3 and 4\");##solving equations in matrix form\n",
+ "A=numpy.matrix([[0, 0 ,0 ,1],[1 ,-2 ,1 ,0],[7/15 ,-1/5, 0, 0],[-23/30, 83/60, 0 ,0]]);\n",
+ "B=numpy.matrix([[40] ,[0], [2/3], [20]])\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B)\n",
+ "print[X];\n",
+ "print(\"V1= 10 V\");\n",
+ "print(\"V2= 20 V\");\n",
+ "print(\"V3= 30 V\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "from the figure\n",
+ "V4= 40 V\n",
+ "nodes 2 and 3 form suoernode:\n",
+ "V1-2*V2+V3 = 0\n",
+ "Applying KCL to node 1:\n",
+ "7/15*V1-1/5*V2 = 2/3\n",
+ "Applying KCL to supernode :\n",
+ "-23/30*V1 +83/60*V3 = 20\n",
+ "Solving equations 1,2,3 and 4\n",
+ "[matrix([[-20.],\n",
+ " [ 0.],\n",
+ " [ 20.],\n",
+ " [ 40.]])]\n",
+ "V1= 10 V\n",
+ "V2= 20 V\n",
+ "V3= 30 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex40-pg2.42"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 1\n",
+ "##page no-2.42\n",
+ "##example2.40\n",
+ "import math\n",
+ "import numpy\n",
+ "print(\"selecting central node as reference node\");\n",
+ "print(\"V1= -12 V\");##equation 1\n",
+ "print(\"Applying KCL at node 1:\");\n",
+ "print(\"-2*V1+2.5*V2-0.5V3 = 14\");##equation 2\n",
+ "print(\"nodes 3 and 4 form a supernode\");\n",
+ "print(\"0.2*V1+V3-1.2*V4 = 0\");##equation 3\n",
+ "print(\"Applying KCL to supernode :\");\n",
+ "print(\"0.1*V1-V2+0.5*V3+1.4*V4 = 0\");##equation 4\n",
+ "print(\"Solving equations 1,2,3 and 4\");##solving equations in matrix form\n",
+ "A=numpy.matrix([[1, 0, 0 ,0],[-2 ,2.5 ,-0.5 ,0],[0.2 ,0 ,1, -1.2],[0.1 ,-1 ,0.5, 1.4]]);\n",
+ "B=numpy.matrix([[-12], [14] ,[0],[0]])\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B)\n",
+ "print[X];\n",
+ "print(\"V1= -12 V\");\n",
+ "print(\"V2= -4 V\");\n",
+ "print(\"V3= 0\");\n",
+ "print(\"V4= -2 V\");\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "selecting central node as reference node\n",
+ "V1= -12 V\n",
+ "Applying KCL at node 1:\n",
+ "-2*V1+2.5*V2-0.5V3 = 14\n",
+ "nodes 3 and 4 form a supernode\n",
+ "0.2*V1+V3-1.2*V4 = 0\n",
+ "Applying KCL to supernode :\n",
+ "0.1*V1-V2+0.5*V3+1.4*V4 = 0\n",
+ "Solving equations 1,2,3 and 4\n",
+ "[matrix([[ -1.20000000e+01],\n",
+ " [ -4.00000000e+00],\n",
+ " [ 4.44089210e-16],\n",
+ " [ -2.00000000e+00]])]\n",
+ "V1= -12 V\n",
+ "V2= -4 V\n",
+ "V3= 0\n",
+ "V4= -2 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electrical_Network_by_R._Singh/Chapter3.ipynb b/Electrical_Network_by_R._Singh/Chapter3.ipynb new file mode 100644 index 00000000..6d33a416 --- /dev/null +++ b/Electrical_Network_by_R._Singh/Chapter3.ipynb @@ -0,0 +1,2941 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:232ca964f6cb50454cfbdf0b82acf046a9abb3f3780b179ff1b54c28005cb225"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter3-Network Theorem 2"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg3.2"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 2\n",
+ "##pg no 3.2\n",
+ "##example 3.1\n",
+ "print(\"When 10-V source is acting alone:\");\n",
+ "print(\"By current-division formula :\");\n",
+ "I1=10.*(0.87/(1.0+0.87));\n",
+ "print\"%s %.2f %s\"%(\"I1=10*(0.87/(10+0.87))= \",I1,\" A (down)\");\n",
+ "print(\"When 4 A source is acting alone:\");\n",
+ "print(\"By current-division formula :\");\n",
+ "I2=2.86*(0.875/(10.+0.875));\n",
+ "print\"%s %.2f %s\"%(\"I2=2.86*(0.875/(10+0.875))= \",I2,\" A (down)\");\n",
+ "print(\"By superposition theorem:\");\n",
+ "I=I1+I2;\n",
+ "print\"%s %.2f %s\"%(\"\\nI=I1+I2=0.8+0.23= \",I,\" A (down)\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "When 10-V source is acting alone:\n",
+ "By current-division formula :\n",
+ "I1=10*(0.87/(10+0.87))= 4.65 A (down)\n",
+ "When 4 A source is acting alone:\n",
+ "By current-division formula :\n",
+ "I2=2.86*(0.875/(10+0.875))= 0.23 A (down)\n",
+ "By superposition theorem:\n",
+ "\n",
+ "I=I1+I2=0.8+0.23= 4.88 A (down)\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg3.3"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 2\n",
+ "##pg no 3.4\n",
+ "##example 3.2\n",
+ "print(\"When 4-A source is acting alone:\");\n",
+ "print(\"By current-division formula :\");\n",
+ "I1=3.33*(3.53/(6.+3.53));\n",
+ "print\"%s %.2f %s\"%(\"I1=3.33*(3.53/(6+3.53)) = \",I1,\" A (down)\");\n",
+ "print(\"When 10-V source is acting alone:\");\n",
+ "print(\"By current-division formula :\");\n",
+ "I2=0.833*(3.53/(6.+3.53));\n",
+ "print\"%s %.2f %s\"%(\"I2=0.833*(3.53/(6+3.53))= \",I2,\" A (up)\");\n",
+ "print(\"When 3-A source is acting alone:\");\n",
+ "print(\"By current-division formula :\");\n",
+ "I3=3*(3.53/(6.+3.53));\n",
+ "print\"%s %.2f %s\"%(\"I3=3*(3.53/(6+3.53))= \",I3,\" A (down)\");\n",
+ "print(\"By superposition theorem:\");\n",
+ "I=I1-I2+I3;\n",
+ "print\"%s %.2f %s\"%(\"\\nI=I1-I2+I3=1.23-0.31+1.11= \",I,\" A (down)\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "When 4-A source is acting alone:\n",
+ "By current-division formula :\n",
+ "I1=3.33*(3.53/(6+3.53)) = 1.23 A (down)\n",
+ "When 10-V source is acting alone:\n",
+ "By current-division formula :\n",
+ "I2=0.833*(3.53/(6+3.53))= 0.31 A (up)\n",
+ "When 3-A source is acting alone:\n",
+ "By current-division formula :\n",
+ "I3=3*(3.53/(6+3.53))= 1.11 A (down)\n",
+ "By superposition theorem:\n",
+ "\n",
+ "I=I1-I2+I3=1.23-0.31+1.11= 2.04 A (down)\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg3.5"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 2\n",
+ "##pg no 3.5\n",
+ "##example 3.3\n",
+ "print(\"When 4-A source is acting alone:\");\n",
+ "print(\"By current-division formula :\");\n",
+ "I1=4./(2.+1.);\n",
+ "print\"%s %.2f %s\"%(\"I1=4/(2+1) = \",I1,\" A (down)\");\n",
+ "print(\"When 3-A source is acting alone:\");\n",
+ "print(\"By current-division formula :\");\n",
+ "I2=3.*(2./(2.+1.));\n",
+ "print\"%s %.2f %s\"%(\"I2=3*(2/(2+1)) = \",I2,\" A (down)\");\n",
+ "print(\"When 1-A source is acting alone:\");\n",
+ "print(\"By current-division formula :\");\n",
+ "I3=1.*(2./(2.+1.));\n",
+ "print\"%s %.2f %s\"%(\"I3=1*(2/(2+1)) = \",I3,\" A (down)\");\n",
+ "print(\"By superposition theorem:\");\n",
+ "I=I1+I2+I3;\n",
+ "print\"%s %.2f %s\"%(\"\\nI=I1+I2+I3=1.33+2+0.66= \",I,\" A (down)\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "When 4-A source is acting alone:\n",
+ "By current-division formula :\n",
+ "I1=4/(2+1) = 1.33 A (down)\n",
+ "When 3-A source is acting alone:\n",
+ "By current-division formula :\n",
+ "I2=3*(2/(2+1)) = 2.00 A (down)\n",
+ "When 1-A source is acting alone:\n",
+ "By current-division formula :\n",
+ "I3=1*(2/(2+1)) = 0.67 A (down)\n",
+ "By superposition theorem:\n",
+ "\n",
+ "I=I1+I2+I3=1.33+2+0.66= 4.00 A (down)\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg3.7"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 2\n",
+ "##pg no 3.\n",
+ "##example 3.4\n",
+ "print(\"When 6-V source is acting alone:\");\n",
+ "VAB1=6.;\n",
+ "print\"%s %.2f %s\"%(\"VAB1 = \",VAB1,\" V\");\n",
+ "print(\"When 10-V source is acting alone:\");\n",
+ "print(\"Since the resistor of 5 ohm is shorted,the voltage across it is zero\")\n",
+ "VAB2=10.;\n",
+ "print\"%s %.2f %s\"%(\"VAB2= \",VAB2,\" V\" );\n",
+ "print(\"When 5-A source is acting alone:\");\n",
+ "print(\"Due to short circuit in both the parts\");\n",
+ "VAB3=0.;\n",
+ "print\"%s %.2f %s\"%(\"VAB3 = \",VAB3,\" V\");\n",
+ "print(\"By superposition theorem:\");\n",
+ "VAB=VAB1+VAB2+VAB3;\n",
+ "print\"%s %.2f %s\"%(\"\\nVAB=VAB=VAB1+VAB2+VAB3= \",VAB,\" V\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "When 6-V source is acting alone:\n",
+ "VAB1 = 6.00 V\n",
+ "When 10-V source is acting alone:\n",
+ "Since the resistor of 5 ohm is shorted,the voltage across it is zero\n",
+ "VAB2= 10.00 V\n",
+ "When 5-A source is acting alone:\n",
+ "Due to short circuit in both the parts\n",
+ "VAB3 = 0.00 V\n",
+ "By superposition theorem:\n",
+ "\n",
+ "VAB=VAB=VAB1+VAB2+VAB3= 16.00 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5-pg3.7"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 2\n",
+ "##pg no 3.7\n",
+ "##example 3.5\n",
+ "print(\"When 5-A source is acting alone:\");\n",
+ "print(\"By current-division formula :\");\n",
+ "I1=5.*(2./(2.+4.));\n",
+ "print\"%s %.2f %s\"%(\"I1=5*(2/(2+4)) = \",I1,\" A (down)\");\n",
+ "print(\"When 2-A source is acting alone:\");\n",
+ "print(\"By current-division formula :\");\n",
+ "I2=2.*(2./(2.+4.));\n",
+ "print\"%s %.2f %s\"%(\"I2=2*(2/(2+4)) = \",I2,\" A (down)\");\n",
+ "print(\"When 6-V source is acting alone:\");\n",
+ "print(\"Applying KVL to the mesh\");\n",
+ "print(\"-2*I3-6-4*I3=0\");\n",
+ "print(\"I3=-1\");\n",
+ "I3=-1.;\n",
+ "print\"%s %.2f %s\"%(\"I3=-1 A= \",I3,\" A (down)\");\n",
+ "print(\"By superposition theorem:\");\n",
+ "I=I1+I2+I3;\n",
+ "print\"%s %.2f %s\"%(\"\\nI=I1+I2+I3=1.67+0.67-1= \",I,\" A (down)\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "When 5-A source is acting alone:\n",
+ "By current-division formula :\n",
+ "I1=5*(2/(2+4)) = 1.67 A (down)\n",
+ "When 2-A source is acting alone:\n",
+ "By current-division formula :\n",
+ "I2=2*(2/(2+4)) = 0.67 A (down)\n",
+ "When 6-V source is acting alone:\n",
+ "Applying KVL to the mesh\n",
+ "-2*I3-6-4*I3=0\n",
+ "I3=-1\n",
+ "I3=-1 A= -1.00 A (down)\n",
+ "By superposition theorem:\n",
+ "\n",
+ "I=I1+I2+I3=1.67+0.67-1= 1.33 A (down)\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6-pg3.8"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 2\n",
+ "##pg no 3.8\n",
+ "##example 3.6\n",
+ "a=15./38.;\n",
+ "b=10./38.;\n",
+ "x=a+b;\n",
+ "print\"%s %.2f %s\"%(\"\\nApplying KCL at node 1, \\nI1 =\",a,\"\");##When the 15 V source is acting alone\n",
+ "print\"%s %.2f %s\"%(\"\\nApplying KCL at node 1, \\nI1 = \",b,\"\");##When the 10 V source is acting alone\n",
+ "print\"%s %.2f %s\"%(\"\\nBy superposition theorem, \\nI = I1+I2 = \",x,\" A\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Applying KCL at node 1, \n",
+ "I1 = 0.39 \n",
+ "\n",
+ "Applying KCL at node 1, \n",
+ "I1 = 0.26 \n",
+ "\n",
+ "By superposition theorem, \n",
+ "I = I1+I2 = 0.66 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7-pg3.9"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 2\n",
+ "##pg no 3.8\n",
+ "##example 3.7\n",
+ "a=3.;\n",
+ "b=2.;\n",
+ "x=a+b;\n",
+ "print\"%s %.2f %s\"%(\"\\napplying KCL at node 1, \\nIx1 = \",a,\" A\");##when the 30 V source is acting alone\n",
+ "print\"%s %.2f %s\"%(\"\\napplying KCL at the mesh, \\nIx2 = \",b,\" A\");##when the 20 V source is acting alone\n",
+ "print\"%s %.2f %s\"%(\"\\nBy superposition theorem, Ix = Ix1+Ix2 = \",x,\" A\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "applying KCL at node 1, \n",
+ "Ix1 = 3.00 A\n",
+ "\n",
+ "applying KCL at the mesh, \n",
+ "Ix2 = 2.00 A\n",
+ "\n",
+ "By superposition theorem, Ix = Ix1+Ix2 = 5.00 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex8-pg3.10"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 2\n",
+ "##pg no 3.10\n",
+ "##example 3.8\n",
+ "##when 5 V source is acting alone\n",
+ "import math\n",
+ "import numpy\n",
+ "from numpy import linalg\n",
+ "print(\"Vx+10I1=5\");##equation 1\n",
+ "print(\"Applying KVL to mesh,\");\n",
+ "print(\"4Vx+12I1=5\");##equation 2\n",
+ "A=numpy.matrix([[1, 10],[4 ,12]]);##solving equation in matrix form\n",
+ "B=([[5],[5]])\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B);\n",
+ "print[X];\n",
+ "print(\"I1 = 0.535 A\");\n",
+ "##when the 2 A source is acting alone\n",
+ "print(\"Vx+10I2=0\");##equation 1\n",
+ "print(\"Applying KCL at Node x,\");\n",
+ "print(\"Vx=-10/7\");##equation 2\n",
+ "A1=numpy.matrix([[1, 10],[1 ,0]]);##solving equation in matrix form\n",
+ "B1=numpy.matrix([[0], [-10/7]])\n",
+ "X1=numpy.dot(numpy.linalg.inv(A1),B1);\n",
+ "print[X1];\n",
+ "print(\"I2 = 0.1428 A\");\n",
+ "a=0.535;\n",
+ "b=0.1428;\n",
+ "x=a+b;\n",
+ "print\"%s %.3f %s\"%(\"\\nBy superposition theorem, \\nI = I1+I2 = \",x,\" A \");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Vx+10I1=5\n",
+ "Applying KVL to mesh,\n",
+ "4Vx+12I1=5\n",
+ "[matrix([[-0.35714286],\n",
+ " [ 0.53571429]])]\n",
+ "I1 = 0.535 A\n",
+ "Vx+10I2=0\n",
+ "Applying KCL at Node x,\n",
+ "Vx=-10/7\n",
+ "[matrix([[-2. ],\n",
+ " [ 0.2]])]\n",
+ "I2 = 0.1428 A\n",
+ "\n",
+ "By superposition theorem, \n",
+ "I = I1+I2 = 0.678 A \n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex9-pg3.10"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 2\n",
+ "##pg no 3.10\n",
+ "##example 3.9\n",
+ "##when 100 V source is acting alone\n",
+ "import numpy\n",
+ "from numpy import linalg\n",
+ "print(\"Vx-5I1=0\");##equation 1\n",
+ "print(\"Applying KVL to mesh,\");\n",
+ "print(\"10Vx-15I1=-100\");##equation 2\n",
+ "A=numpy.matrix([[1, -5],[10 ,-15]]);##solving equation in matrix form\n",
+ "B=numpy.matrix([[0], [-100]])\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B);\n",
+ "print[X];##negative because of opposite direction\n",
+ "print(\"I1 = 2.857 A\");\n",
+ "##when the 10 A source is acting alone\n",
+ "print(\"9Vx+10I2=0\");##equation 1\n",
+ "print(\"Applying KCL at Node 1,\");\n",
+ "print(\"Vx=-100/7\");##equation 2\n",
+ "A=numpy.matrix([[9, 10],[1, 0]]);##solving equation in matrix form\n",
+ "B=numpy.matrix([[0] ,[-100/7]])\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B);\n",
+ "print[X];\n",
+ "print(\"I2 = 12.857 A\");\n",
+ "a=2.857;\n",
+ "b=12.857;\n",
+ "x=a+b;\n",
+ "print\"%s %.2f %s\"%(\"\\nBy superposition theorem, \\nI = I1+I2 = \",x,\" A \");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Vx-5I1=0\n",
+ "Applying KVL to mesh,\n",
+ "10Vx-15I1=-100\n",
+ "[matrix([[-14.28571429],\n",
+ " [ -2.85714286]])]\n",
+ "I1 = 2.857 A\n",
+ "9Vx+10I2=0\n",
+ "Applying KCL at Node 1,\n",
+ "Vx=-100/7\n",
+ "[matrix([[-15. ],\n",
+ " [ 13.5]])]\n",
+ "I2 = 12.857 A\n",
+ "\n",
+ "By superposition theorem, \n",
+ "I = I1+I2 = 15.71 A \n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex10-pg3.11"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 2\n",
+ "##pg no 3.11\n",
+ "##example 3.10\n",
+ "##when 17 V source is acting alone\n",
+ "import numpy\n",
+ "from numpy import linalg\n",
+ "print(\"Vx+2I1=0\");##equation 1\n",
+ "print(\"Applying KVL to mesh,\");\n",
+ "print(\"-5Vx-5I1=17\");##equation 2\n",
+ "A=numpy.matrix([[1, 2],[-5 ,-5]]);##solving equation in matrix form\n",
+ "B=([[0], [17]])\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B);\n",
+ "print[X];\n",
+ "print(\"I1 = 3.4 A\");\n",
+ "##when the 1 A source is acting alone\n",
+ "print(\"4Vx+3I2=0\");##equation 1\n",
+ "print(\"Applying KCL at Node x,\");\n",
+ "print(\"Vx=-6/5\");##equation 2\n",
+ "A=numpy.matrix([[4, 3],[1, 0]]);##solving equation in matrix form\n",
+ "B=numpy.matrix([[0],[-6/5]])\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B);\n",
+ "print[X];\n",
+ "print(\"I2 = 1.6 A\");\n",
+ "a=3.4;\n",
+ "b=1.6;\n",
+ "x=a+b;\n",
+ "print\"%s %.2f %s\"%(\"\\nBy superposition theorem, \\nI = I1+I2 = \",x,\" A \");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Vx+2I1=0\n",
+ "Applying KVL to mesh,\n",
+ "-5Vx-5I1=17\n",
+ "[matrix([[-6.8],\n",
+ " [ 3.4]])]\n",
+ "I1 = 3.4 A\n",
+ "4Vx+3I2=0\n",
+ "Applying KCL at Node x,\n",
+ "Vx=-6/5\n",
+ "[matrix([[-2. ],\n",
+ " [ 2.66666667]])]\n",
+ "I2 = 1.6 A\n",
+ "\n",
+ "By superposition theorem, \n",
+ "I = I1+I2 = 5.00 A \n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex11-pg3.12"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 2\n",
+ "##pg no 3.12\n",
+ "##example 3.11\n",
+ "##when 5 A source is acting alone\n",
+ "print(\"-V1+4I=0\");##equation 1\n",
+ "print(\"Applying KCL to node 1,\");\n",
+ "print(\"1.25V1-4I=5\");##equation 2\n",
+ "import math\n",
+ "import numpy\n",
+ "from numpy import linalg\n",
+ "A=numpy.matrix([[-1, 4],[1.25 ,-4]]);##solving equation in matrix form\n",
+ "B=([[0] ,[5]])\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B);\n",
+ "print[X];\n",
+ "print(\"V1 = 20 V\");\n",
+ "##when the 20 V source is acting alone\n",
+ "print(\"from the figure,\");\n",
+ "print(\"V2-3I=0\");##equation 1\n",
+ "print(\"Applying KVL to the mesh,\");\n",
+ "print(\"I=-20\");##equation 2\n",
+ "A=([[1 ,-3],[0 ,1]]);##solving equation in matrix form\n",
+ "B=([[0] ,[-20]])\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B);\n",
+ "print[X];\n",
+ "print(\"V2 = -60 V\");\n",
+ "a=20.;\n",
+ "b=-60.;\n",
+ "x=a+b;\n",
+ "print\"%s %.2f %s\"%(\"\\nBy superposition theorem, \\n V = V1+V2 =\",x,\" V \");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-V1+4I=0\n",
+ "Applying KCL to node 1,\n",
+ "1.25V1-4I=5\n",
+ "[matrix([[ 20.],\n",
+ " [ 5.]])]\n",
+ "V1 = 20 V\n",
+ "from the figure,\n",
+ "V2-3I=0\n",
+ "Applying KVL to the mesh,\n",
+ "I=-20\n",
+ "[array([[-60.],\n",
+ " [-20.]])]\n",
+ "V2 = -60 V\n",
+ "\n",
+ "By superposition theorem, \n",
+ " V = V1+V2 = -40.00 V \n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex12-pg3.13"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 2\n",
+ "##pg no 3.13\n",
+ "##example 3.12\n",
+ "##when 18 V source is acting alone\n",
+ "print(\"Vx+I1=0\");##equation 1\n",
+ "print(\"Applying KVL to mesh,\");\n",
+ "print(\"3Vx-6I1=-18\");##equation 2\n",
+ "import math\n",
+ "import numpy\n",
+ "from numpy import linalg\n",
+ "A=numpy.matrix([[1, 1],[3 ,-6]]);##solving equation in matrix form\n",
+ "B=([[0] ,[-18]])\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B);\n",
+ "print[X];\n",
+ "print(\"I1 = 2 A\");\n",
+ "##when the 3 A source is acting alone\n",
+ "print(\"from the figure,\");\n",
+ "print(\"Vx=2 V\");##equation 1\n",
+ "print(\"Applying KCL at node 1,\");\n",
+ "print(\"3Vx-6I2=0\");##equation 2\n",
+ "A=([[1 ,0],[3 ,-6]]);##solving equation in matrix form\n",
+ "B=([[2] ,[0]])\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B);\n",
+ "print[X];\n",
+ "print(\"I2 =1 V\");\n",
+ "a=2;\n",
+ "b=1;\n",
+ "x=a+b;\n",
+ "print\"%s %.2f %s\"%(\"\\nBy superposition theorem, \\n I = I1+I2 = \",x,\" A \");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Vx+I1=0\n",
+ "Applying KVL to mesh,\n",
+ "3Vx-6I1=-18\n",
+ "[matrix([[-2.],\n",
+ " [ 2.]])]\n",
+ "I1 = 2 A\n",
+ "from the figure,\n",
+ "Vx=2 V\n",
+ "Applying KCL at node 1,\n",
+ "3Vx-6I2=0\n",
+ "[array([[ 2.],\n",
+ " [ 1.]])]\n",
+ "I2 =1 V\n",
+ "\n",
+ "By superposition theorem, \n",
+ " I = I1+I2 = 3.00 A \n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex13-pg3.14"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 2\n",
+ "##pg no 3.14\n",
+ "##example 3.13\n",
+ "##when 120 V source is acting alone\n",
+ "print(\"Applying KVL to mesh,\");\n",
+ "print(\"Iy1=5.45 A\");\n",
+ "##when the 12 A source is acting alone\n",
+ "print(\"from the figure,\");\n",
+ "print(\"V1+4Iy2=0\");##equation 1\n",
+ "print(\"Applying KCL at node 1,\");\n",
+ "print(\"-V1/8 +9/4Iy2=-12\");##equation 2\n",
+ "import math\n",
+ "import numpy\n",
+ "from numpy import linalg\n",
+ "A=numpy.matrix([[1, 4],[-1/8 ,9/4]]);##solving equation in matrix form\n",
+ "B=([[0] ,[-12]])\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B);\n",
+ "print[X];\n",
+ "print(\"Iy2 =-4.36 A\");\n",
+ "##when 40 V source is acting alone\n",
+ "print(\"Applying KVL to mesh,\");\n",
+ "print(\"Iy3=-1.82 A\");\n",
+ "a=5.45;\n",
+ "b=-4.36;\n",
+ "c=-1.82;\n",
+ "x=a+b+c;\n",
+ "print\"%s %.2f %s\"%(\"\\nBy superposition theorem, \\n I = Iy1+Iy2+Iy3 = \",x,\" A \");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Applying KVL to mesh,\n",
+ "Iy1=5.45 A\n",
+ "from the figure,\n",
+ "V1+4Iy2=0\n",
+ "Applying KCL at node 1,\n",
+ "-V1/8 +9/4Iy2=-12\n",
+ "[matrix([[ 8.],\n",
+ " [-2.]])]\n",
+ "Iy2 =-4.36 A\n",
+ "Applying KVL to mesh,\n",
+ "Iy3=-1.82 A\n",
+ "\n",
+ "By superposition theorem, \n",
+ " I = Iy1+Iy2+Iy3 = -0.73 A \n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex14-pg3.15"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 2\n",
+ "##pg no 3.15\n",
+ "##example 3.14\n",
+ "##when 18 V source is acting alone\n",
+ "print(\"Vx1-31=0\");##equation 1\n",
+ "print(\"Applying KVL to mesh,\");\n",
+ "print(\"-3Vx1-9I=-18\");##equation 2\n",
+ "import math\n",
+ "import numpy\n",
+ "from numpy import linalg\n",
+ "A=numpy.matrix([[1, -3],[-3 ,-9]]);##solving equation in matrix form\n",
+ "B=([[0] ,[-18]])\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B);\n",
+ "print[X];\n",
+ "print(\"Vx1 = 3 V\");\n",
+ "##when the 5 A source is acting alone\n",
+ "print(\"from the figure,\");\n",
+ "print(\"V1+Vx2=0\");##equation 1\n",
+ "print(\"Applying KCL at node 1,\");\n",
+ "print(\"1/2V1-1/2Vx2=5\");##equation 2\n",
+ "A=numpy.matrix([[1, 1],[1/2 ,-1/2]]);##solving equation in matrix form\n",
+ "B=([[0] ,[5]])\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B);\n",
+ "print[X];\n",
+ "print(\"Vx2= -5 V\");\n",
+ "##when the 36 V source is acting alone\n",
+ "print(\"from the figure,\");\n",
+ "print(\"Vx3+3I=0\");##equation 1\n",
+ "print(\"Applying KVL to the mesh,\");\n",
+ "print(\"3Vx3-9I=-36\");##equation 2\n",
+ "A=numpy.matrix([[1, 3],[3 ,-9]]);##solving equation in matrix form\n",
+ "B=([[0] ,[-36]])\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B);\n",
+ "print[X];\n",
+ "print(\"Vx3= -6 V\");\n",
+ "a=3.;\n",
+ "b=-5.;\n",
+ "c=-6.;\n",
+ "x=a+b+c;\n",
+ "print\"%s %.2f %s\"%(\"\\nBy superposition theorem, \\n Vx = Vx1+Vx2+Vx3 = \",x,\" V \");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Vx1-31=0\n",
+ "Applying KVL to mesh,\n",
+ "-3Vx1-9I=-18\n",
+ "[matrix([[ 3.],\n",
+ " [ 1.]])]\n",
+ "Vx1 = 3 V\n",
+ "from the figure,\n",
+ "V1+Vx2=0\n",
+ "Applying KCL at node 1,\n",
+ "1/2V1-1/2Vx2=5\n",
+ "[matrix([[ 5.],\n",
+ " [-5.]])]\n",
+ "Vx2= -5 V\n",
+ "from the figure,\n",
+ "Vx3+3I=0\n",
+ "Applying KVL to the mesh,\n",
+ "3Vx3-9I=-36\n",
+ "[matrix([[-6.],\n",
+ " [ 2.]])]\n",
+ "Vx3= -6 V\n",
+ "\n",
+ "By superposition theorem, \n",
+ " Vx = Vx1+Vx2+Vx3 = -8.00 V \n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex15-pg3.16"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 2\n",
+ "##pg no 3.16\n",
+ "##example 3.15\n",
+ "a=10.;\n",
+ "b=2.;\n",
+ "c=(5.*a)-(20.*b);\n",
+ "x=20.;\n",
+ "y=30.;\n",
+ "z=5.;\n",
+ "r=z+((x*y)/(x+y));\n",
+ "i=c/(r+c);\n",
+ "##Calculation of Vth(Thevenin's voltage)\n",
+ "print(\"removing the 10 ohm resistor from the circuit\");\n",
+ "print\"%s %.2f %s\"%(\"\\nFor mesh 1, \\nI1 = \",a,\" A\");\n",
+ "print\"%s %.2f %s\"%(\"\\nApplying KVL to mesh 2,, \\nI2 = \",b,\" A\");\n",
+ "print\"%s %.2f %s\"%(\"\\nWriting Vth equation, \\n Vth = \",c,\" V\");\n",
+ "##Calculation of Rth(Thevenin's Resistance)\n",
+ "print(\"replacing the current source of 10 A with an open circuit and voltage source of 100 V with a short circuit,\");\n",
+ "print\"%s %.2f %s\"%(\"\\nRth = \",r,\" Ohm\");\n",
+ "##Calculation of IL(load current)\n",
+ "print\"%s %.2f %s\"%(\"\\nIL = \",i,\" A\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "removing the 10 ohm resistor from the circuit\n",
+ "\n",
+ "For mesh 1, \n",
+ "I1 = 10.00 A\n",
+ "\n",
+ "Applying KVL to mesh 2,, \n",
+ "I2 = 2.00 A\n",
+ "\n",
+ "Writing Vth equation, \n",
+ " Vth = 10.00 V\n",
+ "replacing the current source of 10 A with an open circuit and voltage source of 100 V with a short circuit,\n",
+ "\n",
+ "Rth = 17.00 Ohm\n",
+ "\n",
+ "IL = 0.37 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex16-pg3.17"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 2\n",
+ "##pg no 3.17\n",
+ "##example 3.16\n",
+ "a=30.;\n",
+ "b=20.;\n",
+ "c=50.;\n",
+ "d=5.;\n",
+ "e=24.;\n",
+ "v=220.;\n",
+ "x=(v/(a+c));\n",
+ "y=(v/(b+d));\n",
+ "z=(20.*y)-(30.*x);\n",
+ "r=((a*c)/(a+c))+((b*d)/(b+d));\n",
+ "i=z/(r+e);\n",
+ "##Calculation the Vth (Thevenin's voltage)\n",
+ "print(\"removing the 24 Ohm resistor from the network\");\n",
+ "print\"%s %.2f %s\"%(\"\\nI1 = \",x,\" A\");\n",
+ "print\"%s %.2f %s\"%(\"\\nI2 = \",y,\" A\");\n",
+ "print\"%s %.2f %s\"%(\"\\nWriting Vth equation, \\n Vth = \",z,\" V\");\n",
+ "##Calculation of Rth (Thevenin's resistance)\n",
+ "print(\"replacing the 220 V source with short circuit\");\n",
+ "print\"%s %.2f %s\"%(\"\\nRth = \",r,\" Ohm\");\n",
+ "##Calculation of IL (load current)\n",
+ "print\"%s %.2f %s\"%(\"\\nIL = \",i,\" A\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "removing the 24 Ohm resistor from the network\n",
+ "\n",
+ "I1 = 2.75 A\n",
+ "\n",
+ "I2 = 8.80 A\n",
+ "\n",
+ "Writing Vth equation, \n",
+ " Vth = 93.50 V\n",
+ "replacing the 220 V source with short circuit\n",
+ "\n",
+ "Rth = 22.75 Ohm\n",
+ "\n",
+ "IL = 2.00 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex17-pg3.18"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 2\n",
+ "##pg no 3.18\n",
+ "##example 3.17\n",
+ "print(\"removing the 3 Ohm resistor from the network\");\n",
+ "print(\"Applying KVL to mesh 1\");\n",
+ "print(\"11*I1-9*I2=50\");##equation 1\n",
+ "print(\"Applying KVL to mesh 2\");\n",
+ "print(\"-9*I1+18*I2=0\");##equation 2\n",
+ "import math\n",
+ "import numpy\n",
+ "from numpy import linalg\n",
+ "A=numpy.matrix([[11, -9],[-9 ,18]]);##solving equation in matrix form\n",
+ "B=numpy.matrix([[50] ,[0]])\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B);\n",
+ "print[X];\n",
+ "print(\"I1=7.69 A\");\n",
+ "print(\"I2=3.85 A\");\n",
+ "##Calculation of Vth (Thevenin's voltage)\n",
+ "a=7.69;\n",
+ "b=3.85;\n",
+ "v=-((5.*b)+(8.*(b-a)));##the B terminal is positive w.r.t A\n",
+ "print\"%s %.2f %s\"%(\"\\nWriting Vth equation, \\n Vth = \",v,\" V\");\n",
+ "##Calculation of Rth (Thevenin's resistance)\n",
+ "x=4.;\n",
+ "y=2.;\n",
+ "z=5.;\n",
+ "##delta into star network\n",
+ "r1=((x*y)/(x+y+z));\n",
+ "r2=((x*z)/(x+y+z));\n",
+ "r3=((z*y)/(x+y+z));\n",
+ "print\"%s %.2f %s %.2f %s %.2f %s \"%(\"\\nR1 = \",r1,\" Ohm\"and \" \\nR2 = \",r2,\" Ohm\" and \"\\nR3 =\",r3,\" Ohm\");\n",
+ "m=1.73;\n",
+ "n=8.91;\n",
+ "r=(r2+(m*n)/(m+n));\n",
+ "print\"%s %.2f %s\"%(\"\\nRth = \",r,\" Ohm\");\n",
+ "##Claculation of IL (Load Current)\n",
+ "i=v/(r+3.);\t\n",
+ "print\"%s %.2f %s\"%(\"\\nIL = \",i,\" A\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "removing the 3 Ohm resistor from the network\n",
+ "Applying KVL to mesh 1\n",
+ "11*I1-9*I2=50\n",
+ "Applying KVL to mesh 2\n",
+ "-9*I1+18*I2=0\n",
+ "[matrix([[ 7.69230769],\n",
+ " [ 3.84615385]])]\n",
+ "I1=7.69 A\n",
+ "I2=3.85 A\n",
+ "\n",
+ "Writing Vth equation, \n",
+ " Vth = 11.47 V\n",
+ "\n",
+ "R1 = 0.73 \n",
+ "R2 = 1.82 \n",
+ "R3 = 0.91 Ohm \n",
+ "\n",
+ "Rth = 3.27 Ohm\n",
+ "\n",
+ "IL = 1.83 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex18-pg3.21"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 2\n",
+ "##pg no 3.21\n",
+ "##example 3.18\n",
+ "print(\"removing the 20 Ohm resistor from the network\");\n",
+ "print(\"Applying KVL to mesh 1\");\n",
+ "print(\"30*I1-15*I2=-75\");##equation 1\n",
+ "print(\"Applying KVL to mesh 2\");\n",
+ "print(\"-15*I1+20*I2=20\");##equation 2\n",
+ "import math\n",
+ "import numpy\n",
+ "from numpy import linalg\n",
+ "A=numpy.matrix([[30, -15],[-15 ,20]]);##solving equation in matrix form\n",
+ "B=numpy.matrix([[-75] ,[20]])\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B);\n",
+ "print[X];\n",
+ "print(\"I1=-3.2 A\");\n",
+ "print(\"I2=-1.4 A\");\n",
+ "##Calculation of Vth (Thevenin's voltage)\n",
+ "a=-3.2;\n",
+ "b=-1.4;\n",
+ "v=45.;\n",
+ "v1=45.-10.*(a-b);\n",
+ "print\"%s %.2f %s\"%(\"\\nWriting Vth equation, \\n Vth = \",v1,\" V\");\n",
+ "##Calculation of Rth (Thevenin's resistance)\n",
+ "x=10.;\n",
+ "y=5.;\n",
+ "z=5.;\n",
+ "##delta into star network\n",
+ "r1=((x*y)/(x+y+z));\n",
+ "r2=((x*z)/(x+y+z));\n",
+ "r3=((z*y)/(x+y+z));\n",
+ "print\"%s %.2f %s %.2f %s %.2f %s\"%(\"\\nR1 = \",r1,\" Ohm\" and \" \\nR2 = \",r2,\" Ohm \" and \"\\nR3 = \",r3,\" Ohm\");\n",
+ "m=16.25;\n",
+ "r=((m*r1)/(m+r1))+r1;\n",
+ "print\"%s %.2f %s\"%(\"\\nRth = \",r,\" Ohm\");\n",
+ "##Claculation of IL (Load Current)\n",
+ "i=v1/(r+20.);\n",
+ "print\"%s %.2f %s\"%(\"\\nIL = \",i,\" A\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "removing the 20 Ohm resistor from the network\n",
+ "Applying KVL to mesh 1\n",
+ "30*I1-15*I2=-75\n",
+ "Applying KVL to mesh 2\n",
+ "-15*I1+20*I2=20\n",
+ "[matrix([[-3.2],\n",
+ " [-1.4]])]\n",
+ "I1=-3.2 A\n",
+ "I2=-1.4 A\n",
+ "\n",
+ "Writing Vth equation, \n",
+ " Vth = 63.00 V\n",
+ "\n",
+ "R1 = 2.50 \n",
+ "R2 = 2.50 \n",
+ "R3 = 1.25 Ohm\n",
+ "\n",
+ "Rth = 4.67 Ohm\n",
+ "\n",
+ "IL = 2.55 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex19-pg3.22"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 2\n",
+ "##pg no 3.22\n",
+ "##example 3.19\n",
+ "print(\"removing the 3 Ohm resistor from the network\");\n",
+ "print(\"Applying KVL to mesh 1\");\n",
+ "print(\"I1=6\");##equation 1\n",
+ "print(\"Applying KVL to mesh 2\");\n",
+ "print(\"-12*I1+18*I2=42\");##equation 2\n",
+ "import math\n",
+ "import numpy\n",
+ "from numpy import linalg\n",
+ "A=numpy.matrix ([[1, 0],[-12 ,18]]);##solving equation in matrix form\n",
+ "B=numpy.matrix ([[6] ,[42]])\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B);\n",
+ "print[X];\n",
+ "print(\"I2= 6.33 A\");\n",
+ "##Calculation of Vth (Thevenin's voltage)\n",
+ "a=6.33;\n",
+ "v=6.*a;\n",
+ "print\"%s %.2f %s\"%(\"\\nWriting Vth equation, \\n Vth = \",v,\" V\");\n",
+ "##Calculation of Rth (Thevenin's resistance)\n",
+ "print(\"replacing the voltage source with short circuit and current source by open circuit\");\n",
+ "x=6.;\n",
+ "y=12.;\n",
+ "r=(x*y)/(x+y);\n",
+ "print\"%s %.2f %s\"%(\"\\nRth = \",r,\" Ohm\");\n",
+ "##Calculation of IL (load current)\n",
+ "i=v/(r+3.);\n",
+ "print\"%s %.2f %s\"%(\"\\nIL = \",i,\" A\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "removing the 3 Ohm resistor from the network\n",
+ "Applying KVL to mesh 1\n",
+ "I1=6\n",
+ "Applying KVL to mesh 2\n",
+ "-12*I1+18*I2=42\n",
+ "[matrix([[ 6. ],\n",
+ " [ 6.33333333]])]\n",
+ "I2= 6.33 A\n",
+ "\n",
+ "Writing Vth equation, \n",
+ " Vth = 37.98 V\n",
+ "replacing the voltage source with short circuit and current source by open circuit\n",
+ "\n",
+ "Rth = 4.00 Ohm\n",
+ "\n",
+ "IL = 5.43 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex20-pg3.23"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 2\n",
+ "##pg no 3.23\n",
+ "##example 3.20\n",
+ "print(\"removing the 30 Ohm resistor from the network\");\n",
+ "print(\"Applying KVL to supermesh \");\n",
+ "print(\"-I1+I2=13\");##equation 1\n",
+ "print(\"15*I1+100*I2=150\");##equation 2\n",
+ "##Calculation of Vth (Thevenin's voltage)\n",
+ "a=3.;\n",
+ "v=(40.*a)-50.;\n",
+ "print\"%s %.2f %s\"%(\"\\nWriting Vth equation, \\n Vth = \",v,\" V\");\n",
+ "##Calculation of Rth (Thevenin's resistance)\n",
+ "print(\"replacing the voltage source with short circuit and current source by open circuit\");\n",
+ "r=(75.*40.)/(75.+40.);\n",
+ "print\"%s %.2f %s\"%(\"\\nRth = \",r,\" Ohm\");\n",
+ "##Calculation of IL (load current)\n",
+ "i=v/(r+30.);\n",
+ "print\"%s %.2f %s\"%(\"\\nIL = \",i,\" A\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "removing the 30 Ohm resistor from the network\n",
+ "Applying KVL to supermesh \n",
+ "-I1+I2=13\n",
+ "15*I1+100*I2=150\n",
+ "\n",
+ "Writing Vth equation, \n",
+ " Vth = 70.00 V\n",
+ "replacing the voltage source with short circuit and current source by open circuit\n",
+ "\n",
+ "Rth = 26.09 Ohm\n",
+ "\n",
+ "IL = 1.25 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex21-pg3.24"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 2\n",
+ "##pg no 3.25\n",
+ "##example 3.21\n",
+ "##Calculation of Vth\n",
+ "v=100.;\n",
+ "r=20.;\n",
+ "x=v/r;\n",
+ "print(\"Removing the 20 Ohm resistor from the network\");\n",
+ "print\"%s %.2f %s\"%(\"\\nVth = \",v,\" V \");\n",
+ "##calculation of Rth\n",
+ "print(\"replacing the voltage source with short circuit and current source by open circuit\");\n",
+ "print(\"Rth = 0\");\n",
+ "##calculation of IL\n",
+ "print\"%s %.2f %s\"%(\"\\nIL = \",x,\" A\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex22-pg3.25"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 2\n",
+ "##pg no 3.25\n",
+ "##example 3.22\n",
+ "print(\"removing the 10 Ohm resistor from the network\");\n",
+ "print(\"Applying KVL to mesh 1\");\n",
+ "print(\"4*I1-I2=-25\");##equation 1\n",
+ "print(\"Applying KVL to mesh 2\");\n",
+ "print(\"-I1+4*I2=10\");##equation 2\n",
+ "import math\n",
+ "import numpy\n",
+ "from numpy import linalg\n",
+ "A=numpy.matrix([[4, -1],[-1 ,4]]);##solving equation in matrix form\n",
+ "B=([[-25] ,[10]])\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B);\n",
+ "print[X];\n",
+ "print(\"I1=-6 A\");\n",
+ "print(\"I2=1 A\");\n",
+ "##Calculation of Vth (Thevenin's voltage)\n",
+ "a=-6.;\n",
+ "b=1.;\n",
+ "v=-((2.*a)+(2.*b));##the terminal B is positive w.r.t A\n",
+ "print\"%s %.2f %s\"%(\"\\nWriting Vth equation, \\n Vth = \",v,\" V\");\n",
+ "##Calculation of Rth (Thevenin's resistance)\n",
+ "x=2.;\n",
+ "y=2.;\n",
+ "z=1.;\n",
+ "##star into delta network\n",
+ "r1=x+y+((x*y)/z);\n",
+ "r2=x+z+((x*z)/y);\n",
+ "r3=z+y+((z*y)/x);\n",
+ "print\"%s %.2f %s %.2f %s %.2f %s \"%(\"\\nR1 = \",r1,\" Ohm\" and \" \\nR2 = \",r2,\" Ohm\" and \"\\nR3 = \",r3,\" Ohm\");\n",
+ "##Claculation of IL (Load Current)\n",
+ "r=1.33;\n",
+ "i=v/(r+v);\n",
+ "print\"%s %.2f %s\"%(\"\\nIL = \",i,\" A\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "removing the 10 Ohm resistor from the network\n",
+ "Applying KVL to mesh 1\n",
+ "4*I1-I2=-25\n",
+ "Applying KVL to mesh 2\n",
+ "-I1+4*I2=10\n",
+ "[matrix([[-6.],\n",
+ " [ 1.]])]\n",
+ "I1=-6 A\n",
+ "I2=1 A\n",
+ "\n",
+ "Writing Vth equation, \n",
+ " Vth = 10.00 V\n",
+ "\n",
+ "R1 = 8.00 \n",
+ "R2 = 4.00 \n",
+ "R3 = 4.00 Ohm \n",
+ "\n",
+ "IL = 0.88 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex23-pg3.28"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 2\n",
+ "##pg no 3.28\n",
+ "##example 3.23\n",
+ "print(\"removing the 1 Ohm resistor from the network\");\n",
+ "print(\"writing current equation for meshes 1 & 2 \");\n",
+ "print(\"I1= -3 A\");##equation 1\n",
+ "print(\"I2=1 A\");##equation 2\n",
+ "##Calculation of Vth (Thevenin's voltage)\n",
+ "a=-3.;\n",
+ "b=1.;\n",
+ "r=2.;\n",
+ "v=4.-2.*(a-b);\n",
+ "print\"%s %.2f %s\"%(\"\\nWriting Vth equation, \\n Vth = \",v,\" V\");\n",
+ "##Calculation of Rth (Thevenin's resistance)\n",
+ "print(\"replacing the voltage source with short circuit and current source by open circuit\");\n",
+ "print(\"Rth = 2 Ohm\");\n",
+ "##Calculation of IL (load current)\n",
+ "i=v/(r+1.);\n",
+ "print\"%s %.2f %s\"%(\"\\nIL = \",i,\" A\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "removing the 1 Ohm resistor from the network\n",
+ "writing current equation for meshes 1 & 2 \n",
+ "I1= -3 A\n",
+ "I2=1 A\n",
+ "\n",
+ "Writing Vth equation, \n",
+ " Vth = 12.00 V\n",
+ "replacing the voltage source with short circuit and current source by open circuit\n",
+ "Rth = 2 Ohm\n",
+ "\n",
+ "IL = 4.00 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex24-pg3.29"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 1\n",
+ "##page no-3.29\n",
+ "##example3.24\n",
+ "##calculation of Isc (short-circuit current)\n",
+ "print(\"Applying KVL to mesh 1:\");\n",
+ "print(\"I1=2\");##equation 1\n",
+ "print(\"Writing current equation to supermesh:\");##meshes 2 & 3 will form a supermesh \n",
+ "print(\"I3-I2=4\");##equation 2\n",
+ "print(\"Applying KVL to supermesh:\");\n",
+ "print(\"-5I2-15I3=0\");##equation 3\n",
+ "print(\"solving these equations we get :\");##solving equations in matrix form\n",
+ "import math\n",
+ "import numpy\n",
+ "from numpy import linalg\n",
+ "A=([[1, 0 ,0],[0 ,-1, 1],[0 ,-5, -15]]);\n",
+ "B=([[2], [4] ,[0]])\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B);\n",
+ "print[X];\n",
+ "print(\"I1 = 2 A\");\n",
+ "print(\"I2 = -3 A\");\n",
+ "print(\"I3 = 1 A\");\n",
+ "a=2.;\n",
+ "b=-3.;\n",
+ "x=a-b;\n",
+ "print\"%s %.2f %s\"%(\"\\nIsc = \",x,\" A\");\n",
+ "##calculation of Rn (norton's resistance)\n",
+ "print(\"replacing the voltage source with short circuit and current source by open circuit\");\n",
+ "c=1.;\n",
+ "m=15.;\n",
+ "y=(c*(m+x))/(c+m+x);\n",
+ "print\"%s %.2f %s\"%(\"\\nRn = \",y,\" Ohm\");\n",
+ "##calculation of IL (load current)\n",
+ "z=10.;\n",
+ "i=x*(y/(z+y));\n",
+ "print\"%s %.2f %s\"%(\"\\nIL = \",i,\" A\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Applying KVL to mesh 1:\n",
+ "I1=2\n",
+ "Writing current equation to supermesh:\n",
+ "I3-I2=4\n",
+ "Applying KVL to supermesh:\n",
+ "-5I2-15I3=0\n",
+ "solving these equations we get :\n",
+ "[array([[ 2.],\n",
+ " [-3.],\n",
+ " [ 1.]])]\n",
+ "I1 = 2 A\n",
+ "I2 = -3 A\n",
+ "I3 = 1 A\n",
+ "\n",
+ "Isc = 5.00 A\n",
+ "replacing the voltage source with short circuit and current source by open circuit\n",
+ "\n",
+ "Rn = 0.95 Ohm\n",
+ "\n",
+ "IL = 0.43 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex25-pg3.30"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 1\n",
+ "##page no-3.30\n",
+ "##example3.25\n",
+ "##calculation of Isc (short-circuit current)\n",
+ "print(\"Applying KVL to mesh 1:\");\n",
+ "print(\"7*I1-2*I2=20\");##equation 1\n",
+ "print(\"Applying KVL to mesh 2,\"); \n",
+ "print(\"-2*I1+10*I2=-12\");##equation 2\n",
+ "print(\"solving these equations we get :\");##solving equations in matrix form\n",
+ "import numpy\n",
+ "from numpy import linalg\n",
+ "A=numpy.matrix([[7, -2],[-2 ,10]]);##solving equation in matrix form\n",
+ "B=([[20] ,[-12]])\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B);\n",
+ "print[X];\n",
+ "print(\"I2 = -0.67 A\");\n",
+ "a=-0.67;\n",
+ "print\"%s %.2f %s\"%(\"\\nIsc = I2 = \",a,\" A\");\n",
+ "##calculation of Rn (norton's resistance)\n",
+ "print(\"replacing the voltage source with short circuit \");\n",
+ "b=5.;\n",
+ "c=2.;\n",
+ "d=8.;\n",
+ "y=((b*c)/(b+c))+d;\n",
+ "print\"%s %.2f %s\"%(\"\\nRn = \",y,\" Ohm\");\n",
+ "##calculation of IL (load current)\n",
+ "z=10.;\n",
+ "i=-a*(y/(10.+y));\n",
+ "print\"%s %.2f %s\"%(\"\\nIL = \",i,\" A\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Applying KVL to mesh 1:\n",
+ "7*I1-2*I2=20\n",
+ "Applying KVL to mesh 2,\n",
+ "-2*I1+10*I2=-12\n",
+ "solving these equations we get :\n",
+ "[matrix([[ 2.66666667],\n",
+ " [-0.66666667]])]\n",
+ "I2 = -0.67 A\n",
+ "\n",
+ "Isc = I2 = -0.67 A\n",
+ "replacing the voltage source with short circuit \n",
+ "\n",
+ "Rn = 9.43 Ohm\n",
+ "\n",
+ "IL = 0.33 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex26-pg3.31"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 1\n",
+ "##page no-3.31\n",
+ "##example3.26\n",
+ "##calculation of Isc (short-circuit current)\n",
+ "print(\"Applying KVL to mesh 1:\");\n",
+ "print(\"7*I1-I2=10\");##equation 1\n",
+ "print(\"Applying KVL to mesh 2:\"); \n",
+ "print(\"-I1+6*I2-3*I3=0\");##equation 2\n",
+ "print(\"Applying KVL to mesh 3:\");\n",
+ "print(\"3*I2-3*I3=20\");##equation 3\n",
+ "print(\"solving these equations we get :\");##solving equations in matrix form\n",
+ "import math\n",
+ "import numpy\n",
+ "from numpy import linalg\n",
+ "A=([[7, -1 ,0],[-1 ,6, -3],[0 ,3, -3]]);\n",
+ "B=([[10], [0] ,[20]])\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B);\n",
+ "print[X];\n",
+ "print(\"I1 = -13.17 A\");\n",
+ "a=13.17;\n",
+ "print\"%s %.2f %s\"%(\"\\nIsc = \",a,\" A\");\n",
+ "##calculation of Rn (norton's resistance)\n",
+ "print(\"replacing the voltage source with short circuit \");\n",
+ "c=1.;\n",
+ "b=6.;\n",
+ "x=(c*b)/(c+b);\n",
+ "y=x+2.;\n",
+ "z=(y*3.)/(y+3.);\n",
+ "print\"%s %.2f %s\"%(\"\\nRn = \",z,\" Ohm\");\n",
+ "##calculation of IL (load current)\n",
+ "n=10.;\n",
+ "i=a*(z/(z+n));\n",
+ "print\"%s %.2f %s\"%(\"\\nIL = \",i,\" A\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Applying KVL to mesh 1:\n",
+ "7*I1-I2=10\n",
+ "Applying KVL to mesh 2:\n",
+ "-I1+6*I2-3*I3=0\n",
+ "Applying KVL to mesh 3:\n",
+ "3*I2-3*I3=20\n",
+ "solving these equations we get :\n",
+ "[array([[ 0.5 ],\n",
+ " [ -6.5 ],\n",
+ " [-13.16666667]])]\n",
+ "I1 = -13.17 A\n",
+ "\n",
+ "Isc = 13.17 A\n",
+ "replacing the voltage source with short circuit \n",
+ "\n",
+ "Rn = 1.46 Ohm\n",
+ "\n",
+ "IL = 1.68 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex27-pg3.32"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 1\n",
+ "##page no-3.32\n",
+ "##example3.27\n",
+ "##calculation of Isc (short-circuit current)\n",
+ "print(\"Applying KVL to mesh 1:\");\n",
+ "print(\"20*I1-20*I2=10\");##equation 1\n",
+ "print(\"Applying KVL to mesh 2:\"); \n",
+ "print(\"-20*I1+60*I2-20*I3=40\");##equation 2\n",
+ "print(\"Applying KVL to mesh 3:\");\n",
+ "print(\"-20*I2+50*I3=-100\");##equation 3\n",
+ "print(\"solving these equations we get :\");##solving equations in matrix form\n",
+ "import math\n",
+ "import numpy\n",
+ "from numpy import linalg\n",
+ "A=([[20, -20 ,0],[-20 ,60, -20],[0 ,-20, -50]]);\n",
+ "B=([[10], [40] ,[-100]])\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B);\n",
+ "print[X];\n",
+ "print(\"I1 = 0.81A\");\n",
+ "a=0.81;\n",
+ "print\"%s %.2f %s\"%(\"\\nIsc = \",a,\" A\");\n",
+ "##calculation of Rn (norton's resistance)\n",
+ "print(\"replacing the voltage source with short circuit \");\n",
+ "c=20.;\n",
+ "b=30.;\n",
+ "x=(c*b)/(c+b);\n",
+ "y=x+c;\n",
+ "z=(y*c)/(y+c);\n",
+ "print\"%s %.2f %s\"%(\"\\nRn = \",z,\" Ohm\");\n",
+ "##calculation of IL (load current)\n",
+ "n=10.;\n",
+ "i=a*(z/(z+n));\n",
+ "print\"%s %.2f %s\"%(\"\\nIL = \",i,\" A\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Applying KVL to mesh 1:\n",
+ "20*I1-20*I2=10\n",
+ "Applying KVL to mesh 2:\n",
+ "-20*I1+60*I2-20*I3=40\n",
+ "Applying KVL to mesh 3:\n",
+ "-20*I2+50*I3=-100\n",
+ "solving these equations we get :\n",
+ "[array([[ 2.375],\n",
+ " [ 1.875],\n",
+ " [ 1.25 ]])]\n",
+ "I1 = 0.81A\n",
+ "\n",
+ "Isc = 0.81 A\n",
+ "replacing the voltage source with short circuit \n",
+ "\n",
+ "Rn = 12.31 Ohm\n",
+ "\n",
+ "IL = 0.45 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex28-pg3.33"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 1\n",
+ "##page no-3.33\n",
+ "##example3.28\n",
+ "##calculation of Isc (short-circuit current)\n",
+ "print(\"Applying KVL to mesh 1:\");\n",
+ "print(\"90*I1-60*I2=120\");##equation 1\n",
+ "print(\"Applying KVL to mesh 2:\"); \n",
+ "print(\"-60*I1+100*I2-30*I3=40\");##equation 2\n",
+ "print(\"Applying KVL to mesh 3:\");\n",
+ "print(\"30*I2-30*I3=-10\");##equation 3\n",
+ "print(\"solving these equations we get :\");##solving equations in matrix form\n",
+ "import math\n",
+ "import numpy\n",
+ "from numpy import linalg\n",
+ "A=([[90, -60 ,0],[-60 ,100, -30],[0 ,30, -30]]);\n",
+ "B=([[102], [40] ,[-10]])\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B);\n",
+ "print[X];\n",
+ "print(\"I3 = 4.67A\");\n",
+ "a=4.67;\n",
+ "print\"%s %.2f %s\"%(\"\\nIsc = \",a,\" A\");\n",
+ "##calculation of Rn (norton's resistance)\n",
+ "print(\"replacing the voltage source with short circuit \");\n",
+ "c=30.;\n",
+ "b=60.;\n",
+ "x=(c*b)/(c+b);\n",
+ "y=x+10.;\n",
+ "z=(y*c)/(y+c);\n",
+ "print\"%s %.2f %s\"%(\"\\nRn = \",z,\" Ohm\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Applying KVL to mesh 1:\n",
+ "90*I1-60*I2=120\n",
+ "Applying KVL to mesh 2:\n",
+ "-60*I1+100*I2-30*I3=40\n",
+ "Applying KVL to mesh 3:\n",
+ "30*I2-30*I3=-10\n",
+ "solving these equations we get :\n",
+ "[array([[ 3.75555556],\n",
+ " [ 3.93333333],\n",
+ " [ 4.26666667]])]\n",
+ "I3 = 4.67A\n",
+ "\n",
+ "Isc = 4.67 A\n",
+ "replacing the voltage source with short circuit \n",
+ "\n",
+ "Rn = 15.00 Ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex29-pg3.34"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 1\n",
+ "##page no-3.34\n",
+ "##example3.29\n",
+ "##calculation of Isc (short-circuit current)\n",
+ "print(\"Writing current equation for supermesh :\");\n",
+ "print(\"I2-I1=2\");##equation 1\n",
+ "print(\"Applying KVL to supermesh ,\"); \n",
+ "print(\"12*I1= 55\");##equation 2\n",
+ "print(\"solving these equations we get :\");##solving equations in matrix form\n",
+ "import numpy\n",
+ "from numpy import linalg\n",
+ "A=numpy.matrix([[-1, 1],[12 ,0]]);##solving equation in matrix form\n",
+ "B=([[2] ,[55]])\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B);\n",
+ "print[X];\n",
+ "print(\"I1 = 4.58 A\");\n",
+ "print(\"I2 = 6.58 A\");\n",
+ "a=6.58;\n",
+ "print\"%s %.2f %s\"%(\"\\nIsc = I2 = \",a,\" A\");\n",
+ "##calculation of Rn (norton's resistance)\n",
+ "print(\"replacing the voltage source with short circuit and current source with open circuit \");\n",
+ "b=12.;\n",
+ "c=4.;\n",
+ "y=((b*c)/(b+c));\n",
+ "print\"%s %.2f %s\"%(\"\\nRn = \",y,\" Ohm\");\n",
+ "##calculation of IL (load current)\n",
+ "z=8.;\n",
+ "i=a*(y/(z+y));\n",
+ "print\"%s %.2f %s\"%(\"\\nIL = \",i,\" A\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Writing current equation for supermesh :\n",
+ "I2-I1=2\n",
+ "Applying KVL to supermesh ,\n",
+ "12*I1= 55\n",
+ "solving these equations we get :\n",
+ "[matrix([[ 4.58333333],\n",
+ " [ 6.58333333]])]\n",
+ "I1 = 4.58 A\n",
+ "I2 = 6.58 A\n",
+ "\n",
+ "Isc = I2 = 6.58 A\n",
+ "replacing the voltage source with short circuit and current source with open circuit \n",
+ "\n",
+ "Rn = 3.00 Ohm\n",
+ "\n",
+ "IL = 1.79 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex30-pg3.35"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 1\n",
+ "##page no-3.35\n",
+ "##example3.30\n",
+ "##calculation of Isc (short-circuit current)\n",
+ "print(\"Applying KVL to mesh 1:\");\n",
+ "print(\"5*I1-2*I2=-2\");##equation 1\n",
+ "print(\"Applying KVL to mesh 2:\"); \n",
+ "print(\"4*I2-2*I3=-1\");##equation 2\n",
+ "print(\"Applying KVL to mesh 3:\");\n",
+ "print(\"-2*I1-2*I2+4*I3=0\");##equation 3\n",
+ "print(\"solving these equations we get :\");##solving equations in matrix form\n",
+ "import math\n",
+ "import numpy\n",
+ "from numpy import linalg\n",
+ "A=([[5, -2 ,0],[0 ,4, -2],[-2,-2, 4]]);\n",
+ "B=([[-2], [-1] ,[0]])\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B);\n",
+ "print[X];\n",
+ "print(\"I1 = -0.64A\");\n",
+ "print(\"I2 = -0.55A\");\n",
+ "print(\"I3 = -0.59A\");\n",
+ "a=-0.64;\n",
+ "b=-0.55;\n",
+ "c=-0.59;\n",
+ "print\"%s %.2f %s\"%(\"\\nIsc = I3 = \",a,\" A\");\n",
+ "##calculation of Rn (norton's resistance)\n",
+ "print(\"replacing the voltage source with short circuit \");\n",
+ "z=2.2;\n",
+ "print\"%s %.2f %s\"%(\"\\nRn = \",z,\" Ohm\");\n",
+ "##calculation of IL (load current)\n",
+ "n=1.;\n",
+ "i=-c*(z/(z+n));\n",
+ "print\"%s %.2f %s\"%(\"\\nIL = \",i,\" A\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Applying KVL to mesh 1:\n",
+ "5*I1-2*I2=-2\n",
+ "Applying KVL to mesh 2:\n",
+ "4*I2-2*I3=-1\n",
+ "Applying KVL to mesh 3:\n",
+ "-2*I1-2*I2+4*I3=0\n",
+ "solving these equations we get :\n",
+ "[array([[-0.61538462],\n",
+ " [-0.53846154],\n",
+ " [-0.57692308]])]\n",
+ "I1 = -0.64A\n",
+ "I2 = -0.55A\n",
+ "I3 = -0.59A\n",
+ "\n",
+ "Isc = I3 = -0.64 A\n",
+ "replacing the voltage source with short circuit \n",
+ "\n",
+ "Rn = 2.20 Ohm\n",
+ "\n",
+ "IL = 0.41 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex31-pg3.37"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 1\n",
+ "##page no-3.39\n",
+ "##example3.31\n",
+ "##calculation of Vth (Thevenin's voltage)\n",
+ "a=0.25;\n",
+ "import math\n",
+ "import numpy\n",
+ "from numpy import linalg\n",
+ "v=(10.*a)+(8.*a);\n",
+ "print(\"Writing Vth equation,\");\n",
+ "print'%s %.2f %s'%(\"\\nVth = \",v,\" V\");\n",
+ "##calculation of Isc (short-circuit current)\n",
+ "print(\"Applying KVL to mesh 1:\");\n",
+ "print(\"4*I1-2*I2 = 1\");##equation 1\n",
+ "print(\"Applying KVL to mesh 2:\"); \n",
+ "print(\"-18*I1-11*I2=0\");##equation 2\n",
+ "A=numpy.matrix([[4, -2],[8 ,-11]]);##solving equation in matrix form\n",
+ "B=([[1] ,[0]])\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B);\n",
+ "\n",
+ "print[X];\n",
+ "print(\"I2 = 2.25 A\");\n",
+ "a=2.25;\n",
+ "print'%s %.2f %s'%(\"\\nIsc = I2 = \",a,\" A\");\n",
+ "##Calculation of Rth\n",
+ "x=v/a;\n",
+ "print'%s %.2f %s'%(\"\\nRth = \",x,\" Ohm\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Writing Vth equation,\n",
+ "\n",
+ "Vth = 4.50 V\n",
+ "Applying KVL to mesh 1:\n",
+ "4*I1-2*I2 = 1\n",
+ "Applying KVL to mesh 2:\n",
+ "-18*I1-11*I2=0\n",
+ "[matrix([[ 0.39285714],\n",
+ " [ 0.28571429]])]\n",
+ "I2 = 2.25 A\n",
+ "\n",
+ "Isc = I2 = 2.25 A\n",
+ "\n",
+ "Rth = 2.00 Ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex33-pg3.39"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 1\n",
+ "##page no-3.39\n",
+ "##example3.33\n",
+ "##calculation of Vth (Thevenin's voltage)\n",
+ "a=0.25;\n",
+ "import numpy\n",
+ "from numpy import linalg\n",
+ "v=(10.*a)+(8.*a);\n",
+ "print(\"Writing Vth equation,\");\n",
+ "print'%s %.2f %s'%(\"\\nVth = \",v,\" V\");\n",
+ "##calculation of Isc (short-circuit current)\n",
+ "print(\"Applying KVL to mesh 1:\");\n",
+ "print(\"4*I1-2*I2 = 1\");##equation 1\n",
+ "print(\"Applying KVL to mesh 2:\"); \n",
+ "print(\"-18*I1-11*I2=0\");##equation 2\n",
+ "A=numpy.matrix([[4, -2],[8 ,-11]]);##solving equation in matrix form\n",
+ "B=([[1] ,[0]])\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B);\n",
+ "\n",
+ "print[X];\n",
+ "print(\"I2 = 2.25 A\");\n",
+ "a=2.25;\n",
+ "print'%s %.2f %s'%(\"\\nIsc = I2 = \",a,\" A\");\n",
+ "##Calculation of Rth\n",
+ "x=v/a;\n",
+ "print'%s %.2f %s'%(\"\\nRth = \",x,\" Ohm\");\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "import numpy\n",
+ "from numpy import linalg\n",
+ "A=numpy.matrix([[4, -2],[8 ,-11]]);##solving equation in matrix form\n",
+ "B=([[1] ,[0]])\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B);\n",
+ "\n",
+ "print[X];"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Writing Vth equation,\n",
+ "\n",
+ "Vth = 4.50 V\n",
+ "Applying KVL to mesh 1:\n",
+ "4*I1-2*I2 = 1\n",
+ "Applying KVL to mesh 2:\n",
+ "-18*I1-11*I2=0\n",
+ "[matrix([[ 0.39285714],\n",
+ " [ 0.28571429]])]\n",
+ "I2 = 2.25 A\n",
+ "\n",
+ "Isc = I2 = 2.25 A\n",
+ "\n",
+ "Rth = 2.00 Ohm\n",
+ "[matrix([[ 0.39285714],\n",
+ " [ 0.28571429]])]\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex41-pg3.47"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 1\n",
+ "##page no-3.47\n",
+ "##example3.41\n",
+ "##calculation of Vth\n",
+ "print(\"Removing the variable resistor RL from the network:\");\n",
+ "print(\"I2-I1=4\");##equation 1\n",
+ "print(\"Applying KVL at the outerpath:\"); \n",
+ "print(\"-6*I1-5*I2=2\");##equation 2\n",
+ "import numpy\n",
+ "from numpy import linalg\n",
+ "A=numpy.matrix([[-1, 1],[-6 ,-5]]);##solving equation in matrix form\n",
+ "B=([[4] ,[2]])\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B);\n",
+ "\n",
+ "print[X];\n",
+ "print(\"I1 = -2 A\");\n",
+ "print(\"I2 = 2 A\");\n",
+ "print(\"Writing Vth equation,\");\n",
+ "a=-2;\n",
+ "v=8-a;\n",
+ "print'%s %.2f %s'%(\"\\nVth = \",v,\" V\");\n",
+ "##calculation of Rth\n",
+ "print(\"replacing the voltage source with short circuit and current source by an open circuit \");\n",
+ "x=(v*1.)/(v+1.);\n",
+ "print'%s %.2f %s'%(\"\\nRth = \",x,\" Ohm\");\n",
+ "##calculation of RL\n",
+ "print(\"For maximum power transfer\");\n",
+ "print'%s %.2f %s'%(\"\\nRth = RL = \",x,\" Ohm\");\n",
+ "##calculation of Pmax\n",
+ "m=(v**2)/(4.*x);\n",
+ "print'%s %.2f %s'%(\"\\nPmax = \",m,\" W\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Removing the variable resistor RL from the network:\n",
+ "I2-I1=4\n",
+ "Applying KVL at the outerpath:\n",
+ "-6*I1-5*I2=2\n",
+ "[matrix([[-2.],\n",
+ " [ 2.]])]\n",
+ "I1 = -2 A\n",
+ "I2 = 2 A\n",
+ "Writing Vth equation,\n",
+ "\n",
+ "Vth = 10.00 V\n",
+ "replacing the voltage source with short circuit and current source by an open circuit \n",
+ "\n",
+ "Rth = 0.91 Ohm\n",
+ "For maximum power transfer\n",
+ "\n",
+ "Rth = RL = 0.91 Ohm\n",
+ "\n",
+ "Pmax = 27.50 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex42-pg3.48"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 1\n",
+ "##page no-3.48\n",
+ "##example3.42\n",
+ "##calculation of Vth\n",
+ "print(\"Removing the variable resistor RL from the network:\");\n",
+ "print(\"I1=50\");##equation 1\n",
+ "print(\"Applying KVL to mesh 2:\"); \n",
+ "print(\"5*I1-10*I2=0\");##equation 2\n",
+ "import numpy\n",
+ "from numpy import linalg\n",
+ "A=numpy.matrix([[1, 0],[5 ,-10]]);##solving equation in matrix form\n",
+ "B=([[50] ,[0]])\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B);\n",
+ "\n",
+ "print[X];\n",
+ "\n",
+ "print(\"I2 = 25 A\");\n",
+ "print(\"Writing Vth equation,\");\n",
+ "a=25;\n",
+ "v=3*a;\n",
+ "print'%s %.2f %s'%(\"\\nVth = \",v,\" V\");\n",
+ "##calculation of Rth\n",
+ "print(\"replacing the current source of 50 A by an open circuit \");\n",
+ "x=7.;\n",
+ "y=3.;\n",
+ "m=(x*y)/(x+y);\n",
+ "print'%s %.2f %s'%(\"\\nRth = \",m,\" Ohm\");\n",
+ "##calculation of RL\n",
+ "print(\"For maximum power transfer\");\n",
+ "print'%s %.2f %s'%(\"\\nRth = RL = \",m,\" Ohm\");\n",
+ "##calculation of Pmax\n",
+ "n=(v**2)/(4.*m);\n",
+ "print'%s %.2f %s'%(\"\\nPmax = \",n,\" W\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Removing the variable resistor RL from the network:\n",
+ "I1=50\n",
+ "Applying KVL to mesh 2:\n",
+ "5*I1-10*I2=0\n",
+ "[matrix([[ 50.],\n",
+ " [ 25.]])]\n",
+ "I2 = 25 A\n",
+ "Writing Vth equation,\n",
+ "\n",
+ "Vth = 75.00 V\n",
+ "replacing the current source of 50 A by an open circuit \n",
+ "\n",
+ "Rth = 2.10 Ohm\n",
+ "For maximum power transfer\n",
+ "\n",
+ "Rth = RL = 2.10 Ohm\n",
+ "\n",
+ "Pmax = 669.64 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex43-pg3.49"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 1\n",
+ "##page no-3.49\n",
+ "##example3.43\n",
+ "##calculation of Vth\n",
+ "print(\"Removing the variable resistor RL from the network:\");\n",
+ "print(\"Writing the current equation for the supermesh\");\n",
+ "print(\"I2-I1=6\");##equation 1\n",
+ "print(\"Applying KVL to the supermesh :\"); \n",
+ "print(\"5*I1+2*I2=10\");##equation 2\n",
+ "import numpy\n",
+ "from numpy import linalg\n",
+ "A=numpy.matrix([[-1, 1],[5 ,1]]);##solving equation in matrix form\n",
+ "B=([[6] ,[10]])\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B);\n",
+ "\n",
+ "print[X];\n",
+ "\n",
+ "print(\"I1 = -0.29 A\");\n",
+ "print(\"I2 = 5.71 A\");\n",
+ "print(\"Writing Vth equation,\");\n",
+ "a=5.71;\n",
+ "v=2*a;\n",
+ "print'%s %.2f %s'%(\"\\nVth = \",v,\" V\");\n",
+ "##calculation of Rth\n",
+ "print(\"replacing the current source of 50 A by an open circuit \");\n",
+ "x=5.;\n",
+ "y=2.;\n",
+ "m=((x*y)/(x+y))+3.+4.;\n",
+ "print'%s %.2f %s'%(\"\\nRth = \",m,\" Ohm\");\n",
+ "##calculation of RL\n",
+ "print(\"For maximum power transfer\");\n",
+ "print'%s %.2f %s'%(\"\\nRth = RL = \",m,\" Ohm\");\n",
+ "##calculation of Pmax\n",
+ "n=(v**2)/(4.*m);\n",
+ "print'%s %.2f %s'%(\"\\nPmax = \",n,\" W\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Removing the variable resistor RL from the network:\n",
+ "Writing the current equation for the supermesh\n",
+ "I2-I1=6\n",
+ "Applying KVL to the supermesh :\n",
+ "5*I1+2*I2=10\n",
+ "[matrix([[ 0.66666667],\n",
+ " [ 6.66666667]])]\n",
+ "I1 = -0.29 A\n",
+ "I2 = 5.71 A\n",
+ "Writing Vth equation,\n",
+ "\n",
+ "Vth = 11.42 V\n",
+ "replacing the current source of 50 A by an open circuit \n",
+ "\n",
+ "Rth = 8.43 Ohm\n",
+ "For maximum power transfer\n",
+ "\n",
+ "Rth = RL = 8.43 Ohm\n",
+ "\n",
+ "Pmax = 3.87 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex44-pg3.50"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 1\n",
+ "##page no-3.50\n",
+ "##example3.44\n",
+ "##calculation of Vth\n",
+ "print(\"Removing the variable resistor RL from the network:\");\n",
+ "print(\"Applying KVL to mesh 1\");\n",
+ "print(\"15*I1-5*I2=120\");##equation 1\n",
+ "print(\"Applying KVL to the mesh 2:\"); \n",
+ "print(\"I2=-6\");##equation 2\n",
+ "import numpy\n",
+ "from numpy import linalg\n",
+ "A=numpy.matrix([[15, -5],[0 ,1]]);##solving equation in matrix form\n",
+ "B=([[120] ,[-6]])\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B);\n",
+ "\n",
+ "print[X];\n",
+ "\n",
+ "print(\"I1 = 6 A\");\n",
+ "print(\"Writing Vth equation,\");\n",
+ "a=6.;\n",
+ "v=120.-(10.*a);\n",
+ "print'%s %.2f %s'%(\"\\nVth = \",v,\" V\");\n",
+ "##calculation of Rth\n",
+ "print(\"replacing the current source of 50 A by an open circuit \");\n",
+ "x=10.;\n",
+ "y=5.;\n",
+ "m=((x*y)/(x+y));\n",
+ "print'%s %.2f %s'%(\"\\nRth = \",m,\" Ohm\");\n",
+ "##calculation of RL\n",
+ "print(\"For maximum power transfer\");\n",
+ "print'%s %.2f %s'%(\"\\nRth = RL = \",m,\" Ohm\");\n",
+ "##calculation of Pmax\n",
+ "n=(v**2)/(4.*m);\n",
+ "print'%s %.2f %s'%(\"\\nPmax = \",n,\" W\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Removing the variable resistor RL from the network:\n",
+ "Applying KVL to mesh 1\n",
+ "15*I1-5*I2=120\n",
+ "Applying KVL to the mesh 2:\n",
+ "I2=-6\n",
+ "[matrix([[ 6.],\n",
+ " [-6.]])]\n",
+ "I1 = 6 A\n",
+ "Writing Vth equation,\n",
+ "\n",
+ "Vth = 60.00 V\n",
+ "replacing the current source of 50 A by an open circuit \n",
+ "\n",
+ "Rth = 3.33 Ohm\n",
+ "For maximum power transfer\n",
+ "\n",
+ "Rth = RL = 3.33 Ohm\n",
+ "\n",
+ "Pmax = 270.00 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex45-pg3.45"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 1\n",
+ "##page no-3.51\n",
+ "##example3.45\n",
+ "\n",
+ "##calculation of Vth\n",
+ "print(\"Removing the variable resistor RL from the network:\");\n",
+ "print(\"I1=3 A\");##equation 1\n",
+ "print(\"Applying KVL to the mesh 2:\"); \n",
+ "print(\"-25*I1+41*I2=0\");##equation 2\n",
+ "import numpy\n",
+ "from numpy import linalg\n",
+ "A=numpy.matrix([[1, 0],[-25 ,41]]);##solving equation in matrix form\n",
+ "B=([[3] ,[0]])\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B);\n",
+ "\n",
+ "print[X];\n",
+ "\n",
+ "print(\"I2 = 1.83 A\");\n",
+ "print(\"Writing Vth equation,\");\n",
+ "a=1.83;\n",
+ "v=-20.+(10.*a)+(6.*a);\n",
+ "print'%s %.2f %s'%(\"\\nVth = \",v,\" V\");\n",
+ "##calculation of Rth\n",
+ "print(\"replacing the current source of 50 A by an open circuit \");\n",
+ "x=25.;\n",
+ "y=16.;\n",
+ "m=((x*y)/(x+y));\n",
+ "print'%s %.2f %s'%(\"\\nRth = \",m,\" Ohm\");\n",
+ "##calculation of RL\n",
+ "print(\"For maximum power transfer\");\n",
+ "print'%s %.2f %s'%(\"\\nRth = RL = \",m,\" Ohm\");\n",
+ "##calculation of Pmax\n",
+ "n=(v**2)/(4.*m);\n",
+ "print'%s %.2f %s'%(\"\\nPmax = \",n,\" W\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Removing the variable resistor RL from the network:\n",
+ "I1=3 A\n",
+ "Applying KVL to the mesh 2:\n",
+ "-25*I1+41*I2=0\n",
+ "[matrix([[ 3. ],\n",
+ " [ 1.82926829]])]\n",
+ "I2 = 1.83 A\n",
+ "Writing Vth equation,\n",
+ "\n",
+ "Vth = 9.28 V\n",
+ "replacing the current source of 50 A by an open circuit \n",
+ "\n",
+ "Rth = 9.76 Ohm\n",
+ "For maximum power transfer\n",
+ "\n",
+ "Rth = RL = 9.76 Ohm\n",
+ "\n",
+ "Pmax = 2.21 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex46-pg3.52"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 1\n",
+ "##page no-3.52\n",
+ "##example3.46\n",
+ "##calculation of Vth\n",
+ "print(\"Removing the variable resistor RL from the network:\");\n",
+ "print(\"I2-I1=2\");##equation 1\n",
+ "print(\"I2=-3 A\");##equation 2\n",
+ "import numpy\n",
+ "from numpy import linalg\n",
+ "A=numpy.matrix([[-1, 1],[0 ,1]]);##solving equation in matrix form\n",
+ "B=([[2] ,[-3]])\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B);\n",
+ "\n",
+ "print[X];\n",
+ "\n",
+ "print(\"I1 = -5 A\");\n",
+ "print(\"Writing Vth equation,\");\n",
+ "a=-5.;\n",
+ "b=-3.;\n",
+ "v=8.-(2.*a)-b-6.;\n",
+ "print'%s %.2f %s'%(\"\\nVth = \",v,\" V\");\n",
+ "##calculation of Rth\n",
+ "print(\"replacing the voltage source with short circuit and current source by an open circuit \");\n",
+ "m=5.;\n",
+ "print'%s %.2f %s'%(\"\\nRth = \",m,\" Ohm\");\n",
+ "##calculation of RL\n",
+ "print(\"For maximum power transfer\");\n",
+ "print'%s %.2f %s'%(\"\\nRth = RL = \",m,\" Ohm\");\n",
+ "##calculation of Pmax\n",
+ "n=(v**2)/(4.*m);\n",
+ "print'%s %.2f %s'%(\"\\nPmax = \",n,\" W\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Removing the variable resistor RL from the network:\n",
+ "I2-I1=2\n",
+ "I2=-3 A\n",
+ "[matrix([[-5.],\n",
+ " [-3.]])]\n",
+ "I1 = -5 A\n",
+ "Writing Vth equation,\n",
+ "\n",
+ "Vth = 15.00 V\n",
+ "replacing the voltage source with short circuit and current source by an open circuit \n",
+ "\n",
+ "Rth = 5.00 Ohm\n",
+ "For maximum power transfer\n",
+ "\n",
+ "Rth = RL = 5.00 Ohm\n",
+ "\n",
+ "Pmax = 11.25 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex47-pg3.53"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 1\n",
+ "##page no-3.52\n",
+ "##example3.46\n",
+ "##calculation of Vth\n",
+ "print(\"Removing the variable resistor RL from the network:\");\n",
+ "print(\"By star-delta transformation\");\n",
+ "a=5.;\n",
+ "b=20.;\n",
+ "c=9.;\n",
+ "v=100.;\n",
+ "i=v/(a+a+b+c+c);\n",
+ "print(\"Writing Vth equation,\");\n",
+ "vth=v-(14.*i);\n",
+ "print'%s %.2f %s'%(\"\\nVth = \",vth,\" V\");\n",
+ "##calculation of Rth\n",
+ "print(\"replacing the voltage source with short circuit \");\n",
+ "m=23.92;\n",
+ "print'%s %.2f %s'%(\"\\nRth = \",m,\" Ohm\");\n",
+ "##calculation of RL\n",
+ "print(\"For maximum power transfer\");\n",
+ "print'%s %.2f %s'%(\"\\nRth = RL = \",m,\" Ohm\");\n",
+ "##calculation of Pmax\n",
+ "n=(vth**2)/(4.*m);\n",
+ "print'%s %.2f %s'%(\"\\nPmax = \",n,\" W\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Removing the variable resistor RL from the network:\n",
+ "By star-delta transformation\n",
+ "Writing Vth equation,\n",
+ "\n",
+ "Vth = 70.83 V\n",
+ "replacing the voltage source with short circuit \n",
+ "\n",
+ "Rth = 23.92 Ohm\n",
+ "For maximum power transfer\n",
+ "\n",
+ "Rth = RL = 23.92 Ohm\n",
+ "\n",
+ "Pmax = 52.44 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex48-pg3.55"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 1\n",
+ "##page no-3.55\n",
+ "##example3.48\n",
+ "##calculation of Vth\n",
+ "print(\"Removing the variable resistor RL from the network:\");\n",
+ "print(\"Applying KVL to the mesh 1:\"); \n",
+ "print(\"35*I1-30*I2=60\");##equation 1\n",
+ "print(\"Applying KVL to the mesh 2:\"); \n",
+ "print(\"I2=2\");##equation 2\n",
+ "import numpy\n",
+ "from numpy import linalg\n",
+ "A=numpy.matrix([[35, -30],[60 ,2]]);##solving equation in matrix form\n",
+ "B=([[60] ,[2]])\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B);\n",
+ "\n",
+ "print[X];\n",
+ "print(\"I1 = 3.43 A\");\n",
+ "print(\"Writing Vth equation,\");\n",
+ "a=3.43;\n",
+ "b=2.;\n",
+ "v=20.*(a-b)+20.;\n",
+ "print'%s %.2f %s'%(\"\\nVth = \",v,\" V\");\n",
+ "##calculation of Rth\n",
+ "print(\"replacing the voltage source with short circuit and current source by an open circuit \");\n",
+ "x=15.;\n",
+ "y=20.;\n",
+ "m=((x*y)/(x+y));\n",
+ "print'%s %.2f %s'%(\"\\nRth = \",m,\" Ohm\");\n",
+ "##calculation of RL\n",
+ "print(\"For maximum power transfer\");\n",
+ "print'%s %.2f %s'%(\"\\nRth = RL = \",m,\" Ohm\");\n",
+ "##calculation of Pmax\n",
+ "n=(v**2)/(4.*m);\n",
+ "print'%s %.2f %s'%(\"\\nPmax = \",n,\" W\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Removing the variable resistor RL from the network:\n",
+ "Applying KVL to the mesh 1:\n",
+ "35*I1-30*I2=60\n",
+ "Applying KVL to the mesh 2:\n",
+ "I2=2\n",
+ "[matrix([[ 0.09625668],\n",
+ " [-1.88770053]])]\n",
+ "I1 = 3.43 A\n",
+ "Writing Vth equation,\n",
+ "\n",
+ "Vth = 48.60 V\n",
+ "replacing the voltage source with short circuit and current source by an open circuit \n",
+ "\n",
+ "Rth = 8.57 Ohm\n",
+ "For maximum power transfer\n",
+ "\n",
+ "Rth = RL = 8.57 Ohm\n",
+ "\n",
+ "Pmax = 68.89 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex49-pg3.56"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 1\n",
+ "##page no-3.56\n",
+ "##example3.49\n",
+ "##calculation of Vth\n",
+ "print(\"Removing the variable resistor RL from the network:\");\n",
+ "x=100.;\n",
+ "a=10.;\n",
+ "b=20.;\n",
+ "c=30.;\n",
+ "d=40.;\n",
+ "i1=x/(a+c);\n",
+ "i2=x/(b+d);\n",
+ "print'%s %.2f %s'%(\"\\nI1 = \",i1,\" A\");\n",
+ "print'%s %.2f %s'%(\"\\ni2 = \",i2,\" A\");\n",
+ "print(\"Writing Vth equation,\");\n",
+ "x=2.5;\n",
+ "y=1.66;\n",
+ "v=(20.*y)-(10.*x);\n",
+ "print'%s %.2f %s'%(\"\\nVth = \",v,\" V\");\n",
+ "##calculation of Rth\n",
+ "print(\"replacing the voltage source of 100V with short circuit \");\n",
+ "m=((a*c)/(a+c))+((b*d)/(b+d));\n",
+ "print'%s %.2f %s'%(\"\\nRth = \",m,\" Ohm\");\n",
+ "##calculation of RL\n",
+ "print(\"For maximum power transfer\");\n",
+ "print'%s %.2f %s'%(\"\\nRth = RL = \",m,\" Ohm\");\n",
+ "##calculation of Pmax\n",
+ "n=(v**2)/(4.*m);\n",
+ "print'%s %.2f %s'%(\"\\nPmax = \",n,\" W\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Removing the variable resistor RL from the network:\n",
+ "\n",
+ "I1 = 2.50 A\n",
+ "\n",
+ "i2 = 1.67 A\n",
+ "Writing Vth equation,\n",
+ "\n",
+ "Vth = 8.20 V\n",
+ "replacing the voltage source of 100V with short circuit \n",
+ "\n",
+ "Rth = 20.83 Ohm\n",
+ "For maximum power transfer\n",
+ "\n",
+ "Rth = RL = 20.83 Ohm\n",
+ "\n",
+ "Pmax = 0.81 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex50-pg3.57"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 1\n",
+ "##page no-3.57\n",
+ "##example3.50\n",
+ "##calculation of Vth\n",
+ "print(\"Removing the variable resistor RL from the network:\");\n",
+ "print(\"Applying KVL to the mesh 1:\"); \n",
+ "print(\"9*I1-3*I2=72\");##equation 1\n",
+ "print(\"Applying KVL to the mesh 2:\"); \n",
+ "print(\"-3*I1+9*I2=0\");##equation 2\n",
+ "import numpy\n",
+ "from numpy import linalg\n",
+ "A=numpy.matrix([[9, -3],[-3 ,9]]);##solving equation in matrix form\n",
+ "B=([[72] ,[0]])\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B);\n",
+ "\n",
+ "print[X];\n",
+ "print(\"I1 = 9 A\");\n",
+ "print(\"I2 = 3 A\");\n",
+ "print(\"Writing Vth equation,\");\n",
+ "a=9.;\n",
+ "b=3.;\n",
+ "v=(6.*a)+(2.*b);\n",
+ "print'%s %.2f %s'%(\"\\nVth = \",v,\" V\");\n",
+ "##calculation of Rth\n",
+ "print(\"replacing the voltage source with short circuit and current source by an open circuit \");\n",
+ "x=6.;\n",
+ "y=2.;\n",
+ "z=4.;\n",
+ "m=((x*b)/(x+b))+2.;\n",
+ "l=((m*z)/(m+z));\n",
+ "print'%s %.2f %s'%(\"\\nRth = \",l,\" Ohm\");\n",
+ "##calculation of RL\n",
+ "print(\"For maximum power transfer\");\n",
+ "print'%s %.2f %s'%(\"\\nRth = RL = \",l,\" Ohm\");\n",
+ "##calculation of Pmax\n",
+ "n=(v**2)/(4.*l);\n",
+ "print'%s %.2f %s'%(\"\\nPmax = \",n,\" W\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Removing the variable resistor RL from the network:\n",
+ "Applying KVL to the mesh 1:\n",
+ "9*I1-3*I2=72\n",
+ "Applying KVL to the mesh 2:\n",
+ "-3*I1+9*I2=0\n",
+ "[matrix([[ 9.],\n",
+ " [ 3.]])]\n",
+ "I1 = 9 A\n",
+ "I2 = 3 A\n",
+ "Writing Vth equation,\n",
+ "\n",
+ "Vth = 60.00 V\n",
+ "replacing the voltage source with short circuit and current source by an open circuit \n",
+ "\n",
+ "Rth = 2.00 Ohm\n",
+ "For maximum power transfer\n",
+ "\n",
+ "Rth = RL = 2.00 Ohm\n",
+ "\n",
+ "Pmax = 450.00 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex51-pg3.58"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Network Theorem 1\n",
+ "##page no-3.58\n",
+ "##example3.51\n",
+ "##Calculation of Vth\n",
+ "print(\"from the figure\");\n",
+ "print(\"Vth=4*I\");\n",
+ "print(\"Applying KVL to the mesh\");\n",
+ "print(\"0.5*Vth-8*I=-12\");\n",
+ "import numpy\n",
+ "from numpy import linalg\n",
+ "A=numpy.matrix([[1, -4],[0.5 ,-8]]);##solving equation in matrix form\n",
+ "B=([[0] ,[-12]])\n",
+ "X=numpy.dot(numpy.linalg.inv(A),B);\n",
+ "\n",
+ "print[X];\n",
+ "\n",
+ "print(\"Vth=8 V\");\n",
+ "##Calculation of Isc\n",
+ "v=8.;\n",
+ "i=12./4.;\n",
+ "print'%s %.2f %s'%(\"\\nIsc = \",i,\" A\");\n",
+ "##Calculation of Rth\n",
+ "r=v/i;\n",
+ "print'%s %.2f %s'%(\"\\nRth = Vth/Isc = \",r,\" Ohm\");\n",
+ "##calculation of RL\n",
+ "print(\"For maximum power transfer\");\n",
+ "print'%s %.2f %s'%(\"\\nRth = RL = \",r,\" Ohm\");\n",
+ "##calculation of Pmax\n",
+ "x=v/(2.*r);\n",
+ "print'%s %.2f %s'%(\"\\nIL = \",x,\" A\");\n",
+ "n=(x**2)*r;\n",
+ "print'%s %.2f %s'%(\"\\nPmax = \",n,\" W\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "from the figure\n",
+ "Vth=4*I\n",
+ "Applying KVL to the mesh\n",
+ "0.5*Vth-8*I=-12\n",
+ "[matrix([[ 8.],\n",
+ " [ 2.]])]\n",
+ "Vth=8 V\n",
+ "\n",
+ "Isc = 3.00 A\n",
+ "\n",
+ "Rth = Vth/Isc = 2.67 Ohm\n",
+ "For maximum power transfer\n",
+ "\n",
+ "Rth = RL = 2.67 Ohm\n",
+ "\n",
+ "IL = 1.50 A\n",
+ "\n",
+ "Pmax = 6.00 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electrical_Network_by_R._Singh/Chapter4.ipynb b/Electrical_Network_by_R._Singh/Chapter4.ipynb new file mode 100644 index 00000000..da063bd5 --- /dev/null +++ b/Electrical_Network_by_R._Singh/Chapter4.ipynb @@ -0,0 +1,1846 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:3e2d2b728039737326c3b0b27fd3059d5efefa657f8300b7cf26aeeb6c7e63cf"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter4-AC Circuits"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg4.4"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##AC Circuits:example 4.1:(pg4.4)\n",
+ "import math\n",
+ "i=15.;\n",
+ "\n",
+ "t=3.375*10**-3;\n",
+ "f=40.;\n",
+ "pi=3.14;\n",
+ "Im=(i/math.sin(2.*pi*f*t));\n",
+ "print(\"i=15 Amp\");\n",
+ "print(\"t=3.375 ms\");\n",
+ "print(\"f=40 Hz\");\n",
+ "print(\"i=Im*sin(2*pi*f*t)\");\n",
+ "print'%s %.2f %s'%(\"Im= \",Im, \"Amp\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "i=15 Amp\n",
+ "t=3.375 ms\n",
+ "f=40 Hz\n",
+ "i=Im*sin(2*pi*f*t)\n",
+ "Im= 20.00 Amp\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg4.4"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##AC Circuits:example 4.2:(pg4.4)\n",
+ "import math\n",
+ "f=50.;\n",
+ "Im=100.;\n",
+ "i1=86.6;\n",
+ "t=(1/600.);\n",
+ "pi=3.14;\n",
+ "print(\"f=50 c/s\");\n",
+ "print(\"Im=100 A\");\n",
+ "## part(a)\n",
+ "print(\"i=Im*sin(2*pi*f*t)\");\n",
+ "i=Im*math.sin(2*pi*f*t);\n",
+ "print'%s %.2f %s'%(\"i= \",i,\" A\");\n",
+ "## part (b)\n",
+ "print(\"i=Im*sin(2*pi*f*t1)\");\n",
+ "t1=(math.asin(i1/Im)/(2.*pi*f));\n",
+ "print'%s %.2e %s'%(\"t1= \",t1,\" second\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "f=50 c/s\n",
+ "Im=100 A\n",
+ "i=Im*sin(2*pi*f*t)\n",
+ "i= 49.98 A\n",
+ "i=Im*sin(2*pi*f*t1)\n",
+ "t1= 3.33e-03 second\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg4.5"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##AC Circuits:example 4.3:(pg4.5)\n",
+ "f=50.;\n",
+ "import math\n",
+ "I=20.;\n",
+ "t1=0.0025;\n",
+ "t2=0.0125;\n",
+ "I1=14.14;\n",
+ "pi=3.14;\n",
+ "print(\"f=50 c/s\");\n",
+ "print(\"I=20 A\");\n",
+ "print(\"Im=I*sqrt(2)\");\n",
+ "Im=(math.sqrt(2)*I);\n",
+ "print'%s %.2f %s'%(\"\\nIm= \",Im,\" A\");\n",
+ "print(\"\\nEquation of current, \\ni=Im*sin(2*pi*f*t)\");\n",
+ "print(\"=28.28sin(2*pi*f*t)=28.28sin(100*pi*t)\");\n",
+ "print(\"(a)At t=0.0025 seconds\");\n",
+ "i=(Im*math.sin(2.*pi*f*t1));\n",
+ "print'%s %.2f %s'%(\"i= \",i,\" A\"); ##when t=0.0025seconds\n",
+ "print(\"(b)At t=0.0125 seconds\");\n",
+ "i=(Im*math.sin(2*pi*f*t2));\n",
+ "print'%s %.2f %s'%(\"i= \",i,\" A\"); ##when t=0.0125seconds\n",
+ "print(\"(c) i=28.28sin(100*pi*t) \");\n",
+ "t=(math.asin(I1/Im)/(2*math.pi*f));\n",
+ "print'%s %.2e %s'%(\"t= \",t,\" second\");## when I=14.14A"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg4.5"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##AC Circuits : example 4.4 :pg(4.5)\n",
+ "import math\n",
+ "pi=3.14;\n",
+ "Vm=200.;\n",
+ "print(\"v=200sin314t\");\n",
+ "print(\"v=Vmsin(2*pi*f*t)\");\n",
+ "print(\"(2*pi*f)=314\");\n",
+ "f=(314./(2.*pi));\n",
+ "print'%s %.2f %s'%(\"f= \",f,\" Hz\");\n",
+ "Vavg=((2.*Vm)/pi);\n",
+ "Vrms=(Vm/math.sqrt(2.));\n",
+ "print('\\nFor a sinusoidal waveform, \\nVavg=(2*Vm/pi) \\nVrms=(Vm/sqrt(2))');\n",
+ "kf=(Vrms/Vavg);\n",
+ "kc=(Vm/Vrms);\n",
+ "print'%s %.2f %s'%('\\nform fator=',kf,'');\n",
+ "print'%s %.2f %s'%('\\ncrest factor=',kc,'');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "v=200sin314t\n",
+ "v=Vmsin(2*pi*f*t)\n",
+ "(2*pi*f)=314\n",
+ "f= 50.00 Hz\n",
+ "\n",
+ "For a sinusoidal waveform, \n",
+ "Vavg=(2*Vm/pi) \n",
+ "Vrms=(Vm/sqrt(2))\n",
+ "\n",
+ "form fator= 1.11 \n",
+ "\n",
+ "crest factor= 1.41 \n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5-pg4.6"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##AC Circuits : example 4.5 :(pg 4.6)\n",
+ "kf=1.2;\n",
+ "import math\n",
+ "kp=1.5;\n",
+ "Vavg=10.;\n",
+ "print(\"kf=1.2\");\n",
+ "print(\"kp=1.5\");\n",
+ "print(\"Vavg=10\");\n",
+ "print(\"form factor kf=(Vrms/Vavg)\");\n",
+ "Vrms=(kf*Vavg);\n",
+ "print'%s %.2f %s'%(\"\\nVrms= \",Vrms,\" V\");\n",
+ "print(\"peak factor kp=(Vm/Vrms)\");\n",
+ "Vm=(kp*Vrms);\n",
+ "print'%s %.2f %s'%(\"\\nVm= \",Vm,\" V\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "kf=1.2\n",
+ "kp=1.5\n",
+ "Vavg=10\n",
+ "form factor kf=(Vrms/Vavg)\n",
+ "\n",
+ "Vrms= 12.00 V\n",
+ "peak factor kp=(Vm/Vrms)\n",
+ "\n",
+ "Vm= 18.00 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex14-pg4.11"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##AC Circuits: example 4.14 :(pg 4.11)\n",
+ "v1=0.;\n",
+ "import math\n",
+ "v2=40.;\n",
+ "v3=60.;\n",
+ "v4=80.;\n",
+ "v5=100.;\n",
+ "t=8.;\n",
+ "Vavg=((v1+v2+v3+v4+v5+v4+v3+v2)/t);\n",
+ "Vrms=math.sqrt((v1**2+v2**2+v3**2+v4**2+v5**2+v4**2+v3**2+v2**2)/t);\n",
+ "print(\"Vavg=((0.+40.+60.+80.+100.+80.+60.+40.)/8.)\");\n",
+ "print'%s %.2f %s'%(\"\\nVavg= \",Vavg,\" V\");\n",
+ "print(\"Vrms=sqrt((0+(40)^2+(60)^2+(80)^2+(100)^2+(80)^2+(60)^2+(40)^2)/8)\");\n",
+ "print'%s %.2f %s'%(\"\\nVrms= \",Vrms,\" V\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Vavg=((0.+40.+60.+80.+100.+80.+60.+40.)/8.)\n",
+ "\n",
+ "Vavg= 57.50 V\n",
+ "Vrms=sqrt((0+(40)^2+(60)^2+(80)^2+(100)^2+(80)^2+(60)^2+(40)^2)/8)\n",
+ "\n",
+ "Vrms= 64.42 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex15-pg4.11"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##AC Circuits : example 4.15 :pg(4.11 & 4.12)\n",
+ "v1=0.;\n",
+ "import math\n",
+ "v2=10.;\n",
+ "v3=20.;\n",
+ "t=3.;\n",
+ "Vavg=((v1+v2+v3)/t);\n",
+ "Vrms=(math.sqrt((v1**2+v2**2+v3**2)/t));\n",
+ "print(\"Vavg=((0+10+20)/3)\");\n",
+ "print'%s %.2f %s'%(\"Vavg= \",Vavg, \"V\");\n",
+ "print(\"Vrms=(((0)^2+(10)^2+(20)^2)/3)\");\n",
+ "print'%s %.2f %s'%(\"Vrms= \",Vrms,\" V\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Vavg=((0+10+20)/3)\n",
+ "Vavg= 10.00 V\n",
+ "Vrms=(((0)^2+(10)^2+(20)^2)/3)\n",
+ "Vrms= 12.91 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex33-pg4.27"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##AC Circuits : example 4.33 :pg(4.27)\n",
+ "Vm=177.;\n",
+ "import math\n",
+ "Im=14.14;\n",
+ "phi=30.;\n",
+ "V=(Vm/math.sqrt(2));\n",
+ "I=(Im/math.sqrt(2));\n",
+ "pf=math.cos(30/57.3);\n",
+ "P=(V*I*pf);\n",
+ "print(\"v(t)=177sin(314t+10)\");## value of 10 is in degrees\n",
+ "print(\"i(t)=14.14sin(314t-20)\");##value of 20 is in degrees\n",
+ "print(\"\\nCurrent i(t) lags behind voltage v(t) by 30degrees\");\n",
+ "print(\"phi=30degrees\");\n",
+ "print'%s %.2f %s'%(\"Power factor pf=cos(30)= \",pf,\" (lagging)\");\n",
+ "print'%s %.2f %s'%(\"\\nPower consumed P=V*I*cos(phi)= \",P,\" W\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "v(t)=177sin(314t+10)\n",
+ "i(t)=14.14sin(314t-20)\n",
+ "\n",
+ "Current i(t) lags behind voltage v(t) by 30degrees\n",
+ "phi=30degrees\n",
+ "Power factor pf=cos(30)= 0.87 (lagging)\n",
+ "\n",
+ "Power consumed P=V*I*cos(phi)= 1083.76 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex42-pg4.32"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##AC Circuits : example 4.42 :pg(4.32 & 4.33)\n",
+ "import math\n",
+ "PR=1000.;\n",
+ "VR=200.;\n",
+ "Pcoil=250.;\n",
+ "Vcoil=300.;\n",
+ "R=((VR**2)/PR);\n",
+ "I=(VR/R);\n",
+ "r=((Pcoil/(I**2)));\n",
+ "Zcoil=(Vcoil/I);\n",
+ "XL=math.sqrt((Zcoil**2)-(r**2));\n",
+ "RT=(R+r);\n",
+ "ZT=math.sqrt((RT**2)+(XL**2));\n",
+ "V=(ZT*I);\n",
+ "print(\"\\nPR=1000 W \\nVR=200 V \\nPcoil=250 W \\nVcoil=300 V \\nPR=(VR^2/R)\");\n",
+ "print'%s %.2f %s'%(\"\\nR= \",R,\" Ohms\");\n",
+ "print'%s %.2f %s'%(\"\\nVR=R*I \\nI= \",I,\" A\");\n",
+ "print(\"Pcoil=(I^2)*r\");\n",
+ "print'%s %.2f %s'%(\"\\nResistance of coil r= \",r,\" Ohm\");\n",
+ "print'%s %.2f %s'%(\"\\nImpedance of coil Zcoil=(Vcoil/I)= \",Zcoil,\" Ohms\");\n",
+ "print'%s %.2f %s'%(\"\\nReactance of coil XL=sqrt((Zcoil^2)-(r^2)) = \",XL,\" Ohms\");\n",
+ "print'%s %.2f %s'%(\"\\nCombined resistance RT=R+r= \",RT,\"Ohms\");\n",
+ "print'%s %.2f %s'%(\"\\nCombined impedance ZT=sqrt(((R+r)^2)+(XL^2)) = \",ZT,\" Ohms\");\n",
+ "print'%s %.2f %s'%(\"\\nSupply voltage V=ZT*I= \",V,\" V\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "PR=1000 W \n",
+ "VR=200 V \n",
+ "Pcoil=250 W \n",
+ "Vcoil=300 V \n",
+ "PR=(VR^2/R)\n",
+ "\n",
+ "R= 40.00 Ohms\n",
+ "\n",
+ "VR=R*I \n",
+ "I= 5.00 A\n",
+ "Pcoil=(I^2)*r\n",
+ "\n",
+ "Resistance of coil r= 10.00 Ohm\n",
+ "\n",
+ "Impedance of coil Zcoil=(Vcoil/I)= 60.00 Ohms\n",
+ "\n",
+ "Reactance of coil XL=sqrt((Zcoil^2)-(r^2)) = 59.16 Ohms\n",
+ "\n",
+ "Combined resistance RT=R+r= 50.00 Ohms\n",
+ "\n",
+ "Combined impedance ZT=sqrt(((R+r)^2)+(XL^2)) = 77.46 Ohms\n",
+ "\n",
+ "Supply voltage V=ZT*I= 387.30 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex47-pg4.36"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##AC Circuits : example 4.47 :pg(4.47)\n",
+ "import math\n",
+ "f1=60.;\n",
+ "V=200.;\n",
+ "P=600.;\n",
+ "I=5.;\n",
+ "f=50.;\n",
+ "Z=V/I;\n",
+ "r=(P/(I**2));\n",
+ "XL=math.sqrt((Z**2)-(r**2));\n",
+ "L=(XL/(2.*math.pi*f));\n",
+ "XL1=(2.*math.pi*f1*L);\n",
+ "Z1=math.sqrt((r**2)+(XL1**2));\n",
+ "I=(V/Z1);\n",
+ "print(\"\\nI=5 A \\nV=200 V \\nP=600 W \\nFor f=50 Hz,\");\n",
+ "print'%s %.2f %s'%(\"\\nZ=V/I = \",Z,\" Ohms\");\n",
+ "print'%s %.2f %s'%(\"\\nP=((I^2)*r) \\nr= \",r,\" Ohms\");\n",
+ "print'%s %.2f %s'%(\"\\nXL=sqrt((Z^2)-(r^2)) \\nXL= \",XL,\" Ohms\");\n",
+ "print'%s %.2f %s'%(\"\\nXL=(2*pi*f*L)\\nL= \",L,\" H\");\n",
+ "print'%s %.2f %s'%(\"\\nFor f=60 Hz \\nXL= \",XL1,\" Ohm\");\n",
+ "print'%s %.2f %s'%(\"\\nr=24 Ohms \\nZ=sqrt((r^2)+(XL^2))= \",Z1,\" Ohms\");\n",
+ "print'%s %.2f %s'%(\"\\nI=V/Z= \",I,\" A\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "I=5 A \n",
+ "V=200 V \n",
+ "P=600 W \n",
+ "For f=50 Hz,\n",
+ "\n",
+ "Z=V/I = 40.00 Ohms\n",
+ "\n",
+ "P=((I^2)*r) \n",
+ "r= 24.00 Ohms\n",
+ "\n",
+ "XL=sqrt((Z^2)-(r^2)) \n",
+ "XL= 32.00 Ohms\n",
+ "\n",
+ "XL=(2*pi*f*L)\n",
+ "L= 0.10 H\n",
+ "\n",
+ "For f=60 Hz \n",
+ "XL= 38.40 Ohm\n",
+ "\n",
+ "r=24 Ohms \n",
+ "Z=sqrt((r^2)+(XL^2))= 45.28 Ohms\n",
+ "\n",
+ "I=V/Z= 4.42 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex48-pg4.37"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##AC Circuits : example 4.48 :(pg 4.37)\n",
+ "f=50.;\n",
+ "import math\n",
+ "pi=3.14;\n",
+ "Vdc=12.;\n",
+ "Idc=2.5;\n",
+ "Vac=230.;\n",
+ "Iac=2.;\n",
+ "Pac=50.;\n",
+ "R=(Vdc/Idc);\n",
+ "Z=(Vac/Iac);\n",
+ "Pi=(Pac-((Iac**2)*R));\n",
+ "RT=(Pac/(Iac**2));\n",
+ "XL=math.sqrt((Z**2)-(RT**2));\n",
+ "L=(XL/(2.*pi*f));\n",
+ "pf=(RT/Z);\n",
+ "i=(Pi/(Iac**2));\n",
+ "print(\"\\nFor dc V=12 V, I=2.5 A \\nFor ac V=230 V, I=2 A, P=50 W\");\n",
+ "print(\"\\nIn an iron-cored coil,there are two types of losses \\n(i)Losses in core known as core or iron loss \\n(ii)Losses in winding known as copper loss\");\n",
+ "print(\"\\nP=(I^2)*R+Pi \\nP/(I^2)=R+((Pi)/(I^2)) \\nRT=R+(Pi/(I^2)) \\nwhere R is the resistance of the coil and (Pi/I^2) is the resistance which is equivalent to the effect of iron loss\");\n",
+ "print(\"\\nFor dc supply, f=0 \\nXL=0\");\n",
+ "print'%s %.2f %s'%(\"\\nR= \",R,\" Ohm\");\n",
+ "print'%s %.2f %s'%(\"\\nFor ac supply \\nZ= \",Z,\" Ohms\");\n",
+ "print'%s %.2f %s'%(\"\\nIron loss Pi=P-I^2*R= \",Pi,\" W\");\n",
+ "print'%s %.2f %s'%(\"\\nRT=(P/I^2)= \",RT,\" Ohm\");\n",
+ "print'%s %.2f %s'%(\"\\nXL=sqrt((Z^2)-(RT^2))= \",XL,\" Ohm\");\n",
+ "print'%s %.2f %s'%(\"\\nXL=2*pi*L \\nInductance L= \",L,\" H\");\n",
+ "print'%s %.2f %s'%(\"\\nPower factor =RT/Z= \",pf,\" (lagging)\");\n",
+ "print'%s %.2f %s'%(\"\\nThe series resistance equivalent to the effect of iron loss= Pi/(I^2)= \",i,\" Ohms\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "For dc V=12 V, I=2.5 A \n",
+ "For ac V=230 V, I=2 A, P=50 W\n",
+ "\n",
+ "In an iron-cored coil,there are two types of losses \n",
+ "(i)Losses in core known as core or iron loss \n",
+ "(ii)Losses in winding known as copper loss\n",
+ "\n",
+ "P=(I^2)*R+Pi \n",
+ "P/(I^2)=R+((Pi)/(I^2)) \n",
+ "RT=R+(Pi/(I^2)) \n",
+ "where R is the resistance of the coil and (Pi/I^2) is the resistance which is equivalent to the effect of iron loss\n",
+ "\n",
+ "For dc supply, f=0 \n",
+ "XL=0\n",
+ "\n",
+ "R= 4.80 Ohm\n",
+ "\n",
+ "For ac supply \n",
+ "Z= 115.00 Ohms\n",
+ "\n",
+ "Iron loss Pi=P-I^2*R= 30.80 W\n",
+ "\n",
+ "RT=(P/I^2)= 12.50 Ohm\n",
+ "\n",
+ "XL=sqrt((Z^2)-(RT^2))= 114.32 Ohm\n",
+ "\n",
+ "XL=2*pi*L \n",
+ "Inductance L= 0.36 H\n",
+ "\n",
+ "Power factor =RT/Z= 0.11 (lagging)\n",
+ "\n",
+ "The series resistance equivalent to the effect of iron loss= Pi/(I^2)= 7.70 Ohms\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex49-pg4.37"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##AC Circuits : example 4.49 :(pg 4.37 & 4.38)\n",
+ "import math\n",
+ "f=50.;\n",
+ "I1=4.;\n",
+ "pf1=0.5;\n",
+ "V1=200.;\n",
+ "I2=5.;\n",
+ "pf2=0.8;\n",
+ "V2=40.;\n",
+ "Z1=(V2/I2);\n",
+ "R=(Z1*pf2);\n",
+ "XL1=math.sqrt((Z1**2)-(R**2));\n",
+ "L1=(XL1/(2.*math.pi*f));\n",
+ "Z2=(V1/I1);\n",
+ "RT=(Z2*pf1);\n",
+ "XL2=math.sqrt((Z2**2)-(RT**2));\n",
+ "L2=(XL2/(2.*math.pi*f));\n",
+ "Pi=(V1*I1*pf1-(I1**2)*R);\n",
+ "print(\"\\nWith iron core I=4 A pf=0.5, V=200 V \\nWithout iron core I=5 A pf=0.8, V=40 V \\nWhen the iron-core is removed,\");\n",
+ "print'%s %.2f %s'%(\"\\nZ=V/I= \",Z1,\" Ohms\");\n",
+ "print'%s %.2f %s'%(\"\\npf=R/Z \\nR= \",R,\" Ohms\");\n",
+ "print'%s %.2f %s'%(\"\\nXL=sqrt((Z**2)-(RT**2))= \",XL1,\" Ohms\");\n",
+ "print'%s %.2f %s'%(\"\\nXL=(2*pi*f*L) \\nInductance L= \",L1,\" H\");\n",
+ "print'%s %.2f %s'%(\"\\nWith iron core, \\nZ= \",Z2,\" Ohms\");\n",
+ "print'%s %.2f %s'%(\"\\npf=RT/Z \\nRT= \",RT,\" Ohm\");\n",
+ "print'%s %.2f %s'%(\"\\nXL=sqrt((Z**2)-(RT**2))= \",XL2,\" Ohm\");\n",
+ "print'%s %.2f %s'%(\"\\nXL=(2*pi*f*L) \\nInductance L= \",L2,\" H\");\n",
+ "print'%s %.2f %s'%(\"\\nIron loss Pi=P=(I**2)*R \\n=VIcos(phi)-I**2*R \\n= \",Pi,\" W\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "With iron core I=4 A pf=0.5, V=200 V \n",
+ "Without iron core I=5 A pf=0.8, V=40 V \n",
+ "When the iron-core is removed,\n",
+ "\n",
+ "Z=V/I= 8.00 Ohms\n",
+ "\n",
+ "pf=R/Z \n",
+ "R= 6.40 Ohms\n",
+ "\n",
+ "XL=sqrt((Z**2)-(RT**2))= 4.80 Ohms\n",
+ "\n",
+ "XL=(2*pi*f*L) \n",
+ "Inductance L= 0.02 H\n",
+ "\n",
+ "With iron core, \n",
+ "Z= 50.00 Ohms\n",
+ "\n",
+ "pf=RT/Z \n",
+ "RT= 25.00 Ohm\n",
+ "\n",
+ "XL=sqrt((Z**2)-(RT**2))= 43.30 Ohm\n",
+ "\n",
+ "XL=(2*pi*f*L) \n",
+ "Inductance L= 0.14 H\n",
+ "\n",
+ "Iron loss Pi=P=(I**2)*R \n",
+ "=VIcos(phi)-I**2*R \n",
+ "= 297.60 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex51-pg4.40"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##AC Circuits : example 4.51 :(pg 4.40 & 4.41)\n",
+ "import math\n",
+ "P=2000.;\n",
+ "pf=0.5;\n",
+ "V=230.;\n",
+ "S=(P/pf);\n",
+ "phi=math.acos(pf)*57.3;\n",
+ "I=(P/(V*pf));\n",
+ "Q=(V*I*math.sin(phi/57.3));\n",
+ "print(\"P=2000 W\");\n",
+ "print(\"pf=0.5 (leading)\");\n",
+ "print(\"V=230 V\");\n",
+ "print(\"P=V*I*cos(phi)\");\n",
+ "print'%s %.2f %s'%(\"\\nI= \",I,\" A\");\n",
+ "print'%s %.2f %s'%(\"\\nS=V*I=P/cos(phi)= \",S,\" VA\");\n",
+ "print'%s %.2f %s'%(\"\\nphi= \",phi,\" degrees\");\n",
+ "print'%s %.2f %s'%(\"\\nQ=V*I*sin(phi)= \",Q,\" VAR\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "P=2000 W\n",
+ "pf=0.5 (leading)\n",
+ "V=230 V\n",
+ "P=V*I*cos(phi)\n",
+ "\n",
+ "I= 17.39 A\n",
+ "\n",
+ "S=V*I=P/cos(phi)= 4000.00 VA\n",
+ "\n",
+ "phi= 60.00 degrees\n",
+ "\n",
+ "Q=V*I*sin(phi)= 3464.10 VAR\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex52-pg4.41"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##AC Circuits : example 4.52 :(pg 4.41)\n",
+ "import math\n",
+ "V=240.;\n",
+ "VR=100.;\n",
+ "P=300.;\n",
+ "f=50.;\n",
+ "R=((VR**2)/P);\n",
+ "I=math.sqrt(P/R);\n",
+ "Z=V/I;\n",
+ "XC=math.sqrt((Z**2)-(R**2));\n",
+ "C=(1./(2.*math.pi*f*XC));\n",
+ "VC=math.sqrt((V**2)-(VR**2));\n",
+ "VCmax=(VC*math.sqrt(2.));\n",
+ "Qmax=(C*VCmax);\n",
+ "Emax=((1./2.)*C*(VCmax**2));\n",
+ "print(\"\\nV=240 V \\nVR=100 V \\nP=300 W \\nf=50 Hz\");\n",
+ "print'%s %.2f %s'%(\"\\nP=(VR^2)/R \\nR=((VR^2)/P)= \",R,\" Ohm\");\n",
+ "print'%s %.2f %s'%(\"\\nP=(I^2)*R \\nI=sqrt((P/R)) \\nI= \",I,\" A\");\n",
+ "print'%s %.2f %s'%(\"\\nZ=V/I=\",Z,\" Ohm\");\n",
+ "print'%s %.2f %s'%(\"\\nXC=sqrt((Z^2)-(R^2))= \",XC,\" Ohm\");\n",
+ "print'%s %.2e %s'%(\"\\nXC=1/2*pi*f*C \\nC= \",C,\" F\");\n",
+ "print'%s %.2f %s'%(\"\\nVoltage across capacitor VC=sqrt((V^2)-(VR^2))= \",VC,\" V\");\n",
+ "print'%s %.2f %s %.2f %s '%(\"\\nMaximum value of max charge \\nVC= \",VCmax,\" V\" and \" \\nQmax=C*VCmax= \",Qmax,\" C\");\n",
+ "print'%s %.2f %s'%(\"\\nMax stored energy Emax=((1/2)*C*(VCmax^2)) \\n= \",Emax,\" J\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "V=240 V \n",
+ "VR=100 V \n",
+ "P=300 W \n",
+ "f=50 Hz\n",
+ "\n",
+ "P=(VR^2)/R \n",
+ "R=((VR^2)/P)= 33.33 Ohm\n",
+ "\n",
+ "P=(I^2)*R \n",
+ "I=sqrt((P/R)) \n",
+ "I= 3.00 A\n",
+ "\n",
+ "Z=V/I= 80.00 Ohm\n",
+ "\n",
+ "XC=sqrt((Z^2)-(R^2))= 72.72 Ohm\n",
+ "\n",
+ "XC=1/2*pi*f*C \n",
+ "C= 4.38e-05 F\n",
+ "\n",
+ "Voltage across capacitor VC=sqrt((V^2)-(VR^2))= 218.17 V\n",
+ "\n",
+ "Maximum value of max charge \n",
+ "VC= 308.54 \n",
+ "Qmax=C*VCmax= 0.01 C \n",
+ "\n",
+ "Max stored energy Emax=((1/2)*C*(VCmax^2)) \n",
+ "= 2.08 J\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex53-pg4.42"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##AC Circuits : example 4.53 :(pg 4.42)\n",
+ "import math\n",
+ "C=35.*10**-6;\n",
+ "f=50.;\n",
+ "XC=(1./(2.*math.pi*f*C));\n",
+ "R=math.sqrt(3.*(XC**2));\n",
+ "R2=(3*(XC**2));\n",
+ "print'%s %.2f %s'%(\"\\nC=35*10^-6 F \\nf=50 Hz \\nVC=1/2.V \\nXC=1/(2*pi*f*C)= \",XC,\" Ohm\");\n",
+ "print(\"\\nVC=1/2.V \\nXC.I=1/2.Z.I \\nXC=1/2.Z \\nZ=2.XC \\nZ=sqrt((R^2)+(XC^2)) \\n(2XC)^2=(R^2)+(XC^2) \\n3XC^2=R^2\");\n",
+ "print'%s %.2f %s %.2f %s '%(\"\\nR^2=3*XC^2= \",R2,\" Ohm\" and \" \\nR= \",R,\" Ohm\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "C=35*10^-6 F \n",
+ "f=50 Hz \n",
+ "VC=1/2.V \n",
+ "XC=1/(2*pi*f*C)= 90.95 Ohm\n",
+ "\n",
+ "VC=1/2.V \n",
+ "XC.I=1/2.Z.I \n",
+ "XC=1/2.Z \n",
+ "Z=2.XC \n",
+ "Z=sqrt((R^2)+(XC^2)) \n",
+ "(2XC)^2=(R^2)+(XC^2) \n",
+ "3XC^2=R^2\n",
+ "\n",
+ "R^2=3*XC^2= 24813.35 \n",
+ "R= 157.52 Ohm \n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex54-pg4.42"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##AC Circuits : example 4.54 :(pg 4.42)\n",
+ "V=125.;\n",
+ "import math\n",
+ "I=2.2;\n",
+ "P=96.8;\n",
+ "f=50.;\n",
+ "Z=V/I;\n",
+ "R=(P/(I**2));\n",
+ "Xc=math.sqrt((Z**2)-(R**2));\n",
+ "C=(1./(2.*math.pi*f*Xc));\n",
+ "print(\"\\nV=125 V \\nP=96.8 W \\nI=2.2 A \\nf=50 Hz\");\n",
+ "print'%s %.2f %s'%(\"\\nZ=V/I= \",Z,\" A\");\n",
+ "print'%s %.2f %s'%(\"\\nP=(I^2)*R \\nR= \",R,\" Ohm\");\n",
+ "print'%s %.2f %s'%(\"\\nXc=sqrt((Z^2)-(R^2))= \",Xc,\" Ohm\");\n",
+ "print'%s %.2e %s'%(\"\\nXc=1/(2*pi*f*C) \\n C= \",C,\" F\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "V=125 V \n",
+ "P=96.8 W \n",
+ "I=2.2 A \n",
+ "f=50 Hz\n",
+ "\n",
+ "Z=V/I= 56.82 A\n",
+ "\n",
+ "P=(I^2)*R \n",
+ "R= 20.00 Ohm\n",
+ "\n",
+ "Xc=sqrt((Z^2)-(R^2))= 53.18 Ohm\n",
+ "\n",
+ "Xc=1/(2*pi*f*C) \n",
+ " C= 5.99e-05 F\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex57-pg4.46"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##AC Circuits :example 4.57 :(pg 4.46)\n",
+ "import math\n",
+ "j=-math.sqrt(1);\n",
+ "f=50.;\n",
+ "L=0.22;\n",
+ "R1=3.;\n",
+ "Z=3.8+j*6.4;\n",
+ "XL=2.*math.pi*f*L;\n",
+ "R2=3.8;\n",
+ "R=R2-R1;\n",
+ "X=6.4;\n",
+ "XC=XL-X;\n",
+ "C=(1./(2.*math.pi*f*XC));\n",
+ "print(\"\\nZ=(3.8+j*6.4) Ohm\");\n",
+ "print'%s %.2f %s'%(\"\\nXL=2*pi*f*L= \",XL,\" Ohm\");\n",
+ "print(\"\\nZ=(3+j69.12+R-jXC) \\n=(3+R)+j(69.12-XC)\");\n",
+ "print'%s %.2f %s'%(\"\\n3+R=3.8 \\nR= \",R,\" Ohm\");\n",
+ "print'%s %.2f %s'%(\"\\nXC= \",XC,\"Ohm\");\n",
+ "print'%s %.2e %s'%(\"\\nXC=1/2.pi.f.C \\nC= \",C,\" F\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Z=(3.8+j*6.4) Ohm\n",
+ "\n",
+ "XL=2*pi*f*L= 69.12 Ohm\n",
+ "\n",
+ "Z=(3+j69.12+R-jXC) \n",
+ "=(3+R)+j(69.12-XC)\n",
+ "\n",
+ "3+R=3.8 \n",
+ "R= 0.80 Ohm\n",
+ "\n",
+ "XC= 62.72 Ohm\n",
+ "\n",
+ "XC=1/2.pi.f.C \n",
+ "C= 5.08e-05 F\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex58-pg4.46"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##AC Circuits : example 4.58 :(pg 4.46)\n",
+ "import math\n",
+ "R=20.;\n",
+ "phi=45.;\n",
+ "Z=R/math.cos(phi/57.3);\n",
+ "XC=math.sqrt((Z**2)-(R**2));\n",
+ "XL=(2.*XC);\n",
+ "w=1000.;\n",
+ "L=(XL/w);\n",
+ "C=(1./(w*XC));\n",
+ "print(\"\\nvL=300sin(1000t) \\nR=20 Ohm \\nphi=45 \\nVL(max)=2Vcc(max) \\nsqrt(2)*VL=2*sqrt(2)*VC \\nI*XL=2*I*XC \\nXL=2*XC \\ncos(phi)=R/Z\");\n",
+ "print'%s %.2f %s'%(\"\\nZ= \",Z,\" Ohm\");\n",
+ "print'%s %.2f %s'%(\"\\nZ=sqrt((R^2)+(XL-XC)^2) \\nXC = \",XC,\" Ohm\"); ##for series R-L-C ckt\n",
+ "print'%s %.2f %s'%(\"\\nXL=2*XC = \",XL,\" Ohm\");\n",
+ "print'%s %.2f %s'%(\"\\nXL=w*L \\nL= \",L,\" H\");\n",
+ "print'%s %.2e %s'%(\"\\nXC=1/w*C \\nC= \",C,\" F\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "vL=300sin(1000t) \n",
+ "R=20 Ohm \n",
+ "phi=45 \n",
+ "VL(max)=2Vcc(max) \n",
+ "sqrt(2)*VL=2*sqrt(2)*VC \n",
+ "I*XL=2*I*XC \n",
+ "XL=2*XC \n",
+ "cos(phi)=R/Z\n",
+ "\n",
+ "Z= 28.28 Ohm\n",
+ "\n",
+ "Z=sqrt((R^2)+(XL-XC)^2) \n",
+ "XC = 20.00 Ohm\n",
+ "\n",
+ "XL=2*XC = 40.00 Ohm\n",
+ "\n",
+ "XL=w*L \n",
+ "L= 0.04 H\n",
+ "\n",
+ "XC=1/w*C \n",
+ "C= 5.00e-05 F\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex59-pg4.47"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##AC Circuits : example 4.59 :(pg 4.47)\n",
+ "import math\n",
+ "pf=0.5;\n",
+ "C=79.59*10**-6;\n",
+ "f=50.;\n",
+ "XC=(1./(2.*math.pi*f*C));\n",
+ "R=pf*XC;\n",
+ "Zcoil=XC;\n",
+ "XL=math.sqrt((Zcoil**2)-(R**2));\n",
+ "L=(XL/(2.*math.pi*f));\n",
+ "print(\"\\npf=0.5 \\nC=79.57uF \\nf=50 Hz \\nVcoil=VC \");\n",
+ "print'%s %.2f %s'%(\"\\nXC=1/2*pi*f*C = \",XC,\" Ohm\");\n",
+ "print'%s %.2f %s'%(\"\\nVcoil=VC \\nZcoil=XC= \",XC,\" Ohm\");\n",
+ "print'%s %.2f %s'%(\"\\npf of coil=cos(phi)=R/Zcoil \\nResistance of coil R= \",R,\" Ohm\");\n",
+ "print'%s %.2f %s'%(\"\\nXL=sqrt((Zcoil^2)-(R^2))= \",XL,\" Ohm\");\n",
+ "print'%s %.2f %s'%(\"\\nXL=2*pi*f*L \\nInductance of coil= \",L,\" H\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "pf=0.5 \n",
+ "C=79.57uF \n",
+ "f=50 Hz \n",
+ "Vcoil=VC \n",
+ "\n",
+ "XC=1/2*pi*f*C = 39.99 Ohm\n",
+ "\n",
+ "Vcoil=VC \n",
+ "Zcoil=XC= 39.99 Ohm\n",
+ "\n",
+ "pf of coil=cos(phi)=R/Zcoil \n",
+ "Resistance of coil R= 20.00 Ohm\n",
+ "\n",
+ "XL=sqrt((Zcoil^2)-(R^2))= 34.64 Ohm\n",
+ "\n",
+ "XL=2*pi*f*L \n",
+ "Inductance of coil= 0.11 H\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex60-pg4.48"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##AC Circuits : example 4.60 :(pg 4.48)\n",
+ "import math\n",
+ "f=50.;\n",
+ "V=250.;\n",
+ "R=5.;\n",
+ "L=9.55;\n",
+ "Vcoil=300.;\n",
+ "XL=2.*math.pi*f*L;\n",
+ "Zcoil=(math.sqrt((R**2)+(XL**2)));\n",
+ "I=Vcoil/Zcoil;\n",
+ "Z=V/I;\n",
+ "XC1=Zcoil-Z;\n",
+ "XC2=Zcoil+Z;\n",
+ "C1=(1./(2.*math.pi*f*XC1));\n",
+ "C2=(1./(2.*math.pi*f*XC2));\n",
+ "print(\"\\nV=250 V \\nR=5 Ohm \\nL=9.55 H \\nVcoil=300 V\");\n",
+ "print'%s %.2f %s'%(\"\\nXL=2*pi*f*L = \",XL,\" Ohm\");\n",
+ "print'%s %.2f %s'%(\"\\nZcoil=sqrt(R^2)+(XL^2) = \",Zcoil,\" Ohm\");\n",
+ "print'%s %.2f %s'%(\"\\nI=Vcoil/Zcoil = \",I,\" A\");\n",
+ "print'%s %.2f %s'%(\"\\nZ=V/I = \",Z,\" Ohm\");##total impedance\n",
+ "print'%s %.2f %s'%(\"\\nZ=sqrt((R^2)+(XL-XC)^2) \\nXC= \",XC1,\" Ohm\");##when XL>XC\n",
+ "print'%s %.2f %s'%(\"\\nC=1/2*pi*f*XC = \",C1,\" F\");\n",
+ "print'%s %.2f %s'%(\"\\nZ=sqrt((R^2)+(XC-XL)^2) \\nXC= \",XC2,\" Ohm\");##when XC>XL\n",
+ "print'%s %.2e %s'%(\"\\nC= \",C2,\" F\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "V=250 V \n",
+ "R=5 Ohm \n",
+ "L=9.55 H \n",
+ "Vcoil=300 V\n",
+ "\n",
+ "XL=2*pi*f*L = 3000.22 Ohm\n",
+ "\n",
+ "Zcoil=sqrt(R^2)+(XL^2) = 3000.23 Ohm\n",
+ "\n",
+ "I=Vcoil/Zcoil = 0.10 A\n",
+ "\n",
+ "Z=V/I = 2500.19 Ohm\n",
+ "\n",
+ "Z=sqrt((R^2)+(XL-XC)^2) \n",
+ "XC= 500.04 Ohm\n",
+ "\n",
+ "C=1/2*pi*f*XC = 0.00 F\n",
+ "\n",
+ "Z=sqrt((R^2)+(XC-XL)^2) \n",
+ "XC= 5500.41 Ohm\n",
+ "\n",
+ "C= 5.79e-07 F\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex79-pg4.64"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##AC Circuits : example 4.79 :(pg 4.64)\n",
+ "import math\n",
+ "R=10.;\n",
+ "L=0.01;\n",
+ "C=100.*10**-6;\n",
+ "f0=(1./(2.*math.pi*math.sqrt(L*C)));\n",
+ "BW=(R/(2.*math.pi*L));\n",
+ "f1=f0-(BW/2.);\n",
+ "f2=f0+(BW/2.);\n",
+ "print(\"\\nR=10 Ohm \\nL=0.01H \\nC=100uF\");\n",
+ "print'%s %.2f %s'%(\"\\nf0=1/2*pi*sqrt(L*C)= \",f0,\" Hz\");##resonant frequency\n",
+ "print'%s %.2f %s'%(\"\\nBW=R/2*pi*L = \",BW,\" Hz\"); ##bandwidth\n",
+ "print'%s %.2f %s'%(\"\\nf1=f0-BW/2 \\n= \",f1,\" Hz\"); ##lower frequency\n",
+ "print'%s %.2f %s'%(\"\\nf2=f0+BW/2 = \",f2,\" Hz\"); ##higher frequency"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "R=10 Ohm \n",
+ "L=0.01H \n",
+ "C=100uF\n",
+ "\n",
+ "f0=1/2*pi*sqrt(L*C)= 159.15 Hz\n",
+ "\n",
+ "BW=R/2*pi*L = 159.15 Hz\n",
+ "\n",
+ "f1=f0-BW/2 \n",
+ "= 79.58 Hz\n",
+ "\n",
+ "f2=f0+BW/2 = 238.73 Hz\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex80-pg4.65"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##AC Circuits : example 4.80 :(pg 4.65)\n",
+ "import math\n",
+ "R=10.;\n",
+ "L=0.2;\n",
+ "C=40.*10**-6;\n",
+ "V=100.;\n",
+ "f0=(1./(2.*math.pi*math.sqrt(L*C)));\n",
+ "I0=(V/R);\n",
+ "P0=((I0**2)*R);\n",
+ "pf=1.;\n",
+ "Vr=(R*I0);\n",
+ "Vl=((2.*math.pi*f0*L)*I0);\n",
+ "Vc=((1/(2.*math.pi*f0*C))*I0);\n",
+ "Q=((1./R)*math.sqrt(L/C));\n",
+ "f1=(f0-(R/(4.*math.pi*L)));\n",
+ "f2=(f0+(R/(4.*math.pi*L)));\n",
+ "print(\"\\nR=10 Ohm \\nL=0.2 H \\nC=40uF \\nV=100 V\");\n",
+ "print'%s %.2f %s'%(\"\\n(i) f0= 1/2*pi*sqrt(LC) = \",f0,\" Hz\"); ##resonant frequency\n",
+ "print'%s %.2f %s'%(\"\\n(ii) I0= V/R = \",I0,\" A\"); ##current\n",
+ "print'%s %.2f %s'%(\"\\n(iii) P0=(I0^2)*R = \",P0,\" W\");##power\n",
+ "print(\"\\n(iv) pf=1\");##power factor\n",
+ "print'%s %.2f %s'%(\"\\n(v) Rv = R.I = \",Vr,\" V\");##voltage across resistor\n",
+ "print'%s %.2f %s'%(\"\\n Lv = XL.I = \",Vl,\" V\");##voltage across inductor\n",
+ "print'%s %.2f %s'%(\"\\n Cv = XC.I = \",Vc,\" V\"); ##voltage across capacitor\n",
+ "print'%s %.2f %s'%(\"\\n(vi) Q =1/R*sqrt(L/C)=\",Q,\"\");##Quality factor\n",
+ "print'%s %.2f %s'%(\"\\n(vii)f1 = f0-R/4.pi.L = \",f1,\" Hz\"); ##half power points\n",
+ "print'%s %.2f %s'%(\"\\nf2=f0+R/4.pi.L = \",f2,\" Hz\");\n",
+ "## x initialisation \n",
+ "import math\n",
+ "%matplotlib inline\n",
+ "import warnings\n",
+ "warnings.filterwarnings('ignore')\n",
+ "from math import log\n",
+ "import numpy\n",
+ "from math import tan\n",
+ "import matplotlib\n",
+ "from matplotlib import pyplot\n",
+ "x=numpy.array([-1,0.1,6.28]);\n",
+ "##simple plot\n",
+ "y=numpy.sin(x)\n",
+ "pyplot.plot(x,y)\n",
+ "\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "R=10 Ohm \n",
+ "L=0.2 H \n",
+ "C=40uF \n",
+ "V=100 V\n",
+ "\n",
+ "(i) f0= 1/2*pi*sqrt(LC) = 56.27 Hz\n",
+ "\n",
+ "(ii) I0= V/R = 10.00 A\n",
+ "\n",
+ "(iii) P0=(I0^2)*R = 1000.00 W\n",
+ "\n",
+ "(iv) pf=1\n",
+ "\n",
+ "(v) Rv = R.I = 100.00 V\n",
+ "\n",
+ " Lv = XL.I = 707.11 V\n",
+ "\n",
+ " Cv = XC.I = 707.11 V\n",
+ "\n",
+ "(vi) Q =1/R*sqrt(L/C)= 7.07 \n",
+ "\n",
+ "(vii)f1 = f0-R/4.pi.L = 52.29 Hz\n",
+ "\n",
+ "f2=f0+R/4.pi.L = 60.25 Hz\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "pyout",
+ "prompt_number": 37,
+ "text": [
+ "[<matplotlib.lines.Line2D at 0x5aad050>]"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAEACAYAAAC9Gb03AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAFdpJREFUeJzt3X20XHV97/H3l0SKQRBTbB5MaCKQq1UQ8KFRRAdM7gpc\nSu0ft8oqldtru/yjtN57266mupaevyy61l3l2qerqL3Yax9WKZeFokuSwxkB0fD8IElIUcE83JyQ\nBKJIXU3g2z9mAicnM+fMzJ5zZs+e92utWcye2TP7S7Lymb2/e+/fLzITSVJ1nTDoAiRJc8ugl6SK\nM+glqeIMekmqOINekirOoJekiisc9BGxISK2R8S/RMQft3j/NyLi4Yh4JCK+HRHnFt2mJKlzUeQ6\n+ohYADwOrAN2A/cCV2bmtinrvBPYmpmHImIDMJaZa4uVLUnqVNE9+ncAT2Tmk5l5GPgH4FenrpCZ\n38nMQ83FLcCKgtuUJHWhaNC/Dtg5ZXlX87V2Pgx8veA2JUldWFjw8x33fSLiYuC/AhcW3KYkqQtF\ng343sHLK8koae/XHaJ6AvR7YkJnPtPqiiHDQHUnqQWbGTO8Xbd3cB5wdEasi4kTgA8AtU1eIiDOA\nm4CrMvOJWYot/eOTn/zkwGuoSp3DUKN1WmfZH50otEefmUci4hrgm8AC4IuZuS0iPtJ8/3PAJ4DX\nAH8dEQCHM/MdRbYrSepc0dYNmfkN4BvTXvvclOe/Dfx20e1IknrjnbFdqtVqgy6hI8NQ5zDUCNbZ\nb9Y5/wrdMNVPEZFlqUWShkVEkHN8MlaSVHIGvSRVnEEvSRVn0EtSxRn0klRxBr0kVZxBL0kVZ9BL\nUsUZ9JJUcQa9JFWcQS9JFVd49MpRtmsXPPUU/PzPNx6veQ0s9E9UUsk4qFkBl17aCPrDh+HAATh0\nCE499eXg7/SxaBHEjEMSSVJrnQxqZtD36N/+DU4/HZ58EhYvbrz2wgvwzDON0D94sPHfTh6Zxwb/\n4sWz/zgsXgwLFgz0j0BSCXQS9DYaevTd78KaNS+HPDSC9/TTG49uPP98+x+B3bvhkUeOf92jB0md\nMuh7ND4O73tff75r0aLGY+XK2dc9aurRw/THwYOtfxxaHT20OlLw6EGqFls3PbrwQhgbg/XrB11J\nd2Y6emj38OhBKi979HPkJz+BZctg375GmFXdTEcP048kujl6aHUk4dGD1B179HPkjjvg7W8fjZCH\nuTn3sGsXPPywRw/SfDDoe7B5M6xbN+gqyq/f5x4OHDj+x+HoUUQ3Rw9T73vw6EGjwNZND849Fz7/\neVi7dtCV6Khezj38+McvHz10ckmrRw8qI3v0c2DfvsZllfv3exfssOv03MP0B3j0oPKwRz8Hbr8d\n3vteQ74Kejn3kHns0cP0E9Dtzj1MPXro5sY4jx7UD8ZVlzZv7t/18xo+EXDyyY3HGWd0/rluzz14\n9KB+snXTpdWr4Wtfgze9adCVqOqmHz20O4ro5Oihk5vjPHoYTvbo++wHP2jcKLVnj/8gVF6eexgt\n89Kjj4gNwHXAAuALmfnpFut8FrgUeB74L5n5YNHtDsLRto0hrzLrx7mH6Y+dOzs/99DJkYRHD/Or\nUNBHxALgL4B1wG7g3oi4JTO3TVnnMuCszDw7In4Z+GtgKC9MHB+HDRsGXYXUf3N17mHnTo8eyqBQ\n6yYi3gl8MjM3NJc3AmTmtVPW+d/ARGb+Y3N5O/DezJyc9l2lbt28+CIsWQL339/dPwRJx5rt6KHd\nOYlejh6Onnuosvlo3bwO2DlleRfwyx2sswKYZIg88khjj8KQl4qZ76OHiO4uaa3i0UPRoO90F3z6\nr015d93b6OewxJK6N1fnHh56qPW5h1e/ursjhxUrynveoWjQ7wamjmSyksYe+0zrrGi+dpyxsbGX\nntdqNWq1WsHy+md8HD784UFXIakbvR49HDnSOHpodynr9KOHgwcb04rOx1FAvV6nXq939ZmiPfqF\nwOPA+4A9wD3AlS1Oxl6TmZdFxFrgusw87mRsmXv0raYNlKQymPMefWYeiYhrgG/SuLzyi5m5LSI+\n0nz/c5n59Yi4LCKeAH4K/FaRbQ7Cli1w9tmGvKTh5A1THRgba/T5PvOZQVciScfqZI/+hPkqZpg5\n/rykYeYe/Syeew6WLh2daQMlDRf36PvgjjvgbW8z5CUNL4N+FuPjtm0kDTeDfhaOPy9p2Nmjn8G+\nfY3LKg8ccEYpSeVkj76giQmnDZQ0/Az6Gdi2kVQFBv0MHMhMUhUY9G384AeNu2GdG1bSsDPo2zi6\nN1/WYUclqVMGfRu2bSRVhZdXtvDii41hD+67zxmlJJWbl1f26NFHG7PLGPKSqsCgb8G2jaQqMehb\nMOglVYk9+mkOH25MG/j973c3CbEkDYI9+h5s2QJnnmnIS6oOg34a2zaSqsagn8bx5yVVjT36KY5O\nGzg5CSefPNBSJKkj9ui7dOed8Na3GvKSqsWgn8K2jaQqMuincPx5SVVkj77p6afhrLNg/354xSsG\nVoYkdcUefRcmJuA97zHkJVWPQd9k20ZSVRn0Td4oJamqDHrgyScb19C/+c2DrkSS+q9Q0EfE4ojY\nFBE7IuK2iDitxTorI2IiIh6LiO9FxO8X2eZccNpASVVWdI9+I7ApM9cA483l6Q4D/z0z3wSsBX43\nIt5YcLt9ZX9eUpUVurwyIrYD783MyYhYCtQz8w2zfOZm4M8zc3za6wO5vDKzMezBli2watW8b16S\nCpmPyyuXZOZk8/kksGSWglYB5wNbCm63b773PTjlFENeUnUtnG2FiNgELG3x1senLmRmRkTbXfKI\neBVwI/DRzHyu1TpjY2MvPa/VatRqtdnKK8y2jaRhUq/XqdfrXX2mH62bWmbujYhlwESr1k1EvAL4\nGvCNzLyuzXcNpHVz+eXwoQ/Br//6vG9akgqbj9bNLcDVzedXAze3KCKALwJb24X8oBw+3Bix8pJL\nBl2JJM2dokF/LbA+InYAlzSXiYjlEXFrc50LgauAiyPiweZjQ8Ht9sU998DrX++0gZKqbdYe/Uwy\n8yBw3MC+mbkH+E/N53dR0huzvBtW0igoZQDPF8eflzQKRnaY4p/+FJYscdpAScPNYYpncOedcMEF\nhryk6hvZoLdtI2lUjHTQeyJW0igYyR79/v1w5plOGyhp+Nmjb2NiAi66yJCXNBpGMuht20gaJSMZ\n9A5kJmmUjFzQP/UU/OQnThsoaXSMXNCPjzcGMTth5P7PJY2qkYs72zaSRs1IXV6ZCcuWwXe+A6tX\nz+mmJGleeHnlNI891hjywJCXNEpGKuht20gaRSMV9F4/L2kUjUyP/vDhxkxSTzwBr33tnG1GkuaV\nPfop7r230Zs35CWNmpEJets2kkbVSAW9489LGkUj0aM/Om3g3r3wqlfNySYkaSDs0TfddRecf74h\nL2k0jUTQ27aRNMpGJug9EStpVFW+R3/gQOOyyv374cQT+/71kjRQ9uh5edpAQ17SqKp80Nu2kTTq\nKh/0DmQmadT1HPQRsTgiNkXEjoi4LSJOm2HdBRHxYER8tdft9eJHP4Jnn4VzzpnPrUpSuRTZo98I\nbMrMNcB4c7mdjwJbgXk983u0beO0gZJGWZEIvAK4ofn8BuD9rVaKiBXAZcAXgBnPDPebbRtJKhb0\nSzJzsvl8EljSZr0/A/4IeLHAtrqWCbffbtBL0sKZ3oyITcDSFm99fOpCZmZEHNeWiYjLgX2Z+WBE\n1GYrZmxs7KXntVqNWm3Wj7S1dSu88pXw+tf3/BWSVDr1ep16vd7VZ3q+YSoitgO1zNwbEcuAicx8\nw7R1PgX8JnAEOAk4FfjnzPxQi+/r6w1Tn/0sPPooXH99375Skkpnrm+YugW4uvn8auDm6Stk5scy\nc2VmrgY+CNzeKuTngv15SWooEvTXAusjYgdwSXOZiFgeEbe2+cy8XHVz5AjccQdccsl8bE2Syq2S\nY91897vwkY/Aww/35eskqbRGdqwb2zaS9LJKBr3jz0vSyyrXunn+efiFX3DaQEmjYSRbN3fdBeed\nZ8hL0lGVC3rbNpJ0rEoGvSdiJelllerRHzwIq1Y5baCk0TFyPfqJCXj3uw15SZqqUkFv20aSjmfQ\nS1LFVSbod+5s9OjPPXfQlUhSuVQm6MfHG4OYOW2gJB2rMrFo20aSWqvE5ZWZsHx5467YM8/sc2GS\nVGIjc3nltm1w0klOGyhJrVQi6I+2bWLG3zRJGk2VCHrHn5ek9oa+R3/kCJx+Ojz+OCxZMgeFSVKJ\njUSP/v774YwzDHlJamfog962jSTNbOiD3vHnJWlmQ92j/9d/bUwbuGcPnHLKHBUmSSVW+R79t7/d\nGNvGkJek9oY66Ddvtm0jSbMZ6qB3fBtJmt3Q9uifeQZ+8RedNlDSaKt0j35iAt71LkNekmYztEHv\nZZWS1Jmegz4iFkfEpojYERG3RcRpbdY7LSJujIhtEbE1Itb2Xu7L7M9LUmeK7NFvBDZl5hpgvLnc\nyv8Cvp6ZbwTOBbYV2CYAu3Y1evNveUvRb5Kk6isS9FcANzSf3wC8f/oKEfFq4KLM/BJAZh7JzEMF\ntgk4baAkdaNIVC7JzMnm80mg1bBiq4GnI+JvIuKBiLg+IhYV2CZg20aSurFwpjcjYhOwtMVbH5+6\nkJkZEa2ujVwIXABck5n3RsR1NFo8n2i1vbGxsZee12o1arXacetkNm6U+kTLb5CkaqvX69Tr9a4+\n0/N19BGxHahl5t6IWAZMZOYbpq2zFPhOZq5uLr8b2JiZl7f4vo6uo9+2DS69FH74Q2eUkqS5vo7+\nFuDq5vOrgZunr5CZe4GdEbGm+dI64LEC23TaQEnqUpGgvxZYHxE7gEuay0TE8oi4dcp6vwd8JSIe\npnHVzacKbNP+vCR1aaiGQDhyBF77Wti+3RmlJAkqOATCAw/AihWGvCR1Y6iC3raNJHVvqILe8ecl\nqXtD06M/Om3g7t1w6qnzWJgklVilevR33w3nnGPIS1K3hibobdtIUm+GJug9EStJvRmKHv3RaQOf\nfhp+7ufmuTBJKrHK9OjrdXjnOw15SerFUAS90wZKUu+GJujtz0tSb0of9Lt3w759cN55g65EkoZT\n6YPeaQMlqZjSx6dtG0kqptRBn2nQS1JRpQ76xx+HBQvgrLMGXYkkDa9SB73TBkpScUMR9JKk3pV2\nCIQXXmhMG7h1KyxdOsDCJKnEhnoIhAcegOXLDXlJKqq0QW/bRpL6o7RB7/jzktQfpezR/+xnjf68\n0wZK0syGtkd/993w5jcb8pLUD6UM+s2b7c9LUr+UMugdf16S+qd0Pfpnn4WVK2H/fmeUkqTZDGWP\n/lvfctpASeqnnoM+IhZHxKaI2BERt0XEaW3W+5OIeCwiHo2Iv4uIGSPcyyolqb+K7NFvBDZl5hpg\nvLl8jIhYBfwOcEFmngMsAD4405d6o5Qk9VeRoL8CuKH5/Abg/S3W+TFwGFgUEQuBRcDudl+4Zw9M\nTjptoCT1U5GgX5KZk83nk8CS6Stk5kHgfwI/AvYAz2bm5nZfOD4OF1/cGINektQfC2d6MyI2Aa2G\nFfv41IXMzIg47vKdiDgT+G/AKuAQ8E8R8RuZ+ZVW27NtI0n9N2PQZ+b6du9FxGRELM3MvRGxDNjX\nYrW3AXdn5oHmZ24C3gW0DPqbbhrjlFNgbAxqtRq1Wq3D/w1JGg31ep16vd7VZ3q+jj4iPgMcyMxP\nR8RG4LTM3DhtnbfQCPW3Az8D/g9wT2b+ZYvvy5Urk6eeckYpSerUXF9Hfy2wPiJ2AJc0l4mI5RFx\nK0BmPgx8GbgPeKT5uc+3+0KnDZSk/ivVnbF/+7fJVVcNuhJJGh6d7NGXKuj37EmWLRt0JZI0PIYu\n6MtSiyQNi6Ec60aS1F8GvSRVnEEvSRVn0EtSxRn0klRxBr0kVZxBL0kVZ9BLUsUZ9JJUcQa9JFWc\nQS9JFWfQS1LFGfSSVHEGvSRVnEEvSRVn0EtSxRn0klRxBr0kVZxBL0kVZ9BLUsUZ9JJUcQa9JFWc\nQS9JFWfQS1LFGfSSVHEGvSRVXM9BHxH/OSIei4gXIuKCGdbbEBHbI+JfIuKPe92eJKk3RfboHwV+\nDbij3QoRsQD4C2AD8EvAlRHxxgLbHLh6vT7oEjoyDHUOQ41gnf1mnfOv56DPzO2ZuWOW1d4BPJGZ\nT2bmYeAfgF/tdZtlMCx/+cNQ5zDUCNbZb9Y5/+a6R/86YOeU5V3N1yRJ82ThTG9GxCZgaYu3PpaZ\nX+3g+7OnqiRJfROZxbI4IiaAP8jMB1q8txYYy8wNzeU/AV7MzE+3WNcfBUnqQWbGTO/PuEffhXYb\nuQ84OyJWAXuADwBXtlpxtkIlSb0pcnnlr0XETmAtcGtEfKP5+vKIuBUgM48A1wDfBLYC/5iZ24qX\nLUnqVOHWjSSp3EpzZ2ynN2ANyjDc+BURX4qIyYh4dNC1zCQiVkbERPPv+3sR8fuDrqmViDgpIrZE\nxEMRsTUi/nTQNbUTEQsi4sGI6OQiiYGJiCcj4pFmrfcMup5WIuK0iLgxIrY1/97XDrqm6SLiPzT/\nDI8+Ds3076g0e/QR8QbgReBztDm5OyjNG78eB9YBu4F7gSvL1oaKiIuA54AvZ+Y5g66nnYhYCizN\nzIci4lXA/cD7y/bnCRARizLz+YhYCNwF/GFm3jXouqaLiP8BvBU4JTOvGHQ97UTED4G3ZubBQdfS\nTkTcAHwrM7/U/Hs/OTMPDbqudiLiBBq59I7M3NlqndLs0Xd4A9agDMWNX5l5J/DMoOuYTWbuzcyH\nms+fA7YBywdbVWuZ+Xzz6YnAAqB0ARURK4DLgC/Q/sKIMiltjRHxauCizPwSNM4zljnkm9YB328X\n8lCioC85b/yaI80rss4Htgy2ktYi4oSIeAiYBCYyc+uga2rhz4A/onFEXHYJbI6I+yLidwZdTAur\ngacj4m8i4oGIuD4iFg26qFl8EPi7mVaY16CPiE0R8WiLx6/MZx09KEd/q2KabZsbgY829+xLJzNf\nzMzzgBXAeyKiNuCSjhERlwP7MvNBSrynPMWFmXk+cCnwu812Y5ksBC4A/iozLwB+CmwcbEntRcSJ\nwK8A/zTTev26jr4jmbl+PrfXR7uBlVOWV9LYq1ePIuIVwD8D/zczbx50PbPJzEPNy4bfBtQHXM5U\n7wKuiIjLgJOAUyPiy5n5oQHX1VJm/v/mf5+OiP9Hoy1652CrOsYuYFdm3ttcvpESBz2NH8z7M/Pp\nmVYqa+umbHsmL9341fwF/QBwy4BrGloREcAXga2Zed2g62knIk6PiNOaz18JrAceHGxVx8rMj2Xm\nysxcTeMQ/vayhnxELIqIU5rPTwb+I41RcEsjM/cCOyNiTfOldcBjAyxpNlcCfz/bSqUJ+nY3YJXB\nsNz4FRF/D9wNrImInRHxW4OuqY0LgauAi6dcHrZh0EW1sAy4vdmj3wJ8NTPHB1zTbMrcZlwC3Dnl\nz/NrmXnbgGtq5feAr0TEw8C5wKcGXE9LzR/LdcBNs65blssrJUlzozR79JKkuWHQS1LFGfSSVHEG\nvSRVnEEvSRVn0EtSxRn0klRxBr0kVdy/Axa1VVXVraQUAAAAAElFTkSuQmCC\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x5932610>"
+ ]
+ }
+ ],
+ "prompt_number": 37
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex81-pg4.66"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##AC Circuits : example 4.81 :(pg 4.66)\n",
+ "import math\n",
+ "V=200.;\n",
+ "Vc=5000.;\n",
+ "I0=20.;\n",
+ "C=4.*10**-6;\n",
+ "R=V/I0;\n",
+ "Xco=Vc/I0;\n",
+ "f0=(1./(2.*math.pi*Xco*C));\n",
+ "L=(Xco/(2.*math.pi*f0));\n",
+ "print(\"\\nV=200 V \\nI0= 20 A \\nVc=5000 V \\nC=4uF\");\n",
+ "print'%s %.2f %s'%(\"\\nR=V/I0 = \",R,\" Ohm\");##resistance\n",
+ "print'%s %.2f %s'%(\"\\nXco=Vco/Io = \",Xco,\" Ohm\");\n",
+ "print'%s %.2f %s'%(\"\\nXco=1/2*pi*f0*C \\nf0=1/2*pi*Xco*C = \",f0,\" Hz\");\n",
+ "print'%s %.2f %s'%(\"\\nat resonance Xco=Xlo \\nXlo= \",Xco,\" Ohm\");\n",
+ "print'%s %.2f %s'%(\"\\nXlo=2*pi*f0*L \\nL= \",L,\" H\");\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "V=200 V \n",
+ "I0= 20 A \n",
+ "Vc=5000 V \n",
+ "C=4uF\n",
+ "\n",
+ "R=V/I0 = 10.00 Ohm\n",
+ "\n",
+ "Xco=Vco/Io = 250.00 Ohm\n",
+ "\n",
+ "Xco=1/2*pi*f0*C \n",
+ "f0=1/2*pi*Xco*C = 159.15 Hz\n",
+ "\n",
+ "at resonance Xco=Xlo \n",
+ "Xlo= 250.00 Ohm\n",
+ "\n",
+ "Xlo=2*pi*f0*L \n",
+ "L= 0.25 H\n"
+ ]
+ }
+ ],
+ "prompt_number": 38
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex82-pg4.66"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##AC Circuits : example 4.82 :(pg 4.66)\n",
+ "import math\n",
+ "V=230.;\n",
+ "f0=50.;\n",
+ "I0=2.;\n",
+ "Vco=500.;\n",
+ "R=V/I0;\n",
+ "Xco=Vco/I0;\n",
+ "C=(1/(2.*math.pi*f0*Xco));\n",
+ "L=(Xco/(2.*math.pi*f0));\n",
+ "print(\"\\nV = 230 V \\nf0 = 50 Hz \\nI0 = 2A \\nVco = 500 V\");\n",
+ "print'%s %.2f %s'%(\"\\nR=V/I0 = \",R,\" Ohm\");\n",
+ "print'%s %.2f %s'%(\"\\nXco=Vco/I0 = \",Xco,\" Ohm\");\n",
+ "print'%s %.2f %s'%(\"\\nXco=1/2.pi.f0.C \\nC= \",C,\" F\");##capacitance\n",
+ "print'%s %.2f %s'%(\"\\nXco=Xlo \\nXlo= \",Xco,\" Ohm\");##at resonance\n",
+ "print'%s %.2f %s'%(\"\\nXlo=2.pi.f0.L \\nL= \",L,\" H\");##inductance\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "V = 230 V \n",
+ "f0 = 50 Hz \n",
+ "I0 = 2A \n",
+ "Vco = 500 V\n",
+ "\n",
+ "R=V/I0 = 115.00 Ohm\n",
+ "\n",
+ "Xco=Vco/I0 = 250.00 Ohm\n",
+ "\n",
+ "Xco=1/2.pi.f0.C \n",
+ "C= 0.00 F\n",
+ "\n",
+ "Xco=Xlo \n",
+ "Xlo= 250.00 Ohm\n",
+ "\n",
+ "Xlo=2.pi.f0.L \n",
+ "L= 0.80 H\n"
+ ]
+ }
+ ],
+ "prompt_number": 39
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex83-pg4.67"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##AC Circuits : example 4.82 :(pg 4.66)\n",
+ "import math\n",
+ "R=2.;\n",
+ "L=0.01;\n",
+ "V=200.;\n",
+ "f0=50.;\n",
+ "C=(1./(4.*(math.pi)**2*L*(f0**2)));\n",
+ "I0=V/R;\n",
+ "Vco=I0*(1./(2.*math.pi*f0*C));\n",
+ "print(\"\\nR= 2 Ohm \\nL= 0.01 H \\nV=200 V \\nf0=50 Hz \\nf0=1/(2.pi.sqrt(LC)\");\n",
+ "print'%s %.2f %s'%(\"\\nC = \",C,\" F\");##capacitance\n",
+ "print'%s %.2f %s'%(\"\\nI0= V/R = \",I0,\" A\");##current\n",
+ "print'%s %.2f %s'%(\"\\nVco=I0.Xco \\n= \",Vco,\" V\"); ##voltage across capacitor\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "R= 2 Ohm \n",
+ "L= 0.01 H \n",
+ "V=200 V \n",
+ "f0=50 Hz \n",
+ "f0=1/(2.pi.sqrt(LC)\n",
+ "\n",
+ "C = 0.00 F\n",
+ "\n",
+ "I0= V/R = 100.00 A\n",
+ "\n",
+ "Vco=I0.Xco \n",
+ "= 314.16 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 41
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex84-pg4.67"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##AC Circuits : example 4.84 :(pg 4.67)\n",
+ "import math\n",
+ "BW=400.;\n",
+ "Vco=500.;\n",
+ "R=100.;\n",
+ "Vm=10.;\n",
+ "V=(Vm/math.sqrt(2.));\n",
+ "I0=V/R;\n",
+ "L=R/BW;\n",
+ "Q0=Vco/V;\n",
+ "C=(L/(Q0*R)**2);\n",
+ "f0=(1/(2.*math.pi*math.sqrt(L*C)));\n",
+ "f1=(f0-(R/(4.*math.pi*L)));##lower cut-off frequency\n",
+ "f2=(f0+(R/(4.*math.pi*L)));##upper cut-off frequency\n",
+ "print(\"\\nv(t)=10sinwt \\nVco=5000V \\nBW=400rad/s \\nR=100 Ohm\");\n",
+ "print'%s %.2f %s'%(\"\\nV= \",V,\" V\");\n",
+ "print'%s %.2f %s'%(\"\\nI0=V/R= \",I0,\" A\");\n",
+ "print'%s %.2f %s'%(\"\\nBW=R/L \\nL= \",L,\" H\");\n",
+ "print'%s %.2f %s'%(\"\\nQ0=Vco/V =\",Q0,\"\");\n",
+ "print'%s %.2e %s'%(\"\\nQ0=1/R*sqrt(L/C) \\nC= \",C,\" F\");\n",
+ "print'%s %.2f %s'%(\"\\nf0=1/2.pi.sqrt(LC)= \",f0,\" Hz\");\n",
+ "print'%s %.2f %s'%(\"\\nf1=f0-R/4.pi.L = \",f1,\" Hz\");##lower cut-off frequency\n",
+ "print'%s %.2f %s'%(\"\\nf2=f0+R/4.pi.L = \",f2,\" Hz\"); ##upper cut-off frequency"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "v(t)=10sinwt \n",
+ "Vco=5000V \n",
+ "BW=400rad/s \n",
+ "R=100 Ohm\n",
+ "\n",
+ "V= 7.07 V\n",
+ "\n",
+ "I0=V/R= 0.07 A\n",
+ "\n",
+ "BW=R/L \n",
+ "L= 0.25 H\n",
+ "\n",
+ "Q0=Vco/V = 70.71 \n",
+ "\n",
+ "Q0=1/R*sqrt(L/C) \n",
+ "C= 5.00e-09 F\n",
+ "\n",
+ "f0=1/2.pi.sqrt(LC)= 4501.58 Hz\n",
+ "\n",
+ "f1=f0-R/4.pi.L = 4469.75 Hz\n",
+ "\n",
+ "f2=f0+R/4.pi.L = 4533.41 Hz\n"
+ ]
+ }
+ ],
+ "prompt_number": 42
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex85-pg4.68"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##AC Circuits : example 4.85 :(pg 4.68)\n",
+ "import math\n",
+ "R=500.;\n",
+ "f1=100.;\n",
+ "f2=10.*10**3;\n",
+ "BW=f2-f1;\n",
+ "f0=((f1+f2)/2.);\n",
+ "L=(R/(2.*math.pi*BW));\n",
+ "XL0=(2.*math.pi*f0*L);\n",
+ "C=(1/(2.*math.pi*f0*XL0));\n",
+ "Q0=((1./R)*(math.sqrt(L/C)));\n",
+ "print'%s %.2f %s'%(\"\\nR= 500 Ohm \\nf1 = 100 Hz \\nf2=10kHz \\nBW= f2-f1 = \",BW,\" Hz\");\n",
+ "print'%s %.2f %s'%(\"\\nf1=f0-BW/2 ------(i) \\nf2=f0+BW/2 ------(ii) \\nf1+f2 =2f0 \\nf0=(f1+f2)/2 = \",f0,\" Hz\");\n",
+ "print'%s %.2f %s'%(\"\\nBW=R/2.pi.f0.L \\nL= \",L,\" H\");\n",
+ "print'%s %.2f %s'%(\"\\nXL0=2.pi.f0.L = \",XL0,\" Ohm\");\n",
+ "print'%s %.2f %s'%(\"\\nXL0=XC0 = \",XL0,\" Ohm\");##at resonance\n",
+ "print'%s %.2e %s'%(\"\\nXC0 =1/2.pi.f0.C \\nC= \",C,\" F\");\n",
+ "print'%s %.2f %s'%(\"\\nQ0=(1/R*sqrt(L/C)) =\",Q0,\"\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "R= 500 Ohm \n",
+ "f1 = 100 Hz \n",
+ "f2=10kHz \n",
+ "BW= f2-f1 = 9900.00 Hz\n",
+ "\n",
+ "f1=f0-BW/2 ------(i) \n",
+ "f2=f0+BW/2 ------(ii) \n",
+ "f1+f2 =2f0 \n",
+ "f0=(f1+f2)/2 = 5050.00 Hz\n",
+ "\n",
+ "BW=R/2.pi.f0.L \n",
+ "L= 0.01 H\n",
+ "\n",
+ "XL0=2.pi.f0.L = 255.05 Ohm\n",
+ "\n",
+ "XL0=XC0 = 255.05 Ohm\n",
+ "\n",
+ "XC0 =1/2.pi.f0.C \n",
+ "C= 1.24e-07 F\n",
+ "\n",
+ "Q0=(1/R*sqrt(L/C)) = 0.51 \n"
+ ]
+ }
+ ],
+ "prompt_number": 43
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex87-pg4.69"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##AC Circuits : example 4.87 :(pg 4.69 & 4.70)\n",
+ "import math\n",
+ "f0=10**6;\n",
+ "C1=500.*10**-12;\n",
+ "C2=600.*10**-12;\n",
+ "C=500.*10**-12;\n",
+ "x=((2.*math.pi*f0)**2);\n",
+ "L=(1./(x*C));\n",
+ "XL=(2.*math.pi*f0*L);\n",
+ "y=2.*math.pi*f0*C2;\n",
+ "XC=(1./y);\n",
+ "R=math.sqrt(((XL-XC)**2)/3.);\n",
+ "x=math.sqrt(L/C);\n",
+ "Q0=((1./R)*x);\n",
+ "print(\"\\nf0= 1MHz \\nC1=500pF \\nC2=600pF \\nC=500pF\");##At resonance\n",
+ "print'%s %.2e %s'%(\"\\nf0=1/2.pi.sqrt(LC)\\nL= \",L,\" H\");\n",
+ "print'%s %.2f %s'%(\"\\nXL=2.pi.f0.L = \",XL,\" Ohm\");\n",
+ "print'%s %.2f %s'%(\"\\nXC=1/2.pi.f0.C \\nXC= \",XC,\" Ohm\");\n",
+ "print(\"\\nI=1/2.I0 \\nV/Z=1/2.V/R \\nZ=2R\");\n",
+ "print'%s %.2f %s'%(\"\\nsqrt((R^2)-(XL-XC)^2)=2R \\nR= \",R,\" Ohm\");##Resistance of Inductor\n",
+ "print'%s %.2f %s'%(\"\\nQ0=1/R.sqrt(L/C) \\n=\",Q0,\"\");\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "f0= 1MHz \n",
+ "C1=500pF \n",
+ "C2=600pF \n",
+ "C=500pF\n",
+ "\n",
+ "f0=1/2.pi.sqrt(LC)\n",
+ "L= 5.07e-05 H\n",
+ "\n",
+ "XL=2.pi.f0.L = 318.31 Ohm\n",
+ "\n",
+ "XC=1/2.pi.f0.C \n",
+ "XC= 265.26 Ohm\n",
+ "\n",
+ "I=1/2.I0 \n",
+ "V/Z=1/2.V/R \n",
+ "Z=2R\n",
+ "\n",
+ "sqrt((R^2)-(XL-XC)^2)=2R \n",
+ "R= 30.63 Ohm\n",
+ "\n",
+ "Q0=1/R.sqrt(L/C) \n",
+ "= 10.39 \n"
+ ]
+ }
+ ],
+ "prompt_number": 44
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex88-pg4.72"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##AC Circuits : example 4.88 :(pg 4.72)\n",
+ "import math\n",
+ "R=20.;\n",
+ "C=100.*10**-6;\n",
+ "L=0.2;\n",
+ "DR=(L/(C*R));\n",
+ "x=(1./(L*C));\n",
+ "y=((R/L)**2);\n",
+ "f0=((1./(2.*math.pi))*math.sqrt(x-y));\n",
+ "DR=(L/(C*R));\n",
+ "print(\"\\nR=20 Ohm \\nL=0.2 H \\nC=100uF\");\n",
+ "print'%s %.2f %s'%(\"\\nf0=1/2.pi.sqrt(1/LC-R^2/L^2) \\n= \",f0,\" Hz\");\n",
+ "print'%s %.2f %s'%(\"\\n dynamic resistance =L/CR \\n= \",DR,\" Ohm\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "R=20 Ohm \n",
+ "L=0.2 H \n",
+ "C=100uF\n",
+ "\n",
+ "f0=1/2.pi.sqrt(1/LC-R^2/L^2) \n",
+ "= 31.83 Hz\n",
+ "\n",
+ " dynamic resistance =L/CR \n",
+ "= 100.00 Ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 45
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex89-pg4.72"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##AC Circuits : example 4.89 :(pg 4.72 & 4.73)\n",
+ "import math\n",
+ "R=20.;\n",
+ "L=200.*10**-6;\n",
+ "f=10**6;\n",
+ "V=230.;\n",
+ "Rs=8000.;\n",
+ "XL=2.*math.pi*f*L;\n",
+ "x=((2.*math.pi*f)**2);\n",
+ "y=((R/L)**2);\n",
+ "C=(1./((x+y)*L));\n",
+ "Q=((2.*math.pi*f*L)/R);\n",
+ "Z=(L/(C*R));\n",
+ "ZT=(Rs+Z);\n",
+ "IT=(V/ZT);\n",
+ "print'%s %.2f %s'%(\"\\nR=20 Ohm \\nL=200uH \\nf=10^6 \\nV=230 V \\nRs=8000 Ohm \\nXL=2.pi.f.L = \",XL,\"Ohm\");\n",
+ "print'%s %.2f %s'%(\"\\nf0=1/2.pi.sqrt(1/LC-R^2/L^2) \\nC= \",C,\" F\");\n",
+ "print'%s %.2f %s'%(\"\\nQ0=2.pi.f.L/R =\",Q,\"\");##quality factor\n",
+ "print'%s %.2f %s'%(\"\\nZ=L/CR \\n \",Z,\" Ohm\");##dynamic impedance\n",
+ "print'%s %.2f %s'%(\"\\nZt= \",ZT,\" Ohm\");##total equivalent Z at resonance\n",
+ "print'%s %.2e %s'%(\"\\nIt= \",IT,\" A\");##total ckt current"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "R=20 Ohm \n",
+ "L=200uH \n",
+ "f=10^6 \n",
+ "V=230 V \n",
+ "Rs=8000 Ohm \n",
+ "XL=2.pi.f.L = 1256.64 Ohm\n",
+ "\n",
+ "f0=1/2.pi.sqrt(1/LC-R^2/L^2) \n",
+ "C= 0.00 F\n",
+ "\n",
+ "Q0=2.pi.f.L/R = 62.83 \n",
+ "\n",
+ "Z=L/CR \n",
+ " 78976.84 Ohm\n",
+ "\n",
+ "Zt= 86976.84 Ohm\n",
+ "\n",
+ "It= 2.64e-03 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 46
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electrical_Network_by_R._Singh/Chapter6.ipynb b/Electrical_Network_by_R._Singh/Chapter6.ipynb new file mode 100644 index 00000000..6362ce58 --- /dev/null +++ b/Electrical_Network_by_R._Singh/Chapter6.ipynb @@ -0,0 +1,1092 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:ca0fbf545db81ddf68d13f910e1ceeaef7b910e50180358f79f497a3c4d6557e"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter6-Three phase Circuits"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex8-pg6.14"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "## Three-Phase Circuits :example 6.8 :(pg 6.14)\n",
+ "VL=440.;\n",
+ "import math\n",
+ "P=50*10**3;\n",
+ "IL=90.;\n",
+ "Iph=IL/math.sqrt(3);\n",
+ "pf=(P/(math.sqrt(3)*VL*IL));\n",
+ "S=math.sqrt(3)*VL*IL;\n",
+ "print(\"\\nVL=440 V \\nP=50kW \\nIL=90 A\");\n",
+ "print\"%s %.2f %s\"%(\"\\nVL=Vph=\",VL,\" V\");##For delta-connected load\n",
+ "print\"%s %.2f %s\"%(\"\\nIph=IL/sqrt(3)=\",Iph,\" A\");\n",
+ "print(\"\\nP=sqrt(3)*VL*IL*cos(phi)\");\n",
+ "print\"%s %.2f %s\"%(\"\\ncos(phi)=\",pf,\" (lagging)\");\n",
+ "print\"%s %.2f %s\"%(\"\\nS=sqrt(3)*VL*IL =\",S,\" VA\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "VL=440 V \n",
+ "P=50kW \n",
+ "IL=90 A\n",
+ "\n",
+ "VL=Vph= 440.00 V\n",
+ "\n",
+ "Iph=IL/sqrt(3)= 51.96 A\n",
+ "\n",
+ "P=sqrt(3)*VL*IL*cos(phi)\n",
+ "\n",
+ "cos(phi)= 0.73 (lagging)\n",
+ "\n",
+ "S=sqrt(3)*VL*IL = 68589.21 VA\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex9-pg6.15"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "## Three-Phase Circuits :example 6.9 :(pg 6.15)\n",
+ "IL=15.;\n",
+ "import math\n",
+ "P=11.*10**3;\n",
+ "S=15.*10**3;\n",
+ "VL=S/(math.sqrt(3.)*IL);\n",
+ "Vph=VL/math.sqrt(3.);\n",
+ "x=(P/S)*57.3;\n",
+ "phi=math.acos(P/S);\n",
+ "Q=math.sqrt(3.)*VL*IL*math.sin(phi/57.3);\n",
+ "Iph=IL;\n",
+ "Zph=Vph/Iph;\n",
+ "R=Zph*math.cos(phi/57.3);\n",
+ "XL=Zph*math.sin(phi/57.3);\n",
+ "Vph1=VL;\n",
+ "Iph1=(Vph1/Zph);\n",
+ "IL1=math.sqrt(3.)*Iph1;\n",
+ "P1=math.sqrt(3.)*VL*IL1*math.cos(phi/57.3);\n",
+ "Q1=math.sqrt(3.)*VL*IL1*math.sin(phi/57.3);\n",
+ "print(\"\\nIL=15 A \\nP=11kW \\nS=15kVA \");\n",
+ "##For a star-connected load\n",
+ "print\"%s %.2f %s\"%(\"\\nS=sqrt(3)*VL*IL \\nVL=\",Vph,\" V\");\n",
+ "print\"%s %.2f %s\"%(\"\\ncos(phi)=P/S =\",x,\"\");\n",
+ "print\"%s %.3f %s\"%(\"\\nphi=\",phi,\" degrees\"); \n",
+ "print\"%s %.2f %s\"%(\"\\nQ=sqrt(3).VL.IL.sin(phi) = \",Q,\" VAR\");\n",
+ "print\"%s %.2f %s\"%(\"\\nIph=IL = \",IL,\" A\");\n",
+ "print\"%s %.2f %s\"%(\"\\nZph=Vph/Iph = \",Zph,\" Ohm\");\n",
+ "print\"%s %.2f %s\"%(\"\\nR= Zph*cos(phi) =\",R,\" Ohm\");\n",
+ "print\"%s %.2f %s\"%(\"\\nXL=Zph*sin(phi)= \",XL,\" Ohm\");\n",
+ "##If these coils are connected in Delta \n",
+ "print\"%s %.2f %s\"%(\"\\nCph =VL =\",VL,\" V\");\n",
+ "print\"%s %.2f %s\"%(\"\\nZph= \",Zph,\" Ohm\");\n",
+ "print\"%s %.2f %s\"%(\"\\nIph=Vph/Zph =\",Iph1,\" A \");\n",
+ "print\"%s %.2f %s\"%(\"\\nIL=sqrt(3)*Iph =\",IL1,\" A\");\n",
+ "print\"%s %.2f %s\"%(\"\\nP=sqrt(3)*VL*IL*cos(phi) =\",P1,\" W\");\n",
+ "print\"%s %.2f %s\"%(\"\\nQ=sqrt(3)*VL*IL*sin(phi) =\",Q1,\" VAR\");\n",
+ "\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex10-pg6.15"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "## Three-Phase Circuits :example 6.10 :(pg 6.16)\n",
+ "P=1500.*10**3;\n",
+ "import math\n",
+ "pf=0.85;\n",
+ "VL=2.2*10**3;\n",
+ "phi=math.acos(pf)*57.3;\n",
+ "IL=P/(math.sqrt(3.)*VL*pf);\n",
+ "Iph=IL/math.sqrt(3.);\n",
+ "AC=Iph*pf;\n",
+ "RC=Iph*math.sin(phi/57.3);\n",
+ "IAC=IL*pf;\n",
+ "IRC=IL*math.sin(phi/57.3);\n",
+ "print(\"\\nP=1500kW \\npf=0.85 (lagging) \\nVL=2.2kV\");\n",
+ "##For Delta-connected load\n",
+ "print\"%s %.2f %s\"%(\"\\nP=sqrt(3)*VL*IL*cos(phi) \\nIL=\",IL,\" A\");\n",
+ "print\"%s %.2f %s\"%(\"\\nIph=IL/sqrt(3)= \",Iph,\" A\");\n",
+ "##AC=Active Component\n",
+ "print\"%s %.2f %s\"%(\"\\nAC=Iph*cos(phi) = \",AC,\" A\"); ##in each phase of load\n",
+ "##RC=Reactive Component\n",
+ "print\"%s %.2f %s\"%(\"\\nRC=Iph*sin(phi) = \",RC,\" A\"); ##in each phase of load\n",
+ "##For star-connected source\n",
+ "print\"%s %.2f %s\"%(\"\\nIAC = \",IAC,\" A\"); ## current of AC in each phase of source\n",
+ "print\"%s %.2f %s\"%(\"\\nIRC = \",IRC,\"A\"); ## current of RC in each phase of source"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "P=1500kW \n",
+ "pf=0.85 (lagging) \n",
+ "VL=2.2kV\n",
+ "\n",
+ "P=sqrt(3)*VL*IL*cos(phi) \n",
+ "IL= 463.12 A\n",
+ "\n",
+ "Iph=IL/sqrt(3)= 267.38 A\n",
+ "\n",
+ "AC=Iph*cos(phi) = 227.27 A\n",
+ "\n",
+ "RC=Iph*sin(phi) = 140.85 A\n",
+ "\n",
+ "IAC = 393.65 A\n",
+ "\n",
+ "IRC = 243.96 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex11-pg6.16"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "## Three-Phase Circuits :example 6.11 :(pg 6.16)\n",
+ "import math\n",
+ "VL=208.;\n",
+ "P=1800.;\n",
+ "IL=10.;\n",
+ "Vph=VL/math.sqrt(3.);\n",
+ "Zph=(Vph/IL);\n",
+ "pf=P/(math.sqrt(3.)*VL*IL);\n",
+ "phi=math.acos(pf)*57.3;\n",
+ "Rph=Zph*pf;\n",
+ "Xph=Zph*math.sin(phi/57.3);\n",
+ "print(\"\\nVL=208 V \\nP=1800 W \\nIL= 10 A\");\n",
+ "##For a Wye-connected load,\n",
+ "print\"%s %.2f %s\"%(\"\\nVph = VL/sqrt(3) = \",Vph,\" V\");\n",
+ "print\"%s %.2f %s\"%(\"\\nIph = IL = \",IL,\" A\");\n",
+ "print\"%s %.2f %s\"%(\"\\nZph=Vph/Iph = \",Zph,\" Ohm\");\n",
+ "print(\"\\nP=sqrt(3)*VL*IL*cos(phi)\");\n",
+ "print\"%s %.2f %s\"%(\"\\ncos(phi)= \",pf,\" degrees\");\n",
+ "print\"%s %.2f %s\"%(\"\\nphi= \",phi,\" degrees\");\n",
+ "print\"%s %.2f %s\"%(\"\\nRph=Zph*cos(phi) = \",Rph,\" Ohm\");\n",
+ "print\"%s %.2f %s\"%(\"\\nXph=Zph*sin(phi) = \",Xph,\" Ohm\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "VL=208 V \n",
+ "P=1800 W \n",
+ "IL= 10 A\n",
+ "\n",
+ "Vph = VL/sqrt(3) = 120.09 V\n",
+ "\n",
+ "Iph = IL = 10.00 A\n",
+ "\n",
+ "Zph=Vph/Iph = 12.01 Ohm\n",
+ "\n",
+ "P=sqrt(3)*VL*IL*cos(phi)\n",
+ "\n",
+ "cos(phi)= 0.50 degrees\n",
+ "\n",
+ "phi= 60.03 degrees\n",
+ "\n",
+ "Rph=Zph*cos(phi) = 6.00 Ohm\n",
+ "\n",
+ "Xph=Zph*sin(phi) = 10.40 Ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex12-pg6.17"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "## Three-Phase Circuits :example 6.12 :(pg 6.17)\n",
+ "P=100.*10**3;\n",
+ "import math\n",
+ "IL=80.;\n",
+ "VL=1100.;\n",
+ "f=50.;\n",
+ "Vph=(VL/math.sqrt(3.));\n",
+ "Iph=IL;\n",
+ "Zph=(Vph/Iph);\n",
+ "pf=(P/(math.sqrt(3.)*VL*IL));\n",
+ "phi=math.acos(pf)*57.3;\n",
+ "Rph=Zph*pf;\n",
+ "Xph=Zph*math.sin(phi/57.3);\n",
+ "C=(1./(2.*math.pi*f*Xph));\n",
+ "print(\"\\nP=100kW \\nIL=80 A \\nVL=1100 V \\nf=50 Hz\");\n",
+ "##For a star-connected load\n",
+ "\n",
+ "print\"%s %.2f %s\"%(\"\\nIph=IL = \",Iph,\" A\");\n",
+ "\n",
+ "\n",
+ "\n",
+ "## as current is leading,reactance will be capacitive in nature\n",
+ "print(\"\\nXC=(1/2*pi*C)\");\n",
+ "print\"%s %.2e %s\"%(\"\\nC= \",C,\" F\");\n",
+ "\n",
+ "print\"%s %.2f %s\"%(\"\\nVph = VL/sqrt(3) = \",Vph,\" V\");\n",
+ "\n",
+ "print\"%s %.2f %s\"%(\"\\nZph=Vph/Iph = \",Zph,\" Ohm\");\n",
+ "print(\"\\nP=sqrt(3)*VL*IL*cos(phi)\");\n",
+ "print\"%s %.2f %s\"%(\"\\ncos(phi)= \",pf,\" degrees\");\n",
+ "print\"%s %.2f %s\"%(\"\\nphi= \",phi,\" degrees\");\n",
+ "print\"%s %.2f %s\"%(\"\\nRph=Zph*cos(phi) = \",Rph,\" Ohm\");\n",
+ "print\"%s %.2f %s\"%(\"\\nXph=Zph*sin(phi) = \",Xph,\" Ohm\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "P=100kW \n",
+ "IL=80 A \n",
+ "VL=1100 V \n",
+ "f=50 Hz\n",
+ "\n",
+ "Iph=IL = 80.00 A\n",
+ "\n",
+ "XC=(1/2*pi*C)\n",
+ "\n",
+ "C= 5.31e-04 F\n",
+ "\n",
+ "Vph = VL/sqrt(3) = 635.09 V\n",
+ "\n",
+ "Zph=Vph/Iph = 7.94 Ohm\n",
+ "\n",
+ "P=sqrt(3)*VL*IL*cos(phi)\n",
+ "\n",
+ "cos(phi)= 0.66 degrees\n",
+ "\n",
+ "phi= 49.00 degrees\n",
+ "\n",
+ "Rph=Zph*cos(phi) = 5.21 Ohm\n",
+ "\n",
+ "Xph=Zph*sin(phi) = 5.99 Ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex13-pg6.17"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "## Three-Phase Circuits :example 6.13 :(pg 6.17 & 6.18)\n",
+ "\n",
+ "import math\n",
+ "VL=400.;\n",
+ "IL=34.65;\n",
+ "P=14.4*10**3;\n",
+ "Iph=(IL/math.sqrt(3.));\n",
+ "Zph=(VL/Iph);\n",
+ "pf=(P/(math.sqrt(3.)*VL*IL));\n",
+ "phi=math.acos(pf)*57.3;\n",
+ "Rph=(Zph*pf);\n",
+ "Xph=(Zph*math.sin(phi/57.3));\n",
+ "print(\"\\nVL=400 V \\nIL=34.65 A \\nP=14.4kW\");\n",
+ "##For a Delta-connected load\n",
+ "print\"%s %.2f %s\"%(\"\\nVL=Vph= \",VL,\" V\");\n",
+ "print\"%s %.2f %s\"%(\"\\nIph=IL/sqrt(3)= \",Iph,\" A\");\n",
+ "\n",
+ "\n",
+ "print\"%s %.2f %s\"%(\"\\nZph=Vph/Iph = \",Zph,\" Ohm\");\n",
+ "print(\"\\nP=sqrt(3)*VL*IL*cos(phi)\");\n",
+ "print\"%s %.2f %s\"%(\"\\ncos(phi)= \",pf,\" degrees\");\n",
+ "print\"%s %.2f %s\"%(\"\\nphi= \",phi,\" degrees\");\n",
+ "print\"%s %.2f %s\"%(\"\\nRph=Zph*cos(phi) = \",Rph,\" Ohm\");\n",
+ "print\"%s %.2f %s\"%(\"\\nXph=Zph*sin(phi) = \",Xph,\" Ohm\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "VL=400 V \n",
+ "IL=34.65 A \n",
+ "P=14.4kW\n",
+ "\n",
+ "VL=Vph= 400.00 V\n",
+ "\n",
+ "Iph=IL/sqrt(3)= 20.01 A\n",
+ "\n",
+ "Zph=Vph/Iph = 19.99 Ohm\n",
+ "\n",
+ "P=sqrt(3)*VL*IL*cos(phi)\n",
+ "\n",
+ "cos(phi)= 0.60 degrees\n",
+ "\n",
+ "phi= 53.15 degrees\n",
+ "\n",
+ "Rph=Zph*cos(phi) = 11.99 Ohm\n",
+ "\n",
+ "Xph=Zph*sin(phi) = 16.00 Ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex14-pg6.18"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "## Three-Phase Circuits :example 6.14 :(pg 6.18)\n",
+ "P=10.44*10**3;\n",
+ "import math\n",
+ "VL=200.;\n",
+ "pf=0.5;\n",
+ "x=math.acos(pf)*57.3;\n",
+ "IL=(P/(math.sqrt(3.)*VL*pf));\n",
+ "Iph=(IL/math.sqrt(3.));\n",
+ "Zph=(VL/Iph);\n",
+ "Rph=(Zph*pf);\n",
+ "Xph=(Zph*math.sin(x/57.3));\n",
+ "Q=(math.sqrt(3.)*VL*IL*math.sin(x/57.3));\n",
+ "print(\"\\nP=10.44kW \\nVL=200 V \\npf=0.5(leading)\");\n",
+ "## For a delta-connected load,\n",
+ "\n",
+ "print\"%s %.2f %s\"%(\"\\nP=qrt(3)*VL*IL*cos(phi) \\nIL= \",IL,\" A\");\n",
+ "\n",
+ "\n",
+ "print\"%s %.2f %s\"%(\"\\nQ=sqrt(3)*VL*IL*sin(phi) = \",Q,\" VAR\");\n",
+ "\n",
+ "\n",
+ "print\"%s %.2f %s\"%(\"\\nVL=Vph= \",VL,\" V\");\n",
+ "print\"%s %.2f %s\"%(\"\\nIph=IL/sqrt(3)= \",Iph,\" A\");\n",
+ "\n",
+ "\n",
+ "print\"%s %.2f %s\"%(\"\\nZph=Vph/Iph = \",Zph,\" Ohm\");\n",
+ "\n",
+ "print\"%s %.2f %s\"%(\"\\nRph=Zph*cos(phi) = \",Rph,\" Ohm\");\n",
+ "print\"%s %.2f %s\"%(\"\\nXph=Zph*sin(phi) = \",Xph,\" Ohm\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "P=10.44kW \n",
+ "VL=200 V \n",
+ "pf=0.5(leading)\n",
+ "\n",
+ "P=qrt(3)*VL*IL*cos(phi) \n",
+ "IL= 60.28 A\n",
+ "\n",
+ "Q=sqrt(3)*VL*IL*sin(phi) = 18082.61 VAR\n",
+ "\n",
+ "VL=Vph= 200.00 V\n",
+ "\n",
+ "Iph=IL/sqrt(3)= 34.80 A\n",
+ "\n",
+ "Zph=Vph/Iph = 5.75 Ohm\n",
+ "\n",
+ "Rph=Zph*cos(phi) = 2.87 Ohm\n",
+ "\n",
+ "Xph=Zph*sin(phi) = 4.98 Ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex17-pg6.20"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "## Three-Phase Circuits :example 6.17 :(pg 6.20)\n",
+ "import math\n",
+ "Po=200.*10**3;\n",
+ "f=50.;\n",
+ "VL=440.;\n",
+ "N=0.91;\n",
+ "pf=0.86;\n",
+ "phi=math.acos(pf)*57.3;\n",
+ "Pi=(Po/N);\n",
+ "IL=(Pi/(math.sqrt(3.)*VL*pf));\n",
+ "Iph=(IL/math.sqrt(3.));\n",
+ "AC=(Iph*pf);\n",
+ "RC=(Iph*math.sin(phi/57.3));\n",
+ "print(\"\\nPo=200 kW \\nf=50Hz \\nVL= 440 V \\nN=0.91 \\npf=0.86\");\n",
+ "##For a delta connected load (induction motor)\n",
+ "print\"%s %.2f %s\"%(\"\\nVph =VL = \",VL,\"\");\n",
+ "print(\"\\nN=(Po/Pi)\");##efficiency\n",
+ "print\"%s %.2f %s\"%(\"\\nPi= \",Pi,\" W\");##Input power\n",
+ "print\"%s %.2f %s\"%(\"\\nPi=sqrt(3)*VL*IL*cos(phi) \\nIL= \",IL,\" A\");\n",
+ "print\"%s %.2f %s\"%(\"\\nAC = (Iph*cos(phi))= \",AC,\" A\");##Active component of phase current\n",
+ "print\"%s %.2f %s\"%(\"\\nRC=(Iph*sin(phi)) = \",RC,\" A\");##Reactive component of phase current"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Po=200 kW \n",
+ "f=50Hz \n",
+ "VL= 440 V \n",
+ "N=0.91 \n",
+ "pf=0.86\n",
+ "\n",
+ "Vph =VL = 440.00 \n",
+ "\n",
+ "N=(Po/Pi)\n",
+ "\n",
+ "Pi= 219780.22 W\n",
+ "\n",
+ "Pi=sqrt(3)*VL*IL*cos(phi) \n",
+ "IL= 335.33 A\n",
+ "\n",
+ "AC = (Iph*cos(phi))= 166.50 A\n",
+ "\n",
+ "RC=(Iph*sin(phi)) = 98.80 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex18-pg6.21"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "## Three-Phase Circuits :example 6.18 :(pg 6.20)\n",
+ "VL=400.;\n",
+ "import math\n",
+ "Po=112.*10**3;\n",
+ "pf=0.86;\n",
+ "phi=(math.acos(pf)*57.3);\n",
+ "N=0.88; ##Efficiency\n",
+ "Pi=(Po/N);\n",
+ "IL=(Pi/(math.sqrt(3.)*VL*pf));\n",
+ "Iph=(IL/math.sqrt(3.));\n",
+ "AC=(Iph*pf);\n",
+ "RC=(Iph*math.sin(phi/57.3));\n",
+ "Aac=(IL*pf);\n",
+ "Arc=(IL*math.sin(phi/57.3));\n",
+ "print(\"\\nVL=400 V \\nPo=112kW \\npf=0.86 \\nN=0.88\");\n",
+ "##For a mesh-connected load (induction motor)\n",
+ "print\"%s %.2f %s\"%(\"\\nVph=VL= \",VL,\" V\");\n",
+ "print\"%s %.2f %s\"%(\"\\nN=Po/Pi \\nPi= \",Pi,\" W\");##Input power\n",
+ "print\"%s %.2f %s\"%(\"\\nPi=sqrt(3)*VL*IL*cos(phi) \\nIL= \",IL,\" A\");\n",
+ "print\"%s %.2f %s\"%(\"\\nIph=IL/sqrt(3) = \",Iph,\" A\");\n",
+ "##current in star-connected load=line current drawn by motor\n",
+ "print\"%s %.2f %s\"%(\"\\nIA= \",IL,\" A\");##current in alternate phase\n",
+ "print\"%s %.2f %s\"%(\"\\nAC=Iph*cos(phi) = \",AC,\" A\");##active component in each phase of motor\n",
+ "print\"%s %.2f %s\"%(\"\\nRC=Iph*sin(phi) = \",RC,\" A\");##Reactive component in each phase of motor\n",
+ "print\"%s %.2f %s\"%(\"\\nAac= \",Aac,\" A\");##active component in each alternate phase\n",
+ "print\"%s %.2f %s\"%(\"\\nArc= \",Arc,\" A\");##reactive component in each alternate phase\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "VL=400 V \n",
+ "Po=112kW \n",
+ "pf=0.86 \n",
+ "N=0.88\n",
+ "\n",
+ "Vph=VL= 400.00 V\n",
+ "\n",
+ "N=Po/Pi \n",
+ "Pi= 127272.73 W\n",
+ "\n",
+ "Pi=sqrt(3)*VL*IL*cos(phi) \n",
+ "IL= 213.61 A\n",
+ "\n",
+ "Iph=IL/sqrt(3) = 123.33 A\n",
+ "\n",
+ "IA= 213.61 A\n",
+ "\n",
+ "AC=Iph*cos(phi) = 106.06 A\n",
+ "\n",
+ "RC=Iph*sin(phi) = 62.93 A\n",
+ "\n",
+ "Aac= 183.70 A\n",
+ "\n",
+ "Arc= 109.00 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex19-pg6.21"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "## Three-Phase Circuits :example 6.19 :(pg 6.21 & 6.22)\n",
+ "\n",
+ "import math\n",
+ "VL=400.;\n",
+ "IL=5.;\n",
+ "Vph=(VL/math.sqrt(3.));\n",
+ "Zph=(Vph/IL);\n",
+ "Iph=(IL/math.sqrt(3));\n",
+ "Vph1=(Iph*Zph);\n",
+ "print(\"\\nVl=400 V \\nIL=5 A\");\n",
+ "##For a star-connected load\n",
+ "print\"%s %.2f %s\"%(\"\\nVph=VL/sqrt(3) = \",Vph,\" V\");\n",
+ "print\"%s %.2f %s\"%(\"\\nIph=IL= \",IL,\" A\");\n",
+ "print\"%s %.2f %s\"%(\"\\nZph=Rph=Vph/Iph = \",Zph,\" Ohm\");\n",
+ "##For a delta connected load\n",
+ "print\"%s %.2f %s\"%(\"\\nIL=5 A \\nRph= \",Zph,\" Ohm\");\n",
+ "print\"%s %.2f %s\"%(\"\\nIph=IL/sqrt(3)= \",Iph,\" A\");\n",
+ "print\"%s %.2f %s\"%(\"\\nVph=Iph*Rph \\n= \",Vph1,\" V\");\n",
+ "##Voltage needed is 1/3 of the star value\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Vl=400 V \n",
+ "IL=5 A\n",
+ "\n",
+ "Vph=VL/sqrt(3) = 230.94 V\n",
+ "\n",
+ "Iph=IL= 5.00 A\n",
+ "\n",
+ "Zph=Rph=Vph/Iph = 46.19 Ohm\n",
+ "\n",
+ "IL=5 A \n",
+ "Rph= 46.19 Ohm\n",
+ "\n",
+ "Iph=IL/sqrt(3)= 2.89 A\n",
+ "\n",
+ "Vph=Iph*Rph \n",
+ "= 133.33 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex20-pg6.22"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "## Three-Phase Circuits :example 6.20 :(pg 6.22 & 6.23)\n",
+ "VL=400;\n",
+ "import math\n",
+ "Zph=100.;\n",
+ "Vph=(VL/math.sqrt(3.));\n",
+ "Iph=(Vph/Zph);\n",
+ "pf=1.;\n",
+ "P=(math.sqrt(3.)*VL*Iph*pf);\n",
+ "Iph1=(VL/Zph);\n",
+ "IL1=(math.sqrt(3.)*Iph1);\n",
+ "P1=(math.sqrt(3.)*VL*IL1*pf);\n",
+ "I1=(VL/200.);\n",
+ "Pa=(VL*I1);\n",
+ "I2=(VL/100.);\n",
+ "Pb=(VL*I1*I2);\n",
+ "print(\"\\nVL=400 V \\nZph = 100 Ohm\");\n",
+ "##For a star connected load\n",
+ "print\"%s %.2f %s\"%(\"\\nVph=VL/sqrt(3) = \",Vph,\" V\");\n",
+ "print\"%s %.2f %s\"%(\"\\nIph = VL/Zph = \",Iph,\" A\");\n",
+ "print\"%s %.2f %s\"%(\"\\nIL=Iph = \",Iph,\" A\");\n",
+ "print\"%s %.2f %s\"%(\"\\ncos(phi)=1 \\nP=sqrt(3).VL.IL.cos(phi) = \",P,\" W\");\n",
+ "##For a delta connected load\n",
+ "print\"%s %.2f %s\"%(\"\\nVph=VL= \",VL,\" V\");\n",
+ "print\"%s %.2f %s\"%(\"\\nIph=Vph/Zph = \",Iph1,\" A\");\n",
+ "print\"%s %.2f %s\"%(\"\\nIL=sqrt(3)*Iph = \",IL1,\" A\");\n",
+ "print\"%s %.2f %s\"%(\"\\nP=sqrt(3)*VL*IL*cos(phi) = \",P1,\" W\");\n",
+ "##When resistors are open circuited\n",
+ "##(i)Star connection\n",
+ "print\"%s %.2f %s\"%(\"\\nI= \",I1,\" A\");##Current in lines\n",
+ "print\"%s %.2f %s\"%(\"\\nP= \",Pa,\" W\");##Power taken from mains\n",
+ "##(ii)Delta connection\n",
+ "print\"%s %.2f %s\"%(\"\\nI= \",I2,\"A\");##Current in each phase\n",
+ "print\"%s %.2f %s\"%(\"\\nP= \",Pb,\" W\");##Power taken from mains"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "VL=400 V \n",
+ "Zph = 100 Ohm\n",
+ "\n",
+ "Vph=VL/sqrt(3) = 230.94 V\n",
+ "\n",
+ "Iph = VL/Zph = 2.31 A\n",
+ "\n",
+ "IL=Iph = 2.31 A\n",
+ "\n",
+ "cos(phi)=1 \n",
+ "P=sqrt(3).VL.IL.cos(phi) = 1600.00 W\n",
+ "\n",
+ "Vph=VL= 400.00 V\n",
+ "\n",
+ "Iph=Vph/Zph = 4.00 A\n",
+ "\n",
+ "IL=sqrt(3)*Iph = 6.93 A\n",
+ "\n",
+ "P=sqrt(3)*VL*IL*cos(phi) = 4800.00 W\n",
+ "\n",
+ "I= 2.00 A\n",
+ "\n",
+ "P= 800.00 W\n",
+ "\n",
+ "I= 4.00 A\n",
+ "\n",
+ "P= 3200.00 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex27-pg6.30"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "## Three-Phase Circuits :example 6.27 :(pg 6.30 & 6.31)\n",
+ "import math\n",
+ "W1=2000.;\n",
+ "W2=500.;\n",
+ "W3=-500.;\n",
+ "x=(math.sqrt(3.)*((W1-W2)/(W1+W2)));\n",
+ "phi=math.atan(x)*57.3;\n",
+ "pf=math.cos(phi/57.3);\n",
+ "y=(math.sqrt(3.)*((W1-W3)/(W1+W3)));\n",
+ "phi1=math.atan(y)*57.3;\n",
+ "pf1=math.cos(phi1/57.3);\n",
+ "print(\"\\nW1 = 2000W \\nW2 = 500 W\");\n",
+ "##(i) When both readings are same\n",
+ "print(\"\\nWhen W1 &W2 are same \\nW1 = 2000W \\nW2 = 500 W\");\n",
+ "print\"%s %.2f %s\"%(\"\\ntan(phi)= sqrt(3).(W1-W2/W1+W2) = \",x,\"\");\n",
+ "print\"%s %.2f %s\"%(\"\\nphi= \",phi,\" degrees\");\n",
+ "print\"%s %.2f %s\"%(\"\\npf=cos(phi)=\",pf,\"\");##Power factor\n",
+ "##(ii) When the latter reading is obtained after reversing the connection to the current coil of 1 instrument\n",
+ "print(\"\\nWhen W2 is reversed \\nW1= 2000 W \\nW2= -500 W\");\n",
+ "print\"%s %.2f %s\"%(\"\\ntan(phi)= sqrt(3).(W1-W2/W1+W2) =\",y,\"\");\n",
+ "print\"%s %.2f %s\"%(\"\\nphi= \",phi1,\" degrees\");\n",
+ "print\"%s %.2f %s\"%(\"\\npf=cos(phi)= \",pf1,\"\");##Power factor"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "W1 = 2000W \n",
+ "W2 = 500 W\n",
+ "\n",
+ "When W1 &W2 are same \n",
+ "W1 = 2000W \n",
+ "W2 = 500 W\n",
+ "\n",
+ "tan(phi)= sqrt(3).(W1-W2/W1+W2) = 1.04 \n",
+ "\n",
+ "phi= 46.11 degrees\n",
+ "\n",
+ "pf=cos(phi)= 0.69 \n",
+ "\n",
+ "When W2 is reversed \n",
+ "W1= 2000 W \n",
+ "W2= -500 W\n",
+ "\n",
+ "tan(phi)= sqrt(3).(W1-W2/W1+W2) = 2.89 \n",
+ "\n",
+ "phi= 70.90 degrees\n",
+ "\n",
+ "pf=cos(phi)= 0.33 \n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex28-pg6.31"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "## Three-Phase Circuits :example 6.28 :(pg 6.31)\n",
+ "W1=5.*10**3;\n",
+ "import math\n",
+ "W2=-(0.5*10**3);\n",
+ "P=(W1+W2);\n",
+ "x=(math.sqrt(3.)*((W1-W2)/(W1+W2)));\n",
+ "phi=math.atan(x)*57.3;\n",
+ "pf=math.cos(phi/57.3);\n",
+ "print(\"\\nW1=5kW \\W2=0.5kW\");\n",
+ "## When the latter readings are obtained after the reversal of the current coil terminals of the wattmeter\n",
+ "print(\"\\nWhen W2 is reversed \\nW1=5kW \\nW2=-0.5kW\");\n",
+ "print\"%s %.2f %s\"%(\"\\nP=W1+W2 = \",P,\" W\");##Power\n",
+ "print\"%s %.2f %s\"%(\"\\ntan(phi)=sqrt(3)*(W1-W2/W1+W2) =\",x,\"\");\n",
+ "print\"%s %.2f %s\"%(\"\\nphi= \",phi,\" degrees \");\n",
+ "print\"%s %.2f %s\"%(\"\\npf=cos(phi) =\",pf,\"\");##Power factor\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "W1=5kW \\W2=0.5kW\n",
+ "\n",
+ "When W2 is reversed \n",
+ "W1=5kW \n",
+ "W2=-0.5kW\n",
+ "\n",
+ "P=W1+W2 = 4500.00 W\n",
+ "\n",
+ "tan(phi)=sqrt(3)*(W1-W2/W1+W2) = 2.12 \n",
+ "\n",
+ "phi= 64.72 degrees \n",
+ "\n",
+ "pf=cos(phi) = 0.43 \n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex29-pg6.31"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "## Three-Phase Circuits :example 6.29 :(pg 6.31)\n",
+ "import math\n",
+ "S=10*10**3;\n",
+ "pf=0.342;\n",
+ "x=(S/math.sqrt(3.));\n",
+ "phi=math.acos(pf)*57.3;\n",
+ "W1=x*math.cos(30+phi)/(57.3);\n",
+ "W2=x*math.cos(30-phi)/(57.3);\n",
+ "print(\"\\nS=10kVA \\npf=0.342 \\nS=sqrt(3)*VL*IL\");\n",
+ "print\"%s %.2f %s\"%(\"\\nVL*IL= \",x,\"VA\");\n",
+ "print\"%s %.2f %s\"%(\"\\ncos(phi)=\",pf,\"\");\n",
+ "print\"%s %.2f %s\"%(\"\\nphi= \",phi,\" degrees\");\n",
+ "##(i)when power factor is leading\n",
+ "print\"%s %.2f %s\"%(\"\\npf leading \\nW1=VL.IL.cos(30+phi)= \",W1,\" W\");\n",
+ "print\"%s %.2f %s\"%(\"\\n \\nW2=VL.IL.cos(30-phi)= \",W2,\" W\");\n",
+ "##(i)when power factor is lagging\n",
+ "print\"%s %.2f %s\"%(\"\\npf lagging \\nW1=VL.IL.cos(30-phi)= \",W2,\" W\");\n",
+ "print\"%s %.2f %s\"%(\"\\n \\nW2=VL.IL.cos(30+phi)=\",W1,\" W\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "S=10kVA \n",
+ "pf=0.342 \n",
+ "S=sqrt(3)*VL*IL\n",
+ "\n",
+ "VL*IL= 5773.50 VA\n",
+ "\n",
+ "cos(phi)= 0.34 \n",
+ "\n",
+ "phi= 70.01 degrees\n",
+ "\n",
+ "pf leading \n",
+ "W1=VL.IL.cos(30+phi)= 87.21 W\n",
+ "\n",
+ " \n",
+ "W2=VL.IL.cos(30-phi)= -67.68 W\n",
+ "\n",
+ "pf lagging \n",
+ "W1=VL.IL.cos(30-phi)= -67.68 W\n",
+ "\n",
+ " \n",
+ "W2=VL.IL.cos(30+phi)= 87.21 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex30-pg6.31"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "## Three-Phase Circuits :example 6.30 :(pg 6.31 & 6.32)\n",
+ "VL=2000.;\n",
+ "import math\n",
+ "N=0.9;##efficiency\n",
+ "W1=300.*10**3;\n",
+ "W2=100.*10**3;\n",
+ "P=W1+W2;\n",
+ "x=(math.sqrt(3.)*((W1-W2)/(W1+W2)));\n",
+ "phi=math.atan(x)*57.3;\n",
+ "pf=math.cos(phi/57.3);\n",
+ "IL=(P/(math.sqrt(3.)*VL*pf));\n",
+ "print(\"\\nVL=2000 V \\nN=0.9 \\nW1=300kW \\nW2=100kW\");\n",
+ "print\"%s %.2f %s\"%(\"\\nP=W1+W2 = \",P,\" W\");##Input Power\n",
+ "print\"%s %.2f %s\"%(\"\\ntan(phi)=(sqrt(3)*(W1-W2/W1+W2)) =\",x,\"\");\n",
+ "print\"%s %.2f %s\"%(\"\\nphi= \",phi,\" degrees \");\n",
+ "print\"%s %.2f %s\"%(\"\\ncos(phi)=\",pf,\"\");##Power factor\n",
+ "print\"%s %.2f %s\"%(\"\\nP=sqrt(3)*VL*IL*cos(phi) \\nIL= \",IL,\" A\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "VL=2000 V \n",
+ "N=0.9 \n",
+ "W1=300kW \n",
+ "W2=100kW\n",
+ "\n",
+ "P=W1+W2 = 400000.00 W\n",
+ "\n",
+ "tan(phi)=(sqrt(3)*(W1-W2/W1+W2)) = 0.87 \n",
+ "\n",
+ "phi= 40.90 degrees \n",
+ "\n",
+ "cos(phi)= 0.76 \n",
+ "\n",
+ "P=sqrt(3)*VL*IL*cos(phi) \n",
+ "IL= 152.75 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex31-pg6.32"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "## Three-Phase Circuits :example 6.31 :(pg 6.32)\n",
+ "import math\n",
+ "VL=220.;\n",
+ "Po=11.2*10**3;\n",
+ "N=0.88;##efficiency\n",
+ "IL=38.;\n",
+ "Pi=(Po/N);\n",
+ "x=(Pi/(math.sqrt(3.)*VL*IL));\n",
+ "phi=math.acos(x)*57.3;\n",
+ "W1=(VL*IL*math.cos(30-phi)/57.3);\n",
+ "W2=(VL*IL*math.cos(30+phi)/57.3);\n",
+ "print\"%s %.2f %s\"%(\"\\nVL=220 V \\nPo=11.2kW \\nN=0.88 \\nIL=38A \\N=(Po/Pi)= \",Pi,\" W\");\n",
+ "print\"%s %.2f %s\"%(\"\\nPi=sqrt(3)*VL*IL*cos(phi) \\ncos(phi)= \",x,\" lagging\");\n",
+ "print\"%s %.2f %s\"%(\"\\nphi=\",phi,\" degrees\");\n",
+ "print\"%s %.2f %s\"%(\"\\nW1 =VL*IL*cos(30-phi) = \",W1,\" W\");\n",
+ "print\"%s %.2f %s\"%(\"\\nW2 =VL*IL*cos(30+phi) = \",W2,\" W\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "VL=220 V \n",
+ "Po=11.2kW \n",
+ "N=0.88 \n",
+ "IL=38A \\N=(Po/Pi)= 12727.27 W\n",
+ "\n",
+ "Pi=sqrt(3)*VL*IL*cos(phi) \n",
+ "cos(phi)= 0.88 lagging\n",
+ "\n",
+ "phi= 28.49 degrees\n",
+ "\n",
+ "W1 =VL*IL*cos(30-phi) = 8.15 W\n",
+ "\n",
+ "W2 =VL*IL*cos(30+phi) = -52.16 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electrical_Network_by_R._Singh/Chapter7.ipynb b/Electrical_Network_by_R._Singh/Chapter7.ipynb new file mode 100644 index 00000000..be717441 --- /dev/null +++ b/Electrical_Network_by_R._Singh/Chapter7.ipynb @@ -0,0 +1,844 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:b3ef09fe669f6e389f68566c0a4c0c7f68ba17783f87d6b65b51a4db7cae692e"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter7-Graph theory"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7-pg7.18"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "## Graph Theory : example 7.7 : (pg 7.18 & 7.19)\n",
+ "import numpy\n",
+ "\n",
+ "##Complete incidence matrix Aa\n",
+ "print(\"\\nAa=\");\n",
+ "print numpy.matrix([[1, 0 ,0 ,-1 ,1 ,0 ,0 ,0],[-1, 1, 0 ,0 ,0 ,1 ,0 ,0],[0 ,-1 ,1 ,0 ,0 ,0 ,1 ,0],[0, 0 ,-1, 1 ,0 ,0 ,0, 1],[0 ,0 ,0 ,0 ,-1, -1 ,-1, -1]]);\n",
+ "##eliminating last row from Aa\n",
+ "print(\"\\nA=\");\n",
+ "print numpy.matrix([[1, 0 ,0 ,-1, 1 ,0 ,0 ,0],[-1, 1 ,0 ,0 ,0 ,1 ,0 ,0],[0 ,-1, 1, 0, 0 ,0 ,1 ,0],[0, 0, -1, 1 ,0 ,0 ,0 ,1]]);\n",
+ "##Tieset matrix B\n",
+ "print(\"\\ntwigs={1,3,5,7} \\nlinks={2,4,6,8} \\ntieset 2={2,7,5,1} \\ntieset 4={4,5,7,3} \\ntieset 6={6,5,1} \\ntieset 8={8,7,3}\");\n",
+ "## forward direction = 1, reverse direction = -1\n",
+ "print(\"\\nB=\");\n",
+ "print numpy.matrix([[1, 1 ,0 ,0 ,-1, 0, 1, 1],[0, 0, 1 ,1 ,1 ,0, -1, 0],[1, 0 ,0 ,0 ,-1, 1, 0, 0],[0, 0 ,1 ,0 ,0 ,0 ,-1, 1]]);\n",
+ "## f-cutset matrix Q\n",
+ "print(\"\\nf-cutset 1={1,6,2} \\nf-cutset 3={3,4,8} \\nf-cutset 5={5,4,6,2} \\nf-cutset 7={7,2,8,4}\");\n",
+ "print(\"\\nQ=\");\n",
+ "print numpy.matrix([[1 ,-1, 0, 0, 0 ,-1, 0, 0],[0 ,0, 1, -1, 0, 0 ,0 ,-1],[0, 1, 0 ,-1, 1, 1, 0, 0],[0 ,-1, 0, 1, 0 ,0, 1, 1]]);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Aa=\n",
+ "[[ 1 0 0 -1 1 0 0 0]\n",
+ " [-1 1 0 0 0 1 0 0]\n",
+ " [ 0 -1 1 0 0 0 1 0]\n",
+ " [ 0 0 -1 1 0 0 0 1]\n",
+ " [ 0 0 0 0 -1 -1 -1 -1]]\n",
+ "\n",
+ "A=\n",
+ "[[ 1 0 0 -1 1 0 0 0]\n",
+ " [-1 1 0 0 0 1 0 0]\n",
+ " [ 0 -1 1 0 0 0 1 0]\n",
+ " [ 0 0 -1 1 0 0 0 1]]\n",
+ "\n",
+ "twigs={1,3,5,7} \n",
+ "links={2,4,6,8} \n",
+ "tieset 2={2,7,5,1} \n",
+ "tieset 4={4,5,7,3} \n",
+ "tieset 6={6,5,1} \n",
+ "tieset 8={8,7,3}\n",
+ "\n",
+ "B=\n",
+ "[[ 1 1 0 0 -1 0 1 1]\n",
+ " [ 0 0 1 1 1 0 -1 0]\n",
+ " [ 1 0 0 0 -1 1 0 0]\n",
+ " [ 0 0 1 0 0 0 -1 1]]\n",
+ "\n",
+ "f-cutset 1={1,6,2} \n",
+ "f-cutset 3={3,4,8} \n",
+ "f-cutset 5={5,4,6,2} \n",
+ "f-cutset 7={7,2,8,4}\n",
+ "\n",
+ "Q=\n",
+ "[[ 1 -1 0 0 0 -1 0 0]\n",
+ " [ 0 0 1 -1 0 0 0 -1]\n",
+ " [ 0 1 0 -1 1 1 0 0]\n",
+ " [ 0 -1 0 1 0 0 1 1]]\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex8-pg7.19"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "## Graph Theory : example 7.8 :(pg 7.19 & 7.20)\n",
+ "##Complete Incidence Matrix Aa\n",
+ "import numpy\n",
+ "from numpy import linalg\n",
+ "print(\"\\nAa=\");\n",
+ "import numpy\n",
+ "print numpy.matrix([[1 ,0 ,-1 ,1],[-1, 1 ,0 ,0],[0 ,-1 ,1 ,-1]]);\n",
+ "## Reduced Incidence matrix A (by eliminating last row from Aa)\n",
+ "A=numpy.matrix([[1 ,0, -1, 1],[-1, 1 ,0 ,0]]);\n",
+ "print(\"\\nA=\");\n",
+ "print numpy.matrix([[1 ,0 ,-1 ,1],[-1, 1 ,0 ,0]]);\n",
+ "A1=numpy.matrix([[1 ],[0], [-1], [1],[-1], [1] ,[0] ,[0]]);\n",
+ "print(\"A1\")\n",
+ "\n",
+ "print(\"\\nNumber of possible trees=\");##A^T=A'= transpose of A\n",
+ "x=(A*numpy.matrix.transpose(A));\n",
+ "print (x);\n",
+ "alp = numpy.linalg.det(x);\n",
+ "\n",
+ "print(alp)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Aa=\n",
+ "[[ 1 0 -1 1]\n",
+ " [-1 1 0 0]\n",
+ " [ 0 -1 1 -1]]\n",
+ "\n",
+ "A=\n",
+ "[[ 1 0 -1 1]\n",
+ " [-1 1 0 0]]\n",
+ "A1\n",
+ "\n",
+ "Number of possible trees=\n",
+ "[[ 3 -1]\n",
+ " [-1 2]]\n",
+ "5.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex11-pg7.21"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Graph Theory : example 7.11 :(pg 7.21 & 7.22)\n",
+ "import numpy\n",
+ "from numpy import linalg\n",
+ "print (\"Aa=[0 -1 1 0 0;0 0 -1 -1 -1;-1 0 0 0 1;1 1 0 1 0]\");#Complete incidence matrix\n",
+ "A=numpy.matrix([[0, -1, 1, 0, 0],[0, 0, -1, -1, -1],[-1, 0, 0, 0, 1]]);#Reduced incidence matrix\n",
+ "print(\"\\nNumber of possible trees = |A*A^T|\");#A^T=A'=transpose of A \n",
+ "x=(A*numpy.matrix.transpose(A));\n",
+ "print (x);\n",
+ "alp = numpy.linalg.det(x);\n",
+ "print(\"\\n|A*A^T|= \",round(alp));#No. of possible trees\n",
+ "#Tieset Matrix B\n",
+ "print(\"\\ntwigs={3,4,5} \\nlinks={1,2} \\ntieset 1={1,4,5} \\ntieset 2={2,3,4}\");\n",
+ "print (\"B=[1 0 0 -1 1;0 1 1 -1 0]\");\n",
+ "#f-cutset Matrix Q\n",
+ "print(\"\\nf-cutset 3={3,2} \\nf-cutset 4={4,2,1} \\nf-cutset 5={5,1}\");\n",
+ "print (\"Q=[0 -1 1 0 0;1 1 0 1 0;-1 0 0 0 1]\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Aa=[0 -1 1 0 0;0 0 -1 -1 -1;-1 0 0 0 1;1 1 0 1 0]\n",
+ "\n",
+ "Number of possible trees = |A*A^T|\n",
+ "[[ 2 -1 0]\n",
+ " [-1 3 -1]\n",
+ " [ 0 -1 2]]\n",
+ "('\\n|A*A^T|= ', 8.0)\n",
+ "\n",
+ "twigs={3,4,5} \n",
+ "links={1,2} \n",
+ "tieset 1={1,4,5} \n",
+ "tieset 2={2,3,4}\n",
+ "B=[1 0 0 -1 1;0 1 1 -1 0]\n",
+ "\n",
+ "f-cutset 3={3,2} \n",
+ "f-cutset 4={4,2,1} \n",
+ "f-cutset 5={5,1}\n",
+ "Q=[0 -1 1 0 0;1 1 0 1 0;-1 0 0 0 1]\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex14-pg7.27"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Graph Theory : example 7.14 :(pg 7.37 & 7.38)\n",
+ "##Tieset Matrix B\n",
+ "import numpy\n",
+ "import numpy\n",
+ "from numpy import linalg\n",
+ "print(\"\\ntieset1={1,4,5} \\ntieset2={2,4,6} \\ntieset={3,5,6} \\nB=\"); \n",
+ "B=numpy.matrix([[1, 0 ,0 ,1 ,1 ,0],[0 ,1 ,0 ,-1, 0, -1],[0, 0 ,1 ,0 ,-1, 1]]);\n",
+ "print(B);\n",
+ "print(\"\\nThe KVL equation in matrix form \\nB.Zb.(B^T).Il = B.Vs-B.Zb.Is\");\n",
+ "print(\"\\nB.Zb.(B^T).Il = B.Vs \\nZb=\");##Is=0\n",
+ "import numpy as np\n",
+ "Zb = np.array([1,1,1,2,2,2])\n",
+ "d = np.diag(Zb)\n",
+ "print(d)\n",
+ "\n",
+ "print(\"\\n(B^T)=\");\n",
+ "Z= numpy.matrix.transpose(B)\n",
+ "print(Z)\n",
+ "Vs=numpy.matrix([[2],[0],[0],[0],[0],[0]]);\n",
+ "print(\"\\nVs=\");\n",
+ "print(Vs);\n",
+ "print(\"\\nB.Zb =\");\n",
+ "x=numpy.dot(B,Zb);\n",
+ "print(x);\n",
+ "\n",
+ "print(\"\\nB.Vs=\");\n",
+ "z=numpy.dot(B,Vs);\n",
+ "print(z);\n",
+ "print(\"\\nLoad currents:\");\n",
+ "M=numpy.matrix([[5, -2 ,-2],[-2 ,5 ,-2],[-2, -2, 5]]);\n",
+ "H=numpy.linalg.inv(M);\n",
+ "N=([[2],[0],[0]]);\n",
+ "X=numpy.dot(H,N);\n",
+ "print(X);\n",
+ "print(\"\\nIl1=0.857 A \\nIl2=0.571 A \\nIl3=0.571 A\");\n",
+ "print(\"\\nBranch currents:\");\n",
+ "P=(Z,X);\n",
+ "print(P);##Currents in amperes\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "tieset1={1,4,5} \n",
+ "tieset2={2,4,6} \n",
+ "tieset={3,5,6} \n",
+ "B=\n",
+ "[[ 1 0 0 1 1 0]\n",
+ " [ 0 1 0 -1 0 -1]\n",
+ " [ 0 0 1 0 -1 1]]\n",
+ "\n",
+ "The KVL equation in matrix form \n",
+ "B.Zb.(B^T).Il = B.Vs-B.Zb.Is\n",
+ "\n",
+ "B.Zb.(B^T).Il = B.Vs \n",
+ "Zb=\n",
+ "[[1 0 0 0 0 0]\n",
+ " [0 1 0 0 0 0]\n",
+ " [0 0 1 0 0 0]\n",
+ " [0 0 0 2 0 0]\n",
+ " [0 0 0 0 2 0]\n",
+ " [0 0 0 0 0 2]]\n",
+ "\n",
+ "(B^T)=\n",
+ "[[ 1 0 0]\n",
+ " [ 0 1 0]\n",
+ " [ 0 0 1]\n",
+ " [ 1 -1 0]\n",
+ " [ 1 0 -1]\n",
+ " [ 0 -1 1]]\n",
+ "\n",
+ "Vs=\n",
+ "[[2]\n",
+ " [0]\n",
+ " [0]\n",
+ " [0]\n",
+ " [0]\n",
+ " [0]]\n",
+ "\n",
+ "B.Zb =\n",
+ "[[ 5 -3 1]]\n",
+ "\n",
+ "B.Vs=\n",
+ "[[2]\n",
+ " [0]\n",
+ " [0]]\n",
+ "\n",
+ "Load currents:\n",
+ "[[ 0.85714286]\n",
+ " [ 0.57142857]\n",
+ " [ 0.57142857]]\n",
+ "\n",
+ "Il1=0.857 A \n",
+ "Il2=0.571 A \n",
+ "Il3=0.571 A\n",
+ "\n",
+ "Branch currents:\n",
+ "(matrix([[ 1, 0, 0],\n",
+ " [ 0, 1, 0],\n",
+ " [ 0, 0, 1],\n",
+ " [ 1, -1, 0],\n",
+ " [ 1, 0, -1],\n",
+ " [ 0, -1, 1]]), matrix([[ 0.85714286],\n",
+ " [ 0.57142857],\n",
+ " [ 0.57142857]]))\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex15-pg7.28"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Graph Theory : example 7.15 :(pg 7.38 & 7.39)\n",
+ "##Tieset Matrix B\n",
+ "import numpy\n",
+ "import numpy\n",
+ "from numpy import linalg\n",
+ "print(\"\\ntieset1={1,4,6} \\ntieset2={2,5,6} \\ntieset={3,5,4} \\nB=\"); \n",
+ "B=numpy.matrix([[1, 0 ,0 ,1 ,0 ,1],[0, 1, 0, 0, 1 ,-1],[0 ,0 ,1 ,-1 ,-1 ,0]]);\n",
+ "print(B);\n",
+ "print(\"\\nThe KVL equation in matrix form \\nB.Zb.(B^T).Il = B.Vs-B.Zb.Is\");\n",
+ "print(\"\\nB.Zb.(B^T).Il = B.Vs \\nZb=\");##Is=0\n",
+ "Zb = numpy.array([6,4,3,4,6,2])\n",
+ "d = numpy.diag(Zb)\n",
+ "print(d)\n",
+ "XY=numpy.matrix.transpose(B)\n",
+ "print(\"\\n(B^T)=\");\n",
+ "print(XY);\n",
+ "Vs=([[12],[-6],[-8],[0],[0],[0]]);\n",
+ "print(\"\\nVs=\");\n",
+ "print(Vs);\n",
+ "print(\"\\nB.Zb=\");\n",
+ "x=numpy.dot(B,Zb);\n",
+ "print(x);\n",
+ "print(\"\\nB.Zb.(B^T)=\");\n",
+ "#y=numpy.dot(XY,x);\n",
+ "#print(y);\n",
+ "print(\"\\nB.Vs=\");\n",
+ "z=numpy.dot(B,Vs);\n",
+ "print(z);\n",
+ "print(\"\\nLoad currents:\");\n",
+ "M=numpy.matrix([[12 ,-2 ,-4],[-2, 12, -6],[-4, -6, 12]]);\n",
+ "H=numpy.linalg.inv(M);\n",
+ "N=([[12],[-6],[-8]]);\n",
+ "X=numpy.dot(H,N);\n",
+ "print(X);\n",
+ "print(\"\\nIl1=0.55 A \\nIl2=-0.866 A \\nIl3=-0.916 A\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "tieset1={1,4,6} \n",
+ "tieset2={2,5,6} \n",
+ "tieset={3,5,4} \n",
+ "B=\n",
+ "[[ 1 0 0 1 0 1]\n",
+ " [ 0 1 0 0 1 -1]\n",
+ " [ 0 0 1 -1 -1 0]]\n",
+ "\n",
+ "The KVL equation in matrix form \n",
+ "B.Zb.(B^T).Il = B.Vs-B.Zb.Is\n",
+ "\n",
+ "B.Zb.(B^T).Il = B.Vs \n",
+ "Zb=\n",
+ "[[6 0 0 0 0 0]\n",
+ " [0 4 0 0 0 0]\n",
+ " [0 0 3 0 0 0]\n",
+ " [0 0 0 4 0 0]\n",
+ " [0 0 0 0 6 0]\n",
+ " [0 0 0 0 0 2]]\n",
+ "\n",
+ "(B^T)=\n",
+ "[[ 1 0 0]\n",
+ " [ 0 1 0]\n",
+ " [ 0 0 1]\n",
+ " [ 1 0 -1]\n",
+ " [ 0 1 -1]\n",
+ " [ 1 -1 0]]\n",
+ "\n",
+ "Vs=\n",
+ "[[12], [-6], [-8], [0], [0], [0]]\n",
+ "\n",
+ "B.Zb=\n",
+ "[[12 8 -7]]\n",
+ "\n",
+ "B.Zb.(B^T)=\n",
+ "\n",
+ "B.Vs=\n",
+ "[[12]\n",
+ " [-6]\n",
+ " [-8]]\n",
+ "\n",
+ "Load currents:\n",
+ "[[ 0.55 ]\n",
+ " [-0.86666667]\n",
+ " [-0.91666667]]\n",
+ "\n",
+ "Il1=0.55 A \n",
+ "Il2=-0.866 A \n",
+ "Il3=-0.916 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex19-pg7.34"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Graph Theory : example 7.19 \n",
+ "import math\n",
+ "import numpy\n",
+ "from numpy import linalg\n",
+ "Q=numpy.matrix([[1, -1, 0, 0],[0 ,-1 ,1 ,1]]);\n",
+ "print(\"\\nQ=\");\n",
+ "print(Q);\n",
+ "print(\"\\nThe KCL equation in matrix form is given by\");\n",
+ "print(\"\\nQ.Yb.(Q^T).Vl=Q.Is-Q.Yb.Vs\");\n",
+ "print(\"\\nQ.Yb.(Q^T).Vl=Q.Is\");##Vs=0\n",
+ "Yb=numpy.array([5,5,5,10]);\n",
+ "d=numpy.diag(Yb)\n",
+ "Is=numpy.matrix([[-10],[0],[0],[0]]);\n",
+ "print(\"\\nYb=\");\n",
+ "print(d);\n",
+ "print(\"\\n(Q^T)=\");\n",
+ "ZZ=numpy.matrix.transpose(Q)\n",
+ "print(ZZ);\n",
+ "print(\"\\nIs=\");\n",
+ "print(Is);##current entering into nodes is taken as negative\n",
+ "x=numpy.dot(Q,Yb);\n",
+ "print(\"\\nQ.Yb=\");\n",
+ "print(x);\n",
+ "#y=numpy.dot(x[0],ZZ);\n",
+ "print(\"\\nQ.Yb.(Q^T)=\");\n",
+ "#print(y);\n",
+ "z=numpy.dot(Q,Is);\n",
+ "print(\"\\nQ.Is=\");\n",
+ "print(z);\n",
+ "print(\"\\nLoad voltages:\");\n",
+ "M=numpy.matrix([[10, 5],[5, 20]]);\n",
+ "P=numpy.linalg.inv(M);\n",
+ "N=numpy.matrix([[-10],[0]]);\n",
+ "X=numpy.dot(P,N);\n",
+ "print(X);\n",
+ "print(\"\\nvl1=-1.14 V \\nvl2=0.28 V\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Q=\n",
+ "[[ 1 -1 0 0]\n",
+ " [ 0 -1 1 1]]\n",
+ "\n",
+ "The KCL equation in matrix form is given by\n",
+ "\n",
+ "Q.Yb.(Q^T).Vl=Q.Is-Q.Yb.Vs\n",
+ "\n",
+ "Q.Yb.(Q^T).Vl=Q.Is\n",
+ "\n",
+ "Yb=\n",
+ "[[ 5 0 0 0]\n",
+ " [ 0 5 0 0]\n",
+ " [ 0 0 5 0]\n",
+ " [ 0 0 0 10]]\n",
+ "\n",
+ "(Q^T)=\n",
+ "[[ 1 0]\n",
+ " [-1 -1]\n",
+ " [ 0 1]\n",
+ " [ 0 1]]\n",
+ "\n",
+ "Is=\n",
+ "[[-10]\n",
+ " [ 0]\n",
+ " [ 0]\n",
+ " [ 0]]\n",
+ "\n",
+ "Q.Yb=\n",
+ "[[ 0 10]]\n",
+ "\n",
+ "Q.Yb.(Q^T)=\n",
+ "\n",
+ "Q.Is=\n",
+ "[[-10]\n",
+ " [ 0]]\n",
+ "\n",
+ "Load voltages:\n",
+ "[[-1.14285714]\n",
+ " [ 0.28571429]]\n",
+ "\n",
+ "vl1=-1.14 V \n",
+ "vl2=0.28 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex20-pg7.35"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Graph Theory : example 7.20 :(pg 7.35 & 7.36)\n",
+ "import numpy\n",
+ "from numpy import linalg\n",
+ "print(\"\\nf-cutset1={1,4,5,6} \\nf-cutset2={2,4,5} \\nf-cutset3={3,4,6}\");\n",
+ "Q=numpy.matrix([[1, 0 ,0 ,-1, -1, 1],[0 ,1 ,0 ,-1, -1 ,0],[0 ,0, 1, -1 ,0 ,1]]);\n",
+ "print(\"\\nQ=\");\n",
+ "print(Q);\n",
+ "print(\"\\nThe KCL equation in matrix form is given by\");\n",
+ "print(\"\\nQ.Yb.(Q^T).Vl=Q.Is-Q.Yb.Vs\");\n",
+ "print(\"\\nQ.Yb.(Q^T).Vl=Q.Is\");##Is=0\n",
+ "Yb=numpy.array([0.2,0.2,0.2,0.1,0.5,0.1]);\n",
+ "yz=numpy.diag(Yb)\n",
+ "Vs=numpy.matrix([[910],[0],[0],[0],[0],[0]]);\n",
+ "Is=numpy.matrix([[0],[0],[0],[0],[0],[0]]);\n",
+ "print(\"\\nyz=\");\n",
+ "print(yz);\n",
+ "print(\"\\nVs=\");\n",
+ "print(Vs);\n",
+ "print(\"\\nIs=\");\n",
+ "print(Is);\n",
+ "x=numpy.dot(Q,yz);\n",
+ "print(\"\\nQ.Yb=\");\n",
+ "print(x);\n",
+ "z=numpy.dot(x,Vs);\n",
+ "print(\"\\nQ.Yb.Vs=\");\n",
+ "print(z);\n",
+ "print(\"\\nQ.Is=\");\n",
+ "u=numpy.dot(Q,Is);\n",
+ "print(u);\n",
+ "v=(u-z);\n",
+ "print(\"\\nQ.Is-Q.Yb.Vs=\");\n",
+ "print(v);\n",
+ "print(\"\\nLoad voltages:\");\n",
+ "M=([[0.9, 0.6, 0.2],[0.6, 0.8, 0.1],[0.2 ,0.1 ,0.3]]);\n",
+ "P=numpy.linalg.inv(M);\n",
+ "N=([[-182],[0],[0]]);\n",
+ "X=numpy.dot(P,N);\n",
+ "print(X);\n",
+ "print(\"\\nvl1=-460 V \\nvl2=320 V \\nvl3=200 V\");\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "f-cutset1={1,4,5,6} \n",
+ "f-cutset2={2,4,5} \n",
+ "f-cutset3={3,4,6}\n",
+ "\n",
+ "Q=\n",
+ "[[ 1 0 0 -1 -1 1]\n",
+ " [ 0 1 0 -1 -1 0]\n",
+ " [ 0 0 1 -1 0 1]]\n",
+ "\n",
+ "The KCL equation in matrix form is given by\n",
+ "\n",
+ "Q.Yb.(Q^T).Vl=Q.Is-Q.Yb.Vs\n",
+ "\n",
+ "Q.Yb.(Q^T).Vl=Q.Is\n",
+ "\n",
+ "yz=\n",
+ "[[ 0.2 0. 0. 0. 0. 0. ]\n",
+ " [ 0. 0.2 0. 0. 0. 0. ]\n",
+ " [ 0. 0. 0.2 0. 0. 0. ]\n",
+ " [ 0. 0. 0. 0.1 0. 0. ]\n",
+ " [ 0. 0. 0. 0. 0.5 0. ]\n",
+ " [ 0. 0. 0. 0. 0. 0.1]]\n",
+ "\n",
+ "Vs=\n",
+ "[[910]\n",
+ " [ 0]\n",
+ " [ 0]\n",
+ " [ 0]\n",
+ " [ 0]\n",
+ " [ 0]]\n",
+ "\n",
+ "Is=\n",
+ "[[0]\n",
+ " [0]\n",
+ " [0]\n",
+ " [0]\n",
+ " [0]\n",
+ " [0]]\n",
+ "\n",
+ "Q.Yb=\n",
+ "[[ 0.2 0. 0. -0.1 -0.5 0.1]\n",
+ " [ 0. 0.2 0. -0.1 -0.5 0. ]\n",
+ " [ 0. 0. 0.2 -0.1 0. 0.1]]\n",
+ "\n",
+ "Q.Yb.Vs=\n",
+ "[[ 182.]\n",
+ " [ 0.]\n",
+ " [ 0.]]\n",
+ "\n",
+ "Q.Is=\n",
+ "[[0]\n",
+ " [0]\n",
+ " [0]]\n",
+ "\n",
+ "Q.Is-Q.Yb.Vs=\n",
+ "[[-182.]\n",
+ " [ 0.]\n",
+ " [ 0.]]\n",
+ "\n",
+ "Load voltages:\n",
+ "[[-460.]\n",
+ " [ 320.]\n",
+ " [ 200.]]\n",
+ "\n",
+ "vl1=-460 V \n",
+ "vl2=320 V \n",
+ "vl3=200 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex21-pg7.36"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Graph Theory : example 7.21 :(pg 7.38 & 7.39)\n",
+ "import numpy\n",
+ "from numpy import linalg\n",
+ "print(\"\\ntwigs={1,2} \\nf-cutset1={1,4} \\nf-cutset2={2,3}\");\n",
+ "Q=numpy.matrix([[1, 0, 0 ,-1],[0 ,1 ,-1, 0]]);\n",
+ "print(\"\\nQ=\");\n",
+ "print(Q);\n",
+ "print(\"\\nThe KCL equation in matrix form is given by\");\n",
+ "print(\"\\nQ.Yb.(Q^T).Vl=Q.Is-Q.Yb.Vs\");\n",
+ "ZZ=numpy.matrix.transpose(Q)\n",
+ "\n",
+ "yxx=numpy.array([0.25,0.5,0.25,0.5]);\n",
+ "Yb=numpy.diag(yxx)\n",
+ "Vs=numpy.matrix([[1],[1],[0],[0]]);\n",
+ "Is=numpy.matrix([[0],[0],[0.5],[-0.5]]);\n",
+ "print(\"\\nYb=\");\n",
+ "print(Yb);\n",
+ "print(\"\\n(Q^T)=\");\n",
+ "print(ZZ);\n",
+ "print(\"\\nVs=\");\n",
+ "print(Vs);\n",
+ "print(\"\\nIs=\");\n",
+ "print(Is);\n",
+ "x=numpy.dot(Q,Yb);\n",
+ "print(\"\\nQ.Yb=\");\n",
+ "print(x);\n",
+ "y=numpy.dot(x,ZZ);\n",
+ "print(\"\\nQ.Yb.(Q^T)=\");\n",
+ "print(y);\n",
+ "print(\"\\nQ.Is=\");\n",
+ "u=numpy.dot(Q,Is);\n",
+ "print(Q*Is);\n",
+ "z=numpy.dot(x,Vs);\n",
+ "print(\"\\nQ.Yb.Vs=\");\n",
+ "print(z);\n",
+ "v=(u-z);\n",
+ "print(\"\\nQ.Is-Q.Yb.Vs=\");\n",
+ "print(v);\n",
+ "print(\"\\nLoad voltages:\");\n",
+ "M=([[0.75, 0],[0 ,0.75]]);\n",
+ "P=numpy.linalg.inv(M);\n",
+ "N=([[0.25],[-1]]);\n",
+ "X=numpy.dot(P,N);\n",
+ "print(X);\n",
+ "print(\"\\nvl1=0.33 V \\nvl2=-1.33 V\");\n",
+ "vl2=-1.33;\n",
+ "v=1.+vl2;\n",
+ "print\"%s %.2f %s\"%(\"\\nV=\",v,\"\");\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "twigs={1,2} \n",
+ "f-cutset1={1,4} \n",
+ "f-cutset2={2,3}\n",
+ "\n",
+ "Q=\n",
+ "[[ 1 0 0 -1]\n",
+ " [ 0 1 -1 0]]\n",
+ "\n",
+ "The KCL equation in matrix form is given by\n",
+ "\n",
+ "Q.Yb.(Q^T).Vl=Q.Is-Q.Yb.Vs\n",
+ "\n",
+ "Yb=\n",
+ "[[ 0.25 0. 0. 0. ]\n",
+ " [ 0. 0.5 0. 0. ]\n",
+ " [ 0. 0. 0.25 0. ]\n",
+ " [ 0. 0. 0. 0.5 ]]\n",
+ "\n",
+ "(Q^T)=\n",
+ "[[ 1 0]\n",
+ " [ 0 1]\n",
+ " [ 0 -1]\n",
+ " [-1 0]]\n",
+ "\n",
+ "Vs=\n",
+ "[[1]\n",
+ " [1]\n",
+ " [0]\n",
+ " [0]]\n",
+ "\n",
+ "Is=\n",
+ "[[ 0. ]\n",
+ " [ 0. ]\n",
+ " [ 0.5]\n",
+ " [-0.5]]\n",
+ "\n",
+ "Q.Yb=\n",
+ "[[ 0.25 0. 0. -0.5 ]\n",
+ " [ 0. 0.5 -0.25 0. ]]\n",
+ "\n",
+ "Q.Yb.(Q^T)=\n",
+ "[[ 0.75 0. ]\n",
+ " [ 0. 0.75]]\n",
+ "\n",
+ "Q.Is=\n",
+ "[[ 0.5]\n",
+ " [-0.5]]\n",
+ "\n",
+ "Q.Yb.Vs=\n",
+ "[[ 0.25]\n",
+ " [ 0.5 ]]\n",
+ "\n",
+ "Q.Is-Q.Yb.Vs=\n",
+ "[[ 0.25]\n",
+ " [-1. ]]\n",
+ "\n",
+ "Load voltages:\n",
+ "[[ 0.33333333]\n",
+ " [-1.33333333]]\n",
+ "\n",
+ "vl1=0.33 V \n",
+ "vl2=-1.33 V\n",
+ "\n",
+ "V= -0.33 \n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electrical_Network_by_R._Singh/Chapter8.ipynb b/Electrical_Network_by_R._Singh/Chapter8.ipynb new file mode 100644 index 00000000..f72a22fd --- /dev/null +++ b/Electrical_Network_by_R._Singh/Chapter8.ipynb @@ -0,0 +1,124 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:443594b95e4699aa829647ef6201862e165405ad0d20cad94e2fc280e9a33ca5"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter8-Transient Analysis"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex13-pg8.16"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Transient analysis\n",
+ "##pg no - 8.17\n",
+ "##example no - 8.13\n",
+ "import math\n",
+ "import numpy\n",
+ "a=((10.*30.)/(10.+30.));\n",
+ "d=5./a;\n",
+ "b=0.;\n",
+ "c=5.*(20./30.);\n",
+ "print\"%s %.2f %s\"%(\"iL(0-) = \",d,\" A\");\n",
+ "print\"%s %.2f %s\"%(\"\\nvb(0-) = \", b,\"\");\n",
+ "print\"%s %.2f %s\"%(\"\\nva(0-) = \",c,\" V\");\n",
+ "print(\"Applying Kcl equations at t=0+\");\n",
+ "print(\"((va(0+)-5)/10)+(va(0+)/10)+(va(0+)-vb(0+))/20 = 0\"); ##equation 1\n",
+ "print(\"((vb(0+)-va(0+))/20)+((vb(0+)-5)/10)+(2/3) = 0\"); ##equation 2\n",
+ "##solving 1 and 2\n",
+ "M=numpy.matrix([[0.25, -0.05],[-0.05, 0.15]]);\n",
+ "N=numpy.matrix([[0.5], [-0.167]]);\n",
+ "\n",
+ "X=numpy.dot(numpy.linalg.inv(M),N);\n",
+ "print[X]\n",
+ "print(\"va(0+)= 1.9 A\");\n",
+ "print(\"vb(0+)= -0.477 A\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "iL(0-) = 0.67 A\n",
+ "\n",
+ "vb(0-) = 0.00 \n",
+ "\n",
+ "va(0-) = 3.33 V\n",
+ "Applying Kcl equations at t=0+\n",
+ "((va(0+)-5)/10)+(va(0+)/10)+(va(0+)-vb(0+))/20 = 0\n",
+ "((vb(0+)-va(0+))/20)+((vb(0+)-5)/10)+(2/3) = 0\n",
+ "[matrix([[ 1.90428571],\n",
+ " [-0.47857143]])]\n",
+ "va(0+)= 1.9 A\n",
+ "vb(0+)= -0.477 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex14-pg8.17"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Transient analysis\n",
+ "##pg no - 8.17\n",
+ "##example no - 8.13\n",
+ "print(\"va(0+) = 5V\");\n",
+ "print(\"vb(0+) = 5V\");\n",
+ "print(\"vb(0+) = 5V\");\n",
+ "print(\"Writing KCL Equation at t=0+\");\n",
+ "print(\"0.25*va(0+) = 0.75\");\n",
+ "x=(0.75)/(0.25);\n",
+ "print\"%s %.2f %s\"%(\"va(0+) = \",x,\" V\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "va(0+) = 5V\n",
+ "vb(0+) = 5V\n",
+ "vb(0+) = 5V\n",
+ "Writing KCL Equation at t=0+\n",
+ "0.25*va(0+) = 0.75\n",
+ "va(0+) = 3.00 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electrical_Network_by_R._Singh/screenshots/chapter4.png b/Electrical_Network_by_R._Singh/screenshots/chapter4.png Binary files differnew file mode 100644 index 00000000..50d8c4e0 --- /dev/null +++ b/Electrical_Network_by_R._Singh/screenshots/chapter4.png diff --git a/Electrical_Network_by_R._Singh/screenshots/chapter6.png b/Electrical_Network_by_R._Singh/screenshots/chapter6.png Binary files differnew file mode 100644 index 00000000..63d5824c --- /dev/null +++ b/Electrical_Network_by_R._Singh/screenshots/chapter6.png diff --git a/Electrical_Network_by_R._Singh/screenshots/chapter7.png b/Electrical_Network_by_R._Singh/screenshots/chapter7.png Binary files differnew file mode 100644 index 00000000..ea376f2a --- /dev/null +++ b/Electrical_Network_by_R._Singh/screenshots/chapter7.png |