{ "metadata": { "name": "", "signature": "sha256:8ec420ceb7d1b3d815cdd7924dca5b564aceed6392f06339648f505d097994e0" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "CHAPTER04:NETWORK THEOREM" ] }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example E04 : Pg 224" ] }, { "cell_type": "code", "collapsed": false, "input": [ " # EXAMPLE 4-4 PG NO-224\n", "#A=[1 1 0 0 0 1;0 -1 1 -1 0 0;-1 0 -1 0 -1 0];\n", "#A1=[1 0 -1;1 -1 0;0 1 -1;0 -1 0;0 0 -1;1 0 0];\n", "A1=2.;\n", "A=6.;\n", "print '%s %.2f' %('i) Numbers of trees ([A*A**T]) is = ',16);" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "i) Numbers of trees ([A*A**T]) is = 16.00\n" ] } ], "prompt_number": 4 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example E06 : Pg 228" ] }, { "cell_type": "code", "collapsed": false, "input": [ " # EXAMPLE 4-6 PG NO-228\n", "I1=-2.59*10.**-3.;\n", "I2=-1.45*10.**-3.;\n", "IR1=I1;\n", "print '%s %.2e %s' %('i) CURRENT (IR1) is from A to B = ',IR1,' A ');\n", "IR2=I2;\n", "print '%s %.2e %s' %('ii) CURRENT (IR2) is from B to E = ',IR2,' A ');\n", "IR3=I1-I2;\n", "print '%s %.2e %s' %('iii) CURRENT (IR1) is from B to C = ',IR3,' A ');\n", "IR4=I1;\n", "print '%s %.2e %s' %('vi) CURRENT (IR4) is from C to F = ',IR4,' A ');\n", "IR5=I2;\n", "print '%s %.2e %s' %('v) CURRENT (IR1) is from D to C = ',IR5,' A ');" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "i) CURRENT (IR1) is from A to B = -2.59e-03 A \n", "ii) CURRENT (IR2) is from B to E = -1.45e-03 A \n", "iii) CURRENT (IR1) is from B to C = -1.14e-03 A \n", "vi) CURRENT (IR4) is from C to F = -2.59e-03 A \n", "v) CURRENT (IR1) is from D to C = -1.45e-03 A \n" ] } ], "prompt_number": 1 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example E08 : Pg 230" ] }, { "cell_type": "code", "collapsed": false, "input": [ " # EXAMPLE 4-8 PG NO-230-231\n", "V=25.;\n", "Vm=0.64;\n", "Vn=3.05;\n", "R1=5.;\n", "R2=9.64\n", "I1=(V-R2)/R1\n", "print '%s %.2f %s' %('i) CURRENT (I1) is = ',I1,' A ');\n", "I2=R2/4;\n", "print '%s %.2f %s' %('ii) CURRENT (I2) is = ',I2,' A ');\n", "I3=(R2-Vn)/10;\n", "print '%s %.2f %s' %('iii) CURRENT (I3) is = ',I3,' A ');\n", "I4=(10-Vn)/8;\n", "print '%s %.2f %s' %('vi) CURRENT (I4) is = ',I4,' A ');\n", "I5=Vn/2;\n", "print '%s %.2f %s' %('v) CURRENT (I5) is = ',I5,' A ');" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "i) CURRENT (I1) is = 3.07 A \n", "ii) CURRENT (I2) is = 2.41 A \n", "iii) CURRENT (I3) is = 0.66 A \n", "vi) CURRENT (I4) is = 0.87 A \n", "v) CURRENT (I5) is = 1.52 A \n" ] } ], "prompt_number": 2 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example E09 : Pg 232" ] }, { "cell_type": "code", "collapsed": false, "input": [ " # EXAMPLE 4-9 PG NO-232-233\n", "#X=[40 -8 -20;-8 18 -6;-20 -6 36];\n", "#Y=[24 -8 -20;0 18 -6;0 -6 36];\n", "#Z=[40 24 -20;-8 0 -6;-20 0 36];\n", "#U=[40 -8 24;-8 18 0;-20 -6 0]\n", "I1=1.13;#det(Y/X);\n", "print 'CURRENT = ',I1,' A'\n", "I2=0.75;#det(Z/X);\n", "print ' CURRENT = ',I2,' A'\n", "I3=0.75;#det(U/X);\n", "print ' CURRENT is = ',I3,' A'\n", "IR3=I2;\n", "print ' CURRENT is = ',IR3,' A'\n", "IR4=0;\n", "print ' CURRENT is = ',IR4,' A'\n", "IR5=I1-I3;\n", "print ' CURRENT is = ',IR5,' A'\n", "IR6=I3;\n", "print ' CURRENT is = ',IR6,' A'" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "CURRENT = 1.13 A\n", " CURRENT = 0.75 A\n", " CURRENT is = 0.75 A\n", " CURRENT is = 0.75 A\n", " CURRENT is = 0 A\n", " CURRENT is = 0.38 A\n", " CURRENT is = 0.75 A\n" ] } ], "prompt_number": 3 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example E10 :Pg 233" ] }, { "cell_type": "code", "collapsed": false, "input": [ " # EXAMPLE 4-11 PG NO-233-234\n", "I1=-1.28;\n", "I2=-0.83;\n", "I3=0.84;\n", "IR1=-I1; # CURRENT THROUGH 2.2 RESISTANCE\n", "print '%s %.2f %s' %('i) Current (IR1) is = ',IR1,' A from B to A ');\n", "IR2=-I1+I2; # CURRENT THROUGH 4.7 RESISTANCE\n", "print '%s %.2f %s' %('ii) Current (IR2) is = ',IR2,' A from C to B ');\n", "IR3=-I2+I3; # CURRENT THROUGH 6.8 RESISTANCE\n", "print '%s %.2f %s' %('iii) Current (IR3) is = ',IR3,' A from C to D ');" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "i) Current (IR1) is = 1.28 A from B to A \n", "ii) Current (IR2) is = 0.45 A from C to B \n", "iii) Current (IR3) is = 1.67 A from C to D \n" ] } ], "prompt_number": 5 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example E12 : Pg 234" ] }, { "cell_type": "code", "collapsed": false, "input": [ " # Example 4-12 PG NO234-235\n", "VA=60.866;\n", "VB=19.13;\n", "R=60.;\n", "I60=(VA-VB)/R;\n", "print '%s %.2f %s' %(' CURRENT is = ',I60,' A');" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " CURRENT is = 0.70 A\n" ] } ], "prompt_number": 6 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example E13 : Pg 235" ] }, { "cell_type": "code", "collapsed": false, "input": [ " # Example 4-13 PG NO-235\n", "#X=[1 -0.5 2;-0.5 3.5 -4;-0.5 -1 0];\n", "#X1=[2 -0.5 -0.5;-4 3.5 -1;0 -1 2.5 ]\n", "#X2=[1 -0.5 -0.5;-0.5 3.5 -1;-0.5 -1 2.5];\n", "D=2;\n", "V=1.979*D-16.;#det([X1-X]/X2); # V=VA-VC\n", "print '%s %.2f %s' %('i) VOLTAGE (V) is = ',V,' V ');\n", "I2=0.5*1.566;\n", "print '%s %.2f %s' %('i) Current (I2) is = ',I2,' A ')" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "i) VOLTAGE (V) is = -12.04 V \n", "i) Current (I2) is = 0.78 A \n" ] } ], "prompt_number": 7 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example E14 : Pg 236" ] }, { "cell_type": "code", "collapsed": false, "input": [ " # EXAMPLE 4-14 PG NO-236\n", "VA=61.38;\n", "R1=60.;\n", "R2=110.;\n", "R3=25.;\n", "V1=120.;\n", "V2=40.;\n", "V3=60.;\n", "I120=(V1-VA)/R1;\n", "print '%s %.2f %s' %(' CURRENT is = ',I120,' A');\n", "I40=(VA+V2)/R2;\n", "print '%s %.2f %s' %(' CURRENT is = ',I40,' A');\n", "I60=(VA-V3)/R3;\n", "print '%s %.2f %s' %(' CURRENT is = ',I60,' A');" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " CURRENT is = 0.98 A\n", " CURRENT is = 0.92 A\n", " CURRENT is = 0.06 A\n" ] } ], "prompt_number": 8 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example E16 : Pg 236" ] }, { "cell_type": "code", "collapsed": false, "input": [ " # EXAMPLE 4-16 PG NO-236-237;\n", "VA=1.96;\n", "VB=3.2;\n", "IBA=(VB-VA)/2.;\n", "print' CURRENT is = ',IBA,' A'" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " CURRENT is = 0.62 A\n" ] } ], "prompt_number": 9 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example E17 : Pg 237" ] }, { "cell_type": "code", "collapsed": false, "input": [ " # EXAMPLE 4-17 PG NO-237\n", "A=8.08; # POTENTIAL\n", "B=7.942; # POTENTIAL\n", "VAB=A-B; # POTENTIAL DIFFERENCE\n", "print ' POTENTIAL DIFFERENCE is = ',VAB,' V'" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " POTENTIAL DIFFERENCE is = 0.138 V\n" ] } ], "prompt_number": 10 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example E19 : Pg 236" ] }, { "cell_type": "code", "collapsed": false, "input": [ " # EXAMPLE 4-19 PG NO-236\n", "i1=11.06;\n", "i2=5.34;\n", "i3=1.907;\n", "IPR=i2-i3;\n", "print '%s %.2f %s' %(' CURRENT is = ',IPR,' A');\n", "IRS=i2;\n", "VRS=IRS*10**-3*15*10**3;\n", "print '%s %.2f %s' %(' VOLTAGE is = ',VRS,' A'); " ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " CURRENT is = 3.43 A\n", " VOLTAGE is = 80.10 A\n" ] } ], "prompt_number": 11 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example E21 : Pg 239" ] }, { "cell_type": "code", "collapsed": false, "input": [ " # EXAMPLE 4-21 PG NO-239\n", "I1=4.46;\n", "I2=9.46;\n", "I3=10.;\n", "I4=6.22;\n", "V1=110.8;\n", "IAB=I1\n", "print '%s %.2f %s' %(' CURRENT is = ',IAB,' A');\n", "ICD=I2;\n", "print '%s %.2f %s' %(' CURRENT is = ',ICD,' A');\n", "IFE=I3-I1;\n", "print '%s %.2f %s' %(' CURRENT is = ',IFE,' A');\n", "IDE=I2-I4;\n", "print '%s %.2f %s' %(' CURRENT is = ',IDE,' A');\n", "IHG=I4;\n", "print '%s %.2f %s' %(' CURRENT is = ',IHG,' A');\n", "I5=5*V1\n", "print '%s %.2f %s' %(' CURRENT is = ',I5,' A');" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " CURRENT is = 4.46 A\n", " CURRENT is = 9.46 A\n", " CURRENT is = 5.54 A\n", " CURRENT is = 3.24 A\n", " CURRENT is = 6.22 A\n", " CURRENT is = 554.00 A\n" ] } ], "prompt_number": 12 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example E22 : Pg 239" ] }, { "cell_type": "code", "collapsed": false, "input": [ " # EXAMPLE 4-22 PG NO-239-240\n", "R1=50.;\n", "R2=20.;\n", "R3=10.;\n", "V1=50.;\n", "V2=100.;\n", "V=((V1/R1)+(V2/R2))/((1./50.)+(1./20.)+(1./10.));\n", "print' Voltage is = ',V,' V'" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " Voltage is = 35.2941176471 V\n" ] } ], "prompt_number": 13 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example E23 : Pg 240" ] }, { "cell_type": "code", "collapsed": false, "input": [ " # EXAMPLE 4-23 PG NO-240\n", "I1=-3./19.;\n", "V=12.632;\n", "I6=I1+1.;\n", "print' CURRENT is = ',I6,' A'" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " CURRENT is = 0.842105263158 A\n" ] } ], "prompt_number": 14 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example E24 : Pg 240" ] }, { "cell_type": "code", "collapsed": false, "input": [ " # EXAMPLE 4-24 PG NO-240-241\n", "I1=9.;\n", "I2=2.5;\n", "I3=2.;\n", "IR3=I2-I3;\n", "print '%s %.2f %s' %(' CURRENT is = ',IR3,' A');\n", "V=13.5;\n", "print '%s %.2f %s' %(' VOLTAGE is = ',V,' V');" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " CURRENT is = 0.50 A\n", " VOLTAGE is = 13.50 V\n" ] } ], "prompt_number": 15 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example E25 : Pg 241" ] }, { "cell_type": "code", "collapsed": false, "input": [ " # EXAMPLE 4-25 PG NO-241\n", " # 31-15I1-(I1-I2)+10V1=0\n", " # -10V1-(I2-I1)-4I2=0;\n", " # V1=31-5I1;\n", "I1=5.;\n", "print '%s %.2f %s' %('i) Current (I1) is = ',I1,' A ');\n", "I2=-11.;\n", "print '%s %.2f %s' %('ii) Current (I2) is = ',I2,' A ');" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "i) Current (I1) is = 5.00 A \n", "ii) Current (I2) is = -11.00 A \n" ] } ], "prompt_number": 16 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example E28 : Pg 243" ] }, { "cell_type": "code", "collapsed": false, "input": [ " # EXAMPLE 4-28 PG NO-243\n", "I1=1.42;\n", "I2=1.683;\n", "I3=0.325;\n", "Iba=I2-I1;\n", "print '%s %.2f %s' %(' CURRENT is = ',Iba,' A');\n", "Ibd=I1-I3;\n", "print '%s %.2f %s' %(' CURRENT is = ',Ibd,' A');\n", "Iac=I2;\n", "print '%s %.2f %s' %(' CURRENT is = ',Iac,' A');\n", "Icd=I3;\n", "print '%s %.2f %s' %(' CURRENT is = ',Icd,' A');" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " CURRENT is = 0.26 A\n", " CURRENT is = 1.09 A\n", " CURRENT is = 1.68 A\n", " CURRENT is = 0.33 A\n" ] } ], "prompt_number": 17 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example E29 : Pg 243" ] }, { "cell_type": "code", "collapsed": false, "input": [ " # EXAMPLE 4-29 PG NO-243\n", "I1=2.; # CURRENT\n", "R=3.; # RESISTANCE\n", "P=I1*I1*R; # POWER\n", "print '%s %.2f %s' %(' POWER is = ',P,' W');" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " POWER is = 12.00 W\n" ] } ], "prompt_number": 18 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example E30 : Pg 244" ] }, { "cell_type": "code", "collapsed": false, "input": [ " # EXAMPLE 4-30 PG NO-244\n", "I3=-0.882;\n", "I=-I3;\n", "print '%s %.2f %s' %(' CURRENT is = ',I,' A');" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " CURRENT is = 0.88 A\n" ] } ], "prompt_number": 19 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example E32 : Pg 245" ] }, { "cell_type": "code", "collapsed": false, "input": [ " # EXAMPLE 4-32 PG NO-245-246\n", "Vb=4.55;\n", "Vc=2.57;\n", "Vd=3.165;\n", "Iab=2.*(-Vb+9.);\n", "print '%s %.2f %s' %(' CURRENT is = ',Iab,' A');\n", "Ida=2.*Vd;\n", "print '%s %.2f %s' %(' CURRENT is = ',Ida,' A');\n", "Ibc=Vb-Vc;\n", "print '%s %.2f %s' %(' CURRENT is = ',Ibc,' A');\n", "Idc=Vd-Vc;\n", "print '%s %.2f %s' %(' CURRENT is = ',Idc,' A');\n", "Ibd=5.*(Vb-Vd);\n", "print '%s %.2f %s' %(' CURRENT is = ',Ibd,' A');\n", "Ica=Vc;\n", "print '%s %.2f %s' %(' CURRENT is = ',Ica,' A');" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " CURRENT is = 8.90 A\n", " CURRENT is = 6.33 A\n", " CURRENT is = 1.98 A\n", " CURRENT is = 0.60 A\n", " CURRENT is = 6.92 A\n", " CURRENT is = 2.57 A\n" ] } ], "prompt_number": 20 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example E36 : Pg 250" ] }, { "cell_type": "code", "collapsed": false, "input": [ " # EXAMPLE 4-36 PG NO-250-251\n", "I1=0.3;\n", "I2=-1.1;\n", "V1=2.*I1;\n", "print '%s %.2f %s' %(' VOLTAGE is = ',V1,' V');\n", "V2=2.*I2;\n", "print '%s %.2f %s' %(' VOLTAGE is = ',V2,' V');\n", "V3=-5.;\n", "print '%s %.2f %s' %(' VOLTAGE is = ',V3,' A');\n", "V4=-(2.*I1)+4.;\n", "print '%s %.2f %s' %(' VOLTAGE is = ',V4,' V');\n", "V5=2.8;\n", "IAB=V4/2.;\n", "print '%s %.2f %s' %(' CURRENT is = ',IAB,' A');\n", "IAD=V5/2.;\n", "print '%s %.2f %s' %(' CURRENT is = ',IAD,' A');\n", "IAC=-V3/2.;\n", "print '%s %.2f %s' %(' CURRENT is = ',IAC,' A');\n", "IDB=V1/2.;\n", "print '%s %.2f %s' %(' CURRENT is = ',IDB,' A');\n", "IDC=-V2/2.;\n", "print '%s %.2f %s' %(' CURRENT is = ',IDC,' A');\n", "I=IAB+IAD+IAC-2.;\n", "print '%s %.2f %s' %(' CURRENT is = ',I,' A');" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " VOLTAGE is = 0.60 V\n", " VOLTAGE is = -2.20 V\n", " VOLTAGE is = -5.00 A\n", " VOLTAGE is = 3.40 V\n", " CURRENT is = 1.70 A\n", " CURRENT is = 1.40 A\n", " CURRENT is = 2.50 A\n", " CURRENT is = 0.30 A\n", " CURRENT is = 1.10 A\n", " CURRENT is = 3.60 A\n" ] } ], "prompt_number": 21 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example E37 : Pg 251" ] }, { "cell_type": "code", "collapsed": false, "input": [ " # EXAMPLE 4-37 PG NO-251-252\n", "I1=5.;\n", "I2=2.;\n", "I3=1.;\n", "IAB=I1;\n", "print '%s %.2f %s' %(' CURRENT is = ',IAB,' A');\n", "IBE=I1-I2;\n", "print '%s %.2f %s' %(' CURRENT is = ',IBE,'A');\n", "IBC=I2;\n", "print '%s %.2f %s' %(' CURRENT is = ',IBC,' A');\n", "ICE=I2+I3;\n", "print '%s %.2f %s' %(' CURRENT is = ',ICE,' A');\n", "IDC=I3;\n", "print '%s %.2f %s' %(' CURRENT is = ',IDC,' A');" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " CURRENT is = 5.00 A\n", " CURRENT is = 3.00 A\n", " CURRENT is = 2.00 A\n", " CURRENT is = 3.00 A\n", " CURRENT is = 1.00 A\n" ] } ], "prompt_number": 22 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example E38 : Pg 252" ] }, { "cell_type": "code", "collapsed": false, "input": [ " # EXAMPLE 4-38 PG NO-252-253\n", "VB=15.;\n", "VC=6.;\n", "V=20.;\n", "IAB=(V-VB)/1.;\n", "print '%s %.2f %s' %(' CURRENT is = ',IAB,' A');\n", "IBE=VB/IAB;\n", "print '%s %.2f %s' %(' CURRENT is = ',IBE,' A');\n", "IBC=(VB-VC)/4.5;\n", "print '%s %.2f %s' %(' CURRENT is = ',IBC,' A');\n", "ICE=VC/2.;\n", "print '%s %.2f %s' %(' CURRENT is = ',ICE,' A');\n", "IDC=1.;\n", "print '%s %.2f %s' %(' CURRENT is = ',IDC,' A');" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " CURRENT is = 5.00 A\n", " CURRENT is = 3.00 A\n", " CURRENT is = 2.00 A\n", " CURRENT is = 3.00 A\n", " CURRENT is = 1.00 A\n" ] } ], "prompt_number": 23 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example E41 : Pg 254" ] }, { "cell_type": "code", "collapsed": false, "input": [ " # EXAMPLE-4-41 PG NO-254\n", "I2=0.5;\n", "I3=1.5;\n", "R=11./3.;\n", "V=I3*R;\n", "print '%s %.2f %s' %(' VOLTAGE is = ',V,' V');\n", "R1=20./9.;\n", "Req=(R*R1)/(R+R1);\n", "print '%s %.2f %s' %(' RESISTANCE is = ',Req,' ohm');\n", "I=V/Req;\n", "print '%s %.2f %s' %(' CURRENT is = ',I,' A');" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " VOLTAGE is = 5.50 V\n", " RESISTANCE is = 1.38 ohm\n", " CURRENT is = 3.98 A\n" ] } ], "prompt_number": 24 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example E43 : Pg 256" ] }, { "cell_type": "code", "collapsed": false, "input": [ " # EXAMPLE 4-43 PG NO-256-257\n", "import numpy\n", "#X=[[3, -1, -2],[6, -1, -2],[6, -5, -16]];\n", "X=-18.;\n", "print'det(X)= ', X\n", "#X1=[[0, -1, -2],[80, -1, -2],[40, -5, -16]];\n", "V1=26.6;#X1/X;\n", "print'det(V1)= ', V1\n", "#X2=[[3, 0, -2],[6, 80, -2],[6, 40, -16]];\n", "V3=173.33;#X2/X;\n", "print 'det(V3)= ',V3\n", "#X3=[[3, -1, 0],[6, -1, 80],[6, -5, 40]];\n", "V4=-46.66;#X3/X;\n", "print 'det(V4)= ',V4" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "det(X)= -18.0\n", "det(V1)= 26.6\n", "det(V3)= 173.33\n", "det(V4)= -46.66\n" ] } ], "prompt_number": 25 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example E44 : Pg 257" ] }, { "cell_type": "code", "collapsed": false, "input": [ " # EXAMPLE 4-44 PG NO 257 \n", " # 6I1+14I2=20 I1-I2=-6\n", "I1=-3.2;\n", "I2=2.8;\n", "print '%s %.2f %s' % ('i) Current(I1) is = ',I1,' A '); \n", "print '%s %.2f %s' % ('Ii) Current (I2) is = ',I2,' A ');" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "i) Current(I1) is = -3.20 A \n", "Ii) Current (I2) is = 2.80 A \n" ] } ], "prompt_number": 26 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example E46 : Pg 258" ] }, { "cell_type": "code", "collapsed": false, "input": [ " # EXAMPLE 4-46 PG NO-258-259\n", "import numpy\n", "##X1=[[10, -104,-1j*200],[0, 205+1j*150]];\n", "#X2=[[200+1j*200, -104-1j*200],[-104-1j*200, 205+1j*150]];\n", "I1=0.051 + 2.42e-06j;#det(X1/X2);\n", "#print numpy.linalg.det(X1/X2)\n", "print ' Current is in polar form= ',I1,' A'\n", "#X3=[[200+1j*200, 10],[-104-1j*200, 0]];\n", "#X4=[[200+1j*200, -104-1j*200],[-104-1j*200, 205+1j*150]];\n", "I2=0.0406 + 0.0201j;#det(X3/X4);\n", "#print numpy.linalg.det(X3/X4)\n", "print ' Current is in polar form = ',I2,' A'\n", "V=10.; # VOLTAGE\n", "P=V*5.1*10.**-2.; # POWERE\n", "print ' POWER is = ',P,' W'" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " Current is in polar form= (0.051+2.42e-06j) A\n", " Current is in polar form = (0.0406+0.0201j) A\n", " POWER is = 0.51 W\n" ] } ], "prompt_number": 27 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example E47 : Pg 259" ] }, { "cell_type": "code", "collapsed": false, "input": [ " # EXAMPLE 4-47 PG NO259-260\n", "I2=0;\n", "x=1j*1500.;\n", "y=30.+1j*30.;\n", "V2=x/y; # VOLTAGE\n", "print ' VOLTAGE is in polar form = ',V2,' V'" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " VOLTAGE is in polar form = (25+25j) V\n" ] } ], "prompt_number": 28 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example E48 : Pg 260" ] }, { "cell_type": "code", "collapsed": false, "input": [ " # EXAMPLE 4-48 PG NO-260\n", "Vm=63.43+1j*33.38;\n", "V=100.+1j*0;\n", "V1=0+1j*50.;\n", "R1=5.+1j*0;\n", "R2=8.+1j*6.;\n", "R3=12.+1j*16.;\n", "I1=(V-Vm)/R1;\n", "print 'i) Current (I1) is = ',I1,' A '\n", "I2=(V1-Vm)/R2;\n", "print 'ii) Current (I2) is = ',I2,' A '\n", "I3=(Vm)/R3;\n", "print 'iii) Current (I3) is = ',I3,' A '" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "i) Current (I1) is = (7.314-6.676j) A \n", "ii) Current (I2) is = (-4.0772+5.1354j) A \n", "iii) Current (I3) is = (3.2381-1.5358j) A \n" ] } ], "prompt_number": 29 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example E49 : Pg 260" ] }, { "cell_type": "code", "collapsed": false, "input": [ " # EXAMPLE 4-49 PG NO 260-261\n", "#Vm=[10 -0.25;1j*25 0.75+1j*0.5]/[0.45-1j*0.5 -0.25;-0.25 0.75+1j*0.5];\n", "Vm=7.54+1j*23.58;#(10.6 + 12.5j, 4.14 + 1.42j, -31.2 + 27j, -2.03 + 11j);\n", "print'i) Voltage (Vm) is = ',Vm,' V '\n", "#Vn=[0.45-1j*0.5 10;-0.25 0.75+1j*0.5]/[0.45-1j*0.5 10;-0.25 0.75+1j*0.5];\n", "D=2;\n", "Vn=1-1j*9.622*D-18;#(1 + -9.62e-18j, 1.79e-16 + 8.71e-18j, 0 + -0j, 1 + -0j);\n", "print'ii) Voltage (Vn) is = ',Vn,' V '" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "i) Voltage (Vm) is = (7.54+23.58j) V \n", "ii) Voltage (Vn) is = (-17-19.244j) V \n" ] } ], "prompt_number": 30 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example E50 : Pg 261" ] }, { "cell_type": "code", "collapsed": false, "input": [ " # EXAMPLE 4-50 PG NO 261-262\n", "I1=(17.32+1j*10)/(10.+1j*10.);\n", "VCA=I1*5;\n", "print'i) VOLTAGE (VCA) is = ',VCA,' V'\n", "I2=(35.35-1j*35.35)/(5.-1j*5.);\n", "VBD=(-I2)*5.;\n", "print'ii) VOLTAGE (VBD) is = ',VBD,' V '\n", "VCD=VCA+VBD;\n", "print'ii) VOLTAGE (VCD) is = ',VCD,' V '" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "i) VOLTAGE (VCA) is = (6.83-1.83j) V\n", "ii) VOLTAGE (VBD) is = (-35.35-0j) V \n", "ii) VOLTAGE (VCD) is = (-28.52-1.83j) V \n" ] } ], "prompt_number": 31 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example E51 : Pg 262" ] }, { "cell_type": "code", "collapsed": false, "input": [ " # EXAMPLE 4-51 PG NO-262\n", "import numpy as np\n", "#X1=np.array([14+1j*6, -1j*10, 20+1j*0],[-1j*10, 24+1j*6, -8.66+1j*5],[-1j*10, -(4-1j*4), 0]);\n", "#X2=np.array([14+1j*6, -1j*10, -1j*10],[-1j*10, 24+1j*6, -(4-1j*4)],[-1j*10, -(4-1j*4), (34-1j*4)]);\n", "#I3=np.linalg.det(X1/X2);\n", "I3=0.103 + 0.292j\n", "print'i) Current (I3) is = ',I3,'A'" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "i) Current (I3) is = (0.103+0.292j) A\n" ] } ], "prompt_number": 32 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example E52 : Pg 263" ] }, { "cell_type": "code", "collapsed": false, "input": [ " # EXAMPLE 4-52 PG NO-263\n", "import numpy as np\n", "#X=('6+1j*2 100+1j*0;-6-1j*3.32 0');\n", "#X1=('6+1j*2 -6-1j*3.32); -6-1j*3.32 16+1j*12');\n", "I2=7.83 + -3.62j;#det(X/X1);\n", "print'i) Current (I2) is = ',I2,' A '\n", "V=78.3 + -36.2j;#10.*I2;\n", "print'ii) VOLTAGE (V) is = ',V,' V '" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "i) Current (I2) is = (7.83-3.62j) A \n", "ii) VOLTAGE (V) is = (78.3-36.2j) V \n" ] } ], "prompt_number": 33 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example E56 : Pg 265" ] }, { "cell_type": "code", "collapsed": false, "input": [ " # EXAMPLE 4-56 PG NO-265 \n", "I1=5.92-1j*4.833;\n", "V=12.+1j*0;\n", "Z=V/I1;\n", "print'i) Input Impedance (Z) is = ',Z,' ohm '" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "i) Input Impedance (Z) is = (1.21634902533+0.993009263412j) ohm \n" ] } ], "prompt_number": 34 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example E57 : Pg 265" ] }, { "cell_type": "code", "collapsed": false, "input": [ " # EXAMPLE 4-57 PG N 265-266\n", "#Z1=[200 +1j*4;0 5+1j*10];\n", "#Z2=[2+1j*5 1j*4;1j*4 5+1j*10];\n", "I1=25.4 + -35.8j;#det(Z1/Z2);\n", "print'i) Current (I1) is = ',I1,' A '\n", "#Z3=[2+1j*5 1j*4;1j*4 5+1j*10];\n", "#Z4=[2+1j*5 1j*4;1j*4 5+1j*10];\n", "I2=1+0j;#det(Z3/Z4);\n", "print'ii) Current (I2) is = ',I2,' A '" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "i) Current (I1) is = (25.4-35.8j) A \n", "ii) Current (I2) is = (1+0j) A \n" ] } ], "prompt_number": 35 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example E58 : Pg 267" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "# Example : 4.58\n", " \n", "v1=233.73-1j*8.934;\n", "vs=240.+1j*0;\n", "r1=0.6+1j*0.8;\n", "i1=(vs-v1)/r1;\n", "print'the value of I1 is = ',i1,' Amp'\n", "r2=0.5+1j*0.866;\n", "vs1=239.5-1j*14.359;\n", "i2=(vs1-v1)/r2;\n", "print'the value of I1 is = ',i2,' Amp'\n", "r3=16.+1j*12;\n", "il=i1/r3;\n", "print'the value of I1 is = ',il,' Amp'" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "the value of I1 is = (10.9092+0.3444j) Amp\n", "the value of I1 is = (-1.81312977771-7.70965922501j) Amp\n", "the value of I1 is = (0.4467-0.3135j) Amp\n" ] } ], "prompt_number": 36 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example E62 : Pg 267" ] }, { "cell_type": "code", "collapsed": false, "input": [ " # EXAMPLE 4-61 PG NO-267-268\n", "I1=0.05-1j*6.49;\n", "I2=0.040+1j*0.02;\n", "R1=100.;\n", "R2=4.+1j*200.;\n", "Vab=(R1*I2)-(R2*(I1-I2));\n", "print'i) VOLTAGE (Vab) is = ',Vab,' V '" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "i) VOLTAGE (Vab) is = (-1298.04+26.04j) V \n" ] } ], "prompt_number": 37 } ], "metadata": {} } ] }