diff options
author | Trupti Kini | 2016-01-17 23:30:12 +0600 |
---|---|---|
committer | Trupti Kini | 2016-01-17 23:30:12 +0600 |
commit | 2ec8fc25ee45e790f91f2dc0fb342712cc3de4b7 (patch) | |
tree | fd6440fe7cf46a60449631fa5022acc65a04e81f | |
parent | b68dcdb18f92b07d76db49fc86a98ba287cf15fe (diff) | |
download | Python-Textbook-Companions-2ec8fc25ee45e790f91f2dc0fb342712cc3de4b7.tar.gz Python-Textbook-Companions-2ec8fc25ee45e790f91f2dc0fb342712cc3de4b7.tar.bz2 Python-Textbook-Companions-2ec8fc25ee45e790f91f2dc0fb342712cc3de4b7.zip |
Added(A)/Deleted(D) following books
A Electrical_Network_by_R._Singh/Chapter10_1.ipynb
A Electrical_Network_by_R._Singh/Chapter11_1.ipynb
A Electrical_Network_by_R._Singh/Chapter12_1.ipynb
A Electrical_Network_by_R._Singh/Chapter1_1.ipynb
A Electrical_Network_by_R._Singh/Chapter2_1.ipynb
A Electrical_Network_by_R._Singh/Chapter3_1.ipynb
A Electrical_Network_by_R._Singh/Chapter4_1.ipynb
A Electrical_Network_by_R._Singh/Chapter6_1.ipynb
A Electrical_Network_by_R._Singh/Chapter7_1.ipynb
A Electrical_Network_by_R._Singh/Chapter8_1.ipynb
A Electrical_Network_by_R._Singh/screenshots/chapter4_1.png
A Electrical_Network_by_R._Singh/screenshots/chapter6_1.png
A Electrical_Network_by_R._Singh/screenshots/chapter7_1.png
A Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter10_1.ipynb
A Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter11_1.ipynb
A Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter12_1.ipynb
A Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter13_1.ipynb
A Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter14_1.ipynb
A Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter15_1.ipynb
A Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter16_1.ipynb
A Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter17_1.ipynb
A Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter1_1.ipynb
A Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter2_1.ipynb
A Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter3_1.ipynb
A Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter4_1.ipynb
A Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter5_1.ipynb
A Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter6_1.ipynb
A Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter7_1.ipynb
A Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter8_1.ipynb
A Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter9_1.ipynb
A Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/screenshots/chapter3.png
A Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/screenshots/chapter4.png
A Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/screenshots/chapter5.png
A Machine_Design_by_T._H._Wentzell,_P._E/Chapter1.ipynb
A Machine_Design_by_T._H._Wentzell,_P._E/Chapter10.ipynb
A Machine_Design_by_T._H._Wentzell,_P._E/Chapter11.ipynb
A Machine_Design_by_T._H._Wentzell,_P._E/Chapter12.ipynb
A Machine_Design_by_T._H._Wentzell,_P._E/Chapter13.ipynb
A Machine_Design_by_T._H._Wentzell,_P._E/Chapter14.ipynb
A Machine_Design_by_T._H._Wentzell,_P._E/Chapter15.ipynb
A Machine_Design_by_T._H._Wentzell,_P._E/Chapter16.ipynb
A Machine_Design_by_T._H._Wentzell,_P._E/Chapter17.ipynb
A Machine_Design_by_T._H._Wentzell,_P._E/Chapter18.ipynb
A Machine_Design_by_T._H._Wentzell,_P._E/Chapter19.ipynb
A Machine_Design_by_T._H._Wentzell,_P._E/Chapter2.ipynb
A Machine_Design_by_T._H._Wentzell,_P._E/Chapter20.ipynb
A Machine_Design_by_T._H._Wentzell,_P._E/Chapter3.ipynb
A Machine_Design_by_T._H._Wentzell,_P._E/Chapter4.ipynb
A Machine_Design_by_T._H._Wentzell,_P._E/Chapter5.ipynb
A Machine_Design_by_T._H._Wentzell,_P._E/Chapter6.ipynb
A Machine_Design_by_T._H._Wentzell,_P._E/Chapter7.ipynb
A Machine_Design_by_T._H._Wentzell,_P._E/Chapter8.ipynb
A Machine_Design_by_T._H._Wentzell,_P._E/screenshots/chapter1.png
A Machine_Design_by_T._H._Wentzell,_P._E/screenshots/chapter2.png
A Machine_Design_by_T._H._Wentzell,_P._E/screenshots/chapter3.png
55 files changed, 27058 insertions, 0 deletions
diff --git a/Electrical_Network_by_R._Singh/Chapter10_1.ipynb b/Electrical_Network_by_R._Singh/Chapter10_1.ipynb new file mode 100644 index 00000000..6306573f --- /dev/null +++ b/Electrical_Network_by_R._Singh/Chapter10_1.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_1.ipynb b/Electrical_Network_by_R._Singh/Chapter11_1.ipynb new file mode 100644 index 00000000..7477df52 --- /dev/null +++ b/Electrical_Network_by_R._Singh/Chapter11_1.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_1.ipynb b/Electrical_Network_by_R._Singh/Chapter12_1.ipynb new file mode 100644 index 00000000..83ceaa1b --- /dev/null +++ b/Electrical_Network_by_R._Singh/Chapter12_1.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/Chapter1_1.ipynb b/Electrical_Network_by_R._Singh/Chapter1_1.ipynb new file mode 100644 index 00000000..1f66c550 --- /dev/null +++ b/Electrical_Network_by_R._Singh/Chapter1_1.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/Chapter2_1.ipynb b/Electrical_Network_by_R._Singh/Chapter2_1.ipynb new file mode 100644 index 00000000..20e60dfa --- /dev/null +++ b/Electrical_Network_by_R._Singh/Chapter2_1.ipynb @@ -0,0 +1,1958 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:b2b5fb16825d4183b23bc2d431db6308dc6c5888398753fd91beb4d61ab4253a"
+ },
+ "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": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Applying KCL to node a:\n",
+ "2*Va-0.5*Vb-0.5*Vc = 5\n",
+ "Applying KCL to node b:\n",
+ "-3/2*Va+5/6*Vb+2/3*Vc = -1\n",
+ "Applying KCL to node c:\n",
+ "1/2*Va+1/3*Vb-31/30*Vc = -1\n",
+ "Solving equations 1,2 and 3\n",
+ "[matrix([[ 0.5 ],\n",
+ " [-8.125],\n",
+ " [ 0.125]])]"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Va= 4.303 V\n",
+ "Vb= 3.87 V\n",
+ "Vc= 3.33 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "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_1.ipynb b/Electrical_Network_by_R._Singh/Chapter3_1.ipynb new file mode 100644 index 00000000..6d33a416 --- /dev/null +++ b/Electrical_Network_by_R._Singh/Chapter3_1.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_1.ipynb b/Electrical_Network_by_R._Singh/Chapter4_1.ipynb new file mode 100644 index 00000000..cc47617a --- /dev/null +++ b/Electrical_Network_by_R._Singh/Chapter4_1.ipynb @@ -0,0 +1,1876 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:15adbacd624e62f6c267b9512c0735c4ab19ee7a3215fada8af088cb74ddd009"
+ },
+ "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": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "f=50 c/s\n",
+ "I=20 A\n",
+ "Im=I*sqrt(2)\n",
+ "\n",
+ "Im= 28.28 A\n",
+ "\n",
+ "Equation of current, \n",
+ "i=Im*sin(2*pi*f*t)\n",
+ "=28.28sin(2*pi*f*t)=28.28sin(100*pi*t)\n",
+ "(a)At t=0.0025 seconds\n",
+ "i= 19.99 A\n",
+ "(b)At t=0.0125 seconds\n",
+ "i= -19.96 A\n",
+ "(c) i=28.28sin(100*pi*t) \n",
+ "t= 1.67e-03 second"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "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": "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\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_1.ipynb b/Electrical_Network_by_R._Singh/Chapter6_1.ipynb new file mode 100644 index 00000000..aaca3c9c --- /dev/null +++ b/Electrical_Network_by_R._Singh/Chapter6_1.ipynb @@ -0,0 +1,1133 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:3ac2c23233482dc3087073e89bf82acd0d43f65ffc269ad874ae8200d4170ec2"
+ },
+ "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": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "IL=15 A \n",
+ "P=11kW \n",
+ "S=15kVA \n",
+ "\n",
+ "S=sqrt(3)*VL*IL \n",
+ "VL= 333.33 V\n",
+ "\n",
+ "cos(phi)=P/S = 42.02 \n",
+ "\n",
+ "phi= 0.748 degrees\n",
+ "\n",
+ "Q=sqrt(3).VL.IL.sin(phi) = 195.70 VAR\n",
+ "\n",
+ "Iph=IL = 15.00 A\n",
+ "\n",
+ "Zph=Vph/Iph = 22.22 Ohm\n",
+ "\n",
+ "R= Zph*cos(phi) = 22.22 Ohm\n",
+ "\n",
+ "XL=Zph*sin(phi)= 0.29 Ohm\n",
+ "\n",
+ "Cph =VL = 577.35 V\n",
+ "\n",
+ "Zph= 22.22 Ohm\n",
+ "\n",
+ "Iph=Vph/Zph = 25.98 A \n",
+ "\n",
+ "IL=sqrt(3)*Iph = 45.00 A\n",
+ "\n",
+ "P=sqrt(3)*VL*IL*cos(phi) = 44996.17 W\n",
+ "\n",
+ "Q=sqrt(3)*VL*IL*sin(phi) = 587.09 VAR\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "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_1.ipynb b/Electrical_Network_by_R._Singh/Chapter7_1.ipynb new file mode 100644 index 00000000..be717441 --- /dev/null +++ b/Electrical_Network_by_R._Singh/Chapter7_1.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_1.ipynb b/Electrical_Network_by_R._Singh/Chapter8_1.ipynb new file mode 100644 index 00000000..f72a22fd --- /dev/null +++ b/Electrical_Network_by_R._Singh/Chapter8_1.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_1.png b/Electrical_Network_by_R._Singh/screenshots/chapter4_1.png Binary files differnew file mode 100644 index 00000000..3298d998 --- /dev/null +++ b/Electrical_Network_by_R._Singh/screenshots/chapter4_1.png diff --git a/Electrical_Network_by_R._Singh/screenshots/chapter6_1.png b/Electrical_Network_by_R._Singh/screenshots/chapter6_1.png Binary files differnew file mode 100644 index 00000000..9e14cdea --- /dev/null +++ b/Electrical_Network_by_R._Singh/screenshots/chapter6_1.png diff --git a/Electrical_Network_by_R._Singh/screenshots/chapter7_1.png b/Electrical_Network_by_R._Singh/screenshots/chapter7_1.png Binary files differnew file mode 100644 index 00000000..2d5ec5e9 --- /dev/null +++ b/Electrical_Network_by_R._Singh/screenshots/chapter7_1.png diff --git a/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter10_1.ipynb b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter10_1.ipynb new file mode 100644 index 00000000..d37bb7d2 --- /dev/null +++ b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter10_1.ipynb @@ -0,0 +1,593 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:4114bb4b96c500253f7e5458fac8496808721f37dbe4f7191c0a067f28a0192a"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter10-Integrated Circuit Biasing and Active Loads "
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg580"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 10.1\n",
+ "Vbe=0.6;##(V)\n",
+ "b=100.;\n",
+ "V1=5.;\n",
+ "Io=200.;##micro A\n",
+ "Iref=Io*(1.+2./b);\n",
+ "print\"%s %.2f %s\"%('\\nreference current= ',Iref,' microA\\n')\n",
+ "Iref=Iref*0.001;##mA\n",
+ "R1=(V1-Vbe)/Iref;\n",
+ "print\"%s %.2f %s\"%('\\nR1= ',R1,' KOhm\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "reference current= 204.00 microA\n",
+ "\n",
+ "\n",
+ "R1= 21.57 KOhm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg582"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 10.2\n",
+ "V1=5.;\n",
+ "V2=-5.;\n",
+ "R1=9.3;\n",
+ "b=50.;\n",
+ "Vbe=0.7;\n",
+ "Va=80.;\n",
+ "Iref=(V1-Vbe-V2)/R1;\n",
+ "print\"%s %.2f %s\"%('\\nreference current = ',Iref,'mA\\n')\n",
+ "Io=Iref/(1.+2./b);\n",
+ "print\"%s %.2f %s\"%('\\noutput current= ',Io,'mA\\n')\n",
+ "ro=Va/Io;\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal output resistance= ',ro,' KOhm\\n')\n",
+ "##dIo=dVce2/ro\n",
+ "Vce2=0.7;\n",
+ "dIo=(V1-Vce2)/ro;\n",
+ "print\"%s %.2f %s\"%('\\nchange in load current= ',dIo,' mA\\n')\n",
+ "x=dIo/Io;\n",
+ "x=x*100.;\n",
+ "print\"%s %.2f %s\"%('\\npercent change in output current= ',x,' \\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "reference current = 1.00 mA\n",
+ "\n",
+ "\n",
+ "output current= 0.96 mA\n",
+ "\n",
+ "\n",
+ "small signal output resistance= 83.20 KOhm\n",
+ "\n",
+ "\n",
+ "change in load current= 0.05 mA\n",
+ "\n",
+ "\n",
+ "percent change in output current= 5.38 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg591"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 10.4\n",
+ "Iref=1.;\n",
+ "Io=12.*10**-3;\n",
+ "V1=5.;\n",
+ "V2=-5.;\n",
+ "Vt=0.026;\n",
+ "Vbe=0.7;\n",
+ "R1=(V1-Vbe-V2)/Iref;\n",
+ "print\"%s %.2f %s\"%('\\nResistance R1 = ',R1,'KOhm\\n')\n",
+ "Re=(Vt/Io)*math.log(Iref/Io);\n",
+ "print\"%s %.2f %s\"%('\\nResistance Re = ',Re,'KOhm\\n')\n",
+ "Vbe=Io*Re;\n",
+ "print\"%s %.2f %s\"%('\\ndifference between two B-E voltages= ',Vbe,' V\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Resistance R1 = 9.30 KOhm\n",
+ "\n",
+ "\n",
+ "Resistance Re = 9.58 KOhm\n",
+ "\n",
+ "\n",
+ "difference between two B-E voltages= 0.11 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5-pg593"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 10.5\n",
+ "V1=5.;\n",
+ "V2=-5.;\n",
+ "R1=9.3;\n",
+ "Re=9.580;\n",
+ "Vt=0.026;\n",
+ "b=100.;\n",
+ "Vbe=0.7;\n",
+ "Va=80.;\n",
+ "Io=12.;\n",
+ "ro2=Va/Io;\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal collector resistance= ',ro2,' MOhm\\n')\n",
+ "Io=12.*0.001;##mA\n",
+ "gm2=Io/Vt;\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance= ',gm2,' mA/V\\n')\n",
+ "r=b*Vt/Io;\n",
+ "print\"%s %.2f %s\"%('\\nResistance= ',r,' KOhm\\n')\n",
+ "Ro=ro2*(1.+gm2*Re*r/(Re+r));\n",
+ "print\"%s %.2f %s\"%('\\noutput resistance= ',Ro,' MOhm\\n')\n",
+ "dVc2=4.;\n",
+ "dIo=dVc2/Ro;\n",
+ "print\"%s %.2f %s\"%('\\nchange in load current= ',dIo,' microA\\n')\n",
+ "Io=12.;##micro A\n",
+ "x=dIo/Io;\n",
+ "x=x*100.;\n",
+ "print\"%s %.2f %s\"%('\\npercent change in output current =\\n',x,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "small signal collector resistance= 6.67 MOhm\n",
+ "\n",
+ "\n",
+ "transconductance= 0.46 mA/V\n",
+ "\n",
+ "\n",
+ "Resistance= 216.67 KOhm\n",
+ "\n",
+ "\n",
+ "output resistance= 34.90 MOhm\n",
+ "\n",
+ "\n",
+ "change in load current= 0.11 microA\n",
+ "\n",
+ "\n",
+ "percent change in output current =\n",
+ " 0.96 \n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6-pg597"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 10.6\n",
+ "V1=5.;\n",
+ "V2=-5.;\n",
+ "Vbe=0.6;\n",
+ "Veb=0.6;\n",
+ "Iq2=400.*10**-3;##mA\n",
+ "Iref=200.*10**-3;##mA\n",
+ "Iq1=Iref;\n",
+ "Iq3=Iq1;\n",
+ "Iq4=600.*10**-6;\n",
+ "R1=(V1-Veb-Vbe-V2)/Iref;\n",
+ "print\"%s %.2f %s\"%('\\nResistance R1= ',R1,' KOhm\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Resistance R1= 44.00 KOhm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7-pg601"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ " \n",
+ "##Example 10.7\n",
+ "##uox*Cox/2=x\n",
+ "x=20.*10**-6;##A/V^2\n",
+ "Vtn=1.;\n",
+ "V1=5.;\n",
+ "V2=0.;\n",
+ "Iref=0.25*10**-3;\n",
+ "Io=0.1*10**-3;\n",
+ "Vgs2=1.85;\n",
+ "##let y=W/L\n",
+ "y2=Io/(x*(Vgs2-Vtn)**2);\n",
+ "print\"%s %.2f %s\"%('\\nwidth per length 2= ',y2,'\\n')\n",
+ "y1=Iref/(x*(Vgs2-Vtn)**2);\n",
+ "print\"%s %.2f %s\"%('\\nwidth per length 1= ',y1,'\\n')\n",
+ "Vgs1=Vgs2;\n",
+ "Vgs3=V1-V2-Vgs1;\n",
+ "print\"%s %.2f %s\"%('\\nVgs3= ',Vgs3,' V\\n')\n",
+ "y3=Iref/(x*(Vgs3-Vtn)**2);\n",
+ "print\"%s %.2f %s\"%('\\nwidth per length 3= ',y3,'\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "width per length 2= 6.92 \n",
+ "\n",
+ "\n",
+ "width per length 1= 17.30 \n",
+ "\n",
+ "\n",
+ "Vgs3= 3.15 V\n",
+ "\n",
+ "\n",
+ "width per length 3= 2.70 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex8-pg604"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 10.8\n",
+ "Iref=100.;\n",
+ "Io=Iref;\n",
+ "##lambda=y\n",
+ "y=0.01;\n",
+ "gm=0.5*10**3;\n",
+ "ro=1./(y*Iref);\n",
+ "print\"%s %.2f %s\"%('\\noutput resistance= ',ro,' MOhm\\n')\n",
+ "ro2=1.;\n",
+ "ro4=1.;\n",
+ "Ro=ro4+ro2*(1.+gm*ro4);\n",
+ "print\"%s %.2f %s\"%('\\noutput resistance of cascode circuit= ',Ro,' MOhm\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "output resistance= 1.00 MOhm\n",
+ "\n",
+ "\n",
+ "output resistance of cascode circuit= 502.00 MOhm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex9-pg609"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 10.9\n",
+ "Idss1=2.;\n",
+ "Idss2=1.;\n",
+ "Vp1=-1.5;\n",
+ "Vp2=Vp1;\n",
+ "##lambda=y\n",
+ "y1=0.05;\n",
+ "y2=y1;\n",
+ "V2=-5.;\n",
+ "Vds=1.5;\n",
+ "Vsmin=Vds+V2;\n",
+ "print\"%s %.2f %s\"%('\\nminimum value of Vs= ',Vsmin,' V\\n')\n",
+ "Io=Idss2*(1.+y1*Vds);\n",
+ "print\"%s %.2f %s\"%('\\noutput current= ',Io,' mA\\n')\n",
+ "Vgs1=(1.-math.sqrt(Io/Idss1))*Vp1;\n",
+ "print\"%s %.2f %s\"%('\\ngate to source voltage of Q1= ',Vgs1,' V\\n')\n",
+ "V1=Vgs1+Vsmin;\n",
+ "print\"%s %.2f %s\"%('\\nV1= ',V1,' V\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "minimum value of Vs= -3.50 V\n",
+ "\n",
+ "\n",
+ "output current= 1.07 mA\n",
+ "\n",
+ "\n",
+ "gate to source voltage of Q1= -0.40 V\n",
+ "\n",
+ "\n",
+ "V1= -3.90 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex10-pg615"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 10.10\n",
+ "Vt=0.026;\n",
+ "Van=120.;\n",
+ "Vap=80.;\n",
+ "Av=-(1./Vt)/(1./Van+1./Vap);\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal open circuit voltage gain=\\n',Av,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "small signal open circuit voltage gain=\n",
+ " -1846.15 \n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex11-pg620"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 10.11\n",
+ "Van=120.;\n",
+ "Vap=80.;\n",
+ "Vt=0.026;\n",
+ "Ico=0.001;\n",
+ "##Rl=infinity\n",
+ "Av=-(1./Vt)/(1./Van+1./Vap);\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal open circuit voltage gain=\\n',Av,'')\n",
+ "Rl=100.;\n",
+ "Av1=-(1./Vt)/(1./Van+1./Vap+1./Rl);\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal open circuit voltage gain=',Av1,'')\n",
+ "Rl=10.;\n",
+ "Av2=-(1./Vt)/(1./Van+1./Vap+1./Rl);\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal open circuit voltage gain=\\n',Av2,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "small signal open circuit voltage gain=\n",
+ " -1846.15 \n",
+ "\n",
+ "small signal open circuit voltage gain= -1247.40 \n",
+ "\n",
+ "small signal open circuit voltage gain=\n",
+ " -318.30 \n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex12-pg623"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ " \n",
+ "##Example 10.12\n",
+ "##lambda=y\n",
+ "yn=0.01;\n",
+ "yp=0.01;\n",
+ "Vtn=1.;\n",
+ "Kn=1.;\n",
+ "Iref=0.5;\n",
+ "gm=2.*math.sqrt(Kn*Iref);\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance = ',gm,'mA/V\\n')\n",
+ "go=yn*Iref;\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal transistor conductance= ',go,' mA/V\\n')\n",
+ "go2=go;\n",
+ "##for Rl=infinity\n",
+ "Av=-gm/(go+go2);\n",
+ "print\"%s %.2f %s\"%('\\nvoltage gain= ',Av,' \\n')\n",
+ "Rl=100.;##Kohm\n",
+ "gl=0.01;\n",
+ "Av=-gm/(go+gl+go2);\n",
+ "print\"%s %.2f %s\"%('\\nvoltage gain= \\n',Av,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "transconductance = 1.41 mA/V\n",
+ "\n",
+ "\n",
+ "small signal transistor conductance= 0.01 mA/V\n",
+ "\n",
+ "\n",
+ "voltage gain= -141.42 \n",
+ "\n",
+ "\n",
+ "voltage gain= \n",
+ " -70.71 \n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter11_1.ipynb b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter11_1.ipynb new file mode 100644 index 00000000..2169385c --- /dev/null +++ b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter11_1.ipynb @@ -0,0 +1,829 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:0fdbe6834196a025d433ba7f08db65ee9b5adb39200cf4941d120ea6aacb306c"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter11-Differential and Multistage Amplifier"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg642"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 11.1\n",
+ "V1=10.;\n",
+ "V2=-10.;\n",
+ "Iq=1.;\n",
+ "Rc=10.;\n",
+ "Vbe=0.7;\n",
+ "iC1=Iq/2.;\n",
+ "iC2=iC1;\n",
+ "print\"%s %.2f %s\"%('\\ncollector currents = ',iC1,'mA\\n')\n",
+ "Vc1=V1-iC1*Rc;\n",
+ "Vc2=Vc1;\n",
+ "print\"%s %.2f %s\"%('\\ncollector voltages = ',Vc1,'V\\n')\n",
+ "Vcm=0.;\n",
+ "Ve=Vcm-Vbe;\n",
+ "Vce1=Vc1-Ve;\n",
+ "print\"%s %.2f %s\"%('\\ncollector emitter voltage= ',Vce1,' V\\n')\n",
+ "Vcm=-5.;\n",
+ "Ve=Vcm-Vbe;\n",
+ "Vce1=Vc1-Ve;\n",
+ "print\"%s %.2f %s\"%('\\ncollector emitter voltage = ',Vce1,'V\\n')\n",
+ "Vcm=5.;\n",
+ "Ve=Vcm-Vbe;\n",
+ "Vce1=Vc1-Ve;\n",
+ "print\"%s %.2f %s\"%('\\ncollector emitter voltage= ',Vce1,' V\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "collector currents = 0.50 mA\n",
+ "\n",
+ "\n",
+ "collector voltages = 5.00 V\n",
+ "\n",
+ "\n",
+ "collector emitter voltage= 5.70 V\n",
+ "\n",
+ "\n",
+ "collector emitter voltage = 10.70 V\n",
+ "\n",
+ "\n",
+ "collector emitter voltage= 0.70 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg650"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 11.3\n",
+ "V1=10.;\n",
+ "V2=-10.;\n",
+ "Iq=0.8*10**-3;\n",
+ "Rc=12000.;\n",
+ "Ro=25000.;\n",
+ "b=100.;\n",
+ "Vt=0.026;\n",
+ "Ad=Iq*Rc/(4.*Vt);\n",
+ "print\"%s %.2f %s\"%('\\ndifferential gain=\\n',Ad,'')\n",
+ "Acm=-(Iq*Rc/(2.*Vt))/(1.+(1.+b)*Iq*Ro/(Vt*b));\n",
+ "print\"%s %.2f %s\"%('\\ncommon mode gain=\\n',Acm,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "differential gain=\n",
+ " 92.31 \n",
+ "\n",
+ "common mode gain=\n",
+ " -0.24 \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7-pg657"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 11.7\n",
+ "Ad=92.3;\n",
+ "Acm=0.237;##mod of Acm\n",
+ "CMRR=Ad/Acm;\n",
+ "print\"%s %.2f %s\"%('\\ncommon mode rejection ratio=\\n',CMRR,'')\n",
+ "CMRRdB=20.*math.log10(CMRR);\n",
+ "print\"%s %.2f %s\"%('\\nCMRR in decibels= ',CMRRdB,' dB\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "common mode rejection ratio=\n",
+ " 389.45 \n",
+ "\n",
+ "CMRR in decibels= 51.81 dB\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex8-pg658"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 11.8\n",
+ "CMRRdB=90.;##dB\n",
+ "CMRR=3.16*10**4;\n",
+ "b=100.;\n",
+ "Vt=0.026;\n",
+ "Iq=0.8;\n",
+ "Ro=(2.*CMRR-1.)*Vt*b/((1.+b)*Iq);\n",
+ "Ro=Ro*10**-3;##Mohm\n",
+ "print round(Ro,2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2.03\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex9-pg661"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 11.9\n",
+ "b=100.;\n",
+ "Vbe=0.7;\n",
+ "Va=100.;\n",
+ "Vt=0.026;\n",
+ "Iref=0.5;\n",
+ "Iq=Iref;\n",
+ "I1=Iq/2.\n",
+ "Icq=I1;\n",
+ "r=b*Vt/Icq;\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal parameter= ',r,' KOhm\\n')\n",
+ "ro=Va/Icq;\n",
+ "print\"%s %.2f %s\"%('\\nro= ',ro,' KOhm\\n')\n",
+ "Ro=Va/Iq;\n",
+ "print\"%s %.2f %s\"%('\\noutput resistance of Q4= ',Ro,' KOhm\\n')\n",
+ "Rid=2.*r;\n",
+ "print\"%s %.2f %s\"%('\\ndifferential mode input resistance = ',Rid,'KOhm\\n')\n",
+ "Ricm=(1.+b)*(Ro*ro/2.)/(Ro+ro/2.);\n",
+ "Ricm=Ricm*0.001;##Mohm\n",
+ "print\"%s %.2f %s\"%('\\ncommon mode input resistance= ',Ricm,' MOhm\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "small signal parameter= 10.40 KOhm\n",
+ "\n",
+ "\n",
+ "ro= 400.00 KOhm\n",
+ "\n",
+ "\n",
+ "output resistance of Q4= 200.00 KOhm\n",
+ "\n",
+ "\n",
+ "differential mode input resistance = 20.80 KOhm\n",
+ "\n",
+ "\n",
+ "common mode input resistance= 10.10 MOhm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex10-pg664"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "import numpy\n",
+ "from numpy import poly\n",
+ "##Example 11.10\n",
+ "Kn1=0.1;\n",
+ "Kn2=Kn1;\n",
+ "Kn3=0.1;\n",
+ "Kn4=Kn3;\n",
+ "R1=30.;\n",
+ "Vtn=1.;\n",
+ "Rd=16.;\n",
+ "\n",
+ "Vgs4=2.40;\n",
+ "I1=(20.-Vgs4)/R1;\n",
+ "print\"%s %.2f %s\"%('\\nI1= ',I1,' mA\\n')\n",
+ "Iq=I1;\n",
+ "Id1=Iq/2.;\n",
+ "print\"%s %.2f %s\"%('\\nId1 and Id2 = ',Id1, 'mA\\n')\n",
+ "Vgs1=math.sqrt(Id1/Kn1)+Vtn;\n",
+ "print\"%s %.2f %s\"%('\\nVgs1 and Vgs2 = ',Vgs1,'V\\n')\n",
+ "vo1=10.-Id1*Rd;\n",
+ "print\"%s %.2f %s\"%('\\nvo1 and vo2= ',vo1,' V\\n')\n",
+ "Vds1=Vgs1-Vtn;\n",
+ "print\"%s %.2f %s\"%('\\nVds1=Vds2=Vds1(sat)= ',Vds1,' V\\n')\n",
+ "Vcm=vo1-Vds1+Vgs1;\n",
+ "print\"%s %.2f %s\"%('\\nVcm max= ',Vcm,' V\\n')\n",
+ "Vds4=Vgs4-Vtn;\n",
+ "print\"%s %.2f %s\"%('\\nVds4= ',Vds4,' V\\n')\n",
+ "Vcm2=Vgs1+Vds4-10.;\n",
+ "print\"%s %.2f %s\"%('\\nVcm min= ',Vcm2,'V\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "I1= 0.59 mA\n",
+ "\n",
+ "\n",
+ "Id1 and Id2 = 0.29 mA\n",
+ "\n",
+ "\n",
+ "Vgs1 and Vgs2 = 2.71 V\n",
+ "\n",
+ "\n",
+ "vo1 and vo2= 5.31 V\n",
+ "\n",
+ "\n",
+ "Vds1=Vds2=Vds1(sat)= 1.71 V\n",
+ "\n",
+ "\n",
+ "Vcm max= 6.31 V\n",
+ "\n",
+ "\n",
+ "Vds4= 1.40 V\n",
+ "\n",
+ "\n",
+ "Vcm min= -5.89 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex11-pg668"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 11.11\n",
+ "Kn=0.5;\n",
+ "Iq=1.;\n",
+ "Vt=0.026;\n",
+ "##transconductance of the MOSFET\n",
+ "gm=2.*math.sqrt(Kn*Iq/2);\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance= ',gm,' mA/V\\n')\n",
+ "##transconductance of the bipolar transistor \n",
+ "gm=Iq/(2.*Vt);\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance= ',gm,' mA/V\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "transconductance= 1.00 mA/V\n",
+ "\n",
+ "\n",
+ "transconductance= 19.23 mA/V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex12-pg670"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 11.12\n",
+ "Iq=0.587;\n",
+ "Kn=1.;\n",
+ "Rd=16.;\n",
+ "##lambda=y\n",
+ "y=0.01;\n",
+ "Ro=1./(y*Iq);\n",
+ "print\"%s %.2f %s\"%('\\noutput resistance = ',Ro,'KOhm\\n')\n",
+ "Ad=math.sqrt(Kn*Iq/2.)*Rd;\n",
+ "print\"%s %.2f %s\"%('\\ndifferential mode voltage gain= \\n',Ad,'')\n",
+ "Acm=-math.sqrt(2.*Kn*Iq)*Rd/(1.+2.*math.sqrt(2.*Kn*Iq)*Ro);\n",
+ "print\"%s %.2f %s\"%('\\ncommon mode voltage gain=\\n',Acm,'')\n",
+ "CMRR=20.*math.log10(-Ad/Acm);\n",
+ "print\"%s %.2f %s\"%('\\ncommon mode rejection ratio= ',CMRR,' dB\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "output resistance = 170.36 KOhm\n",
+ "\n",
+ "\n",
+ "differential mode voltage gain= \n",
+ " 8.67 \n",
+ "\n",
+ "common mode voltage gain=\n",
+ " -0.05 \n",
+ "\n",
+ "common mode rejection ratio= 45.35 dB\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex13-pg678"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 11.13\n",
+ "Iq=0.2;\n",
+ "Va=100.;\n",
+ "Va2=Va;\n",
+ "Va4=Va;\n",
+ "Rl=100.;\n",
+ "Vt=0.026;\n",
+ "Ad=(1./Vt)/(1./Va2+1./Va4);\n",
+ "print\"%s %.2f %s\"%('\\nopen circuit voltage gain=\\n',Ad,'')\n",
+ "Ad=(Iq/(2.*Vt))/(Iq/(2.*Va2)+Iq/(2.*Va4)+1./Rl);\n",
+ "print\"%s %.2f %s\"%('\\nvoltage gain=\\n',Ad,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "open circuit voltage gain=\n",
+ " 1923.08 \n",
+ "\n",
+ "voltage gain=\n",
+ " 320.51 \n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex15-pg684"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 11.15\n",
+ "Kn=0.2;\n",
+ "Idq=0.1;\n",
+ "ro4=1000.;##Kohm\n",
+ "ro6=1000.;##KOhm\n",
+ "ro2=ro4;\n",
+ "##lambda=y\n",
+ "y=0.01;\n",
+ "gm=2.*math.sqrt(Kn*Idq);\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance= ',gm,' mA/V\\n')\n",
+ "ro=1./(y*Idq);\n",
+ "print\"%s %.2f %s\"%('\\noutput resistance= ',ro,' KOhm\\n')\n",
+ "Ro=ro4+ro6*(1.+gm*ro);\n",
+ "Ro=Ro*0.001;##Mohm\n",
+ "print\"%s %.2f %s\"%('\\noutput resistance of the cascode active load= ',Ro,'Mohm\\n')\n",
+ "Ro=Ro*1000.;##KOhm\n",
+ "Ad=gm*ro2*Ro/(ro4+Ro);\n",
+ "print\"%s %.2f %s\"%('\\ndifferential mode voltage gain=\\n',Ad,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "transconductance= 0.28 mA/V\n",
+ "\n",
+ "\n",
+ "output resistance= 1000.00 KOhm\n",
+ "\n",
+ "\n",
+ "output resistance of the cascode active load= 284.84 Mohm\n",
+ "\n",
+ "\n",
+ "differential mode voltage gain=\n",
+ " 281.85 \n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex16-pg693"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 11.16\n",
+ "Iq=0.2;\n",
+ "Ic1=Iq;\n",
+ "Icb=1.;\n",
+ "R4=10.;\n",
+ "R3=0.2;\n",
+ "b=100.;\n",
+ "Va=100.;\n",
+ "Vt=0.026;\n",
+ "Ri=2.*(1.+b)*b*Vt/Iq;\n",
+ "Ri=Ri*0.001;##MOhm\n",
+ "print\"%s %.2f %s\"%('\\ninput resistance= ',Ri,' MOhm\\n')\n",
+ "R11=b*Vt/Iq;\n",
+ "print\"%s %.2f %s\"%('\\nresistance R11= ',R11,' KOhm\\n')\n",
+ "Re=R11*R3/(R11+R3);\n",
+ "print\"%s %.2f %s\"%('\\nRe= ',Re,' KOhm\\n')\n",
+ "gm11=Iq/Vt;\n",
+ "print\"%s %.2f %s\"%('\\ngm11= ',gm11,' mA/V\\n')\n",
+ "ro11=Va/Iq;\n",
+ "print\"%s %.2f %s\"%('\\nro11 = ',ro11,'KOhm\\n')\n",
+ "Rc11=ro11*(1+gm11*Re);\n",
+ "Rc11=Rc11*0.001;##MOhm\n",
+ "print\"%s %.2f %s\"%('\\nRc11= ',Rc11,' MOhm\\n')\n",
+ "r8=b*Vt/Icb;\n",
+ "print\"%s %.2f %s\"%('\\nresistance= ',r8,'KOhm\\n')\n",
+ "##answer of following given in the book is wrong\n",
+ "Rb8=r8+(1.+b)*R4;\n",
+ "Rb8=Rb8*0.001;##MOhm\n",
+ "print\"%s %.2f %s\"%('\\nRb8 = ',Rb8,'MOhm\\n')\n",
+ "Rl7=Rc11*Rb8/(Rc11+Rb8);\n",
+ "print\"%s %.2f %s\"%('\\nRl7= ',Rl7,' MOhm\\n')\n",
+ "Av=Iq*Rl7/(2.*Vt);\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal voltage gain=\\n',Av,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "input resistance= 2.63 MOhm\n",
+ "\n",
+ "\n",
+ "resistance R11= 13.00 KOhm\n",
+ "\n",
+ "\n",
+ "Re= 0.20 KOhm\n",
+ "\n",
+ "\n",
+ "gm11= 7.69 mA/V\n",
+ "\n",
+ "\n",
+ "ro11 = 500.00 KOhm\n",
+ "\n",
+ "\n",
+ "Rc11= 1.26 MOhm\n",
+ "\n",
+ "\n",
+ "resistance= 2.60 KOhm\n",
+ "\n",
+ "\n",
+ "Rb8 = 1.01 MOhm\n",
+ "\n",
+ "\n",
+ "Rl7= 0.56 MOhm\n",
+ "\n",
+ "\n",
+ "small signal voltage gain=\n",
+ " 2.16 \n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex17-pg694"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 11.17\n",
+ "Va=100.;\n",
+ "R4=10.;\n",
+ "b=100.;\n",
+ "Rc11=1.26*10**3;\n",
+ "r8=2.6;\n",
+ "Iq=0.2;\n",
+ "Rc7=Va/Iq;\n",
+ "print\"%s %.2f %s\"%('\\nRc7= ',Rc7,' KOhm\\n')\n",
+ "Z=Rc11*Rc7/(Rc11+Rc7);\n",
+ "print\"%s %.2f %s\"%('\\nZ= ',Z,' KOhm\\n')\n",
+ "x=(r8+Z)/(1.+b);\n",
+ "Ro=R4*x/(R4+x);\n",
+ "print\"%s %.2f %s\"%('\\noutput resistance= ',Ro,' KOhm\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Rc7= 500.00 KOhm\n",
+ "\n",
+ "\n",
+ "Z= 357.95 KOhm\n",
+ "\n",
+ "\n",
+ "output resistance= 2.63 KOhm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex19-pg697"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 11.19\n",
+ "b=100.;\n",
+ "Vt=0.026;\n",
+ "Rc=20.;\n",
+ "Ir4=0.4;\n",
+ "Iq=Ir4;\n",
+ "Ir6=Ir4;\n",
+ "r4=b*Vt/Ir4;\n",
+ "print\"%s %.2f %s\"%('\\nr4= ',r4,' KOhm\\n')\n",
+ "r3=b**2*Vt/Ir4;\n",
+ "print\"%s %.2f %s\"%('\\nr3= ',r3,' KOhm\\n')\n",
+ "Ri2=r3+(1.+b)*r4;\n",
+ "print\"%s %.2f %s\"%('\\ninput resistance= ',Ri2,' KOhm\\n')\n",
+ "gm=Iq/(2.*Vt);\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance= ',gm,' mA/V\\n')\n",
+ "Ad1=gm*Rc*Ri2/(2.*(Rc+Ri2));\n",
+ "print\"%s %.2f %s\"%('\\ngain of differential amplifier stage=\\n',Ad1,'')\n",
+ "r5=b*Vt/Ir6;\n",
+ "print\"%s %.2f %s\"%('\\nr5 = ',r5,'KOhm\\n')\n",
+ "Ir7=2.;\n",
+ "r6=b*Vt/Ir7;\n",
+ "print\"%s %.2f %s\"%('\\nr6= ',r6,' KOhm\\n')\n",
+ "R6=16.5;\n",
+ "R7=5.;\n",
+ "Ri3=r5+(1.+b)*(R6+r6+(1.+b)*R7);\n",
+ "Ri3=Ri3*0.001;##MOhm\n",
+ "print\"%s %.2f %s\"%('\\nRi3= ',Ri3,' MOhm\\n')\n",
+ "Rs=5.;\n",
+ "A2=Ir4*Rs/(2.*Vt);\n",
+ "print\"%s %.2f %s\"%('\\nvoltage gain A2=\\n',A2,'')\n",
+ "A3=1.;##vo/vo3\n",
+ "Ad=Ad1*A2*A3;\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal voltage gain=\\n',Ad,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "r4= 6.50 KOhm\n",
+ "\n",
+ "\n",
+ "r3= 650.00 KOhm\n",
+ "\n",
+ "\n",
+ "input resistance= 1306.50 KOhm\n",
+ "\n",
+ "\n",
+ "transconductance= 7.69 mA/V\n",
+ "\n",
+ "\n",
+ "gain of differential amplifier stage=\n",
+ " 75.76 \n",
+ "\n",
+ "r5 = 6.50 KOhm\n",
+ "\n",
+ "\n",
+ "r6= 1.30 KOhm\n",
+ "\n",
+ "\n",
+ "Ri3= 52.81 MOhm\n",
+ "\n",
+ "\n",
+ "voltage gain A2=\n",
+ " 38.46 \n",
+ "\n",
+ "small signal voltage gain=\n",
+ " 2913.97 \n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex20-pg702"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 11.20\n",
+ "Ro=10000000.;\n",
+ "Co=1.*10**-12;\n",
+ "Rb=500.;\n",
+ "r=10000.;\n",
+ "b=100.;\n",
+ "f=1./(2.*math.pi*Ro*Co);\n",
+ "f=f*0.001;##KHz\n",
+ "print\"%s %.2f %s\"%('\\nfrequency of the zero= ',f,' KHz\\n')\n",
+ "Req=Ro*(1.+Rb/r)/(1.+Rb/r+2.*(1.+b)*Ro/r);\n",
+ "print\"%s %.2f %s\"%('\\nReq= ',Req,' Ohm\\n')\n",
+ "f=1/(2.*math.pi*Req*Co);\n",
+ "f=f*10**-9;##GHz\n",
+ "print\"%s %.2f %s\"%('\\nfrequency of the pole= ',f,' GHz\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "frequency of the zero= 15.92 KHz\n",
+ "\n",
+ "\n",
+ "Req= 51.98 Ohm\n",
+ "\n",
+ "\n",
+ "frequency of the pole= 3.06 GHz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter12_1.ipynb b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter12_1.ipynb new file mode 100644 index 00000000..448e6f50 --- /dev/null +++ b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter12_1.ipynb @@ -0,0 +1,540 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:a45447f2d4288231e83b274110baf3c884392e16ba16d91e2efdd93828802282"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter12-Feedback and Stability"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg732"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 12.1\n",
+ "A=10**5;##open loop gain\n",
+ "Af=50.;##closed loop gain\n",
+ "b=(A/Af-1.)/A;\n",
+ "print\"%s %.2f %s\"%('\\nfeedback transfer function=\\n',b,'')\n",
+ "A=-10**5;\n",
+ "Af=-50.;\n",
+ "b=(A/Af-1.)/A;\n",
+ "print\"%s %.2f %s\"%('\\nfeedback transfer function=\\n',b,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "feedback transfer function=\n",
+ " 0.02 \n",
+ "\n",
+ "feedback transfer function=\n",
+ " -0.02 \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg733"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 12.2\n",
+ "A=10**5;\n",
+ "Af=50.;\n",
+ "b=0.019999;\n",
+ "dA=10**4;\n",
+ "dAf=Af*dA/(A*(1.+b*A));\n",
+ "print\"%s %.2e %s\"%('\\ndAf ',dAf,'\\n')\n",
+ "##x=dAf/Af\n",
+ "x=dAf/Af;\n",
+ "x=x*100.;\n",
+ "print\"%s %.2e %s\"%('\\npercent change dAf/Af= ',x,'\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "dAf 2.50e-03 \n",
+ "\n",
+ "\n",
+ "percent change dAf/Af= 5.00e-03 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg735"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 12.3\n",
+ "Ao=10**4;\n",
+ "wh=2.*math.pi*100.;##rad/s\n",
+ "Af=50.;\n",
+ "##x=(1+bAo)\n",
+ "x=Ao/Af;\n",
+ "print\"%s %.2f %s\"%('\\n(1+bAo)=\\n',x,'')\n",
+ "wfh=wh*x;\n",
+ "print\"%s %.2f %s\"%('\\nclosed loop bandwidth=\\n',wfh,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "(1+bAo)=\n",
+ " 200.00 \n",
+ "\n",
+ "closed loop bandwidth=\n",
+ " 125663.71 \n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5-pg742"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ " \n",
+ "##Example 12.5\n",
+ "Av=10**5;\n",
+ "Avf=50.;\n",
+ "Rf=10.;##Kohm\n",
+ "Ro=20000.;##Ohm\n",
+ "##x=(1+bvAv)\n",
+ "x=Av/Avf;\n",
+ "print\"%s %.2e %s\"%('\\n(1+bvAv)=\\n',x,'')\n",
+ "Rif=Rf*x;\n",
+ "Rif=Rif*0.001;##MOhm\n",
+ "print\"%s %.2f %s\"%('\\ninput resistance= ',Rif,' MOhm\\n')\n",
+ "Rof=Ro/x;\n",
+ "print\"%s %.2f %s\"%('\\noutput resistance= ',Rof,' Ohm\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "(1+bvAv)=\n",
+ " 2.00e+03 \n",
+ "\n",
+ "input resistance= 20.00 MOhm\n",
+ "\n",
+ "\n",
+ "output resistance= 10.00 Ohm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6-pg745"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 12.6\n",
+ "Af=10**5;\n",
+ "Aif=50.;\n",
+ "Rf=10000.;\n",
+ "Ro=20.;\n",
+ "##x=(1+biAi)\n",
+ "x=Af/Aif;\n",
+ "print\"%s %.2e %s\"%('\\n(1+biAi)=\\n',x,'')\n",
+ "Rif=Rf/x;\n",
+ "print\"%s %.2f %s\"%('\\ninput resistance = ',Rif,'Ohm\\n')\n",
+ "Rof=Ro*x;\n",
+ "Rof=Rof*0.001;##Mohm\n",
+ "print\"%s %.2f %s\"%('\\noutput resistance= ',Rof,' MOhm\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "(1+biAi)=\n",
+ " 2.00e+03 \n",
+ "\n",
+ "input resistance = 5.00 Ohm\n",
+ "\n",
+ "\n",
+ "output resistance= 40.00 MOhm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7-pg751"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 12.7\n",
+ "Ri=50.;\n",
+ "R1=10.;\n",
+ "R2=90.;\n",
+ "Av=10**4;\n",
+ "bv=1./(1.+R2/R1);\n",
+ "print\"%s %.2f %s\"%('\\nfeedback transfer function=\\n',bv,'')\n",
+ "Rif=Ri*(1.+bv*Av);\n",
+ "Rif=Rif*0.001;##Mohm\n",
+ "print\"%s %.2f %s\"%('\\ninput resistance= ',Rif,' MOhm\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "feedback transfer function=\n",
+ " 0.10 \n",
+ "\n",
+ "input resistance= 50.05 MOhm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex11-pg765"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ " \n",
+ "##Example 12.11\n",
+ "hFE=100.;##transistor parameter\n",
+ "Vbe=0.7;\n",
+ "Vcc=10.;\n",
+ "R1=55.;\n",
+ "R2=12.;\n",
+ "Re=1.;\n",
+ "Rc=4.;\n",
+ "Rl=4.;\n",
+ "Icq=0.983;\n",
+ "Vceq=5.08;\n",
+ "Vt=0.026;\n",
+ "r=hFE*Vt/Icq;\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal parameter resistance= ',r,' KOhm\\n')\n",
+ "gm=Icq/Vt;\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance= ',gm,' mA/V\\n')\n",
+ "Agf=-gm*(Rc/(Rc+Rl))/(1.+Re*(gm+1./r));\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance transfer function= ',Agf,' mA/V\\n')\n",
+ "##as first approximation\n",
+ "Agf2=-1./Re;\n",
+ "print\"%s %.2f %s\"%('\\nAgf= ',Agf2,' mA/V\\n')\n",
+ "Avf=Agf*Rl;\n",
+ "print\"%s %.2f %s\"%('\\nvoltage gain=\\n',Avf,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "small signal parameter resistance= 2.64 KOhm\n",
+ "\n",
+ "\n",
+ "transconductance= 37.81 mA/V\n",
+ "\n",
+ "\n",
+ "transconductance transfer function= -0.48 mA/V\n",
+ "\n",
+ "\n",
+ "Agf= -1.00 mA/V\n",
+ "\n",
+ "\n",
+ "voltage gain=\n",
+ " -1.93 \n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex15-pg777"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 12.15\n",
+ "##Determine the loop gain fig12.45(a)\n",
+ "hFE=100.;\n",
+ "Vbe=0.7;\n",
+ "Icq=0.492;\n",
+ "r=5.28;\n",
+ "gm=18.9;\n",
+ "Rs=10.;\n",
+ "R1=51.;\n",
+ "R2=5.5;\n",
+ "Re=0.500;\n",
+ "Rc=10.;\n",
+ "Rf=82.;\n",
+ "x=r*R2/(r+R2);\n",
+ "y=R1*x/(x+R1);\n",
+ "t=Rs*y/(y+Rs);\n",
+ "Req=t;\n",
+ "print\"%s %.2f %s\"%('\\nequivalent resistance ',t,' KOhm\\n')\n",
+ "T=gm*Rc*Req/(Rc+Rf+Req);\n",
+ "print\"%s %.2f %s\"%('\\nthe loop gain=\\n',T,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "equivalent resistance 2.04 KOhm\n",
+ "\n",
+ "\n",
+ "the loop gain=\n",
+ " 4.09 \n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex19-pg791"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 12.19\n",
+ "##T=b*100/(sqrt(1+(f/10^5)^2) angle=-3tan^-1(f/10^5)\n",
+ "##stable at f180 at which phase becomes -180 degrees\n",
+ "##-3*atan(f180/10^5)=-180\n",
+ "f180=math.tan(60/57.3)*10**5;\n",
+ "print\"%s %.2f %s\"%('\\nfrequency at -180 degree= ',f180,'f Hz\\n')\n",
+ "b=0.2;\n",
+ "T=b*100./(math.sqrt(1.+(f180/10**5)**2))**3;\n",
+ "print\"%s %.2f %s\"%('\\nmagnitude of the loop gain=\\n',T,'')\n",
+ "b=0.02;\n",
+ "T=b*100./(math.sqrt(1.+(f180/10**5)**2))**3;\n",
+ "print\"%s %.2f %s\"%('\\nmagnitude of the loop gain=\\n',T,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "frequency at -180 degree= 173174.23 f Hz\n",
+ "\n",
+ "\n",
+ "magnitude of the loop gain=\n",
+ " 2.50 \n",
+ "\n",
+ "magnitude of the loop gain=\n",
+ " 0.25 \n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex22-pg798"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 12.22\n",
+ "Ao=10**6;\n",
+ "fPD=0.010;##KHz\n",
+ "b=0.01;\n",
+ "Af=Ao/(1.+b*Ao);\n",
+ "print\"%s %.2f %s\"%('\\nlow frequency closed loop gain=\\n',Af,'')\n",
+ "fc=fPD*(1.+b*Ao);\n",
+ "print\"%s %.2f %s\"%('\\nclosed loop 3dB frequency= ',fc,' KHz\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "low frequency closed loop gain=\n",
+ " 99.99 \n",
+ "\n",
+ "closed loop 3dB frequency= 100.01 KHz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex23-pg799"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 12.23\n",
+ "A=10**3;\n",
+ "Cf=30.*10**-12;##feedback capacitor (F)\n",
+ "R2=5.*10**5;\n",
+ "Cm=Cf*(1.+A);\n",
+ "print\"%s %.2e %s\"%('\\nMiller capacitance= ',Cm,' F\\n')\n",
+ "fp=1/(2.*math.pi*R2*Cm);\n",
+ "print\"%s %.2f %s\"%('\\ndominant pole frequency = ',fp,'Hz\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Miller capacitance= 3.00e-08 F\n",
+ "\n",
+ "\n",
+ "dominant pole frequency = 10.60 Hz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter13_1.ipynb b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter13_1.ipynb new file mode 100644 index 00000000..2505f949 --- /dev/null +++ b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter13_1.ipynb @@ -0,0 +1,804 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:d79e0ffa0dc246919c405ced6f920658f107cc2f3da7e821333d37e6758e0306"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter13-Operational Amplifier Circuits "
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg824"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "\n",
+ "V1=15.;##positive supply voltage\n",
+ "V2=-15.;##negative supply voltage\n",
+ "Veb12=-0.6;\n",
+ "Vbe11=0.6;\n",
+ "Rs=40.;\n",
+ "Iref=(V1-V2-Veb12-Vbe11)/Rs;\n",
+ "print\"%s %.2f %s\"%('\\nreference current= ',Iref,' mA\\n')\n",
+ "Ic10=19.;\n",
+ "Ic1=Ic10/2.;\n",
+ "print\"%s %.2f %s\"%('\\nIc1=Ic2=Ic3=Ic4= ',Ic1,'microA\\n')\n",
+ "Ic1=Ic1*0.001;##mA\n",
+ "Vbe7=0.6;\n",
+ "Vbe6=0.6;\n",
+ "Ic6=Ic1;\n",
+ "R2=1.;\n",
+ "Vc6=Vbe7+Vbe6+Ic6*R2+V2;\n",
+ "print\"%s %.2f %s\"%('\\nvoltage at collector of Q6= ',Vc6,' V\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "reference current= 0.75 mA\n",
+ "\n",
+ "\n",
+ "Ic1=Ic2=Ic3=Ic4= 9.50 microA\n",
+ "\n",
+ "\n",
+ "voltage at collector of Q6= -13.79 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg827"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 13.2\n",
+ "Iref=0.72;\n",
+ "Ic17=0.75*Iref;\n",
+ "print\"%s %.2f %s\"%('\\ncollector currents in Q17= ',Ic17,' mA\\n')\n",
+ "b=200.;\n",
+ "Ib17=Ic17/b;\n",
+ "Ie17=Ic17;\n",
+ "R8=0.100;\n",
+ "Vbe17=0.6;\n",
+ "R9=50.;\n",
+ "Ic16=Ib17+(Ie17*R8+Vbe17)/R9;\n",
+ "Ic16=Ic16*1000.;\n",
+ "print\"%s %.2f %s\"%('\\ncollector current in Q16= ',Ic16,' microA\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "collector currents in Q17= 0.54 mA\n",
+ "\n",
+ "\n",
+ "collector current in Q16= 15.78 microA\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg829"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 13.3\n",
+ "Is1=10**-14;##reverse saturation currents for Q18 Q19\n",
+ "Is2=3*10**-14;##reverse saturation currents for Q14 Q20\n",
+ "Iref=0.72;\n",
+ "Vt=0.026;\n",
+ "Ic13a=0.25*Iref;\n",
+ "print\"%s %.2f %s\"%('\\nIc13a= ',Ic13a,' mA\\n')\n",
+ "Vbe19=0.6;\n",
+ "R10=50.;\n",
+ "Ir1o=Vbe19/R10;\n",
+ "print\"%s %.2f %s\"%('\\ncurrent in Ro= ',Ir1o,' mA\\n')\n",
+ "Ic19=Ic13a-Ir1o;\n",
+ "print\"%s %.2f %s\"%('\\ncurrent in Q19 = ',Ic19,'mA\\n')\n",
+ "Ic19=Ic19*0.001;##A\n",
+ "Vbe19=Vt*math.log(Ic19/Is1);\n",
+ "print\"%s %.2f %s\"%('\\nB-E voltage of Q19= ',Vbe19,' V\\n')\n",
+ "b=200.;\n",
+ "Ic19=Ic19*10**6;##micro A\n",
+ "Iv19=Ic19*1000.;\n",
+ "Ib18=Ic19/b;\n",
+ "Ir1o=Ir1o*1000.;\n",
+ "print\"%s %.2f %s\"%('\\nbase current in Q18= ',Ib18,' microA\\n')\n",
+ "Ic18=Ir1o+Ib18;\n",
+ "print\"%s %.2f %s\"%('\\ncurrents in Q18= ',Ic18,' microA\\n')\n",
+ "Ic18=Ic18*10**-6;\n",
+ "Vbe18=Vt*math.log(Ic18/Is1);\n",
+ "print\"%s %.2f %s\"%('\\nB-E voltage of Q18= ',Vbe18,' V\\n')\n",
+ "Vbb=Vbe18+Vbe19;\n",
+ "print\"%s %.2f %s\"%('\\nvoltage difference Vbb= ',Vbb,' V\\n')\n",
+ "Ic14=Is2*math.exp(Vbb/(2.*Vt));\n",
+ "Ic14=Ic14*10**6;##micro A\n",
+ "print\"%s %.2f %s\"%('\\nquiescent currents in Q14 and Q20 ',Ic14,'microA\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Ic13a= 0.18 mA\n",
+ "\n",
+ "\n",
+ "current in Ro= 0.01 mA\n",
+ "\n",
+ "\n",
+ "current in Q19 = 0.17 mA\n",
+ "\n",
+ "\n",
+ "B-E voltage of Q19= 0.61 V\n",
+ "\n",
+ "\n",
+ "base current in Q18= 0.84 microA\n",
+ "\n",
+ "\n",
+ "currents in Q18= 12.84 microA\n",
+ "\n",
+ "\n",
+ "B-E voltage of Q18= 0.55 V\n",
+ "\n",
+ "\n",
+ "voltage difference Vbb= 1.16 V\n",
+ "\n",
+ "\n",
+ "quiescent currents in Q14 and Q20 139.33 microA\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg832"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 13.4\n",
+ "b=200.;\n",
+ "Va=50.\n",
+ "Vt=0.026;\n",
+ "R2=1.;\n",
+ "Ic6=0.0095;\n",
+ "Ic4=Ic6;\n",
+ "Ic16=0.0158;\n",
+ "Ic17=0.54;\n",
+ "r17=b*Vt/Ic17;\n",
+ "print\"%s %.2f %s\"%('\\ninput resistance to gain stage= ',r17,' KOhm\\n')\n",
+ "R9=50.;\n",
+ "R8=0.100;\n",
+ "x=r17+(1.+b)*R8;\n",
+ "Re=x*R9/(x+R9);\n",
+ "print\"%s %.2f %s\"%('\\nRe= ',Re,' KOhm\\n')\n",
+ "r16=b*Vt/Ic16;\n",
+ "print\"%s %.2f %s\"%('\\nr16= ',r16,' KOhm\\n')\n",
+ "Ri2=r16+(1.+b)*Re;\n",
+ "Ri2=Ri2*0.001;##MOhm\n",
+ "print\"%s %.2f %s\"%('\\nRi2= ',Ri2,' KOhm\\n')\n",
+ "r6=b*Vt/Ic6;\n",
+ "print\"%s %.2f %s\"%('\\nresistance of the active load= ',r6,' KOhm\\n')\n",
+ "gm=Ic6/Vt;\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance = ',gm,'mA/V\\n')\n",
+ "ro6=Va/Ic6;\n",
+ "ro6=ro6*0.001;##MOhm\n",
+ "print\"%s %.2f %s\"%('\\nro6= ',ro6,' MOhm\\n')\n",
+ "R=ro6*(1.+gm*R2*r6/(R2+r6));\n",
+ "print\"%s %.2f %s\"%('\\neffective resistance of active load= ',R,' MOhm\\n')\n",
+ "ro4=Va/Ic4;\n",
+ "ro4=ro4*0.001;##Mohm\n",
+ "print\"%s %.2f %s\"%('\\nResistance ro4= ',ro4,' KOhm\\n')\n",
+ "Icq=9.5;\n",
+ "x=Ri2*R/(R+Ri2);\n",
+ "y=ro4*x/(ro4+x);\n",
+ "Ad=-y*Icq/Vt;\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal differential voltage gain=\\n',Ad,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "input resistance to gain stage= 9.63 KOhm\n",
+ "\n",
+ "\n",
+ "Re= 18.64 KOhm\n",
+ "\n",
+ "\n",
+ "r16= 329.11 KOhm\n",
+ "\n",
+ "\n",
+ "Ri2= 4.08 KOhm\n",
+ "\n",
+ "\n",
+ "resistance of the active load= 547.37 KOhm\n",
+ "\n",
+ "\n",
+ "transconductance = 0.37 mA/V\n",
+ "\n",
+ "\n",
+ "ro6= 5.26 MOhm\n",
+ "\n",
+ "\n",
+ "effective resistance of active load= 7.18 MOhm\n",
+ "\n",
+ "\n",
+ "Resistance ro4= 5.26 KOhm\n",
+ "\n",
+ "\n",
+ "small signal differential voltage gain=\n",
+ " -635.97 \n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5-pg835"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 13.5\n",
+ "bp=50.;\n",
+ "bn=200.;\n",
+ "Va=50.;\n",
+ "R9=50.;\n",
+ "R8=0.100;\n",
+ "Rl=2.;\n",
+ "Vt=0.026;\n",
+ "Ri2=4070.;\n",
+ "Ic20=0.138;\n",
+ "r20=bp*Vt/Ic20;\n",
+ "print\"%s %.2f %s\"%('\\nr20= ',r20,' KOhm\\n')\n",
+ "R20=r20+(1.+bp)*Rl;\n",
+ "print\"%s %.2f %s\"%('\\nR20= ',R20,' KOhm\\n')\n",
+ "Ic13A=0.18;\n",
+ "R19=Va/Ic13A;\n",
+ "print\"%s %.2f %s\"%('\\nR19= ',R19,' KOhm\\n')\n",
+ "r22=bp*Vt/Ic13A;\n",
+ "print\"%s %.2f %s\"%('\\nr22= ',r22,' KOhm\\n')\n",
+ "Ri3=r22+(1.+bp)*R19*R20/(R19+R20);\n",
+ "Ri3=Ri3*0.001;##MOhm\n",
+ "print\"%s %.2f %s\"%('\\ninput resistance to the output stage= ',Ri3,' MOhm\\n')\n",
+ "Ic13B=0.54;\n",
+ "R=Va/Ic13B;\n",
+ "print\"%s %.2f %s\"%('\\neffective resistance of the active load= ',R,' KOhm\\n')\n",
+ "Ic17=Ic13B;\n",
+ "R17=Va/Ic17;\n",
+ "print\"%s %.2f %s\"%('\\noutput resistance Ro17 = ',R17,'KOhm\\n')\n",
+ "Ri3=Ri3*1000.;##KOhm\n",
+ "r17=9.63;\n",
+ "x=R17*Ri3/(Ri3+R17);\n",
+ "y=x*R/(R+x);\n",
+ "A=-bn*R9*(1.+bn)*y/(Ri2*(R9+r17+(1.+bn)*R8));\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal voltage gain=\\n',A,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "r20= 9.42 KOhm\n",
+ "\n",
+ "\n",
+ "R20= 111.42 KOhm\n",
+ "\n",
+ "\n",
+ "R19= 277.78 KOhm\n",
+ "\n",
+ "\n",
+ "r22= 7.22 KOhm\n",
+ "\n",
+ "\n",
+ "input resistance to the output stage= 4.06 MOhm\n",
+ "\n",
+ "\n",
+ "effective resistance of the active load= 92.59 KOhm\n",
+ "\n",
+ "\n",
+ "output resistance Ro17 = 92.59 KOhm\n",
+ "\n",
+ "\n",
+ "small signal voltage gain=\n",
+ " -283.53 \n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6-pg837"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 13.6\n",
+ "Ic20=2.;\n",
+ "bn=200.;\n",
+ "bp=50.;\n",
+ "Va=50.;\n",
+ "r17=9.63;\n",
+ "r22=7.22;\n",
+ "R20=0.260;\n",
+ "gm17=20.8;\n",
+ "ro17=92.6;\n",
+ "Ro13B=92.6;\n",
+ "R8=0.100;\n",
+ "Rc17=ro17*(1.+gm17*R8*r17/(R8+r17));\n",
+ "print\"%s %.2f %s\"%('\\nRc17= ',Rc17,' KOhm\\n')\n",
+ "Rc22=(r22+Rc17*Ro13B/(Rc17+Ro13B))/(1.+bp);\n",
+ "print\"%s %.2f %s\"%('\\nRc22= ',Rc22,' KOhm\\n')\n",
+ "Ic13A=0.18;\n",
+ "Rc19=Va/Ic13A;\n",
+ "print\"%s %.2f %s\"%('\\nRc19= ',Rc19,' KOhm\\n')\n",
+ "Rc20=(R20+Rc22*Rc19/(Rc22+Rc19))/(1.+bp);\n",
+ "print\"%s %.2f %s\"%('\\nRc20= ',Rc20,' KOhm\\n')\n",
+ "Rc20=Rc20*1000.;##Ohm\n",
+ "R3=22.;\n",
+ "Ro=R3+Rc20;\n",
+ "print\"%s %.2f %s\"%('\\noutput resistance= ',Ro,' Ohm\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Rc17= 283.23 KOhm\n",
+ "\n",
+ "\n",
+ "Rc22= 1.51 KOhm\n",
+ "\n",
+ "\n",
+ "Rc19= 277.78 KOhm\n",
+ "\n",
+ "\n",
+ "Rc20= 0.03 KOhm\n",
+ "\n",
+ "\n",
+ "output resistance= 56.54 Ohm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7-pg838"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 13.7\n",
+ "Av2=285.;\n",
+ "C1=30.;\n",
+ "Ci=C1*(1.+Av2);\n",
+ "print\"%s %.2f %s\"%('\\ninput capacitance= ',Ci,' pF\\n')\n",
+ "Ri2=4.07;\n",
+ "Ract=7.18;\n",
+ "ro4=5.26;\n",
+ "Ro1=Ract*ro4/(Ract+ro4);\n",
+ "print\"%s %.2f %s\"%('\\ngate stage input resistance= ',Ro1,' MOhm \\n')\n",
+ "Req=Ro1*Ri2/(Ri2+Ro1);\n",
+ "print\"%s %.2f %s\"%('\\nequivalent resistance= ',Req,' MOhm\\n')\n",
+ "Req=Req*10**6;##Ohm\n",
+ "Ci=Ci*10**-12;##F\n",
+ "fPD=1/(2.*math.pi*Req*Ci);\n",
+ "print\"%s %.2f %s\"%('\\ndominant pole frequency = ',fPD,' Hz\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "input capacitance= 8580.00 pF\n",
+ "\n",
+ "\n",
+ "gate stage input resistance= 3.04 MOhm \n",
+ "\n",
+ "\n",
+ "equivalent resistance= 1.74 MOhm\n",
+ "\n",
+ "\n",
+ "dominant pole frequency = 10.67 Hz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex9-pg842"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ " \n",
+ "##Example 13.9\n",
+ "##lambda=y\n",
+ "y=0.02;\n",
+ "##W/L=x and u*Cox/2=t\n",
+ "x=12.5;\n",
+ "t=10.;\n",
+ "Kp1=x*t;\n",
+ "print\"%s %.2f %s\"%('\\nconduction parameters of M1 and M2= ',Kp1,' microA/V^2\\n')\n",
+ "Kp1=Kp1*0.001;##mA/V^2\n",
+ "Id=0.0199;\n",
+ "ro2=1./(y*Id);\n",
+ "ro2=ro2*0.001;##Mohm\n",
+ "print\"%s %.2f %s\"%('\\noutput resistance= MOhm\\n',ro2,'')\n",
+ "Iq=0.0397;\n",
+ "ro2=ro2*1000.;##Kohm\n",
+ "ro4=ro2;\n",
+ "Ad=math.sqrt(2.*Kp1*Iq)*ro2*ro4/(ro2+ro4);\n",
+ "print\"%s %.2f %s\"%('\\nthe gain of input stage= \\n',Ad,'')\n",
+ "Kn7=0.250;\n",
+ "Id7=Iq;\n",
+ "gm7=2.*math.sqrt(Kn7*Id7)\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance of M7= ',gm7,' mA/V\\n')\n",
+ "ro7=1./(y*Id7);\n",
+ "ro7=ro7*0.001;\n",
+ "print\"%s %.2f %s\"%('\\noutput resistance of M7 and M8 = ',ro7,'MOhm\\n')\n",
+ "ro7=ro7*1000.;##Kohm\n",
+ "ro8=ro7;\n",
+ "Av2=gm7*ro7*ro8/(ro7+ro8);\n",
+ "print\"%s %.2f %s\"%('\\ngain of the second stage=\\n',Av2,'')\n",
+ "Av=Ad*Av2;\n",
+ "print\"%s %.2f %s\"%('\\noverall voltage gain=\\n',Av,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "conduction parameters of M1 and M2= 125.00 microA/V^2\n",
+ "\n",
+ "\n",
+ "output resistance= MOhm\n",
+ " 2.51 \n",
+ "\n",
+ "the gain of input stage= \n",
+ " 125.16 \n",
+ "\n",
+ "transconductance of M7= 0.20 mA/V\n",
+ "\n",
+ "\n",
+ "output resistance of M7 and M8 = 1.26 MOhm\n",
+ "\n",
+ "\n",
+ "gain of the second stage=\n",
+ " 125.47 \n",
+ "\n",
+ "overall voltage gain=\n",
+ " 15703.52 \n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex10-pg845"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 13.10\n",
+ "Iref=100;\n",
+ "Kn=80;\n",
+ "Kp=40;\n",
+ "##W/L=x\n",
+ "x=25;\n",
+ "##lambda=y\n",
+ "y=0.02;\n",
+ "Id=Iref/2.;\n",
+ "gm1=2.*math.sqrt(Kp*x*Id/2.);\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance gm1=gm8= ',gm1,' microA/V\\n')\n",
+ "gm6=2.*math.sqrt(Kn*x*Id/2.);\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance= ',gm6,' microA/V\\n')\n",
+ "ro1=1./(y*Id);\n",
+ "ro8=ro1;\n",
+ "ro6=ro1;\n",
+ "ro10=ro1;\n",
+ "print\"%s %.2f %s\"%('\\noutput resistance ro1=ro8=ro6=ro10= ',ro1,' MOhm\\n')\n",
+ "Id4=Iref;\n",
+ "ro4=1./(y*Id4);\n",
+ "print\"%s %.2f %s\"%('\\nro4= ',ro4,' MOhm\\n')\n",
+ "Ro8=gm1*ro8*ro10;\n",
+ "print\"%s %.2f %s\"%('\\ncomposite output resistances = ',Ro8,'MOhm\\n')\n",
+ "Ro6=gm6*ro6*ro4*ro1/(ro4+ro1);\n",
+ "print\"%s %.2f %s\"%('\\ncomposite output resistances= ',Ro6,' MOhm\\n')\n",
+ "Ad=gm1*Ro6*Ro8/(Ro6+Ro8);\n",
+ "print\"%s %.2f %s\"%('\\ndifferential voltage gain=\\n',Ad,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "transconductance gm1=gm8= 316.23 microA/V\n",
+ "\n",
+ "\n",
+ "transconductance= 447.21 microA/V\n",
+ "\n",
+ "\n",
+ "output resistance ro1=ro8=ro6=ro10= 1.00 MOhm\n",
+ "\n",
+ "\n",
+ "ro4= 0.50 MOhm\n",
+ "\n",
+ "\n",
+ "composite output resistances = 316.23 MOhm\n",
+ "\n",
+ "\n",
+ "composite output resistances= 149.07 MOhm\n",
+ "\n",
+ "\n",
+ "differential voltage gain=\n",
+ " 32037.72 \n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex12-pg854"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 13.12\n",
+ "Kp=0.6;\n",
+ "bn=200.;\n",
+ "Va=50.;\n",
+ "Vt=0.026;\n",
+ "Ic13=0.20;\n",
+ "Ri2=bn*Vt/Ic13;\n",
+ "print\"%s %.2f %s\"%('\\ninput resistance to the gain stage= ',Ri2,' KOhm\\n')\n",
+ "Iq5=Ic13;\n",
+ "Ad=math.sqrt(2.*Kp*Iq5)*Ri2;\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal voltage gain=\\n',Ad,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "input resistance to the gain stage= 26.00 KOhm\n",
+ "\n",
+ "\n",
+ "small signal voltage gain=\n",
+ " 12.74 \n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex13-pg855"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 13.13\n",
+ "Va=150.;\n",
+ "Vt=0.026;\n",
+ "Ic13=0.2;\n",
+ "gm13=Ic13/Vt;\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance= ',gm13,' mA/V\\n')\n",
+ "ro13=Va/Ic13;\n",
+ "print\"%s %.2f %s\"%('\\noutput resistance= ',ro13,' KOhm\\n')\n",
+ "Av2=gm13*ro13;\n",
+ "print\"%s %.2f %s\"%('\\nvoltage gain= \\n',Av2,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "transconductance= 7.69 mA/V\n",
+ "\n",
+ "\n",
+ "output resistance= 750.00 KOhm\n",
+ "\n",
+ "\n",
+ "voltage gain= \n",
+ " 5769.23 \n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex14-pg856"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 13.14\n",
+ "Av2=5768.;\n",
+ "C1=12.;\n",
+ "Ci=C1*(1.+Av2);\n",
+ "print\"%s %.2f %s\"%('\\neffective input capacitance= ',Ci,' pF\\n')\n",
+ "Ri2=26000.;##gain stage input resistance (Ohm)\n",
+ "Ci=Ci*10**-12;##F\n",
+ "fPD=1/(2.*math.pi*Ri2*Ci);\n",
+ "print\"%s %.2f %s\"%('\\ndominant pole frequency= ',fPD,' Hz\\n')\n",
+ "Av=73254.;\n",
+ "fT=fPD*Av;\n",
+ "fT=fT*10**-6;##MHz\n",
+ "print\"%s %.2f %s\"%('\\nunity gain bandwidth= ',fT,' MHz\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "effective input capacitance= 69228.00 pF\n",
+ "\n",
+ "\n",
+ "dominant pole frequency= 88.42 Hz\n",
+ "\n",
+ "\n",
+ "unity gain bandwidth= 6.48 MHz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter14_1.ipynb b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter14_1.ipynb new file mode 100644 index 00000000..9940398c --- /dev/null +++ b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter14_1.ipynb @@ -0,0 +1,385 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:0ef8833f45f1abc63222145a7e21a8f8259a2762d408e245d2dc7a9c312f8db4"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter14-Nonideal Effects in Operational Amplifier Circuits"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg880"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "\n",
+ "##Example 14.2\n",
+ "R2=10000.;\n",
+ "Ri=10000.\n",
+ "Aol=10**5;\n",
+ "Rif=1./(1./Ri+(1.+Aol)/R2);\n",
+ "print\"%s %.2f %s\"%('\\nclosed loop input resistance = ',Rif,'Ohm\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "closed loop input resistance = 0.10 Ohm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg883"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ " \n",
+ "##Example 14.3\n",
+ "Aol=10**5;\n",
+ "Ri=10.;\n",
+ "R1=10.;\n",
+ "R2=R1;\n",
+ "Rif=(Ri*(1.+Aol)+R2*(1.+Ri/R1))/(1.+R2/R1);\n",
+ "Rif=Rif*0.001;##Mohm\n",
+ "print\"%s %.2f %s\"%('\\ninput resistance ',Rif,'MOhm\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "input resistance 500.01 MOhm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5-pg888"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ " \n",
+ "##Example 14.5\n",
+ "Ao=2*10**5;\n",
+ "fPD=5.;\n",
+ "fT=fPD*Ao;\n",
+ "print\"%s %.2f %s\"%('\\nunity gain bandwidth= ',fT,' Hz\\n')\n",
+ "f3dB=20.*10**3;\n",
+ "Acl=fT/f3dB;\n",
+ "print\"%s %.2f %s\"%('\\nclosed loop gain=\\n',Acl,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "unity gain bandwidth= 1000000.00 Hz\n",
+ "\n",
+ "\n",
+ "closed loop gain=\n",
+ " 50.00 \n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6-pg890"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 14.6\n",
+ "Iq=19*10**-6;\n",
+ "C1=30*10**-12;\n",
+ "SR=Iq/C1;\n",
+ "SR=SR*10**-6;\n",
+ "print\"%s %.2f %s\"%('\\nslew rate= ',SR,' V/micros\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "slew rate= 0.63 V/micros\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7-pg892"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 14.7\n",
+ "fT=1000.;##KHz\n",
+ "Aclo=10.;\n",
+ "SR=1.*10**3;\n",
+ "Vpo=10.;\n",
+ "f3dB=fT/Aclo;\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal closed loop bandwidth= ',f3dB,' KHz\\n')\n",
+ "fmax=SR/(2.*math.pi*Vpo);\n",
+ "print\"%s %.2f %s\"%('\\nfull power bandwidth= ',fmax,' KHz\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "small signal closed loop bandwidth= 100.00 KHz\n",
+ "\n",
+ "\n",
+ "full power bandwidth= 15.92 KHz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex8-pg895"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ " \n",
+ "##Example 14.8\n",
+ "Is1=10**-14;\n",
+ "Is2=1.05*10**-14;\n",
+ "Vt=0.026;\n",
+ "Vos=Vt*math.log(Is2/Is1);\n",
+ "print\"%s %.2e %s\"%('\\nthe offset voltage = ',Vos,'V\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "the offset voltage = 1.27e-03 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex10-pg900"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 14.10\n",
+ "Kn1=105.;\n",
+ "Kn2=100.;\n",
+ "Iq=200.;\n",
+ "dKn=Kn1-Kn2;\n",
+ "print\"%s %.2f %s\"%('\\ndifference in conduction parameter= ',dKn,' microA/V^2\\n')\n",
+ "Kn=(Kn1+Kn2)/2.;\n",
+ "print\"%s %.2f %s\"%('\\naverage of the conduction parameter= ',Kn,' microA/V^2\\n')\n",
+ "Vos=math.sqrt(Iq/(2.*Kn))*dKn/(2.*Kn);\n",
+ "print\"%s %.2f %s\"%('\\noffset voltage= ',Vos,' V\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "difference in conduction parameter= 5.00 microA/V^2\n",
+ "\n",
+ "\n",
+ "average of the conduction parameter= 102.50 microA/V^2\n",
+ "\n",
+ "\n",
+ "offset voltage= 0.02 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex11-pg901"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 14.11\n",
+ "Rs=100.;\n",
+ "R4=100000.;\n",
+ "R3=100000.;\n",
+ "V1=15.;\n",
+ "V2=-15.;\n",
+ "Vy=Rs*V1/(Rs+R4);\n",
+ "Vy=Vy*1000.;##mV\n",
+ "print\"%s %.2f %s\"%('\\nVoltage Vy = ',Vy,'mV\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Voltage Vy = 14.99 mV\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex13-pg908"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 14.13\n",
+ "R1=10.;\n",
+ "R2=100.;\n",
+ "Ib1=1.1*10**-3;\n",
+ "Ib2=1.*10**-3;\n",
+ "vo=Ib1*R2;\n",
+ "print\"%s %.2f %s\"%('\\noutput voltage = ',vo,'V\\n')\n",
+ "R3=R1*R2/(R1+R2);\n",
+ "print\"%s %.2f %s\"%('\\nR3= ',R3,' KOhm\\n')\n",
+ "vo=R2*(Ib1-Ib2);\n",
+ "print\"%s %.2f %s\"%('\\noutput voltage= ',vo,' V\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "output voltage = 0.11 V\n",
+ "\n",
+ "\n",
+ "R3= 9.09 KOhm\n",
+ "\n",
+ "\n",
+ "output voltage= 0.01 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter15_1.ipynb b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter15_1.ipynb new file mode 100644 index 00000000..3980c758 --- /dev/null +++ b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter15_1.ipynb @@ -0,0 +1,452 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:3265ac4a672eddbdc33f1f3fbb2e748facf5a170a65e7d4c4c98fc93c38a4905"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter15-Applications and Design of Integrated Circuits"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg935"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "import math\n",
+ "\n",
+ "##Example 15.2\n",
+ "C=20.*10**-6;\n",
+ "Req=1000.;\n",
+ "fC=1./(C*Req);\n",
+ "print\"%s %.2f %s\"%('\\nclock frequency = ',fC,' KHz\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "clock frequency = 50.00 KHz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg936"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 15.3\n",
+ "fC=10000.;\n",
+ "f3dB=1000.;\n",
+ "##x=C2/C1\n",
+ "x=2.*math.pi*f3dB/fC;\n",
+ "print\"%s %.2f %s\"%('\\ncapacitances C2/C1= \\n',x,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "capacitances C2/C1= \n",
+ " 0.63 \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg940"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 15.4\n",
+ "C=0.1*10**-6;\n",
+ "R=1000.;\n",
+ "fo=1/(2.*math.pi*R*C*math.sqrt(3.));\n",
+ "print\"%s %.2f %s\"%('\\nthe oscillation frequency = ',fo,'Hz\\n')\n",
+ "##minimum amplifier gain=8\n",
+ "R=1.;##KOhm\n",
+ "R2=8.*R;\n",
+ "print\"%s %.2f %s\"%('\\nR2= ',R2,' KOhm\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "the oscillation frequency = 918.88 Hz\n",
+ "\n",
+ "\n",
+ "R2= 8.00 KOhm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6-pg953"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 15.6\n",
+ "R1=10000.;\n",
+ "R2=90000.;\n",
+ "Vh=10.;\n",
+ "Vl=-10.;\n",
+ "Vth=R1*Vh/(R1+R2);\n",
+ "print\"%s %.2f %s\"%('\\nupper crossover voltage= ',Vth,' V\\n')\n",
+ "Vtl=R1*Vl/(R1+R2);\n",
+ "print\"%s %.2f %s\"%('\\nlower crossover voltage= ',Vtl,' V\\n')\n",
+ "x=Vth-Vtl;\n",
+ "print\"%s %.2f %s\"%('\\nhysteresis width = ',x,'V\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "upper crossover voltage= 1.00 V\n",
+ "\n",
+ "\n",
+ "lower crossover voltage= -1.00 V\n",
+ "\n",
+ "\n",
+ "hysteresis width = 2.00 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7-pg958"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 15.7\n",
+ "Vs=2.;\n",
+ "Vh=15.;\n",
+ "Vl=-15.;\n",
+ "##hysteresis width=x\n",
+ "x=60.*0.001;##(V)\n",
+ "##Vth-Vtl=(R1/(R1+R2))*(Vh-Vl)\n",
+ "##R2/R=y\n",
+ "y=(Vh-Vl)/x-1.;\n",
+ "print\"%s %.2f %s\"%('\\nR2/R1= \\n',y,'')\n",
+ "Vref=(1.+1./y)*Vs;\n",
+ "print\"%s %.2f %s\"%('\\nreference voltage= ',Vref,' V\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "R2/R1= \n",
+ " 499.00 \n",
+ "\n",
+ "reference voltage= 2.00 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex10-pg969"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 15.10\n",
+ "C=15.*10**-9;\n",
+ "T=100.*10**-6;##(s) time\n",
+ "R=T/(1.1*C);\n",
+ "R=R*0.001;##Kohm\n",
+ "print\"%s %.2f %s\"%('\\nResistance R= ',R,' KOhm\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Resistance R= 6.06 KOhm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex13-pg974"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 15.13\n",
+ "Rl=10.;##load resistance \n",
+ "Pl=20.;##power delivered to the load\n",
+ "Ps=20.;##(W)\n",
+ "Vp=math.sqrt(2.*Rl*Pl);\n",
+ "print\"%s %.2f %s\"%('\\npeak output voltage= ',Vp,' V\\n')\n",
+ "Ip=Vp/Rl;\n",
+ "print\"%s %.2f %s\"%('\\npeak load current = ',Ip,'A\\n')\n",
+ "Vs=math.pi*Rl*Ps/Vp;\n",
+ "print\"%s %.2f %s\"%('\\nrequired supply voltage= ',Vs,' V\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "peak output voltage= 20.00 V\n",
+ "\n",
+ "\n",
+ "peak load current = 2.00 A\n",
+ "\n",
+ "\n",
+ "required supply voltage= 31.42 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex14-pg979"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 15.14\n",
+ "Vonl=5;\n",
+ "Vofl=4.96;\n",
+ "I1=0.005;\n",
+ "I2=1.5;\n",
+ "dVo=Vonl-Vofl;\n",
+ "dIo=I1-I2;\n",
+ "Rvf=-dVo/dIo;\n",
+ "print\"%s %.2f %s\"%('\\noutput resistance= ',Rvf,' Ohm\\n')\n",
+ "LR=100.*(Vonl-Vofl)/Vonl;\n",
+ "print\"%s %.2f %s\"%('\\nload regulation =\\n',LR,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "output resistance= 0.03 Ohm\n",
+ "\n",
+ "\n",
+ "load regulation =\n",
+ " 0.80 \n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex15-pg982"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 15.15\n",
+ "Aol=1000.;\n",
+ "Vref=5.;\n",
+ "Vo=10.;\n",
+ "Io=0.1*0.001;\n",
+ "Vt=0.026;\n",
+ "Rof=2.*Vt*Vo/(Io*Vref*Aol);\n",
+ "print\"%s %.2f %s\"%('\\noutput resistance= ',Rof,' mOhm\\n')\n",
+ "##dVo/Vo=V and dIo/Io=I\n",
+ "##V=-I*2*Vt/(Vref*Aol)\n",
+ "##V/I=x\n",
+ "x=-2.*Vt/(Vref*Aol);\n",
+ "print\"%s %.2e %s\"%('\\npercent change=\\n',x,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "output resistance= 1.04 mOhm\n",
+ "\n",
+ "\n",
+ "percent change=\n",
+ " -1.04e-05 \n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex16-pg984"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 15.16\n",
+ "Vz=6.3;\n",
+ "Vbe=0.6;\n",
+ "Veb=0.6;\n",
+ "Vo=8.;\n",
+ "R1=3.9;\n",
+ "R2=3.4;\n",
+ "R3=0.576;\n",
+ "Ic3=(Vz-3.*Vbe)/(R1+R2+R3);\n",
+ "print\"%s %.2f %s\"%('\\nbias current = ',Ic3,' mA\\n')\n",
+ "Vb7=Ic3*R1+2.*Vbe;\n",
+ "print\"%s %.2f %s\"%('\\ntemperature compensated reference voltage= ',Vb7,' V\\n')\n",
+ "R13=2.23;\n",
+ "R12=R13*Vo/Vb7-R13;\n",
+ "print\"%s %.2f %s\"%('\\nR12= ',R12,' KOhm\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "bias current = 0.57 mA\n",
+ "\n",
+ "\n",
+ "temperature compensated reference voltage= 3.43 V\n",
+ "\n",
+ "\n",
+ "R12= 2.97 KOhm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter16_1.ipynb b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter16_1.ipynb new file mode 100644 index 00000000..2d0de40c --- /dev/null +++ b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter16_1.ipynb @@ -0,0 +1,428 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:2c1f0572305869070ba4c4550f2c2ddcdc134200c33890cfededcae546a1a172"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter16-MOSFET Digital Circuits "
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg1013"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 16.3\n",
+ "Vdd=5.;\n",
+ "Vtnd=0.8;\n",
+ "Vtnl=0.8;\n",
+ "Kn=35.;\n",
+ "Vo=0.1;\n",
+ "Vi=4.2;\n",
+ "##W/L=Y\n",
+ "yl=0.5;\n",
+ "##Kd/Kl=x\n",
+ "x=(Vdd-Vo-Vtnl)**2/(2.*Vo*(Vi-Vtnd)-Vo**2);\n",
+ "print\"%s %.2f %s\"%('\\nKd/Kl=\\n',x,'')\n",
+ "##Kd/Kl=yd/yl\n",
+ "yd=12.6\n",
+ "yl=0.5\n",
+ "iD=Kn*yl*(Vdd-Vo-Vtnl)**2/2.;\n",
+ "print\"%s %.2f %s\"%('\\ndrain current = ',iD,' microA\\n')\n",
+ "P=iD*Vdd;\n",
+ "print\"%s %.2f %s\"%('\\npower dissipation= ',P,' microW\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Kd/Kl=\n",
+ " 25.09 \n",
+ "\n",
+ "drain current = 147.09 microA\n",
+ "\n",
+ "\n",
+ "power dissipation= 735.44 microW\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg1017"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ " \n",
+ "##Example 16.4\n",
+ "Vdd=5.;\n",
+ "Vtnd=0.8;\n",
+ "Vtnl=-2.;\n",
+ "Kn=35.;\n",
+ "Vo=0.1;\n",
+ "Vi=5.;\n",
+ "##W/L=Y\n",
+ "yl=0.5;\n",
+ "##Kd/Kl=x\n",
+ "x=(-Vtnl)**2/(2.*Vo*(Vi-Vtnd)-Vo**2);\n",
+ "print\"%s %.2f %s\"%('\\nKd/Kl=\\n',x,'')\n",
+ "##Kd/Kl=yd/yl\n",
+ "yd=2.41\n",
+ "yl=0.5\n",
+ "iD=Kn*yl*(-Vtnl)**2/2.;\n",
+ "print\"%s %.2f %s\"%('\\ndrain current= ',iD,' microA\\n')\n",
+ "P=iD*Vdd;\n",
+ "print\"%s %.2f %s\"%('\\npower dissipation = ',P,' microW\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Kd/Kl=\n",
+ " 4.82 \n",
+ "\n",
+ "drain current= 35.00 microA\n",
+ "\n",
+ "\n",
+ "power dissipation = 175.00 microW\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5-pg1021"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 16.5\n",
+ "Voh=4.2;\n",
+ "Vol=0.1;\n",
+ "##x=Kd/Kl\n",
+ "x=25.1;\n",
+ "Vdd=5.;\n",
+ "Vtnl=0.8;\n",
+ "Vohu=4.2;\n",
+ "Vil=0.8;\n",
+ "Vtnd=0.8;\n",
+ "Vih=Vtnd+(Vdd-Vtnl)/x*((1+2*x)/math.sqrt(1.+3.*x)-1.);\n",
+ "print\"%s %.2f %s\"%('\\nVih= ',Vih,' V\\n')\n",
+ "Volu=(Vdd-Vtnl+x*(Vih-Vtnd))/(1.+2.*x);\n",
+ "print\"%s %.2f %s\"%('\\noutput voltage corresponding to Vih= ',Volu,' V\\n')\n",
+ "NMl=Vil-Volu;\n",
+ "print\"%s %.2f %s\"%('\\nnoise margin= ',NMl,' V\\n')\n",
+ "NMh=Vohu-Vih;\n",
+ "print\"%s %.2f %s\"%('\\nnoise margin= ',NMh,' V\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Vih= 1.61 V\n",
+ "\n",
+ "\n",
+ "output voltage corresponding to Vih= 0.48 V\n",
+ "\n",
+ "\n",
+ "noise margin= 0.32 V\n",
+ "\n",
+ "\n",
+ "noise margin= 2.59 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex9-pg1041"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ " \n",
+ "##Example 16.9\n",
+ "Vdd=5.;\n",
+ "Vtn=1.;\n",
+ "Vtp=-1.;\n",
+ "##Kn=Kp hence Kn/Kp=x=1;\n",
+ "x=1.;\n",
+ "Vit=(Vdd+Vtp+math.sqrt(x)*Vtn)/(1.+math.sqrt(x));\n",
+ "print\"%s %.2f %s\"%('\\ninput voltage= ',Vit,' V\\n')\n",
+ "Vipt=Vit;\n",
+ "Vopt=Vipt-Vtp;\n",
+ "print\"%s %.2f %s\"%('\\noutput voltage at the transition point for PMOS = ',Vopt,' V\\n')\n",
+ "Vint=Vit;\n",
+ "Vont=Vint-Vtn;\n",
+ "print\"%s %.2f %s\"%('\\noutput voltage at the transition point for NMOS= ',Vont,' V\\n')\n",
+ "Vdd=10.;\n",
+ "Vit=(Vdd+Vtp+math.sqrt(x)*Vtn)/(1.+math.sqrt(x));\n",
+ "print\"%s %.2f %s\"%('\\ninput voltage = ',Vit,'V\\n')\n",
+ "Vipt=Vit;\n",
+ "Vint=Vit;\n",
+ "Vopt=Vipt-Vtp;\n",
+ "print\"%s %.2f %s\"%('\\noutput voltage at the transition point for PMOS = ',Vopt,' V\\n')\n",
+ "Vont=Vint-Vtn;\n",
+ "print\"%s %.2f %s\"%('\\noutput voltage at the transition point for NMOS = ',Vont,' V\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "input voltage= 2.50 V\n",
+ "\n",
+ "\n",
+ "output voltage at the transition point for PMOS = 3.50 V\n",
+ "\n",
+ "\n",
+ "output voltage at the transition point for NMOS= 1.50 V\n",
+ "\n",
+ "\n",
+ "input voltage = 5.00 V\n",
+ "\n",
+ "\n",
+ "output voltage at the transition point for PMOS = 6.00 V\n",
+ "\n",
+ "\n",
+ "output voltage at the transition point for NMOS = 4.00 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex10-pg1045"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 16.10\n",
+ "Cl=2.*10**-6;\n",
+ "Vdd=5.;\n",
+ "f=100000.;\n",
+ "P=f*Cl*Vdd**2;\n",
+ "print\"%s %.2f %s\"%('\\npower dissipation in the CMOS inverter= ',P,' microW\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "power dissipation in the CMOS inverter= 5.00 microW\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex11-pg1047"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 16.11\n",
+ "Vtn=1.;\n",
+ "Vtp=-1.;\n",
+ "Vdd=5.;\n",
+ "Vth=1.;\n",
+ "Vil=Vtn+3.*(Vdd+Vtp-Vth)/8.;\n",
+ "print\"%s %.2f %s\"%('\\ninput voltage at the transition points Vil= ',Vil,' V\\n')\n",
+ "Vih=Vtn+5.*(Vdd+Vtp-Vtn)/8.;\n",
+ "print\"%s %.2f %s\"%('\\ninput voltage at the transition points Vih= ',Vih,' V\\n')\n",
+ "Vohu=1.*(2.*Vil+Vdd-Vtn-Vtp)/2.;\n",
+ "print\"%s %.2f %s\"%('\\noutput voltage = ',Vohu,' V\\n')\n",
+ "Volu=1.*(2.*Vih-Vdd-Vtn-Vtp)/2.;\n",
+ "print\"%s %.2f %s\"%('\\noutput voltage = ',Volu,' V\\n')\n",
+ "NML=Vil-Volu;\n",
+ "print\"%s %.2f %s\"%('\\nnoise margin = ',NML,' V\\n')\n",
+ "NMH=Vohu-Vih;\n",
+ "print\"%s %.2f %s\"%('\\nnoise margin= ',NML,' V\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "input voltage at the transition points Vil= 2.12 V\n",
+ "\n",
+ "\n",
+ "input voltage at the transition points Vih= 2.88 V\n",
+ "\n",
+ "\n",
+ "output voltage = 4.62 V\n",
+ "\n",
+ "\n",
+ "output voltage = 0.38 V\n",
+ "\n",
+ "\n",
+ "noise margin = 1.75 V\n",
+ "\n",
+ "\n",
+ "noise margin= 1.75 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex15-pg1080"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ " \n",
+ "##Example 16.15\n",
+ "Vdd=3.;\n",
+ "Kn=60.;\n",
+ "Vtnd=0.5;\n",
+ "##W/L=x\n",
+ "xd=2.;\n",
+ "Vtnl=-1.;\n",
+ "xl=0.5;\n",
+ "R=2.;##(MOhm)\n",
+ "Vgsl=0.;\n",
+ "##solution with Depletion load\n",
+ "iD=Kn*xl*(Vgsl-Vtnl)**2/2.;\n",
+ "print\"%s %.2f %s\"%('\\nfrain currents in M1 and M3 = ',iD,' microA\\n')\n",
+ "P=iD*Vdd;\n",
+ "print\"%s %.2f %s\"%('\\npower dissipation in the circuit= ',P,'microW\\n')\n",
+ "##iD=Kn/2*x*(2*Vgsd-Vtnd)Vdsd-Vdsd^2\n",
+ "Q=50.5\n",
+ "p=0.25 - 5*(50.5) + 50.5\n",
+ "print(p)\n",
+ "\n",
+ "##solution with Resistor load\n",
+ "##(Vdd-Q)/R=Kn/2*xd*(2*Vgsd-Vtnd)Q-Q^2\n",
+ "\n",
+ "\n",
+ "Q=0.005;\n",
+ "p1=0.25 - 5*(0.005) + 0.005\n",
+ "print(p1)\n",
+ "iD=(Vdd-Q)/R;\n",
+ "print\"%s %.2f %s\"%('\\ndrain current = ',iD,' microA\\n')\n",
+ "P=iD*Vdd;\n",
+ "print\"%s %.2f %s\"%('\\npower dissipation in the circuit = ',P,' microW\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "frain currents in M1 and M3 = 15.00 microA\n",
+ "\n",
+ "\n",
+ "power dissipation in the circuit= 45.00 microW\n",
+ "\n",
+ "-201.75\n",
+ "0.23\n",
+ "\n",
+ "drain current = 1.50 microA\n",
+ "\n",
+ "\n",
+ "power dissipation in the circuit = 4.49 microW\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter17_1.ipynb b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter17_1.ipynb new file mode 100644 index 00000000..36f2555a --- /dev/null +++ b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter17_1.ipynb @@ -0,0 +1,647 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:abf15ae78837b656bd4ca10fb9d29bc4f18126add8de13c4bce16bc14f199d7a"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter17-Bipolar Digital Circuits"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg1115"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 17.1\n",
+ "V1=5.;\n",
+ "V2=-5.;\n",
+ "Rc1=1.;\n",
+ "Rc2=Rc1;\n",
+ "Rc=Rc1;\n",
+ "Re=2.150;\n",
+ "v2=0.;\n",
+ "##for v1=0\n",
+ "vE=-0.7;\n",
+ "iE=(vE-V2)/Re;\n",
+ "print\"%s %.2f %s\"%('\\nemitter current= ',iE,' mA\\n')\n",
+ "iC=1.;\n",
+ "Vcc=5.;\n",
+ "vo1=Vcc-iC*Rc;\n",
+ "print\"%s %.2f %s\"%('\\nvo1=vo2= ',vo1,' V\\n')\n",
+ "##for v2=-1\n",
+ "vE=-0.7;\n",
+ "iE=2.;\n",
+ "iC2=2.;\n",
+ "vo1=5.;\n",
+ "vo2=Vcc-iC2*Rc;\n",
+ "print\"%s %.2f %s\"%('\\nvo2= ',vo2,' V\\n')\n",
+ "v1=1.;\n",
+ "Vbe=0.7;\n",
+ "vE=v1-Vbe;\n",
+ "iE=(vE-V2)/Re;\n",
+ "print\"%s %.2f %s\"%('\\nemitter current =',iE,' mA\\n')\n",
+ "iC1=iE;\n",
+ "vo1=Vcc-iC1*Rc;\n",
+ "print\"%s %.2f %s\"%('\\nvo1= ',vo1,' V\\n')\n",
+ "vo2=Vcc\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "emitter current= 2.00 mA\n",
+ "\n",
+ "\n",
+ "vo1=vo2= 4.00 V\n",
+ "\n",
+ "\n",
+ "vo2= 3.00 V\n",
+ "\n",
+ "\n",
+ "emitter current = 2.47 mA\n",
+ "\n",
+ "\n",
+ "vo1= 2.53 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg1118"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 17.2\n",
+ "Vx=-0.7;\n",
+ "Vy=Vx;\n",
+ "Vbe=0.7;\n",
+ "V2=-5.2;\n",
+ "Re=1.180;\n",
+ "vE=Vx-Vbe;\n",
+ "print\"%s %.2f %s\"%('\\nemitter voltage = ',vE,' V\\n')\n",
+ "iE=(vE-V2)/Re;\n",
+ "print\"%s %.2f %s\"%('\\nemitter current= ',iE,' mA\\n')\n",
+ "Icxy=iE;\n",
+ "vo1=-0.7;\n",
+ "Rc1=-vo1/Icxy;\n",
+ "print\"%s %.2f %s\"%('\\nRc1= ',Rc1,' KOhm\\n')\n",
+ "Vnor=vo1-Vbe;\n",
+ "print\"%s %.2f %s\"%('\\nNOR output logic 0 value= ',Vnor,' V\\n')\n",
+ "Vr=(vo1+Vnor)/2.;\n",
+ "vE=Vr-Vbe;\n",
+ "print\"%s %.2f %s\"%('\\nvE= ',vE,' V\\n')\n",
+ "iE=(vE-V2)/Re;\n",
+ "print\"%s %.2f %s\"%('\\niE= ',iE,' mA\\n')\n",
+ "vo2=-0.7;\n",
+ "iC2=iE;\n",
+ "Rc2=-vo2/iC2;\n",
+ "print\"%s %.2f %s\"%('\\nRc2= ',Rc2,' KOhm\\n')\n",
+ "Vor=vo2-Vbe;\n",
+ "print\"%s %.2f %s\"%('\\nOR logic 0 value is= ',Vor,' V\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "emitter voltage = -1.40 V\n",
+ "\n",
+ "\n",
+ "emitter current= 3.22 mA\n",
+ "\n",
+ "\n",
+ "Rc1= 0.22 KOhm\n",
+ "\n",
+ "\n",
+ "NOR output logic 0 value= -1.40 V\n",
+ "\n",
+ "\n",
+ "vE= -1.75 V\n",
+ "\n",
+ "\n",
+ "iE= 2.92 mA\n",
+ "\n",
+ "\n",
+ "Rc2= 0.24 KOhm\n",
+ "\n",
+ "\n",
+ "OR logic 0 value is= -1.40 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg1120"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 17.3\n",
+ "Vr=-1.05;\n",
+ "Vbe=0.7;\n",
+ "Vb5=Vr+Vbe;\n",
+ "print\"%s %.2f %s\"%('\\nVb5 = ',Vb5,' V\\n')\n",
+ "R1=0.250;\n",
+ "i1=-Vb5/R1;\n",
+ "print\"%s %.2f %s\"%('\\ni1= ',i1,' mA\\n')\n",
+ "Vy=0.7;\n",
+ "V2=-5.2;\n",
+ "##let R1+R2=x\n",
+ "x=(-2.*Vy-V2)/i1;\n",
+ "R2=x-R1;\n",
+ "print\"%s %.2f %s\"%('\\nR2= ',R2,' KOhm\\n')\n",
+ "iS=i1;\n",
+ "Rs=(Vr-V2)/iS;\n",
+ "print\"%s %.2f %s\"%('\\nRs= ',Rs,' KOhm\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Vb5 = -0.35 V\n",
+ "\n",
+ "\n",
+ "i1= 1.40 mA\n",
+ "\n",
+ "\n",
+ "R2= 2.46 KOhm\n",
+ "\n",
+ "\n",
+ "Rs= 2.96 KOhm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg1121"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 17.4\n",
+ "Vx=-0.7;\n",
+ "Vy=-0.7;\n",
+ "iCxy=3.22;##(mA)\n",
+ "iCR=0.;\n",
+ "i5=1.40;\n",
+ "i1=1.40;\n",
+ "Vor=-0.7;\n",
+ "R4=1.500;\n",
+ "Vnor=-1.4;\n",
+ "V2=-5.2;\n",
+ "R3=1.500;\n",
+ "i3=(Vor-V2)/R3;\n",
+ "print\"%s %.2f %s\"%('\\ncurrent i3= ',i3,' mA\\n')\n",
+ "i4=(Vnor-V2)/R4;\n",
+ "print\"%s %.2f %s\"%('\\ncurrent i4 = ',i4, 'mA')\n",
+ "P=(iCxy+iCR+i5+i1+i3+i4)*(0.-V2);\n",
+ "print\"%s %.2f %s\"%('\\npower dissipation= ',P,' mW\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "current i3= 3.00 mA\n",
+ "\n",
+ "\n",
+ "current i4 = 2.53 mA\n",
+ "\n",
+ "power dissipation= 60.08 mW\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5-pg1122"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 17.5\n",
+ "b=50.;\n",
+ "V2=-5.2;\n",
+ "Vbe=0.7;\n",
+ "Rc2=0.240;\n",
+ "Vor=-0.75;\n",
+ "Re=1.180;\n",
+ "iE=(Vor-Vbe-V2)/Re;\n",
+ "print\"%s %.2f %s\"%('\\nemitter current= ',iE,' mA\\n')\n",
+ "iB=iE/(1.+b);\n",
+ "iB=iB*1000.;##micro A\n",
+ "print\"%s %.2f %s\"%('\\ninput base current= ',iB,' microA\\n')\n",
+ "R3=1.500;\n",
+ "i3=(Vor-V2)/R3;\n",
+ "print\"%s %.2f %s\"%('\\ni3= ',i3,' mA\\n')\n",
+ "iB=iB*0.001;##mA\n",
+ "N=(-(Vor+Vbe)*(1.+b)/(Rc2)-i3)/iB;\n",
+ "print\"%s %.2f %s\"%('\\nN\\n',N,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "emitter current= 3.18 mA\n",
+ "\n",
+ "\n",
+ "input base current= 62.31 microA\n",
+ "\n",
+ "\n",
+ "i3= 2.97 mA\n",
+ "\n",
+ "\n",
+ "N\n",
+ " 122.90 \n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7-pg1127"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ " \n",
+ "##Example 17.7\n",
+ "Vcc=1.7;\n",
+ "Re=0.008;##mohm\n",
+ "Rc=0.008;##mohm\n",
+ "Vy=0.4;\n",
+ "Vbe=0.7;\n",
+ "Vor=Vcc##logic 1\n",
+ "Vor=Vcc-Vy##logic 0\n",
+ "Vr=1.5;\n",
+ "iE=(Vr-Vbe)/Re;\n",
+ "print\"%s %.2f %s\"%('\\nemitter current= ',iE,' microA\\n')\n",
+ "iR=Vy/Rc;\n",
+ "print\"%s %.2f %s\"%('\\nmaximum current in Rc = ',iR,' microA\\n')\n",
+ "iD=iE-iR;\n",
+ "print\"%s %.2f %s\"%('\\ncurrent through the diode= ',iD,' microA\\n')\n",
+ "P=iE*Vcc;\n",
+ "print\"%s %.2f %s\"%('\\npower dissipation= ',P,' microW\\n')\n",
+ "Vv=1.7;\n",
+ "iE=(Vv-Vbe)/Re;\n",
+ "print\"%s %.2f %s\"%('\\niE = ',iE,' microA\\n')\n",
+ "P=iE*Vcc;\n",
+ "print\"%s %.2f %s\"%('\\npower dissipation = ',P,' microW\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "emitter current= 100.00 microA\n",
+ "\n",
+ "\n",
+ "maximum current in Rc = 50.00 microA\n",
+ "\n",
+ "\n",
+ "current through the diode= 50.00 microA\n",
+ "\n",
+ "\n",
+ "power dissipation= 170.00 microW\n",
+ "\n",
+ "\n",
+ "iE = 125.00 microA\n",
+ "\n",
+ "\n",
+ "power dissipation = 212.50 microW\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex9-pg1142"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 17.9\n",
+ "bf=25.;\n",
+ "b=bf;\n",
+ "br=0.1;\n",
+ "Vcc=5.;\n",
+ "R1=4.;\n",
+ "Vbc=0.7;\n",
+ "Vy=0.1;\n",
+ "Vx=0.1;\n",
+ "R2=1.6;\n",
+ "Vbe=0.8;\n",
+ "Rc=4.;\n",
+ "Vce=0.1;\n",
+ "vB2=Vx+Vce;\n",
+ "print\"%s %.2f %s\"%('\\nvB2= ',vB2,' V\\n')\n",
+ "vB1=Vx+Vbe;\n",
+ "print\"%s %.2f %s\"%('\\nbase voltage= ',vB1,' V\\n')\n",
+ "i1=(Vcc-vB1)/R1;\n",
+ "print\"%s %.2f %s\"%('\\ncurrent i1= ',i1,' mA\\n')\n",
+ "vB1=Vbe+Vbe+Vbc;\n",
+ "print\"%s %.2f %s\"%('\\nvB1= ',vB1,' V\\n')\n",
+ "vC2=Vbe+Vce;\n",
+ "print\"%s %.2f %s\"%('\\ncollector voltage= ',vC2,' V\\n')\n",
+ "i1=(Vcc-vB1)/R1;\n",
+ "print\"%s %.2f %s\"%('\\ncurrent i1 = ',i1,' mA\\n')\n",
+ "iB2=(1.+2.*br)*i1;\n",
+ "print\"%s %.2f %s\"%('\\niB2= ',iB2,' mA\\n')\n",
+ "i2=(Vcc-vC2)/R2;\n",
+ "print\"%s %.2f %s\"%('\\ni2 = ',i2,' mA\\n')\n",
+ "iE2=i2+iB2;\n",
+ "print\"%s %.2f %s\"%('\\niE2= ',iE2,' mA\\n')\n",
+ "Rb=1.;\n",
+ "i4=Vbe/Rb;\n",
+ "print\"%s %.2f %s\"%('\\ncurrent in the pull down resistor= ',i4,' mA\\n')\n",
+ "iBo=iE2-i4;\n",
+ "print\"%s %.2f %s\"%('\\nbase drive to the output transistor= ',iBo,' mA\\n')\n",
+ "i1=(Vcc-Vce)/Rc;\n",
+ "print\"%s %.2f %s\"%('\\ni1= ',i1,' mA\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "vB2= 0.20 V\n",
+ "\n",
+ "\n",
+ "base voltage= 0.90 V\n",
+ "\n",
+ "\n",
+ "current i1= 1.02 mA\n",
+ "\n",
+ "\n",
+ "vB1= 2.30 V\n",
+ "\n",
+ "\n",
+ "collector voltage= 0.90 V\n",
+ "\n",
+ "\n",
+ "current i1 = 0.68 mA\n",
+ "\n",
+ "\n",
+ "iB2= 0.81 mA\n",
+ "\n",
+ "\n",
+ "i2 = 2.56 mA\n",
+ "\n",
+ "\n",
+ "iE2= 3.37 mA\n",
+ "\n",
+ "\n",
+ "current in the pull down resistor= 0.80 mA\n",
+ "\n",
+ "\n",
+ "base drive to the output transistor= 2.57 mA\n",
+ "\n",
+ "\n",
+ "i1= 1.23 mA\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex11-pg1150"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 17.11\n",
+ "b=25.;\n",
+ "iB=1.;\n",
+ "iC=2.;\n",
+ "ic=(iB+iC)/(1.+1./b);\n",
+ "print\"%s %.2f %s\"%('\\ninternal collector current= ',ic,' mA\\n',)\n",
+ "ib=ic/b;\n",
+ "print\"%s %.2f %s\"%('\\ninternal base current = ',ib,' mA\\n')\n",
+ "iD=iB-ib;\n",
+ "print\"%s %.2f %s\"%('\\nSchottky diode current= ',iD,' mA\\n')\n",
+ "iC=20.;\n",
+ "ic=(iB+iC)/(1.+1./b);\n",
+ "print\"%s %.2f %s\"%('\\ninternal collector current= ',ic,' mA\\n')\n",
+ "ib=ic/b;\n",
+ "print\"%s %.2f %s\"%('\\ninternal base current = ',ib,' mA\\n')\n",
+ "iD=iB-ib;\n",
+ "print\"%s %.2f %s\"%('\\nSchottky diode current= ',iD,' mA\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "internal collector current= 2.88 mA\n",
+ "\n",
+ "\n",
+ "internal base current = 0.12 mA\n",
+ "\n",
+ "\n",
+ "Schottky diode current= 0.88 mA\n",
+ "\n",
+ "\n",
+ "internal collector current= 20.19 mA\n",
+ "\n",
+ "\n",
+ "internal base current = 0.81 mA\n",
+ "\n",
+ "\n",
+ "Schottky diode current= 0.19 mA\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex12-pg1154"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 17.12\n",
+ "Vy=0.3;\n",
+ "Vbe=0.7;\n",
+ "vx=0.4;\n",
+ "R2=8.;\n",
+ "Vce=0.4;\n",
+ "Vcc=5.;\n",
+ "b=25.;\n",
+ "Vce=0.4;\n",
+ "Vbe1=0.7;\n",
+ "Vbe2=0.7;\n",
+ "Vcc=5.;\n",
+ "R1=20.;\n",
+ "v1=Vce+Vy;\n",
+ "i1=(Vcc-v1)/R1;\n",
+ "print\"%s %.2f %s\"%('\\ni1= ',i1,' mA\\n')\n",
+ "Pl=i1*(Vcc-vx);\n",
+ "print\"%s %.2f %s\"%('\\npower dissipation= ',Pl,' mW\\n')\n",
+ "v1=Vbe1+Vbe2;\n",
+ "print\"%s %.2f %s\"%('\\nv1= ',v1,' V\\n')\n",
+ "vC2=Vbe1+Vce;\n",
+ "print\"%s %.2f %s\"%('\\nvoltage vC2 =',vC2,' V\\n')\n",
+ "i1=(Vcc-v1)/R1;\n",
+ "print\"%s %.2f %s\"%('\\ncurrent i1 = ',i1,' mA\\n')\n",
+ "i2=(Vcc-vC2)/R2;\n",
+ "print\"%s %.2f %s\"%('\\ncurrent i2 = ',i2,' mA\\n')\n",
+ "P=(i1+i2)*Vcc;\n",
+ "print\"%s %.2f %s\"%('\\npower dissipation for high input condition= ',P,' mW\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "i1= 0.21 mA\n",
+ "\n",
+ "\n",
+ "power dissipation= 0.99 mW\n",
+ "\n",
+ "\n",
+ "v1= 1.40 V\n",
+ "\n",
+ "\n",
+ "voltage vC2 = 1.10 V\n",
+ "\n",
+ "\n",
+ "current i1 = 0.18 mA\n",
+ "\n",
+ "\n",
+ "current i2 = 0.49 mA\n",
+ "\n",
+ "\n",
+ "power dissipation for high input condition= 3.34 mW\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter1_1.ipynb b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter1_1.ipynb new file mode 100644 index 00000000..5dae57eb --- /dev/null +++ b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter1_1.ipynb @@ -0,0 +1,474 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:ee4acc9fe033182686c067f9b51c12e7f872f20a61bb079c1ca29002499b1ddd"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter1-Semiconductor materials and diodes"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg6"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#calculate the \n",
+ "##Example 1.1\n",
+ "T=300.;##((K)temperature)\n",
+ "##for silicon\n",
+ "B=5.23*10**(15);##Constant (per centimeter cube degree kelvin)\n",
+ "Eg=1.1;##bandgap energy in electrovolt(eV)\n",
+ "k=86.*10**(-6);##Boltzmann's constant(eV per degree kelvin)\n",
+ "n_i=B*T**(3/2.)*math.exp(-Eg/(2.*k*T));##intrinsic carrier concentration\n",
+ "print\"%s %.2f %s\"%('intrinsic carrier concentration= ',n_i,' cm^-3');\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "intrinsic carrier concentration= 14995738948.72 cm^-3\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg8"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "import math\n",
+ "\n",
+ "#calculate the\n",
+ "\n",
+ "##Example 1.2 \n",
+ "T=300.;##(K)Given Temperature\n",
+ "Nd=10**16;##(cm^-3)Donor concentration\n",
+ "n_i=1.5*10**10;##(cm^-3)intrinsic carrier concentration\n",
+ "##since Nd>>n_i\n",
+ "n_o=10**16;##(cm^-3)electron concentration\n",
+ "##by using formula ::n_i^2=n_o*p_o\n",
+ "p_o=(n_i)**2/Nd;##hole concentration\n",
+ "print\"%s %.2e %s\"%('\\nelectron concentration= ',n_o,' cm^-3');\n",
+ "print\"%s %.2e %s\"%('\\nhole concentration = ',p_o,' cm^-3');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "electron concentration= 1.00e+16 cm^-3\n",
+ "\n",
+ "hole concentration = 2.25e+04 cm^-3\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg13"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#calculate the \n",
+ "##Example1.3\n",
+ "T=300;##(K)Given Temperature\n",
+ "Na=10**16;##(cm^-3)Acceptor concentration in p region\n",
+ "Nd=10**17;##(cm^-3)Donor concentration in n region\n",
+ "n_i=1.5*10**10;##(cm^-3)intrinsic carrier concentration\n",
+ "V_T=0.026;##(Volt)terminal voltage\n",
+ "##built-in potential\n",
+ "V_bi=V_T*math.log(Na*Nd/(n_i)**2);\n",
+ "print\"%s %.2f %s\"%('\\nthe built-in potential= ',V_bi,'V')\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "the built-in potential= 0.76 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg15"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#calculate the \n",
+ "##Example 1.4\n",
+ "T=300.;##(K)Given Temperature\n",
+ "Na=10**16;##(cm**-3)Acceptor concentration in p region\n",
+ "Nd=10**15;##(cm**-3)Donor concentration in n region\n",
+ "n_i=1.5*10**10;##(cm**-3)intrinsic carrier concentration\n",
+ "C_jo=0.5;##(pF)junction capacitance at zero applied voltage\n",
+ "V_T=0.026;##(Volt)terminal voltage\n",
+ "##built-in potential\n",
+ "V_bi=V_T*math.log(Na*Nd/(n_i)**2);\n",
+ "print\"%s %.2f %s\"%(\"the built-in potential(V)\",V_bi,\"\")\n",
+ "##the junction capacitance for\n",
+ "V_R=1.;##(V)reverse bias voltage\n",
+ "Cj=C_jo*(1.+V_R/V_bi)**(-1/2.);\n",
+ "print\"%s %.2f %s\"%('\\nthe junction capacitance for V_R=1V= ',Cj,' pF\\n')\n",
+ "V_R=5.;##(V)reverse bias voltage\n",
+ "Cj=C_jo*(1.+V_R/V_bi)**(-1/2.);\n",
+ "print\"%s %.2f %s\"%('\\nthe junction capacitance for V_R=5V = ',Cj,' pF')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the built-in potential(V) 0.64 \n",
+ "\n",
+ "the junction capacitance for V_R=1V= 0.31 pF\n",
+ "\n",
+ "\n",
+ "the junction capacitance for V_R=5V = 0.17 pF\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5-pg17"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#calculate the \n",
+ "##Example 1.5\n",
+ "T=300.;##(K)Given Temperature\n",
+ "V_T=0.026;##(Volt)terminal voltage\n",
+ "Is=10**-11;##(mA)reverse bias saturation current\n",
+ "n=1.;##emission coefficient\n",
+ "v_D=+0.7;##(V)applied voltage\n",
+ "##pn junction is forward biased\n",
+ "i_D=Is*(math.exp(v_D/V_T)-1.);##diode current\n",
+ "print\"%s %.2f %s\"%('\\ndiode current= ',i_D,' mA\\n')\n",
+ "v_D=-0.7;##(V)pn junction is reverse biased\n",
+ "Is=10**-14##A;\n",
+ "i_D=Is*(math.exp(v_D/V_T)-1);##diode current\n",
+ "print\"%s %.2e %s\"%('\\ndiode current= ',i_D,' A')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "diode current= 4.93 mA\n",
+ "\n",
+ "\n",
+ "diode current= -1.00e-14 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6-pg25"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#calculate the \n",
+ "##Example 1.6\n",
+ "Is=10**-13;##(A)reverse saturation current\n",
+ "V_PS=5.;##(V)applied voltage\n",
+ "R=2;##(KOhm)Resistance in circuit\n",
+ "V_T=0.026;##(Volt)terminal voltage\n",
+ "##V_PS=Is*R*(exp(V_D/V_T)-1)+V_D\n",
+ "##5=(10^-13)*(2000)*(exp(V_D/V_T)-1)+V_D\n",
+ "##let right side of equation be x=(10^-13)*(2000)*(exp(V_D/V_T)-1)+V_D\n",
+ "V_D=0.6;##(V)\n",
+ "x=(10**-13)*(2000.)*(math.exp(V_D/V_T)-1.)+V_D\n",
+ "##so the equation is not balanced\n",
+ "V_D=0.65;##(V)\n",
+ "x=(10**-13)*(2000.)*(math.exp(V_D/V_T)-1.)+V_D\n",
+ "##again equation is not balanced .solution for V_D is between 0.6V and 0.65V\n",
+ "V_D=0.619;##(V)\n",
+ "x=(10**-13)*(2000.)*(math.exp(V_D/V_T)-1.)+V_D\n",
+ "##essentially equal to the value of the left side of the equation i.e 5V\n",
+ "print\"%s %.2f %s\"%('\\ndiode voltage= ',V_D,' V')\n",
+ "I_D=(V_PS-V_D)/R;##(A)diode current\n",
+ "print\"%s %.2f %s\"%('\\nthe diode current= ',I_D,' mA')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "diode voltage= 0.62 V\n",
+ "\n",
+ "the diode current= 2.19 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7-pg28"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#calculate the \n",
+ "##Example 1.7\n",
+ "##piecewise linear diode parameters\n",
+ "V_Y=0.6;##(V)\n",
+ "r_f=0.010;##(KOhm)\n",
+ "V_PS=5.;##(V)applied voltage\n",
+ "R=2.;##(KOhm)Resistance in circuit\n",
+ "I_D=(V_PS-V_Y)/(R+r_f);##(A)diode current\n",
+ "print\"%s %.2f %s\"%('\\nthe diode current= ',I_D,' mA\\n')\n",
+ "V_D=V_Y+I_D*r_f;##(V)diode voltage\n",
+ "print\"%s %.2f %s\"%('\\ndiode voltage= ',V_D,' V')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "the diode current= 2.19 mA\n",
+ "\n",
+ "\n",
+ "diode voltage= 0.62 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex9-pg33"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#calculate the \n",
+ "##Example 1.9 \n",
+ "##circuit and diode parameters \n",
+ "V_PS=5.;##(V)\n",
+ "R=5;##(KOhm)\n",
+ "V_Y=0.6;##(V)\n",
+ "V_T=0.026;##(Volt)terminal voltage\n",
+ "v_i=0.1##*sin(wt)Volt\n",
+ "##dc analysis\n",
+ "I_DQ=(V_PS-V_Y)/R;\n",
+ "print\"%s %.2f %s\"%('\\ndc quiescent current= ',I_DQ,' mA\\n')\n",
+ "V_O=I_DQ*R;\n",
+ "print\"%s %.2f %s\"%('\\ndc output voltage= ',V_O,' V\\n')\n",
+ "##ac analysis\n",
+ "V_PS=0.;\n",
+ "##Kirchhoff voltage law equation becomes\n",
+ "##v_i=i_d*r_d+i_d*R\n",
+ "r_d=V_T/I_DQ##(Ohm)small signal diode diffusion resistance\n",
+ "i_d=v_i/(r_d+R);##ac diode current\n",
+ "print\"%s %.2f %s\"%('\\nac diode current= ',i_d,'sin(wt) A\\n')\n",
+ "\n",
+ "v_o=i_d*R;##ac output voltage\n",
+ "print\"%s %.2f %s\"%('\\nac output voltage= ',v_o,'sin(wt) V')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "dc quiescent current= 0.88 mA\n",
+ "\n",
+ "\n",
+ "dc output voltage= 4.40 V\n",
+ "\n",
+ "\n",
+ "ac diode current= 0.02 sin(wt) A\n",
+ "\n",
+ "\n",
+ "ac output voltage= 0.10 sin(wt) V\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex10-pg38"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#calculate the \n",
+ "##Example 1.10\n",
+ "V_Y=0.7;##(V)cut in voltage for pn junction\n",
+ "r_f=0.;\n",
+ "V_PS=4;##(V)\n",
+ "R1=4.\n",
+ "R2=4.##(KOhm) from given circuit\n",
+ "I1=(V_PS-V_Y)/R1;\n",
+ "print\"%s %.2f %s\"%('\\ncurrent through pn junction diode= ',I1,' mA\\n')\n",
+ "V_Y=0.3;##(V)cut in voltage for Schottky diode\n",
+ "I2=(V_PS-V_Y)/R2;\n",
+ "print\"%s %.2f %s\"%('\\ncurrent through Schottky diode= ',I2,' mA\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "current through pn junction diode= 0.82 mA\n",
+ "\n",
+ "\n",
+ "current through Schottky diode= 0.93 mA\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex11-pg40"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#calculate the \n",
+ "##Example 1.11 \n",
+ "V_Z=5.6;##(V)Zener diode breakdown voltage\n",
+ "r_z=0.;##(Ohm)Zener resistance\n",
+ "I=3.;##(mA)current in the diode\n",
+ "V_PS=10.;##(V)\n",
+ "##I=(V_PS-V_Z)/R\n",
+ "R=(V_PS-V_Z)/I;\n",
+ "print\"%s %.2f %s\"%('\\nresistance= ',R,' KOhm\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "resistance= 1.47 KOhm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter2_1.ipynb b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter2_1.ipynb new file mode 100644 index 00000000..deae3c71 --- /dev/null +++ b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter2_1.ipynb @@ -0,0 +1,407 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:230e38613ff389c9b83b1ccaac7bd389b698eb1c9fba0f06950798a22a773eaf"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter2-Diode Circuits"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg55"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ " \n",
+ "##Example 2.1\n",
+ "v_I=120.;##(V)rms primary input \n",
+ "v_o=9.;##(V)peak output voltage\n",
+ "V_Y=0.7;##(V)diode cut in voltage\n",
+ "##for center-tapped transformer circuit in fig.2.6(a)\n",
+ "v_S=v_o+V_Y##(V)peak value of secondary voltage\n",
+ "print\"%s %.2f %s\"%('\\npeak value of secondary voltage= ',v_S,' V\\n')\n",
+ "v_S_rms=v_S/math.sqrt(2)##for a sinusoidal signal rms value of v_S\n",
+ "print\"%s %.2f %s\"%('\\nrms value of v_S= ',v_S_rms,' V\\n')\n",
+ "##let turns ratio of the primary to secondary winding be x=N1/N2\n",
+ "x=v_I/v_S_rms;\n",
+ "print\"%s %.2f %s\"%('\\nturns ratio= \\n',x,'')\n",
+ "##for the bridge circuit in fig.2.7(a)\n",
+ "v_Sb=v_o+2*V_Y;##(V)peak value of secondary voltage\n",
+ "print\"%s %.2f %s\"%('\\npeak value of secondary voltage= ',v_Sb,' V\\n')\n",
+ "v_S_rms=v_Sb/math.sqrt(2.);##for a sinusoidal signal rms value of v_S\n",
+ "print\"%s %.2f %s\"%('\\nrms value of v_S= ',v_S_rms,' V\\n')\n",
+ "##let turns ratio of the primary to secondary winding be x=N1/N2\n",
+ "x=v_I/v_S_rms;\n",
+ "print\"%s %.2f %s\"%('\\nturns ratio=\\n',x,'')\n",
+ "##for center tapped rectifier\n",
+ "PIV=2*v_S-V_Y;\n",
+ "print\"%s %.2f %s\"%('\\npeak inverse voltage of a diode= ',PIV,' V\\n')\n",
+ "##for the bridge rectifier peak inverse voltage of a diode\n",
+ "PIV=v_Sb-V_Y;\n",
+ "print\"%s %.2f %s\"%('\\npeak inverse voltage of a diode=\\n',PIV,'V')\n",
+ "##advantage of bridge rectifier over center tapped rectifier is it requies only half of the turns\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "peak value of secondary voltage= 9.70 V\n",
+ "\n",
+ "\n",
+ "rms value of v_S= 6.86 V\n",
+ "\n",
+ "\n",
+ "turns ratio= \n",
+ " 17.50 \n",
+ "\n",
+ "peak value of secondary voltage= 10.40 V\n",
+ "\n",
+ "\n",
+ "rms value of v_S= 7.35 V\n",
+ "\n",
+ "\n",
+ "turns ratio=\n",
+ " 16.32 \n",
+ "\n",
+ "peak inverse voltage of a diode= 18.70 V\n",
+ "\n",
+ "\n",
+ "peak inverse voltage of a diode=\n",
+ " 9.70 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg59"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 2.2\n",
+ "##full wave rectifier circuit with 60Hz input signal\n",
+ "V_M=10.;##(V)peak output voltage\n",
+ "R=0.01;##(MOhm)output load resistance\n",
+ "f=60.;##Hz\n",
+ "V_r=0.2;##(V)ripple voltage\n",
+ "C=V_M/(2.*f*R*V_r);##capacitance\n",
+ "print\"%s %.2f %s\"%('\\ncapacitance= ',C,' microF\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "capacitance= 41.67 microF\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg61"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ " \n",
+ "##Example 2.3\n",
+ "V_O=12.;##(V)peak output voltage\n",
+ "I_L=0.12;##(A)current delivered to the load\n",
+ "R=V_O/I_L;\n",
+ "print\"%s %.2f %s\"%('\\neffective load resistance= ',R,' Ohm\\n')\n",
+ "V_Y=0.7;##(V)diode cut in voltage\n",
+ "v_S=V_O+2.*V_Y;\n",
+ "print\"%s %.2f %s\"%('\\npeak value of v_S= ',v_S,' V\\n')\n",
+ "v_Srms=v_S/math.sqrt(2.);\n",
+ "print\"%s %.2f %s\"%('\\nrms voltage= ',v_Srms,' V\\n')\n",
+ "##let x=N1/N2\n",
+ "Vin=120.;##(V)input line voltage\n",
+ "x=Vin/v_Srms;\n",
+ "print\"%s %.2f %s\"%('\\nturns ratio= \\n',x,'')\n",
+ "VM=12.;##(V)\n",
+ "Vr=5/100.*VM;\n",
+ "print\"%s %.2f %s\"%('\\nripple voltage= ',Vr,' V\\n')\n",
+ "f=60.;##(Hz) input frequency\n",
+ "C=VM/(2.*R*Vr*f);\n",
+ "print\"%s %.2f %s\"%('\\nfilter capacitance= ',C,' F\\n')\n",
+ "i_Dmax=(VM/R)*(1+2*math.pi*math.sqrt(VM/(2.*Vr)));\n",
+ "print\"%s %.2f %s\"%('\\npeak diode current= ',i_Dmax,' A\\n')\n",
+ "R=0.1;##Kohm\n",
+ "i_Davg=(1/(2.*math.pi))*math.sqrt(2.*Vr/VM)*((VM/R)*(1.+math.pi*math.sqrt(VM/(2.*Vr))));\n",
+ "print\"%s %.2f %s\"%('\\naverage diode current= ',i_Davg,' mA\\n')\n",
+ "PIV=v_S-V_Y;\n",
+ "print\"%s %.2f %s\"%('\\npeak inverse voltage= ',PIV,' V\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "effective load resistance= 100.00 Ohm\n",
+ "\n",
+ "\n",
+ "peak value of v_S= 13.40 V\n",
+ "\n",
+ "\n",
+ "rms voltage= 9.48 V\n",
+ "\n",
+ "\n",
+ "turns ratio= \n",
+ " 12.66 \n",
+ "\n",
+ "ripple voltage= 0.60 V\n",
+ "\n",
+ "\n",
+ "filter capacitance= 0.00 F\n",
+ "\n",
+ "\n",
+ "peak diode current= 2.50 A\n",
+ "\n",
+ "\n",
+ "average diode current= 66.04 mA\n",
+ "\n",
+ "\n",
+ "peak inverse voltage= 12.70 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5-pg68"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 2.5\n",
+ "rZ=4.;##(Ohm) Zener resistance\n",
+ "V_Lnom=9.;##(V) nominal output voltage\n",
+ "Izmax=0.3;##(A) maximum zener diode current\n",
+ "Izmin=0.03;##(A) minimum zener diode current\n",
+ "V_Lmax=V_Lnom+Izmax*rZ\n",
+ "V_Lmin=V_Lnom+Izmin*rZ\n",
+ "##percent regulation R\n",
+ "R=((V_Lmax-V_Lmin)/V_Lnom)*100.;\n",
+ "print\"%s %.2f %s\"%('\\npercent regulation= ',R,' \\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "percent regulation= 12.00 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex8-pg77"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 2.8\n",
+ "R1=5.;R2=10.;##(KOhm) \n",
+ "V_Y=0.7;##(V)diode cut in voltage\n",
+ "V1=5.;V2=-5;##(V)\n",
+ "vt=0.;##(V)\n",
+ "##asssuming initially diode D1 is off\n",
+ "##iR1=iD2=iR2=V1-V2-V_Y/(R1+R2)\n",
+ "iD2=(V1-V2-V_Y)/(R1+R2);\n",
+ "print\"%s %.2f %s\"%('\\ndiode current= ',iD2,'mA\\n')\n",
+ "iR1=iD2;\n",
+ "vo=V1-iR1*R1;\n",
+ "print\"%s %.2f %s\"%('\\noutput voltage= ',vo,' V\\n')\n",
+ "v=vo-V_Y;##v=v'\n",
+ "print\"%s %.2f %s\"%('\\nVoltage= ',v,' V\\n')\n",
+ "vt=4.;##(V)fig.2.33\n",
+ "##both D1 and D2 are on\n",
+ "vo==vt;\n",
+ "vo=4.;\n",
+ "iD2=(V1-vo)/R1;\n",
+ "print\"%s %.2f %s\"%('\\ndiode current= ',iD2,' mA\\n')\n",
+ "iR1==iD2;\n",
+ "v=vo-V_Y;\n",
+ "print\"%s %.2f %s\"%('\\nV= ',v,' V\\n')\n",
+ "iR2=(v-V2)/R2;\n",
+ "print\"%s %.2f %s\"%('\\niR2= ',iR2,' mA\\n')\n",
+ "iD1=iR2-iD2;\n",
+ "print\"%s %.2f %s\"%('\\ncurrent through D1= ',iD1,' mA\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "diode current= 0.62 mA\n",
+ "\n",
+ "\n",
+ "output voltage= 1.90 V\n",
+ "\n",
+ "\n",
+ "Voltage= 1.20 V\n",
+ "\n",
+ "\n",
+ "diode current= 0.20 mA\n",
+ "\n",
+ "\n",
+ "V= 3.30 V\n",
+ "\n",
+ "\n",
+ "iR2= 0.83 mA\n",
+ "\n",
+ "\n",
+ "current through D1= 0.63 mA\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex10-pg83"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 2.10\n",
+ "n=1.;##quantum efficiency\n",
+ "A=10**-2;##cm^2 junction area\n",
+ "p=5*10**17;##(cm^-2-s^-1) incident photon flux\n",
+ "e=1.6*10**-16;##charge of an electron\n",
+ "Iph=n*e*p*A;\n",
+ "print\"%s %.2f %s\"%('\\nphotocurrent= ',Iph,' mA\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "photocurrent= 0.80 mA\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex11-pg84"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 2.11\n",
+ "I=0.01;##(A) diode current\n",
+ "V_Y=1.7;##(V) forward bias voltage drop\n",
+ "Vt=0.2;##(V)\n",
+ "R=(5.-V_Y-Vt)/I;\n",
+ "print\"%s %.2f %s\"%('\\nresistance= ',R,' Ohm')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "resistance= 310.00 Ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter3_1.ipynb b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter3_1.ipynb new file mode 100644 index 00000000..2cf8c2a1 --- /dev/null +++ b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter3_1.ipynb @@ -0,0 +1,990 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:28e8a6daf4511e5943012a63f0712d999ea35abe1d000868606263c23a5458a4"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter3-The Bipolar Junction Transistor"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pgpg104"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "\n",
+ "##Example 3.1\n",
+ "##let beta be \"b\"\n",
+ "b=150.;##common emitter current gain\n",
+ "iB=15*10**-3;##(mA) base current\n",
+ "##assume transistor biased in forward active mode\n",
+ "iC=b*iB;\n",
+ "print\"%s %.2f %s\"%('\\ncollector current= ',iC,' mA\\n')\n",
+ "iE=(1.+b)*iB;\n",
+ "print\"%s %.2f %s\"%('\\nemitter current= ',iE,' mA\\n')\n",
+ "a=b/(1.+b);\n",
+ "print\"%s %.2f %s\"%('\\ncommon base current gain=',a,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "collector current= 2.25 mA\n",
+ "\n",
+ "\n",
+ "emitter current= 2.27 mA\n",
+ "\n",
+ "\n",
+ "common base current gain= 0.99 \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg113"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#calculate the \n",
+ "##Example 3.2\n",
+ "b=100.;##common emitter current gain\n",
+ "BVcbo=120.;##(V) break down voltage of the B-C junction\n",
+ "n=3.;##empirical constant\n",
+ "BVceo=BVcbo/(b)**(1./n);\n",
+ "print\"%s %.2f %s\"%('\\nbreakdown voltage= ',BVceo,' V\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "breakdown voltage= 25.85 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg115"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 3.3\n",
+ "Vbb=4.;##(V)\n",
+ "Rb=220.##(KOhm);\n",
+ "Rc=2.;##(KOhm)\n",
+ "Vcc=10.;##(V)\n",
+ "Vbe=0.7;##(V)\n",
+ "b=200.;\n",
+ "##from fig.3.19(b)\n",
+ "Ib=(Vbb-Vbe)/Rb;\n",
+ "print\"%s %.2f %s\"%('\\nbase current= ',Ib,' mA\\n')\n",
+ "Ic=b*Ib;\n",
+ "print\"%s %.2f %s\"%('\\ncollector current= ',Ic,' mA\\n')\n",
+ "Ie=(1.+b)*Ib;\n",
+ "print\"%s %.2f %s\"%('\\nemitter current= ',Ie,' mA\\n')\n",
+ "Vce=Vcc-Ic*Rc;\n",
+ "print\"%s %.2f %s\"%('\\ncollector emitter voltage= ',Vce,' V\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "base current= 0.01 mA\n",
+ "\n",
+ "\n",
+ "collector current= 3.00 mA\n",
+ "\n",
+ "\n",
+ "emitter current= 3.01 mA\n",
+ "\n",
+ "\n",
+ "collector emitter voltage= 4.00 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg116"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 3.4\n",
+ "Vbb=1.5;##(V)\n",
+ "Rb=580.;##(KOhm)\n",
+ "Veb=0.6;##(V)\n",
+ "Vcc=5.;##(V)\n",
+ "b=100.;\n",
+ "##writing Kirchhoff voltage law equation around E-B loop\n",
+ "Ib=(Vcc-Veb-Vbb)/Rb;\n",
+ "print\"%s %.2f %s\"%('\\nbase current= ',Ib,' mA\\n')\n",
+ "Ic=b*Ib;\n",
+ "print\"%s %.2f %s\"%('\\ncollector current= ',Ic,' mA\\n')\n",
+ "Ie=(1.+b)*Ib;\n",
+ "print\"%s %.2f %s\"%('\\nemitter current=',Ie,' mA\\n')\n",
+ "Vec=(1./2.)*Vcc;\n",
+ "print\"%s %.2f %s\"%('\\nce voltage= ',Vec,' V\\n')\n",
+ "Rc=(Vcc-Vec)/Ic;\n",
+ "print\"%s %.2f %s\"%('\\ncollector resistance= ',Rc,' KOhm\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "base current= 0.01 mA\n",
+ "\n",
+ "\n",
+ "collector current= 0.50 mA\n",
+ "\n",
+ "\n",
+ "emitter current= 0.51 mA\n",
+ "\n",
+ "\n",
+ "ce voltage= 2.50 V\n",
+ "\n",
+ "\n",
+ "collector resistance= 5.00 KOhm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5-pg119"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 3.5\n",
+ "b=100.;\n",
+ "Vbe=0.7;##(V)\n",
+ "Vce=0.2;##(V)\n",
+ "Vbb=8.;##(v)\n",
+ "Rb=220.;##(KOhm)\n",
+ "Ib=(Vbb-Vbe)/Rb\n",
+ "print\"%s %.2f %s\"%('\\nbase current= ',Ib,' mA\\n')\n",
+ "##transistor in active region\n",
+ "Ic=b*Ib;\n",
+ "print\"%s %.2f %s\"%('\\ncollector current= ',Ic,' mA\\n')\n",
+ "Vcc=10.;##(V)\n",
+ "Rc=4.;##(KOhm)\n",
+ "Vce=Vcc-Ic*Rc;\n",
+ "print\"%s %.2f %s\"%('\\ncollector emitter voltage= ',Vce,' V\\n')\n",
+ "##saturation\n",
+ "Vce=0.2;##(V)\n",
+ "Ic=(Vcc-Vce)/Rc;\n",
+ "print\"%s %.2f %s\"%('\\nsaturation collector current= ',Ic,' mA\\n')\n",
+ "x=Ic/Ib\n",
+ "##which is <b\n",
+ "Ie=Ic+Ib;\n",
+ "print\"%s %.2f %s\"%('\\nemitter current= ',Ie,' mA\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "base current= 0.03 mA\n",
+ "\n",
+ "\n",
+ "collector current= 3.32 mA\n",
+ "\n",
+ "\n",
+ "collector emitter voltage= -3.27 V\n",
+ "\n",
+ "\n",
+ "saturation collector current= 2.45 mA\n",
+ "\n",
+ "\n",
+ "emitter current= 2.48 mA\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6-pg122"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "import numpy\n",
+ "import matplotlib\n",
+ "from matplotlib import pyplot\n",
+ "import math\n",
+ "%matplotlib inline\n",
+ "import warnings\n",
+ "warnings.filterwarnings('ignore')\n",
+ "#calculate the \n",
+ "##Example 3.6\n",
+ "Vbe=0.7;\n",
+ "b=75.;\n",
+ "##Q point values::\n",
+ "##using KVL eq around the B-E loop\n",
+ "##Vbb=Ib*Re+Vbe+Ie*Re\n",
+ "##assuming transistor is in forward biased mode we can write Ie=(1+b)*Ib\n",
+ "Vbb=6.;\n",
+ "Rb=25.;##KOhm\n",
+ "Re=0.6;##KOhm\n",
+ "Ib=(Vbb-Vbe)/(Rb+(1.+b)*Re);\n",
+ "print\"%s %.2f %s\"%('\\nbase current= ',Ib,' mA\\n')\n",
+ "Ic=b*Ib;\n",
+ "print\"%s %.2f %s\"%('\\ncollector current= ',Ic,' mA\\n')\n",
+ "Ie=(1+b)*Ib;\n",
+ "print\"%s %.2f %s\"%('\\nemitter current= ',Ie,' mA\\n')\n",
+ "Vcc=12.;\n",
+ "Rc=0.4;\n",
+ "Vce=Vcc-Ic*Rc-Ie*Re;\n",
+ "print\"%s %.2f %s\"%('\\ncollector emitter voltage= ',Vce,' V\\n')\n",
+ "##load line::\n",
+ "##using KVL law around C-E loop\n",
+ "##Vce=Vcc-(Ic*(Rc+((1+B)/B)*Re));\n",
+ "Ic=numpy.array([0.12,5.63])\n",
+ "Vce=12.-(Ic)*1\n",
+ "pyplot.plot(Vce,Ic)\n",
+ "pyplot.xlabel(\"Vce\")\n",
+ "pyplot.ylabel(\"Ic\")\n",
+ "pyplot.show()\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "base current= 0.08 mA\n",
+ "\n",
+ "\n",
+ "collector current= 5.63 mA\n",
+ "\n",
+ "\n",
+ "emitter current= 5.71 mA\n",
+ "\n",
+ "\n",
+ "collector emitter voltage= 6.32 V\n",
+ "\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "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\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x71a3ed0>"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7-pg123"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "import numpy\n",
+ "import matplotlib\n",
+ "from matplotlib import pyplot\n",
+ "#calculate the \n",
+ "##Example 3.7\n",
+ "Vbe=0.65;\n",
+ "Vcc=5.;\n",
+ "Rc=0.5;##KOhm\n",
+ "b=100.;\n",
+ "V1=-5.;\n",
+ "Re=1.;##KOhm\n",
+ "## Q-point values :: writing KVL eq around B-E loop\n",
+ "Ie=(-V1-Vbe)/Re;\n",
+ "print\"%s %.2f %s\"%('\\nemitter current= ',Ie,' mA\\n')\n",
+ "Ib=(Ie/(1.+b));\n",
+ "print\"%s %.2f %s\"%('\\nbase current= ',Ib,' mA\\n')\n",
+ "Ic=(b/(1.+b))*Ie;\n",
+ "print\"%s %.2f %s\"%('\\ncollector current= ',Ic,' mA\\n')\n",
+ "Vce=Vcc-Ic*Rc-Ie*Re-V1;\n",
+ "print\"%s %.2f %s\"%('\\ncollector emitter voltage= ',Vce,' V\\n')\n",
+ "##load line::\n",
+ "##Vce=Vcc-V1-(Ic*(Rc+((1+B)/B)*Re));\n",
+ "\n",
+ "Vce=numpy.array([0,2,3.5,4,6,8,10])\n",
+ "Ic=(10.-Vce)/1.51;\n",
+ "\n",
+ "\n",
+ "pyplot.plot(Vce,Ic)\n",
+ "pyplot.xlabel(\"Vce\")\n",
+ "pyplot.ylabel(\"Ic\")\n",
+ "\n",
+ "pyplot.title(\"load line\")\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "emitter current= 4.35 mA\n",
+ "\n",
+ "\n",
+ "base current= 0.04 mA\n",
+ "\n",
+ "\n",
+ "collector current= 4.31 mA\n",
+ "\n",
+ "\n",
+ "collector emitter voltage= 3.50 V\n",
+ "\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "pyout",
+ "prompt_number": 20,
+ "text": [
+ "<matplotlib.text.Text at 0x6f909d0>"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "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\n/T96Dpvfmjsi0wAAAABJRU5ErkJggg==\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x6f80db0>"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex9-pg128"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "import numpy\n",
+ "import matplotlib\n",
+ "from matplotlib import pyplot\n",
+ "#calculate the \n",
+ "##Example 3.9\n",
+ "b=100.;\n",
+ "Vbe=0.7;\n",
+ "V1=-5.;\n",
+ "V2=12.;\n",
+ "Rb=10.;\n",
+ "Re=5.;\n",
+ "Rc=5.;\n",
+ "Rl=5.;\n",
+ "##Q point values:: using KVL eq around B-E loop\n",
+ "Ib=-(V1+Vbe)/(Rb+(1.+b)*Re);\n",
+ "print\"%s %.2f %s\"%('\\nbase current= ',Ib,' mA\\n')\n",
+ "Ic=b*Ib;\n",
+ "print\"%s %.2f %s\"%('\\ncollector current= ',Ic,' mA\\n')\n",
+ "Ie=(1.+b)*Ib;\n",
+ "print\"%s %.2f %s\"%('\\nemitter current= ',Ie,' mA\\n')\n",
+ "##at collector node we can write Ic=(V2-Vo)/Rc-Vo/Rl\n",
+ "Vo=(V2/Rc-Ic)*Rc*Rl/(Rc+Rl);\n",
+ "print\"%s %.2f %s\"%('\\noutput voltage= ',Vo,' V\\n')\n",
+ "Vce=Vo-Ie*Re-V1;\n",
+ "print\"%s %.2f %s\"%('\\ncollector emitter voltage= ',Vce,' V\\n')\n",
+ "##load line::\n",
+ "Rth=Rl*Rc/(Rl+Rc);\n",
+ "print\"%s %.2f %s\"%('\\nThevenin rquivalent resistance= ',Rth,' KOhm\\n')\n",
+ "Vth=(Rl/(Rl+Rc))*V2;\n",
+ "print\"%s %.2f %s\"%('\\nThevenin equivalent voltage= ',Vth,' V\\n')\n",
+ "##fig.3.36(c) KVL law\n",
+ "##Vce=6-V1-Ic*Rth-Ie*Re;\n",
+ "\n",
+ "\n",
+ "\n",
+ "Vce=numpy.array([0,2,4.7,3.5,4,6,8,10])\n",
+ "Ic=(11.-Vce)/7.5;\n",
+ "\n",
+ "\n",
+ "pyplot.plot(Vce,Ic)\n",
+ "pyplot.xlabel(\"Vce\")\n",
+ "pyplot.ylabel(\"Ic\")\n",
+ "pyplot.title(\"load line\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "base current= 0.01 mA\n",
+ "\n",
+ "\n",
+ "collector current= 0.83 mA\n",
+ "\n",
+ "\n",
+ "emitter current= 0.84 mA\n",
+ "\n",
+ "\n",
+ "output voltage= 3.91 V\n",
+ "\n",
+ "\n",
+ "collector emitter voltage= 4.70 V\n",
+ "\n",
+ "\n",
+ "Thevenin rquivalent resistance= 2.50 KOhm\n",
+ "\n",
+ "\n",
+ "Thevenin equivalent voltage= 6.00 V\n",
+ "\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "pyout",
+ "prompt_number": 21,
+ "text": [
+ "<matplotlib.text.Text at 0x6fe9af0>"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "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\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x6f80950>"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex10-pg132"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#calculate the \n",
+ "##Example 3.10\n",
+ "Rb=0.24;\n",
+ "Vcc=12.;\n",
+ "Vbe=0.7;\n",
+ "Vce=0.1;\n",
+ "b=75.;\n",
+ "Rc=5.;##Ohm\n",
+ "##for Vt=0 ,transistor is cut off,Ib=Ic=0,Vo=Vcc=12 V,power dissipation is zero\n",
+ "Vt=12.;##(V)\n",
+ "Ib=(Vt-Vbe)/Rb;\n",
+ "print\"%s %.2f %s\"%('\\nbase current= ',Ib,' mA\\n')\n",
+ "Ic=(Vcc-Vce)/Rc;\n",
+ "print\"%s %.2f %s\"%('\\ncollector current= ',Ic,'A\\n')\n",
+ "Ib=0.0471;##A\n",
+ "x=Ic/Ib\n",
+ "##since Ic/Ib<b transistor is in saturation\n",
+ "##Vo==Vcc;\n",
+ "Vo=0.1;\n",
+ "print\"%s %.2f %s\"%('\\noutput voltage= ',Vo,' V\\n')\n",
+ "P=Ic*Vce+Ib*Vbe;\n",
+ "print\"%s %.2f %s\"%('\\npower dissipation= ',P,' W\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "base current= 47.08 mA\n",
+ "\n",
+ "\n",
+ "collector current= 2.38 A\n",
+ "\n",
+ "\n",
+ "output voltage= 0.10 V\n",
+ "\n",
+ "\n",
+ "power dissipation= 0.27 W\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex13-pg138"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 3.13\n",
+ "b=100.;\n",
+ "Vcc=12.;\n",
+ "Vbe=0.7;\n",
+ "Icq=1.;##mA\n",
+ "Vceq=6.;\n",
+ "Rc=(Vcc-Vceq)/Icq;\n",
+ "print\"%s %.2f %s\"%('\\ncollector resistance= ',Rc,' KOhms\\n')\n",
+ "Ibq=Icq/b;\n",
+ "print\"%s %.2f %s\"%('\\nbase current= ',Ibq,' mA\\n')\n",
+ "Rb=(Vcc-Vbe)/Ibq;\n",
+ "print\"%s %.2f %s\"%('\\nbase resistance= ',Rb,' KOhms\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "collector resistance= 6.00 KOhms\n",
+ "\n",
+ "\n",
+ "base current= 0.01 mA\n",
+ "\n",
+ "\n",
+ "base resistance= 1130.00 KOhms\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex14-pg141"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 3.14\n",
+ "R1=56.;\n",
+ "R2=12.2;\n",
+ "Rc=2.;\n",
+ "Re=.4;\n",
+ "Vcc=10.;\n",
+ "Vbe=0.7;\n",
+ "b=100.;\n",
+ "##fig.3.53(b)\n",
+ "Rth=R2*R1/(R1+R2);\n",
+ "print\"%s %.2f %s\"%('\\nThevenin rquivalent resistance= ',Rth,' KOhm\\n')\n",
+ "Vth=(R2/(R1+R2))*Vcc;\n",
+ "print\"%s %.2f %s\"%('\\nThevenin equivalent voltage= ',Vth,' V\\n')\n",
+ "Ibq=(Vth-Vbe)/(Rth+(1.+b)*Re);\n",
+ "print\"%s %.2f %s\"%('\\nbase current= ',Ibq,' mA\\n')\n",
+ "Icq=b*Ibq;\n",
+ "print\"%s %.2f %s\"%('\\ncollector current= ',Icq,' mA\\n')\n",
+ "Ieq=(1.+b)*Ibq;\n",
+ "print\"%s %.2f %s\"%('\\nemitter current= ',Ieq,' mA\\n')\n",
+ "Vceq=Vcc-Icq*Rc-Ieq*Re;\n",
+ "print\"%s %.2f %s\"%('\\ncollector emitter voltage= ',Vceq,' V\\n')\n",
+ "b=numpy.array([50,100,150])\n",
+ "for x in range(0,150):\n",
+ " Ibq=(Vth-Vbe)/(Rth+(1.+x)*Re);\n",
+ "print(\"Ibeq,Iceq,Ieq,Vceq\")\n",
+ "print(Ibq)\n",
+ "Icq=x*Ibq;\n",
+ "print(Icq)\n",
+ "Ieq=(1+x)*Ibq;\n",
+ "print(Ieq)\n",
+ "Vceq=Vcc-Icq*Rc-Ieq*Re;\n",
+ "print(Vceq)\n",
+ "print(\"\")\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Thevenin rquivalent resistance= 10.02 KOhm\n",
+ "\n",
+ "\n",
+ "Thevenin equivalent voltage= 1.79 V\n",
+ "\n",
+ "\n",
+ "base current= 0.02 mA\n",
+ "\n",
+ "\n",
+ "collector current= 2.16 mA\n",
+ "\n",
+ "\n",
+ "emitter current= 2.18 mA\n",
+ "\n",
+ "\n",
+ "collector emitter voltage= 4.81 V\n",
+ "\n",
+ "Ibeq,Iceq,Ieq,Vceq\n",
+ "0.0155511811024\n",
+ "2.31712598425\n",
+ "2.33267716535\n",
+ "4.43267716535\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex15-pg142"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 3.15\n",
+ "Vcc=5.;\n",
+ "Rc=1.;##KOhm\n",
+ "Vbe=0.7;\n",
+ "b=120.;\n",
+ "Vceq=3.;\n",
+ "Re=.510;\n",
+ "Icq=(Vcc-Vceq)/(Rc+Re);\n",
+ "print\"%s %.2f %s\"%('\\ncollector current= ',Icq,' mA\\n')\n",
+ "Ibq=Icq/b;\n",
+ "print\"%s %.2f %s\"%('\\nbase current= ',Ibq,' mA\\n')\n",
+ "##for bias stable circuit\n",
+ "Rth=0.1*(1.+b)*Re;\n",
+ "print\"%s %.2f %s\"%('\\nThevenin rquivalent resistance= ',Rth,' KOhm\\n')\n",
+ "##Ibq=(Vth-Vbe)/(Rth+(1+b)*Re)\n",
+ "Vth=Ibq*(Rth+(1.+b)*Re)+Vbe;\n",
+ "print\"%s %.2f %s\"%('\\nThevenin equivalent voltage= ',Vth,' V\\n')\n",
+ "##Vth=(R2/(R1+R2))*Vcc\n",
+ "##let x=(R2/(R1+R2))\n",
+ "x=Vth/Vcc\n",
+ "##Rth=6050=R1*x\n",
+ "R1=6.05/x;\n",
+ "print\"%s %.2f %s\"%('\\nR1= ',R1,'KOhms\\n')\n",
+ "R2=x*R1/(1-x);\n",
+ "print\"%s %.2f %s\"%('\\nR2= ',R2,'KOhms\\'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "collector current= 1.32 mA\n",
+ "\n",
+ "\n",
+ "base current= 0.01 mA\n",
+ "\n",
+ "\n",
+ "Thevenin rquivalent resistance= 6.17 KOhm\n",
+ "\n",
+ "\n",
+ "Thevenin equivalent voltage= 1.45 V\n",
+ "\n",
+ "\n",
+ "R1= 20.87 KOhms\n",
+ "\n",
+ "\n",
+ "R2= 8.52 KOhms'\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex16-pg146"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 3.16\n",
+ "R1=10.;\n",
+ "b=50.;\n",
+ "Vbe=0.7;\n",
+ "V1=-5.;\n",
+ "I1=-(V1+Vbe)/R1;\n",
+ "print\"%s %.2f %s\"%('\\nreference current= ',I1,' mA\\n')\n",
+ "Iq=I1/(1.+2./b);\n",
+ "print\"%s %.2f %s\"%('\\nbias current= ',Iq,' mA\\n')\n",
+ "##Ib=Ib1=Ib2\n",
+ "Ib=Iq/b;\n",
+ "print\"%s %.2f %s\"%('\\nbase current= ',Ib,' mA\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "reference current= 0.43 mA\n",
+ "\n",
+ "\n",
+ "bias current= 0.41 mA\n",
+ "\n",
+ "\n",
+ "base current= 0.01 mA\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex17-pg148"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#calculate the \n",
+ "##Example 3.17\n",
+ "Vbe=0.7;\n",
+ "Vcc=10.;\n",
+ "V2=5.;\n",
+ "b=100.;\n",
+ "R1=100.;\n",
+ "R2=50.;\n",
+ "Re1=2.;\n",
+ "Rth=R2*R1/(R1+R2);\n",
+ "print\"%s %.2f %s\"%('\\nThevenin rquivalent resistance= ',Rth,' KOhm\\n')\n",
+ "Vth=(R2/(R1+R2))*Vcc-V2;\n",
+ "print\"%s %.2f %s\"%('\\nThevenin equivalent voltage= ',Vth,' V\\n')\n",
+ "##Vth=Ib1*Rth+Vbe+Ie1*Re1-5 and Ie1=(1+b)*Ib1\n",
+ "Ib1=(Vth+5-Vbe)/(Rth+(1+b)*Re1);\n",
+ "print\"%s %.2f %s\"%('\\nIb1= ',Ib1,' mA\\n')\n",
+ "Ic1=b*Ib1;\n",
+ "print\"%s %.2f %s\"%('\\nIc1= ',Ic1,' mA\\n')\n",
+ "Ie1=(1.+b)*Ib1;\n",
+ "print\"%s %.2f %s\"%('\\nIe1= ',Ie1,' mA\\n')\n",
+ "##summing the currents at the collector of Q1,Ir1+Ib2=Ic1\n",
+ "##(5-Vc1)/Rc1+Ib2=Ic1\n",
+ "##also Ib2=Ie2/(1+b)=(5-(Vc1+0.7))/(1+b)*Re2\n",
+ "Rc1=5.;\n",
+ "Re1=2.;\n",
+ "Re2=2.;\n",
+ "Rc2=1.5;\n",
+ "Vc1=Rc1*(1.+b)*Re2*((5./Rc1)+(4.3/((1.+b)*Re2))-Ic1)/(((1.+b)*Re2)+Rc1);\n",
+ "print\"%s %.2f %s\"%('\\nVc1= ',Vc1,' V\\n')\n",
+ "Ir1=(5.-Vc1)/Rc1;\n",
+ "print\"%s %.2f %s\"%('\\nIr1= ',Ir1,' mA\\n')\n",
+ "Ve2=Vc1+Vbe;\n",
+ "print\"%s %.2f %s\"%('\\nVe2= ',Ve2,' V\\n')\n",
+ "Ie2=(5-Ve2)/Re1;\n",
+ "print\"%s %.2f %s\"%('\\nIe2= ',Ie2,' mA\\n')\n",
+ "Ic2=Ie2*b/(1.+b);\n",
+ "print\"%s %.2f %s\"%('\\nIc2= ',Ic2,' mA\\n')\n",
+ "Ib2=Ie2/(1.+b);\n",
+ "print\"%s %.2f %s\"%('\\nIb2 ',Ib2,' mA\\n')\n",
+ "Ve1=Ie1*Re1-5;\n",
+ "print\"%s %.2f %s\"%('\\nVe1= ',Ve1,' V\\n')\n",
+ "Vc2=Ic2*Rc2-5.;\n",
+ "print\"%s %.2f %s\"%('\\nVc2= ',Vc2,' V\\n')\n",
+ "Vce1=Vc1-Ve1;\n",
+ "print\"%s %.2f %s\"%('\\nVce1= ',Vce1,'V\\n')\n",
+ "Vec2=Ve2-Vc2;\n",
+ "print\"%s %.2f %s\"%('\\nVec2= ',Vec2,' V\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Thevenin rquivalent resistance= 33.33 KOhm\n",
+ "\n",
+ "\n",
+ "Thevenin equivalent voltage= -1.67 V\n",
+ "\n",
+ "\n",
+ "Ib1= 0.01 mA\n",
+ "\n",
+ "\n",
+ "Ic1= 1.12 mA\n",
+ "\n",
+ "\n",
+ "Ie1= 1.13 mA\n",
+ "\n",
+ "\n",
+ "Vc1= -0.48 V\n",
+ "\n",
+ "\n",
+ "Ir1= 1.10 mA\n",
+ "\n",
+ "\n",
+ "Ve2= 0.22 V\n",
+ "\n",
+ "\n",
+ "Ie2= 2.39 mA\n",
+ "\n",
+ "\n",
+ "Ic2= 2.36 mA\n",
+ "\n",
+ "\n",
+ "Ib2 0.02 mA\n",
+ "\n",
+ "\n",
+ "Ve1= -2.74 V\n",
+ "\n",
+ "\n",
+ "Vc2= -1.45 V\n",
+ "\n",
+ "\n",
+ "Vce1= 2.26 V\n",
+ "\n",
+ "\n",
+ "Vec2= 1.68 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter4_1.ipynb b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter4_1.ipynb new file mode 100644 index 00000000..dfbff5bf --- /dev/null +++ b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter4_1.ipynb @@ -0,0 +1,511 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:a988599b6e2af8c15b7ef7a59b8994eb09ea352b9faa5033a7a9c0aa8c680105"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter4-Basic BJT Amplifiers"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg174"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 4.1\n",
+ "b=100.;\n",
+ "Vcc=12.;\n",
+ "Vbe=0.7;\n",
+ "Rc=6.;\n",
+ "Rb=50.;\n",
+ "Vbb=1.2;\n",
+ "##dc solution\n",
+ "Ibq=(Vbb-Vbe)/Rb;\n",
+ "print\"%s %.2f %s\"%('\\nbase current= ',Ibq,' mA\\n')\n",
+ "Icq=b*Ibq;\n",
+ "print\"%s %.2f %s\"%('\\ncollector current= ',Icq,' mA\\n')\n",
+ "Vceq=Vcc-Icq*Rc;\n",
+ "print\"%s %.2f %s\"%('\\ncollector emitter voltage= ',Vceq,' V\\n')\n",
+ "##transistor is forward biased\n",
+ "##ac solution \n",
+ "V_T=0.026;##(V)\n",
+ "##small signal hybrid pi parameters\n",
+ "r_pi=b*V_T/Icq;\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal resistance= ',r_pi,' KOhm\\n')\n",
+ "g_m=Icq/V_T;\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance= ',g_m,' mA/V\\n')\n",
+ "##Av=Vo/Vs=-(g_m*Rc)*r_pi/(r_pi+Rb)\n",
+ "Av=-(g_m*Rc)*r_pi/(r_pi+Rb);\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal voltage gain=\\n',Av,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "base current= 0.01 mA\n",
+ "\n",
+ "\n",
+ "collector current= 1.00 mA\n",
+ "\n",
+ "\n",
+ "collector emitter voltage= 6.00 V\n",
+ "\n",
+ "\n",
+ "small signal resistance= 2.60 KOhm\n",
+ "\n",
+ "\n",
+ "transconductance= 38.46 mA/V\n",
+ "\n",
+ "\n",
+ "small signal voltage gain=\n",
+ " -11.41 \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg177"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 4.2\n",
+ "V_pi=50.;##(V)\n",
+ "Icq=1.;##(mA)\n",
+ "ro=V_pi/Icq;\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal output resistance= ',ro,' KOhm\\n')\n",
+ "Rc=6.;\n",
+ "g_m=38.5;\n",
+ "r_pi=2.6;\n",
+ "Rb=50.;\n",
+ "Av=-(g_m)*(Rc*ro/(Rc+ro))*r_pi/(r_pi+Rb);\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal voltage gain= \\n',Av,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "small signal output resistance= 50.00 KOhm\n",
+ "\n",
+ "\n",
+ "small signal voltage gain= \n",
+ " -10.19 \n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg190"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 4.4\n",
+ "b=100.;\n",
+ "Vbe=0.7;\n",
+ "Va=100.;\n",
+ "V_T=0.026;##(V)\n",
+ "##from dc analysis\n",
+ "Icq=0.95;\n",
+ "Vceq=6.31;\n",
+ "##ac analysis\n",
+ "r_pi=b*V_T/Icq;\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal resistance= ',r_pi,' KOhm\\n')\n",
+ "g_m=Icq/V_T;\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance= ',g_m,' mA/V\\n')\n",
+ "Rs=0.5;\n",
+ "Rc=6.;\n",
+ "ro=Va/Icq;\n",
+ "print\"%s %.2f %s\"%('\\nro= ',ro,' KOhm\\n')\n",
+ "Av=-g_m*(5.9*r_pi/(5.9+r_pi))/((5.9*r_pi/(r_pi+5.9))+Rs)*ro*Rc/(ro+Rc);\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal voltage gain= ',Av,' \\n')\n",
+ "Ri=5.9*r_pi/(r_pi+5.9);\n",
+ "print\"%s %.2f %s\"%('\\ninput resistance= ',Ri,' KOhm\\n')\n",
+ "Ro=ro*Rc/(ro+Rc);\n",
+ "print\"%s %.2f %s\"%('\\noutput resistance= ',Ro,' KOhm\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "small signal resistance= 2.74 KOhm\n",
+ "\n",
+ "\n",
+ "transconductance= 36.54 mA/V\n",
+ "\n",
+ "\n",
+ "ro= 105.26 KOhm\n",
+ "\n",
+ "\n",
+ "small signal voltage gain= -163.64 \n",
+ "\n",
+ "\n",
+ "input resistance= 1.87 KOhm\n",
+ "\n",
+ "\n",
+ "output resistance= 5.68 KOhm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5-pg194"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 4.5\n",
+ "b=100.;\n",
+ "Vbe=0.7;\n",
+ "Rc=2.;\n",
+ "Rs=0.5;\n",
+ "Icq=2.16;\n",
+ "V_T=0.026;##(V)\n",
+ "Vceq=4.8\n",
+ "##ac solution\n",
+ "r_pi=b*V_T/Icq;\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal resistance= ',r_pi,' KOhm\\n')\n",
+ "g_m=Icq/V_T;\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance= ',g_m,' mA/V\\n')\n",
+ "##since Va=infinity,ro=Va/Icq is also infinity\n",
+ "Re=0.4;\n",
+ "Rib=r_pi+(1.+b)*Re;\n",
+ "print\"%s %.2f %s\"%('\\ninput resistance to the base= ',Rib,' KOhm\\n')\n",
+ "##Ri=R1||R2||Rib\n",
+ "Ri=10.*Rib/(10.+Rib);\n",
+ "print\"%s %.2f %s\"%('\\ninput resistance to the amplifier= ',Ri,' KOhm\\n')\n",
+ "Av=-(1./(r_pi+(1.+b)*Re))*b*Rc*Ri/(Ri+Rs);\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal voltage gain= \\n',Av,'')\n",
+ "##by approximate expression\n",
+ "Av=-Rc/Re;\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal voltage gain= \\n',Av,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "small signal resistance= 1.20 KOhm\n",
+ "\n",
+ "\n",
+ "transconductance= 83.08 mA/V\n",
+ "\n",
+ "\n",
+ "input resistance to the base= 41.60 KOhm\n",
+ "\n",
+ "\n",
+ "input resistance to the amplifier= 8.06 KOhm\n",
+ "\n",
+ "\n",
+ "small signal voltage gain= \n",
+ " -4.53 \n",
+ "\n",
+ "small signal voltage gain= \n",
+ " -5.00 \n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7-pg199"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 4.7\n",
+ "Iq=0.5;\n",
+ "b=120.;\n",
+ "Va=80.;\n",
+ "V_T=0.026;##(V)\n",
+ "rc=120.;##small signal collector resistance (KOhm)\n",
+ "##Icq=Iq\n",
+ "Icq=0.5;\n",
+ "g_m=Icq/V_T;\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance= ',g_m,' mA/V\\n')\n",
+ "ro=Va/Icq;\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal output resistance= ',ro,' KOhm\\n')\n",
+ "Av=-g_m*ro*rc/(ro+rc);\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal voltage gain= ',Av,' \\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "transconductance= 19.23 mA/V\n",
+ "\n",
+ "\n",
+ "small signal output resistance= 160.00 KOhm\n",
+ "\n",
+ "\n",
+ "small signal voltage gain= -1318.68 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex8-pg201"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 4.8\n",
+ "b=150.;Veb=0.7;\n",
+ "##dc solution\n",
+ "V2=10.;\n",
+ "V1=-10.;\n",
+ "V_T=0.026;##(V)\n",
+ "Rc=5.;\n",
+ "Rb=50.;\n",
+ "Re=10.;\n",
+ "Ibq=(V2-Veb)/(Rb+(1.+b)*Re);\n",
+ "print\"%s %.2f %s\"%('\\nbase current ',Ibq,' mA\\n')\n",
+ "Icq=b*Ibq;\n",
+ "print\"%s %.2f %s\"%('\\ncollector current= ',Icq,' mA\\n')\n",
+ "Ieq=(1.+b)*Ibq;\n",
+ "print\"%s %.2f %s\"%('\\nemitter current= ',Ieq,' mA\\n')\n",
+ "Vecq=V2-V1-Icq*Rc-Ieq*Re;\n",
+ "print\"%s %.2f %s\"%('\\nemitter collector voltage= ',Vecq,' V\\n')\n",
+ "##ac solution\n",
+ "r_pi=b*V_T/Icq;\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal resistance= ',r_pi,' KOhm\\n')\n",
+ "g_m=Icq/V_T;\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance = ',g_m,'mA/V\\n')\n",
+ "##since Va=infinity,ro=Va/Icq is also infinity\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "base current 0.01 mA\n",
+ "\n",
+ "\n",
+ "collector current= 0.89 mA\n",
+ "\n",
+ "\n",
+ "emitter current= 0.90 mA\n",
+ "\n",
+ "\n",
+ "emitter collector voltage= 6.53 V\n",
+ "\n",
+ "\n",
+ "small signal resistance= 4.36 KOhm\n",
+ "\n",
+ "\n",
+ "transconductance = 34.39 mA/V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex9-203"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 4.9\n",
+ "Ic=0.894;\n",
+ "i_C=2.*Ic;\n",
+ "print\"%s %.2f %s\"%('\\nmaximum possible symmetrical peak to peak ac collector current= ',i_C,' mA\\n')\n",
+ "Rc=5.;\n",
+ "Rl=2.;\n",
+ "vo=i_C*Rc*Rl/(Rc+Rl);\n",
+ "print\"%s %.2f %s\"%('\\nmaximum possible symmetrical peak to peak output voltage= ',vo,' V\\n')\n",
+ "iC=Ic+i_C*1/2.;\n",
+ "print\"%s %.2f %s\"%('\\nmaximum instantaneous collector current= ',iC,' mA\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "maximum possible symmetrical peak to peak ac collector current= 1.79 mA\n",
+ "\n",
+ "\n",
+ "maximum possible symmetrical peak to peak output voltage= 2.55 V\n",
+ "\n",
+ "\n",
+ "maximum instantaneous collector current= 1.79 mA\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex10-pg206"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ " \n",
+ "##Example 4.10\n",
+ "b=100.;\n",
+ "Vbe=0.7;\n",
+ "V_T=0.026;##(V)\n",
+ "Re=2.;\n",
+ "R1=50.;\n",
+ "R2=50.;\n",
+ "Rs=0.5;\n",
+ "Va=80.;\n",
+ "##by dc analysis\n",
+ "Icq=0.793;\n",
+ "Vceq=3.4;\n",
+ "r_pi=b*V_T/Icq;\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal resistance= ',r_pi,' KOhm\\n')\n",
+ "g_m=Icq/V_T;\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance= ',g_m,' mA/V\\n')\n",
+ "ro=Va/Icq;\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal output resistance= ',ro,' KOhm\\n')\n",
+ "Rib=r_pi+(1.+b)*Re*ro/(ro+Re);\n",
+ "print\"%s %.2f %s\"%('\\ninput resistance to the base= ',Rib,' KOhm\\n')\n",
+ "##Ri=R1||R2||Rib\n",
+ "x=R1*R2/(R1+R2);\n",
+ "Ri=x*Rib/(x+Rib);\n",
+ "print\"%s %.2f %s\"%('\\nRi= ',Ri,' KOhm\\n')\n",
+ "y=ro*Re/(ro+Re);\n",
+ "Av=(1./(r_pi+(1.+b)*y))*(1.+b)*y*Ri/(Ri+Rs);\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal voltage gain= ',Av,' \\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "small signal resistance= 3.28 KOhm\n",
+ "\n",
+ "\n",
+ "transconductance= 30.50 mA/V\n",
+ "\n",
+ "\n",
+ "small signal output resistance= 100.88 KOhm\n",
+ "\n",
+ "\n",
+ "input resistance to the base= 201.35 KOhm\n",
+ "\n",
+ "\n",
+ "Ri= 22.24 KOhm\n",
+ "\n",
+ "\n",
+ "small signal voltage gain= 0.96 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter5_1.ipynb b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter5_1.ipynb new file mode 100644 index 00000000..204a2063 --- /dev/null +++ b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter5_1.ipynb @@ -0,0 +1,812 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:0555012832221206e793f4fc06592e55a682a07482b8e470e5ef81f7c83915c6"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter5-The Field Effect Transistor "
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg252"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 5.1\n",
+ "Vtn=0.75;##(V)\n",
+ "W=40.*10**-6;##(cm)\n",
+ "L=4.*10**-6;##(cm)\n",
+ "u=650.;##(cm)\n",
+ "Iox=450.*10**-11;\n",
+ "e=3.9*8.86*10**-14;\n",
+ "Kn=W*u*e/(2.*L*Iox);\n",
+ "print\"%s %.2f %s\"%('\\nconduction parameter= ',Kn,' mA/V^2\\n')\n",
+ "Vgs=2.*Vtn;\n",
+ "i_D=Kn*(Vgs-Vtn)**2;\n",
+ "print\"%s %.2f %s\"%('\\ndrain current= ',i_D,' mA\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "conduction parameter= 0.25 mA/V^2\n",
+ "\n",
+ "\n",
+ "drain current= 0.14 mA\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg256"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ " \n",
+ "##Example 5.2\n",
+ "Kp=0.2;##(mA/V^2)\n",
+ "Vtp=0.5;\n",
+ "iD=0.5;\n",
+ "Vsg=math.sqrt(iD/Kp)-Vtp;\n",
+ "print\"%s %.2f %s\"%('\\nVgs= ',Vsg,' V\\n')\n",
+ "##to bias in p channel MOSFET \n",
+ "Vsd=Vsg+Vtp;\n",
+ "print\"%s %.2f %s\"%('\\nVsd= ',Vsd,' V\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Vgs= 1.08 V\n",
+ "\n",
+ "\n",
+ "Vsd= 1.58 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg264"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ " \n",
+ "##Example 5.3\n",
+ "R1=30.;\n",
+ "R2=20.;\n",
+ "RD=20.;\n",
+ "Vdd=5.;\n",
+ "Vtn=1.;\n",
+ "Kn=0.1;\n",
+ "Vgs=R2*Vdd/(R1+R2);\n",
+ "print\"%s %.2f %s\"%('\\nVgs= ',Vgs,' V\\n')\n",
+ "I_D=Kn*(Vgs-Vtn)**2;\n",
+ "print\"%s %.2f %s\"%('\\nthe drain current= ',I_D,' mA\\n')\n",
+ "Vds=Vdd-I_D*RD;\n",
+ "print\"%s %.2f %s\"%('\\ndrain to source voltage= ',Vds,' V\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Vgs= 2.00 V\n",
+ "\n",
+ "\n",
+ "the drain current= 0.10 mA\n",
+ "\n",
+ "\n",
+ "drain to source voltage= 3.00 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg265"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 5.4\n",
+ "R1=50.;\n",
+ "R2=50.;\n",
+ "RD=7.5;\n",
+ "Vdd=5.;\n",
+ "Vtp=-0.8;\n",
+ "Vg=2.5;\n",
+ "Kp=0.2;\n",
+ "Vo=R2*Vdd/(R1+R2);\n",
+ "print\"%s %.2f %s\"%('\\nVo= ',Vo,' V\\n')\n",
+ "Vsg=Vdd-Vg;\n",
+ "print\"%s %.2f %s\"%('\\nsource to gate voltage= ',Vsg,' V\\n')\n",
+ "I_D=Kp*(Vsg+Vtp)**2;\n",
+ "print\"%s %.2f %s\"%('\\nthe drain current= ',I_D,' mA\\n')\n",
+ "Vsd=Vdd-I_D*RD;\n",
+ "print\"%s %.2f %s\"%('\\nsource to drain voltage= ',Vsd,' V\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Vo= 2.50 V\n",
+ "\n",
+ "\n",
+ "source to gate voltage= 2.50 V\n",
+ "\n",
+ "\n",
+ "the drain current= 0.58 mA\n",
+ "\n",
+ "\n",
+ "source to drain voltage= 0.67 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6-pg269"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 5.6\n",
+ "Vtn=2.;\n",
+ "Kn=80.*10**-3;\n",
+ "##x=W/L\n",
+ "x=4.;\n",
+ "I_D=0.5;\n",
+ "##I_D=Kn*x*((Vgs-Vtn)^2)/2;\n",
+ "Vgs=math.sqrt(I_D*2./(Kn*x))+2.;\n",
+ "print\"%s %.2f %s\"%('\\nVgs= ',Vgs,' V\\n')\n",
+ "##y=R1+R2\n",
+ "Rs=2.;\n",
+ "y=10./0.05;\n",
+ "print\"%s %.2f %s\"%('\\nR1+R2= ',y,' Kohm\\n')\n",
+ "##Vgs=Vg-Vs=(R2/(R1+R2)*10-5)-I_D*Rs+5\n",
+ "R2=(y/10.)*(Vgs+I_D*Rs);\n",
+ "print\"%s %.2f %s\"%('\\nR2= ',R2,' KOhm\\n')\n",
+ "R1=y-R2;\n",
+ "print\"%s %.2f %s\"%('\\nR1= ',R1,' KOhm\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Vgs= 3.77 V\n",
+ "\n",
+ "\n",
+ "R1+R2= 200.00 Kohm\n",
+ "\n",
+ "\n",
+ "R2= 95.36 KOhm\n",
+ "\n",
+ "\n",
+ "R1= 104.64 KOhm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7-pg270"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 5.7\n",
+ "Vtn=0.8;\n",
+ "Kn=80.;\n",
+ "##x=W/L\n",
+ "x=3.;\n",
+ "I_D=250.;\n",
+ "Vd=2.5;\n",
+ "##I_D=Kn/2*x*(Vgs-Vtn)^2\n",
+ "Vgs=math.sqrt(I_D*2./(Kn*x))+Vtn;\n",
+ "print\"%s %.2f %s\"%('\\nVgs= ',Vgs,' V\\n')\n",
+ "Vs=-Vgs\n",
+ "##I_D=(5-Vd)/Rd\n",
+ "Rd=(5.-Vd)/I_D;\n",
+ "print\"%s %.2f %s\"%('\\nRd= ',Rd,' KOhm\\n')\n",
+ "Vds=Vd-Vs;\n",
+ "print\"%s %.2f %s\"%('\\nVds= ',Vds,' V\\n')\n",
+ "Vdssat=Vgs-Vtn\n",
+ "##since Vds>Vdssat transistor is biased in saturation region\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Vgs= 2.24 V\n",
+ "\n",
+ "\n",
+ "Rd= 0.01 KOhm\n",
+ "\n",
+ "\n",
+ "Vds= 4.74 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex8-pg272"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from sympy import *\n",
+ "##Example 5.8\n",
+ "Vtn=0.8;\n",
+ "Kn=0.05;\n",
+ "##I_D=Kn*(Vgs-Vtn)^2\n",
+ "##Vds=Vgs=5-I_D*Rs\n",
+ "##combining these two equations we obtain 0.5(Vgs)^2+0.2Vgs-4.68\n",
+ "import numpy\n",
+ "from numpy.polynomial import Polynomial as P\n",
+ "p = P([1, 5, 6])\n",
+ "p.roots()\n",
+ "\n",
+ "\n",
+ "print('',p.roots(),' V\\n')\n",
+ "##assuming transistor is conducting ,Vgs must be greater than threshold voltage\n",
+ "Vgs=2.87;\n",
+ "I_D=Kn*(Vgs-Vtn)**2;\n",
+ "print\"%s %.2f %s\"%('\\ndrain current= ',I_D,' mA\\n')\n",
+ "#ans is varying due to round of error in book calculations are done wrong\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "('', array([-0.5 , -0.33333333]), ' V\\n')\n",
+ "\n",
+ "drain current= 0.21 mA\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex10-pg277"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ " \n",
+ "##Example 5.10\n",
+ "Vtn=-2.;\n",
+ "Kn=0.1;\n",
+ "Vdd=5.;\n",
+ "Rs=5.;\n",
+ "Vgs=0.;\n",
+ "I_D=Kn*(Vgs-Vtn)**2;\n",
+ "print\"%s %.2f %s\"%('\\ndrain current= ',I_D,' mA\\n')\n",
+ "Vds=Vdd-I_D*Rs;\n",
+ "print\"%s %.2f %s\"%('\\ndc drain to source voltage= ',Vds,' V\\n')\n",
+ "Vdssat=Vgs-Vtn\n",
+ "##since Vds>Vdssat transisyor is biased in saturation region\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "drain current= 0.40 mA\n",
+ "\n",
+ "\n",
+ "dc drain to source voltage= 3.00 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex11-pg277"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "import numpy\n",
+ "\n",
+ "##Example 5.11\n",
+ "Vtnd=1;\n",
+ "Vtnl=-2;\n",
+ "Knd=50;\n",
+ "Knl=10;\n",
+ "Vt=5;\n",
+ "import numpy\n",
+ "from numpy.polynomial import Polynomial as P\n",
+ "p = P([4, -40, 5])\n",
+ "p.roots()\n",
+ "\n",
+ "\n",
+ "print('\\npossible solutions ::',p.roots(),'')\n",
+ "##since output voltage cannot be greater than supply voltage 5V\n",
+ "Vo=0.1;##(V)\n",
+ "I_D=Knl*(-Vtnl)**2;\n",
+ "print\"%s %.2f %s\"%('\\ndrain current= ',I_D,' microA\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "('\\npossible solutions ::', array([ 0.10128226, 7.89871774]), '')\n",
+ "\n",
+ "drain current= 40.00 microA\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex13-pg282"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#calculate the \n",
+ "##Example 5.13\n",
+ "Kn1=0.2;\n",
+ "Kn2=0.1;\n",
+ "Kn3=0.1;\n",
+ "Kn4=0.1;\n",
+ "Vtn1=1.;\n",
+ "Vtn2=1.;\n",
+ "Vtn3=1.;\n",
+ "Vtn4=1.;\n",
+ "V2=-5.;\n",
+ "Vgs3=(math.sqrt(Kn4/Kn3)*(-V2-Vtn4)+Vtn3)/(1.+math.sqrt(Kn4/Kn3));\n",
+ "print\"%s %.2f %s\"%('\\nVgs3= ',Vgs3,' V\\n')\n",
+ "Iq=Kn3*(Vgs3-Vtn3)**2;\n",
+ "print\"%s %.2f %s\"%('\\nbias current= ',Iq,' mA\\n')\n",
+ "Vgs1=math.sqrt(Iq/Kn1)+Vtn1;\n",
+ "print\"%s %.2f %s\"%('\\ngate to source voltage on M1= ',Vgs1,' V\\n')\n",
+ "Vds2=-V2-Vgs1;\n",
+ "print\"%s %.2f %s\"%('\\ndrain to source voltage on M2= ',Vds2,' V\\n')\n",
+ "Vgs2=Vgs3;\n",
+ "Vdssat=Vgs2-Vtn2\n",
+ "##since Vds2>Vdssat M2 is biased in saturation region\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Vgs3= 2.50 V\n",
+ "\n",
+ "\n",
+ "bias current= 0.23 mA\n",
+ "\n",
+ "\n",
+ "gate to source voltage on M1= 2.06 V\n",
+ "\n",
+ "\n",
+ "drain to source voltage on M2= 2.94 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex14-pg284"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 5.14\n",
+ "I_D=0.5;\n",
+ "Vds=6.;\n",
+ "Kn=80.*10**-6;\n",
+ "Vgs=5.;\n",
+ "Vtn=1.;\n",
+ "##x=W/L\n",
+ "x=I_D*2./(Kn*(Vgs-Vtn)**2);\n",
+ "print(x,\"W/L \")\n",
+ "##maximum power dissipation in transistor \n",
+ "Pmax=Vds*I_D;\n",
+ "print\"%s %.2f %s\"%('\\nmaximum power dissipation in transistor= ',Pmax,' W\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(781.2500000000001, 'W/L ')\n",
+ "\n",
+ "maximum power dissipation in transistor= 3.00 W\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex16-pg293"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "import numpy \n",
+ "##Example 5.16\n",
+ "Idss=2.;##(mA) saturation current\n",
+ "Vp=-3.5;##(V) pinch off voltage\n",
+ "Vgs=numpy.array([[0, Vp/4. ,Vp/2.]])\n",
+ "I_D=Idss*(1.-Vgs/Vp)**2;\n",
+ "print (I_D)\n",
+ "Vds=Vgs-Vp;\n",
+ "print (Vds)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "[[ 2. 1.125 0.5 ]]\n",
+ "[[ 3.5 2.625 1.75 ]]\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex17-pg295"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 5.17\n",
+ "Idss=5.;##mA\n",
+ "Vp=-4.;\n",
+ "Vdd=10.;\n",
+ "I_D=2.;\n",
+ "Vds=6.;\n",
+ "##I_D=Idss*(1-Vgs/Vp)^2\n",
+ "Vgs=(1.-math.sqrt(I_D/Idss))*Vp;\n",
+ "print\"%s %.2f %s\"%('\\nVgs= ',Vgs,' V\\n')\n",
+ "Rs=-Vgs/I_D;\n",
+ "print\"%s %.2f %s\"%('\\nRs= ',Rs,' KOhm\\n')\n",
+ "Rd=(Vdd-Vds-I_D*Rs)/I_D;\n",
+ "print\"%s %.2f %s\"%('\\nRd= ',Rd,' KOhm\\n')\n",
+ "Vgs-Vp\n",
+ "##since Vds>Vgs-Vp JFET is biased in saturation\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Vgs= -1.47 V\n",
+ "\n",
+ "\n",
+ "Rs= 0.74 KOhm\n",
+ "\n",
+ "\n",
+ "Rd= 1.26 KOhm\n",
+ "\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "pyout",
+ "prompt_number": 19,
+ "text": [
+ "2.5298221281347035"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex19-pg298"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 5.19\n",
+ "Idss=2.5;\n",
+ "Vp=2.5;\n",
+ "I_D=0.8;\n",
+ "##I_D=Iq=0.8*10^-3=(Vd-(-9))/Rd\n",
+ "Vd=0.8*4.-9;\n",
+ "print\"%s %.2f %s\"%('\\nVd = ',Vd,'V\\n')\n",
+ "##I_D=Idss*(1-Vgs/Vp)^2;\n",
+ "Vgs=(1.-math.sqrt(I_D/Idss))*Vp;\n",
+ "print\"%s %.2f %s\"%('\\nVgs = ',Vgs,'V\\n')\n",
+ "Vs=1-Vgs;\n",
+ "print\"%s %.2f %s\"%('\\nVs= ',Vs,' V\\n')\n",
+ "Vsd=Vs-Vd;\n",
+ "print\"%s %.2f %s\"%('\\nVsd= ',Vsd,' V\\n')\n",
+ "Vp-Vgs\n",
+ "##since Vsd>Vp-Vgs JFET is biased in saturation\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Vd = -5.80 V\n",
+ "\n",
+ "\n",
+ "Vgs = 1.09 V\n",
+ "\n",
+ "\n",
+ "Vs= -0.09 V\n",
+ "\n",
+ "\n",
+ "Vsd= 5.71 V\n",
+ "\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "pyout",
+ "prompt_number": 20,
+ "text": [
+ "1.414213562373095"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex20-pg299"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 5.20\n",
+ "Vtn=0.24;\n",
+ "Kn=1.1;\n",
+ "##x=R1+R2=50000\n",
+ "x=50.;\n",
+ "Vgs=0.5;\n",
+ "Vds=2.5;\n",
+ "Vdd=4.;\n",
+ "Rd=6.7;\n",
+ "I_D=Kn*(Vgs-Vtn)**2;\n",
+ "print\"%s %.2f %s\"%('\\ndrain current= ',I_D,' mA\\n')\n",
+ "Vd=Vdd-I_D*Rd;\n",
+ "print\"%s %.2f %s\"%('\\nvoltage at drain= ',Vd,' V\\n')\n",
+ "Vs=Vd-Vds;\n",
+ "print\"%s %.2f %s\"%('\\nvoltage at source = ',Vs,'V\\n')\n",
+ "Rs=Vs/I_D;\n",
+ "print\"%s %.2f %s\"%('\\nsource resistance = ',Rs,'KOhm\\n')\n",
+ "Vg=Vgs+Vs;\n",
+ "print\"%s %.2f %s\"%('\\nvoltage at the gate= ',Vg,' V\\n')\n",
+ "##Vg=R2*Vdd/(R2+R1)\n",
+ "R2=Vg*x/Vdd;\n",
+ "print\"%s %.2f %s\"%('\\nR2= ',R2,' KOhm\\n')\n",
+ "R1=x-R2;\n",
+ "print\"%s %.2f %s\"%('\\nR1= ',R1,' KOhm\\n')\n",
+ "Vgs-Vtn\n",
+ "##since Vds>Vgs-Vtn transistor is biased in saturation\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "drain current= 0.07 mA\n",
+ "\n",
+ "\n",
+ "voltage at drain= 3.50 V\n",
+ "\n",
+ "\n",
+ "voltage at source = 1.00 V\n",
+ "\n",
+ "\n",
+ "source resistance = 13.47 KOhm\n",
+ "\n",
+ "\n",
+ "voltage at the gate= 1.50 V\n",
+ "\n",
+ "\n",
+ "R2= 18.77 KOhm\n",
+ "\n",
+ "\n",
+ "R1= 31.23 KOhm\n",
+ "\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "pyout",
+ "prompt_number": 21,
+ "text": [
+ "0.26"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter6_1.ipynb b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter6_1.ipynb new file mode 100644 index 00000000..27fe0eac --- /dev/null +++ b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter6_1.ipynb @@ -0,0 +1,955 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:ddb81cb66c6e60e18386ce9465623c3e9136c0ad815bf2b64587c945fdfe08bd"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter6-Basic FET Amplifier"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg316"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 6.1\n",
+ "Vtn=1.;\n",
+ "##let x= u_n*Cox*1/2\n",
+ "x=20.*10**-3;\n",
+ "##let y=W/L\n",
+ "y=40.;\n",
+ "I_D=1.;\n",
+ "Kn=x*y;\n",
+ "print\"%s %.2f %s\"%('\\nconduction parameter= ',Kn,' mA/V^2\\n')\n",
+ "g_m=2.*math.sqrt(Kn*I_D);\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance= ',g_m,' mA/V\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "conduction parameter= 0.80 mA/V^2\n",
+ "\n",
+ "\n",
+ "transconductance= 1.79 mA/V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg319"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 6.2\n",
+ "Vgsq=2.12;\n",
+ "Vdd=5.;\n",
+ "Rd=2.5;\n",
+ "Vtn=1.;\n",
+ "Kn=0.8;\n",
+ "##let lambda=y\n",
+ "y=0.02;##V^-1\n",
+ "Idq=Kn*(Vgsq-Vtn)**2;\n",
+ "print\"%s %.2f %s\"%('\\ndrain current= ',Idq,'mA\\n')\n",
+ "Vdsq=Vdd-Idq*Rd;\n",
+ "print\"%s %.2f %s\"%('\\ndrain to source voltage= ',Vdsq,' V\\n')\n",
+ "Vgs=1.82;\n",
+ "Vgs-Vtn\n",
+ "##since Vdsq>Vgs-Vtn transistor is biased in saturation\n",
+ "g_m=2.*Kn*(Vgsq-Vtn);\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance= ',g_m,' mA/V\\n')\n",
+ "ro=(y*Idq)**-1;\n",
+ "print\"%s %.2f %s\"%('\\noutput resistance= ',ro,' KOhm\\n')\n",
+ "Av=-g_m*ro*Rd/(ro+Rd);\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal voltage gain= ',Av,'\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "drain current= 1.00 mA\n",
+ "\n",
+ "\n",
+ "drain to source voltage= 2.49 V\n",
+ "\n",
+ "\n",
+ "transconductance= 1.79 mA/V\n",
+ "\n",
+ "\n",
+ "output resistance= 49.82 KOhm\n",
+ "\n",
+ "\n",
+ "small signal voltage gain= -4.27 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg326"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 6.3\n",
+ "Vdd=10.;\n",
+ "R1=70.9;##(Kohm)\n",
+ "R2=29.1;##(Kohm)\n",
+ "Rd=5.;##(Kohm)\n",
+ "Vtn=1.5;\n",
+ "Kn=0.5;##(mA/V^2)\n",
+ "##lambda=y\n",
+ "y=0.01;##V^-1\n",
+ "Rsi=4.;##(Kohm)\n",
+ "Vgsq=Vdd*R2/(R1+R2);\n",
+ "print\"%s %.2f %s\"%('\\ngate to source voltage= ',Vgsq,' V\\n')\n",
+ "Idq=Kn*(Vgsq-Vtn)**2;\n",
+ "print\"%s %.2f %s\"%('\\ndrain current= ',Idq,' mA\\n')\n",
+ "Vdsq=Vdd-Idq*Rd;\n",
+ "print\"%s %.2f %s\"%('\\ndrain to source voltage= ',Vdsq,' V\\n')\n",
+ "g_m=2*Kn*(Vgsq-Vtn);\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance= ',g_m,' mA/V\\n')\n",
+ "ro=(y*Idq)**-1;\n",
+ "print\"%s %.2f %s\"%('\\noutput resistance= ',ro,' KOhm\\n')\n",
+ "Ri=R1*R2/(R1+R2);\n",
+ "print\"%s %.2f %s\"%('\\namplifier input resistance= ',Ri,' Kohm\\n')\n",
+ "Av=-g_m*(ro*Rd/(ro+Rd))*Ri/(Ri+Rsi);\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal voltage gain=\\n',Av,'')\n",
+ "print\"%s %.2f %s\"%('\\namplifier input resistance= ',Ri,' Kohm\\n')\n",
+ "Ro=Rd*ro/(Rd+ro);\n",
+ "print\"%s %.2f %s\"%('\\namplifier output resistance= ',Ro,' Kohm\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "gate to source voltage= 2.91 V\n",
+ "\n",
+ "\n",
+ "drain current= 0.99 mA\n",
+ "\n",
+ "\n",
+ "drain to source voltage= 5.03 V\n",
+ "\n",
+ "\n",
+ "transconductance= 1.41 mA/V\n",
+ "\n",
+ "\n",
+ "output resistance= 100.60 KOhm\n",
+ "\n",
+ "\n",
+ "amplifier input resistance= 20.63 Kohm\n",
+ "\n",
+ "\n",
+ "small signal voltage gain=\n",
+ " -5.63 \n",
+ "\n",
+ "amplifier input resistance= 20.63 Kohm\n",
+ "\n",
+ "\n",
+ "amplifier output resistance= 4.76 Kohm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg327"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 6.4\n",
+ "Vtn=1.;\n",
+ "Kn=1.;##(mA/V^2)\n",
+ "##lambda=y\n",
+ "y=0.015;##V^-1\n",
+ "Ri=100.;##(Kohm)\n",
+ "Idq=2.;##(mA)\n",
+ "Idt=4.;##(mA)\n",
+ "##Idt=4=Kn*(Vgst-Vtn)^2\n",
+ "Vgst=math.sqrt(Idt/Kn)+Vtn;\n",
+ "print\"%s %.2f %s\"%('\\nVgst= ',Vgst,' V\\n')\n",
+ "Vdst=Vgst-Vtn;\n",
+ "print\"%s %.2f %s\"%('\\nVdst= ',Vdst,' V\\n')\n",
+ "Vdd=12.;\n",
+ "Vdsq=7.;\n",
+ "Rd=(Vdd-Vdsq)/Idq;\n",
+ "print\"%s %.2f %s\"%('\\nRd = ',Rd,'KOhm\\n')\n",
+ "Vgsq=math.sqrt(Idq/Kn)+Vtn;\n",
+ "print\"%s %.2f %s\"%('\\nVgsq= ',Vgsq,' V\\n')\n",
+ "R1=Ri*Vdd/Vgsq;\n",
+ "print\"%s %.2f %s\"%('\\nR1= ',R1,' Kohm\\n')\n",
+ "R2=Ri*R1/(R1-Ri);\n",
+ "print\"%s %.2f %s\"%('\\nR2= ',R2,' Kohm\\n')\n",
+ "g_m=2*Kn*(Vgsq-Vtn);\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance= ',g_m,' mA/V\\n')\n",
+ "ro=(y*Idq)**-1;\n",
+ "print\"%s %.2f %s\"%('\\noutput resistance= ',ro,' KOhm\\n')\n",
+ "Av=-g_m*(ro*Rd/(ro+Rd));\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal voltage gain= ',Av,'\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Vgst= 3.00 V\n",
+ "\n",
+ "\n",
+ "Vdst= 2.00 V\n",
+ "\n",
+ "\n",
+ "Rd = 2.50 KOhm\n",
+ "\n",
+ "\n",
+ "Vgsq= 2.41 V\n",
+ "\n",
+ "\n",
+ "R1= 497.06 Kohm\n",
+ "\n",
+ "\n",
+ "R2= 125.19 Kohm\n",
+ "\n",
+ "\n",
+ "transconductance= 2.83 mA/V\n",
+ "\n",
+ "\n",
+ "output resistance= 33.33 KOhm\n",
+ "\n",
+ "\n",
+ "small signal voltage gain= -6.58 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6-pg332"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 6.6\n",
+ "Vtn=0.8;\n",
+ "Kn=1.;##(mA/V^2)\n",
+ "Idq=0.5;\n",
+ "Vdd=5.;\n",
+ "Rd=7.;##(Kohm)\n",
+ "Vgsq=math.sqrt(Idq/Kn)+Vtn;\n",
+ "print\"%s %.2f %s\"%('\\nVgsq= ',Vgsq,' V\\n')\n",
+ "Vs=-Vgsq\n",
+ "Vdsq=Vdd-Idq*Rd-Vs;\n",
+ "print\"%s %.2f %s\"%('\\nVdsq=',Vdsq,' V\\n')\n",
+ "g_m=2.*Kn*(Vgsq-Vtn);\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance= ',g_m,' mA/V\\n')\n",
+ "Av=-g_m*Rd;\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal voltage gain=\\n',Av,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Vgsq= 1.51 V\n",
+ "\n",
+ "\n",
+ "Vdsq= 3.01 V\n",
+ "\n",
+ "\n",
+ "transconductance= 1.41 mA/V\n",
+ "\n",
+ "\n",
+ "small signal voltage gain=\n",
+ " -9.90 \n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7-pg336"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 6.7\n",
+ "Vdd=12.;\n",
+ "R1=162.;\n",
+ "R2=463.;\n",
+ "Rs=0.75;\n",
+ "Kn=4.;\n",
+ "Vtn=1.5;\n",
+ "##lambda=y\n",
+ "y=0.01;\n",
+ "Rsi=4.;\n",
+ "Idq=7.97;\n",
+ "Vgsq=2.91;\n",
+ "g_m=2.*Kn*(Vgsq-Vtn);\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance= ',g_m,' mA/V\\n')\n",
+ "ro=(y*Idq)**-1.;\n",
+ "print\"%s %.2f %s\"%('\\noutput resistance= ',ro,' KOhm\\n')\n",
+ "Ri=R1*R2/(R1+R2);\n",
+ "print\"%s %.2f %s\"%('\\namplifier input resistance= ',Ri,' Kohm\\n')\n",
+ "x=Rs*ro/(Rs+ro);\n",
+ "Av=g_m*x*(Ri/(Ri+Rsi))/(1.+g_m*x);\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal voltage gain=\\n',Av,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "transconductance= 11.28 mA/V\n",
+ "\n",
+ "\n",
+ "output resistance= 12.55 KOhm\n",
+ "\n",
+ "\n",
+ "amplifier input resistance= 120.01 Kohm\n",
+ "\n",
+ "\n",
+ "small signal voltage gain=\n",
+ " 0.86 \n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex9-pg340"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 6.9\n",
+ "Rs=750.;##Ohm\n",
+ "ro=12500.;\n",
+ "g_m=11.3*10**-3;\n",
+ "x=1./g_m;\n",
+ "y=x*Rs/(x+Rs);\n",
+ "Ro=y*ro/(y+ro);\n",
+ "print\"%s %.2f %s\"%('\\noutput resistance= ',Ro,' ohm\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "output resistance= 78.66 ohm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex11-pg348"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 6.11\n",
+ "Vtnd=1.;\n",
+ "Vtnl=1.;\n",
+ "Kn=30.;\n",
+ "##let W/L=x\n",
+ "xl=1.;\n",
+ "Vdd=5.;\n",
+ "Av=10.;\n",
+ "##Av=sqrt(xd/xl)\n",
+ "xd=(Av)**2*xl;\n",
+ "print\"%s %.2f %s\"%('\\nwidth to length ratio of driver transistor=\\n',xd,'')\n",
+ "Knd=xd*Kn*0.001/2.;\n",
+ "Knl=xl*Kn*0.001/2.;\n",
+ "print\"%s %.2f %s\"%('\\nconduction parameter Knd= ',Knd,' mA/V^2\\n')\n",
+ "print\"%s %.2f %s\"%('\\nconduction parameter Knl= ',Knl,' mA/V^2\\n')\n",
+ "##Vgsd-Vtnd=(Vdd-Vtnl)-sqrt(Knd/Knl)*(Vgsd-Vtnd)\n",
+ "y=math.sqrt(Knd/Knl);\n",
+ "Vgsd=(y+5.)/(1.+y);\n",
+ "print\"%s %.2f %s\"%('\\nVgsd= ',Vgsd,' V\\n')\n",
+ "Vdsd=Vgsd-1.;\n",
+ "print\"%s %.2f %s\"%('\\nVdsd= ',Vdsd,' V\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "width to length ratio of driver transistor=\n",
+ " 100.00 \n",
+ "\n",
+ "conduction parameter Knd= 1.50 mA/V^2\n",
+ "\n",
+ "\n",
+ "conduction parameter Knl= 0.01 mA/V^2\n",
+ "\n",
+ "\n",
+ "Vgsd= 1.36 V\n",
+ "\n",
+ "\n",
+ "Vdsd= 0.36 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex12-pg352"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 6.12\n",
+ "Vtnd=0.8;\n",
+ "Vtnl=-1.5;\n",
+ "Knd=1.;\n",
+ "Knl=0.2;\n",
+ "##lambda=y\n",
+ "yd=0.01;\n",
+ "yl=0.01;\n",
+ "Idq=0.2;\n",
+ "gmd=2.*math.sqrt(Knd*Idq);\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance of the driver= ',gmd,' mA/V\\n')\n",
+ "roD=1./(yd*Idq);\n",
+ "print\"%s %.2f %s\"%('\\noutput resistances= ',roD,' Kohm\\n')\n",
+ "Av=-gmd*roD/2.;\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal voltage gain= \\n',Av,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "transconductance of the driver= 0.89 mA/V\n",
+ "\n",
+ "\n",
+ "output resistances= 500.00 Kohm\n",
+ "\n",
+ "\n",
+ "small signal voltage gain= \n",
+ " -223.61 \n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex13-pg354"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 6.13\n",
+ "Vtn=0.8;\n",
+ "Vtp=-0.8;\n",
+ "Kn=80.*10**-3;\n",
+ "Kp=40.*10**-3;\n",
+ "##x=W/L\n",
+ "xn=15.;\n",
+ "xp=10.;\n",
+ "##lambda=y\n",
+ "yn=0.01;\n",
+ "yp=0.01;\n",
+ "Ibias=0.2;\n",
+ "gm=2.*math.sqrt(Kn*xn*Ibias/2.);\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance of the NMOS driver= ',gm,' mA/V^2\\n')\n",
+ "ron=1./(yn*Ibias);\n",
+ "print\"%s %.2f %s\"%('\\noutput resistances= ',ron,' Kohm\\n')\n",
+ "Av=-gm*ron/2.;\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal voltage gain= \\n',Av,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "transconductance of the NMOS driver= 0.69 mA/V^2\n",
+ "\n",
+ "\n",
+ "output resistances= 500.00 Kohm\n",
+ "\n",
+ "\n",
+ "small signal voltage gain= \n",
+ " -173.21 \n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex14-pg357"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 6.14\n",
+ "Kn1=500.*10**-3;\n",
+ "Kn2=200.*10**-3;\n",
+ "Vtn1=1.2;\n",
+ "Vtn2=Vtn1;\n",
+ "Idq1=0.2;\n",
+ "Idq2=0.5;\n",
+ "Vdsq1=6.;\n",
+ "Vdsq2=6.;\n",
+ "Ri=100.;\n",
+ "Rsi=4.;\n",
+ "Rs2=(10.-Vdsq2)/Idq2;\n",
+ "print\"%s %.2f %s\"%('\\nRs2= ',Rs2,' KOhm\\n')\n",
+ "Vgs2=math.sqrt(Idq2/Kn2)+Vtn2;\n",
+ "print\"%s %.2f %s\"%('\\ngate to source voltage for M2= ',Vgs2,' V\\n')\n",
+ "Vs2=-1.;\n",
+ "Vg2=Vs2+Vgs2;\n",
+ "print\"%s %.2f %s\"%('\\ngate voltage of M2= ',Vg2,' V\\n')\n",
+ "Vg1=Vg2;\n",
+ "Rd1=(5.-Vg1)/Idq1;\n",
+ "print\"%s %.2f %s\"%('\\nresistor Rd1= ',Rd1,' KOhm\\n')\n",
+ "Vs1=Vg1-Vdsq1;\n",
+ "print\"%s %.2f %s\"%('\\nsource voltage of M1= ',Vs1,' KOhm\\n')\n",
+ "Rs1=(Vs1+5.)/Idq1;\n",
+ "print\"%s %.2f %s\"%('\\nresistor Rs1= ',Rs1,' KOhm\\n')\n",
+ "Vgs1=math.sqrt(Idq1/Kn1)+Vtn1;\n",
+ "print\"%s %.2f %s\"%('\\ngate to source voltage for M1',Vgs1,' V\\n')\n",
+ "R1=Ri*10./(Vgs1+Idq1*Rs1);\n",
+ "print\"%s %.2f %s\"%('\\nR1= ',R1,' KOhm\\n')\n",
+ "##Ri=R1*R2/(R1+R2)\n",
+ "R2=Ri*R1/(R1-Ri);\n",
+ "print\"%s %.2f %s\"%('\\nR2= ',R2,' KOhm\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Rs2= 8.00 KOhm\n",
+ "\n",
+ "\n",
+ "gate to source voltage for M2= 2.78 V\n",
+ "\n",
+ "\n",
+ "gate voltage of M2= 1.78 V\n",
+ "\n",
+ "\n",
+ "resistor Rd1= 16.09 KOhm\n",
+ "\n",
+ "\n",
+ "source voltage of M1= -4.22 KOhm\n",
+ "\n",
+ "\n",
+ "resistor Rs1= 3.91 KOhm\n",
+ "\n",
+ "\n",
+ "gate to source voltage for M1 1.83 V\n",
+ "\n",
+ "\n",
+ "R1= 382.61 KOhm\n",
+ "\n",
+ "\n",
+ "R2= 135.38 KOhm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex15-pg358"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 6.15\n",
+ "Vtn1=1.2;\n",
+ "Vtn2=1.2;\n",
+ "Kn1=0.8;\n",
+ "Kn2=0.8;\n",
+ "##x=R1+R2+R3=300\n",
+ "x=300.;\n",
+ "Rs=10.;\n",
+ "Idq=0.4;\n",
+ "Vdsq1=2.5;\n",
+ "Vdsq2=2.5;\n",
+ "Vs1=Idq*Rs-5.;\n",
+ "print\"%s %.2f %s\"%('\\ndc voltage at source of M1= ',Vs1,' V\\n')\n",
+ "Vgs=math.sqrt(Idq/Kn1)+Vtn1;\n",
+ "print\"%s %.2f %s\"%('\\ngate to source voltage= ',Vgs,' V\\n')\n",
+ "R3=(Vgs+Vs1)*x/5.;\n",
+ "print\"%s %.2f %s\"%('\\nR3= ',R3,' KOhm\\n')\n",
+ "Vs2=Vdsq2+Vs1;\n",
+ "print\"%s %.2f %s\"%('\\nvoltage at source of M2= ',Vs2,' V\\n')\n",
+ "##y=R2+R3\n",
+ "y=(Vgs+Vs2)*x/5.;\n",
+ "print\"%s %.2f %s\"%('\\nR2+R3= ',y,' KOhm\\n')\n",
+ "R2=150.;\n",
+ "R1=x-y;\n",
+ "print\"%s %.2f %s\"%('\\nR1=',R1,' KOhm\\n')\n",
+ "R3=y-R2;\n",
+ "print\"%s %.2f %s\"%('\\nR3= ',R3,' KOhm\\n')\n",
+ "Vd2=Vdsq2+Vs2;\n",
+ "print\"%s %.2f %s\"%('\\nvoltage at drain of M2 = ',Vd2,'V\\n')\n",
+ "Rd=(5.-Vd2)/Idq;\n",
+ "print\"%s %.2f %s\"%('\\ndrain resistance= ',Rd,' KOhm\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "dc voltage at source of M1= -1.00 V\n",
+ "\n",
+ "\n",
+ "gate to source voltage= 1.91 V\n",
+ "\n",
+ "\n",
+ "R3= 54.43 KOhm\n",
+ "\n",
+ "\n",
+ "voltage at source of M2= 1.50 V\n",
+ "\n",
+ "\n",
+ "R2+R3= 204.43 KOhm\n",
+ "\n",
+ "\n",
+ "R1= 95.57 KOhm\n",
+ "\n",
+ "\n",
+ "R3= 54.43 KOhm\n",
+ "\n",
+ "\n",
+ "voltage at drain of M2 = 4.00 V\n",
+ "\n",
+ "\n",
+ "drain resistance= 2.50 KOhm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex17-pg361"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ " \n",
+ "##Example 6.17\n",
+ "Kn=0.8;\n",
+ "Vtn=1.2;\n",
+ "Vgs=1.91;\n",
+ "Rd=2.5;\n",
+ "gm=2.*Kn*(Vgs-Vtn);\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance= ',gm,' mA/V\\n')\n",
+ "Av=-gm*Rd;\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal voltage gain= ',Av,' \\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "transconductance= 1.14 mA/V\n",
+ "\n",
+ "\n",
+ "small signal voltage gain= -2.84 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex18-pg364"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 6.18\n",
+ "##Determine the small signal voltage gain of a circuit in fig.6.55\n",
+ "Idss=12.;\n",
+ "Vp=-4.;\n",
+ "##lambda=y\n",
+ "y=0.008;\n",
+ "import numpy\n",
+ "from numpy.polynomial import Polynomial as P\n",
+ "p = P([26.4, 17.2, 2.025])\n",
+ "p.roots()\n",
+ "\n",
+ "\n",
+ "print('',p.roots(),' V\\n')\n",
+ "Vgsq=-2.01\n",
+ "Idq=Idss*(1.-Vgsq/Vp)**2;\n",
+ "print\"%s %.2f %s\"%('\\nquiescent drain current= ',Idq,' mA\\n')\n",
+ "gm=(-2*Idss/Vp)*(1.-Vgsq/Vp);\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance= ',gm,' mA/V\\n')\n",
+ "ro=(1/(y*Idq));\n",
+ "print\"%s %.2f %s\"%('\\noutput resistance= ',ro,' KOhm\\n')\n",
+ "Rd=2.7;\n",
+ "Rl=4.;\n",
+ "x=Rd*Rl/(Rd+Rl);\n",
+ "Av=-gm*ro*x/(ro+x);\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal voltage gain= ',Av,' \\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "('', array([-6.48281115, -2.01101602]), ' V\\n')\n",
+ "\n",
+ "quiescent drain current= 2.97 mA\n",
+ "\n",
+ "\n",
+ "transconductance= 2.99 mA/V\n",
+ "\n",
+ "\n",
+ "output resistance= 42.09 KOhm\n",
+ "\n",
+ "\n",
+ "small signal voltage gain= -4.63 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex19-pg366"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ " \n",
+ "##Example 6.19\n",
+ "Idss=12.;\n",
+ "Vp=-4.;\n",
+ "Rl=10.;\n",
+ "##lambda=y\n",
+ "y=0.01;\n",
+ "Av=0.9;\n",
+ "##gm=(-2*Idss/Vp)*(1-Vgs/Vp)\n",
+ "gm=2.;\n",
+ "Vgs=(1.+gm*Vp/(2.*Idss))*Vp;\n",
+ "print\"%s %.2f %s\"%('\\ngate to source voltage= ',Vgs,' V\\n')\n",
+ "Idq=Idss*(1.-Vgs/Vp)**2;\n",
+ "print\"%s %.2f %s\"%('\\nquiescent drain current= ',Idq,' mA\\n')\n",
+ "Rs=(-Vgs+10.)/Idq;\n",
+ "print\"%s %.2f %s\"%('\\nRs= ',Rs,' KOhm\\n')\n",
+ "ro=(1./(y*Idq));\n",
+ "print\"%s %.2f %s\"%('\\noutput resistance= ',ro,' KOhm\\n')\n",
+ "x=Rl*ro/(Rl+ro);\n",
+ "t=x*Rs/(x+Rs);\n",
+ "Av=gm*t/(1.+gm*t);\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal voltage gain= ',Av,' \\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "gate to source voltage= -2.67 V\n",
+ "\n",
+ "\n",
+ "quiescent drain current= 1.33 mA\n",
+ "\n",
+ "\n",
+ "Rs= 9.50 KOhm\n",
+ "\n",
+ "\n",
+ "output resistance= 75.00 KOhm\n",
+ "\n",
+ "\n",
+ "small signal voltage gain= 0.90 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter7_1.ipynb b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter7_1.ipynb new file mode 100644 index 00000000..cdaa4721 --- /dev/null +++ b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter7_1.ipynb @@ -0,0 +1,1012 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:f18f9d847269f9edf29c736ee46e70f983f60a1586ec020e9b0c78d7d24ae225"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter7-Frequency Response"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg393"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ " \n",
+ "##Example 7.1\n",
+ "Rs=1000.;\n",
+ "Rp=10000.;\n",
+ "Cs=1.*10**-6;\n",
+ "Cp=3.*10**-12;\n",
+ "Ts=(Rs+Rp)*Cs;\n",
+ "print\"%s %.2f %s\"%('\\ntime constant= ',Ts,' s\\n')\n",
+ "f=1/(2.*math.pi*Ts);\n",
+ "print\"%s %.2f %s\"%('\\ncorner frequency= ',f,' Hz\\n')\n",
+ "x=20.*math.log10(Rp/(Rp+Rs));\n",
+ "print\"%s %.2f %s\"%('\\nmaximum magnitude = ',x,'dB\\n')\n",
+ "Rp=10.;##KOhm\n",
+ "Rs=1.;##Kohm\n",
+ "Cp=3.;##pF\n",
+ "Tp=Cp*Rs*Rp/(Rs+Rp);\n",
+ "print\"%s %.2f %s\"%('\\ntime constant= ',Tp,' ns\\n')\n",
+ "Tp=2.73*10**-3;##micro sec\n",
+ "f=1/(2.*math.pi*Tp);\n",
+ "print\"%s %.2f %s\"%('\\ncorner frequency = ',f,'MHz\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "time constant= 0.01 s\n",
+ "\n",
+ "\n",
+ "corner frequency= 14.47 Hz\n",
+ "\n",
+ "\n",
+ "maximum magnitude = -0.83 dB\n",
+ "\n",
+ "\n",
+ "time constant= 2.73 ns\n",
+ "\n",
+ "\n",
+ "corner frequency = 58.30 MHz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg396"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 7.2\n",
+ "Rs=1000.;\n",
+ "Rp=10000.;\n",
+ "Cs=1*10**-6;\n",
+ "Cp=3*10**-12;\n",
+ "Ts=(Rs+Rp)*Cs;\n",
+ "print\"%s %.2f %s\"%('\\nopen circuit time constant= ',Ts,' s\\n')\n",
+ "Rs=1.;##KOhm\n",
+ "Rp=10.;##KOhm\n",
+ "Cp=3.;##pF\n",
+ "Tp=Cp*Rs*Rp/(Rs+Rp);\n",
+ "print\"%s %.2f %s\"%('\\nshort circuit time constant= ',Tp,' ns\\n')\n",
+ "fL=1./(2.*math.pi*Ts);\n",
+ "print\"%s %.2f %s\"%('\\ncorner frequency fL= ',fL,' Hz\\n')\n",
+ "Tp=2.73*10**-3;##microsec\n",
+ "fH=1/(2.*math.pi*Tp);\n",
+ "print\"%s %.2f %s\"%('\\ncorner frequency fH= ',fH,' MHz\\n')\n",
+ "fL=14.5*10**-6;##MHz\n",
+ "fbw=fH-fL;\n",
+ "print\"%s %.2f %s\"%('\\nbandwidth = ',fbw,' MHz\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "open circuit time constant= 0.01 s\n",
+ "\n",
+ "\n",
+ "short circuit time constant= 2.73 ns\n",
+ "\n",
+ "\n",
+ "corner frequency fL= 14.47 Hz\n",
+ "\n",
+ "\n",
+ "corner frequency fH= 58.30 MHz\n",
+ "\n",
+ "\n",
+ "bandwidth = 58.30 MHz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg400"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 7.3\n",
+ "R1=51.2;\n",
+ "R2=9.6;\n",
+ "Rc=2.;\n",
+ "Re=.4;\n",
+ "Rsi=.1;\n",
+ "Vt=0.026;\n",
+ "Cc=1.;\n",
+ "Vcc=10.;\n",
+ "Vbe=0.7;\n",
+ "b=100.;\n",
+ "Rb=8.08;\n",
+ "Icq=1.81;\n",
+ "gm=Icq/Vt;\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance= ',gm,' mA/V\\n')\n",
+ "r=b*Vt/Icq;\n",
+ "print\"%s %.2f %s\"%('\\ndiffusion resistance= ',r,' KOhm\\n')\n",
+ "x=r+(1.+b)*Re;\n",
+ "y=x*R2/(x+R2);\n",
+ "Ri=y*R1/(R1+y);\n",
+ "print\"%s %.2f %s\"%('\\ninput resistance= ',Ri,' KOhm\\n')\n",
+ "Ts=(Rsi+Ri)*Cc;\n",
+ "print\"%s %.2f %s\"%('\\ntime constant= ',Ts, 'ms')\n",
+ "Ts=6.87*10**-3;##Sec\n",
+ "fL=1/(2.*math.pi*Ts);\n",
+ "print\"%s %.2f %s\"%('\\ncorner frequency fL= ',fL,' Hz\\n')\n",
+ "Rib=r+(1.+b)*Re;\n",
+ "print\"%s %.2f %s\"%('\\nRib= ',Rib,' KOhm\\n')\n",
+ "Av=(gm*r*Rc/(Rsi+Ri))*Rb/(Rb+Rib);\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal voltage gain= ',Av,'\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "transconductance= 69.62 mA/V\n",
+ "\n",
+ "\n",
+ "diffusion resistance= 1.44 KOhm\n",
+ "\n",
+ "\n",
+ "input resistance= 6.78 KOhm\n",
+ "\n",
+ "\n",
+ "time constant= 6.88 ms\n",
+ "\n",
+ "corner frequency fL= 23.17 Hz\n",
+ "\n",
+ "\n",
+ "Rib= 41.84 KOhm\n",
+ "\n",
+ "\n",
+ "small signal voltage gain= 4.71 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg402"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 7.4\n",
+ "fL=20.*10**-3;##KHz\n",
+ "Rd=6.7;\n",
+ "Rl=10;\n",
+ "Ts=1./(2.*math.pi*fL);\n",
+ "print\"%s %.2f %s\"%('\\ntime constant= ',Ts,' ms\\n')\n",
+ "Cc=Ts/(Rd+Rl);\n",
+ "print\"%s %.2f %s\"%('\\ncoupling capacitance= ',Cc,' microF\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "time constant= 7.96 ms\n",
+ "\n",
+ "\n",
+ "coupling capacitance= 0.48 microF\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5-pg403"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 7.5\n",
+ "b=100.;\n",
+ "Vbe=0.7;\n",
+ "Rs=500.;\n",
+ "Rb=100000.;\n",
+ "Re=10000.;\n",
+ "Rl=10000.;\n",
+ "Va=120.;\n",
+ "Ccc2=1*10**-6;\n",
+ "Icq=0.838*0.001;\n",
+ "r=3100.;##small signal parameter\n",
+ "gm=32.2*0.001;\n",
+ "ro=143000.;\n",
+ "x=(r+Rs*Rb/(Rs+Rb))/(1+b);\n",
+ "y=ro*x/(ro+x);\n",
+ "Ro=Re*y/(Re+y);\n",
+ "print\"%s %.2f %s\"%('\\noutput resistance of emitter= ',Ro,' Ohm\\n')\n",
+ "Ts=(Ro+Rl)*Ccc2;\n",
+ "print\"%s %.2f %s\"%('\\ntime constant= ',Ts,' s\\n')\n",
+ "fL=1/(2.*math.pi*Ts);\n",
+ "print\"%s %.2f %s\"%('\\n3dB frequency= ',fL,' Hz\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "output resistance of emitter= 35.48 Ohm\n",
+ "\n",
+ "\n",
+ "time constant= 0.01 s\n",
+ "\n",
+ "\n",
+ "3dB frequency= 15.86 Hz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6-pg406"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 7.6\n",
+ "Rs=3.2;\n",
+ "Rd=10.;\n",
+ "Rl=20.;\n",
+ "Cl=10.;\n",
+ "Vtp=-2.;\n",
+ "Kp=0.25;\n",
+ "Idq=0.5;\n",
+ "Vsgq=3.41;\n",
+ "Vsdq=3.41;\n",
+ "gm=2.*Kp*(Vsgq+Vtp);\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance = ',gm,'mA/V\\n')\n",
+ "Tp=Cl*Rd*Rl/(Rd+Rl);\n",
+ "print\"%s %.2f %s\"%('\\ntime constant= ',Tp,' ns\\n')\n",
+ "Tp=66.7*10**-3;##micro sec\n",
+ "fH=1./(2.*math.pi*Tp);\n",
+ "print\"%s %.2f %s\"%('\\ncorner frequency= ',fH,' MHz\\n')\n",
+ "Av=(gm*Rd*Rl/(Rd+Rl))/(1+gm*Rs);\n",
+ "print\"%s %.2f %s\"%('\\nmaximum small signal voltage gain=\\n',Av,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "transconductance = 0.71 mA/V\n",
+ "\n",
+ "\n",
+ "time constant= 66.67 ns\n",
+ "\n",
+ "\n",
+ "corner frequency= 2.39 MHz\n",
+ "\n",
+ "\n",
+ "maximum small signal voltage gain=\n",
+ " 1.44 \n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7-pg409"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 7.7\n",
+ "Vbe=0.7;\n",
+ "b=100.;\n",
+ "Re=.5;\n",
+ "Rc=5.;\n",
+ "Rl=10.;\n",
+ "R1=40.;\n",
+ "Cc=10.;\n",
+ "R2=5.7;\n",
+ "Rs=.1;\n",
+ "Vt=0.026;\n",
+ "Icq=0.99;\n",
+ "gm=Icq/Vt;\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance= ',gm,' mA/V\\n')\n",
+ "r=b*Vt/Icq;\n",
+ "print\"%s %.2f %s\"%('\\ndiffusion resistance= ',r,' KOhm\\n')\n",
+ "Ri=r+(1.+b)*Re;\n",
+ "print\"%s %.2f %s\"%('\\ninput resistance= ',Ri,' KOhm\\n')\n",
+ "x=Rc*Rl/(Rc+Rl);\n",
+ "y=R1*R2/(R1+R2);\n",
+ "t=y*Ri/(y+Ri);\n",
+ "Av=gm*r*x*(y/(y+Ri))*(1./(Rs+t));\n",
+ "print\"%s %.2f %s\"%('\\nmaximum small signal voltage gain=\\n',Av,'')\n",
+ "Ts=(Rs+t)*Cc;\n",
+ "print\"%s %.2f %s\"%('\\ntime constant=\\n',Ts,'ms')\n",
+ "Ts=46.6*0.001;##sec\n",
+ "Cl=15.;\n",
+ "Tp=x*Cl;\n",
+ "print\"%s %.2f %s\"%('\\ntime constant ',Tp,' ns\\n')\n",
+ "fL=1/(2.*math.pi*Ts);\n",
+ "print\"%s %.2f %s\"%('\\nlower corner frequency= ',fL,' Hz\\n')\n",
+ "Tp=50.*10**-3;##micro sec\n",
+ "fH=1/(2.*math.pi*Tp);\n",
+ "print\"%s %.2f %s\"%('\\nupper corner frequency= ',fH,' MHz\\n')\n",
+ "fL=3.4*10**-6;##MHz\n",
+ "fbw=fH-fL;\n",
+ "print\"%s %.2f %s\"%('\\nbandwidth = ',fbw,'MHz\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "transconductance= 38.08 mA/V\n",
+ "\n",
+ "\n",
+ "diffusion resistance= 2.63 KOhm\n",
+ "\n",
+ "\n",
+ "input resistance= 53.13 KOhm\n",
+ "\n",
+ "\n",
+ "maximum small signal voltage gain=\n",
+ " 6.14 \n",
+ "\n",
+ "time constant=\n",
+ " 46.61 ms\n",
+ "\n",
+ "time constant 50.00 ns\n",
+ "\n",
+ "\n",
+ "lower corner frequency= 3.42 Hz\n",
+ "\n",
+ "\n",
+ "upper corner frequency= 3.18 MHz\n",
+ "\n",
+ "\n",
+ "bandwidth = 3.18 MHz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex8-pg412"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ " \n",
+ "##Example 7.8\n",
+ "Re=4.;\n",
+ "Rc=2.;\n",
+ "Rs=0.5;\n",
+ "Vt=0.026;\n",
+ "Ce=1*10**-3;\n",
+ "V1=5.;\n",
+ "Icq=1.06;\n",
+ "V2=-5.;\n",
+ "b=100.;\n",
+ "Vbe=0.7;\n",
+ "gm=Icq/Vt;\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance = ',gm,'mA/V\\n')\n",
+ "r=b*Vt/Icq;\n",
+ "print\"%s %.2f %s\"%('\\ndiffusion resistance= ',r,' KOhm\\n')\n",
+ "Ta=Re*Ce;\n",
+ "print\"%s %.2f %s\"%('\\ntime constant Ta= ',Ta,'f s\\n')\n",
+ "Tb=(Re*Ce*(Rs+r))/(Rs+r+(1+b)*Re);\n",
+ "print\"%s %.2f %s\"%('\\ntime constant Tb= ',Tb,' s\\n')\n",
+ "fA=1/(2.*math.pi*Ta);\n",
+ "print\"%s %.2f %s\"%('\\ncorner frequency = ',fA,'Hz\\n')\n",
+ "Tb=2.9*0.01;##msec\n",
+ "fB=1/(2.*math.pi*Tb);\n",
+ "print\"%s %.2f %s\"%('\\ncorner frequency =',fB,'khz')\n",
+ "Av=(gm*r*Rc)/(Rs+r+(1.+b)*Re);\n",
+ "print\"%s %.2f %s\"%('\\nlimiting low frequency horizontal asymptote= \\n',Av,'')\n",
+ "Av=gm*r*Rc/(Rs+r);\n",
+ "print\"%s %.2f %s\"%('\\nnlimiting high frequency horizontal asymptote=\\n',Av,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "transconductance = 40.77 mA/V\n",
+ "\n",
+ "\n",
+ "diffusion resistance= 2.45 KOhm\n",
+ "\n",
+ "\n",
+ "time constant Ta= 0.00 f s\n",
+ "\n",
+ "\n",
+ "time constant Tb= 0.00 s\n",
+ "\n",
+ "\n",
+ "corner frequency = 39.79 Hz\n",
+ "\n",
+ "\n",
+ "corner frequency = 5.49 khz\n",
+ "\n",
+ "limiting low frequency horizontal asymptote= \n",
+ " 0.49 \n",
+ "\n",
+ "nlimiting high frequency horizontal asymptote=\n",
+ " 67.73 \n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex9-pg420"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 7.9\n",
+ "r=2600.;\n",
+ "C1=2.*10**-6;\n",
+ "C2=0.1*10**-6;\n",
+ "fB=1/(2.*math.pi*r*(C1+C2));\n",
+ "print\"%s %.2f %s\"%('\\n3dB frequency= ',fB,' MHz\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "3dB frequency= 29.15 MHz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex10-pg421"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 7.10\n",
+ "fT=500.;\n",
+ "Ic=1.;\n",
+ "b=100.;\n",
+ "Vt=0.026;\n",
+ "C2=0.3*10**-12;\n",
+ "fB=fT/b;\n",
+ "print\"%s %.2f %s\"%('\\nbandwidth= ',fB,' MHz\\n')\n",
+ "gm=Ic/Vt;\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance= ',gm,'mA/V\\n')\n",
+ "fT=500000000.;\n",
+ "gm=38.5*0.001;\n",
+ "C1=gm/(fT*2.*math.pi)-C2;\n",
+ "print\"%s %.2e %s\"%('\\ncapacitance = ',C1,'F\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "bandwidth= 5.00 MHz\n",
+ "\n",
+ "\n",
+ "transconductance= 38.46 mA/V\n",
+ "\n",
+ "\n",
+ "capacitance = 1.20e-11 F\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex12-pg430"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 7.12\n",
+ "Kn=0.25;\n",
+ "Vtn=1.;\n",
+ "Cgd=0.04*10**-3;\n",
+ "Cgs=0.2*10**-3;\n",
+ "Vgs=3.;\n",
+ "gm=2.*Kn*(Vgs-Vtn);\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance = ',gm,'mA/V\\n')\n",
+ "fT=gm/(2.*math.pi*(Cgd+Cgs));\n",
+ "print\"%s %.2f %s\"%('\\nunity gain bandwidth= ',fT,' MHz\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "transconductance = 1.00 mA/V\n",
+ "\n",
+ "\n",
+ "unity gain bandwidth= 663.15 MHz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex13-pg432"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ " \n",
+ "##Example 7.13\n",
+ "gm=1.;\n",
+ "Cgd=0.04;\n",
+ "Rl=10.;\n",
+ "Cgs=0.2;\n",
+ "Cm=Cgd*(1.+gm*Rl);\n",
+ "print\"%s %.2f %s\"%('\\nMiller capacitance= ',Cm,' pF\\n')\n",
+ "Cm=0.44*0.001;##nF\n",
+ "Cgs=0.2*0.001;##nF\n",
+ "fT=gm/(2.*math.pi*(Cgs+Cm));\n",
+ "print\"%s %.2f %s\"%('\\ncutoff frequency= ',fT,' MHz\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Miller capacitance= 0.44 pF\n",
+ "\n",
+ "\n",
+ "cutoff frequency= 248.68 MHz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex14-pg435"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 7.14\n",
+ "V1=5.;\n",
+ "V=-5.;\n",
+ "Rs=0.1;\n",
+ "Rb=40.;\n",
+ "R2=5.72;\n",
+ "Re=0.5;\n",
+ "Rc=5.;\n",
+ "Rl=10.;\n",
+ "b=150.;\n",
+ "Vbe=0.7;\n",
+ "C1=35*10**-3;\n",
+ "C2=4.;\n",
+ "Vt=0.026;\n",
+ "Icq=1.02;\n",
+ "r=b*Vt/Icq;\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal parameter= ',r,' KOhm\\n')\n",
+ "gm=Icq/Vt;\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance= ',gm,' mA/V\\n')\n",
+ "Cm=C2*(1+gm*Rc*Rl/(Rc+Rl));\n",
+ "print\"%s %.2f %s\"%('\\nMiller capacitance= ',Cm,' pF\\n')\n",
+ "Cm=527.*10**-3;\n",
+ "x=Rb*Rs/(Rb+Rs);\n",
+ "y=r*x/(r+x);\n",
+ "fH=1/(2.*math.pi*y*(C1+Cm));\n",
+ "print\"%s %.2f %s\"%('\\nupper corner frequency = ',fH,'MHz\\n')\n",
+ "t=Rb*r/(Rb+r);\n",
+ "p=Rc*Rl/(Rc+Rl);\n",
+ "Av=gm*p*t/(t+Rs);\n",
+ "print\"%s %.2f %s\"%('\\nmidband gain= ',Av,'\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "small signal parameter= 3.82 KOhm\n",
+ "\n",
+ "\n",
+ "transconductance= 39.23 mA/V\n",
+ "\n",
+ "\n",
+ "Miller capacitance= 527.08 pF\n",
+ "\n",
+ "\n",
+ "upper corner frequency = 2.91 MHz\n",
+ "\n",
+ "\n",
+ "midband gain= 127.13 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex15-pg439"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 7.15\n",
+ "V1=5.;\n",
+ "V=-5.;\n",
+ "Rs=0.1;\n",
+ "R1=40.;\n",
+ "R2=5.72;\n",
+ "Re=0.5;\n",
+ "Rc=5.;\n",
+ "Rl=10.;\n",
+ "b=150.;\n",
+ "Vbe=0.7;\n",
+ "C1=35.;\n",
+ "C2=4.;\n",
+ "Vt=0.026;\n",
+ "Icq=1.02;\n",
+ "gm=39.2;\n",
+ "r=3.82;\n",
+ "x=Re*Rs/(Re+Rs);\n",
+ "t=r/(1.+b);\n",
+ "y=t*x/(t+x);\n",
+ "Tp=y*C1;\n",
+ "print\"%s %.2f %s\"%('\\ntime constant= ',Tp,' ns\\n')\n",
+ "Tp=0.679*10**-3;##micro sec\n",
+ "f=1/(2.*math.pi*Tp);\n",
+ "print\"%s %.2f %s\"%('\\nupper frequency = ',f,'MHz\\n')\n",
+ "T=C2*Rc*Rl/(Rc+Rl);\n",
+ "print\"%s %.2f %s\"%('\\ntime constant= ',T,' ns\\n')\n",
+ "T=13.3*10**-3;##micro sec\n",
+ "f=1/(2.*math.pi*T);\n",
+ "print\"%s %.2f %s\"%('\\nupper frequency= ',f,' MHz\\n')\n",
+ "x=Rc*Rl/(Rc+Rl);\n",
+ "y=Re*t/(Re+t);\n",
+ "Av=gm*x*(y/(y+Rs));\n",
+ "print\"%s %.2f %s\"%('\\nmidband voltage gain \\n',Av,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "time constant= 0.68 ns\n",
+ "\n",
+ "\n",
+ "upper frequency = 234.40 MHz\n",
+ "\n",
+ "\n",
+ "time constant= 13.33 ns\n",
+ "\n",
+ "\n",
+ "upper frequency= 11.97 MHz\n",
+ "\n",
+ "\n",
+ "midband voltage gain \n",
+ " 25.36 \n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex16-pg443"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 7.16\n",
+ "V1=5.;\n",
+ "V=-5.;\n",
+ "Rs=0.1;\n",
+ "R1=42.5;\n",
+ "R2=20.5;\n",
+ "R3=28.3;\n",
+ "Re=5.4;\n",
+ "Rc=5.;\n",
+ "Rl=10.;\n",
+ "b=150.;\n",
+ "Vbe=0.7;\n",
+ "C1=35.;\n",
+ "C2=4.;\n",
+ "Vt=0.026;\n",
+ "Icq=1.02;\n",
+ "gm=39.2;\n",
+ "r=3.820;\n",
+ "Rb=R2*R3/(R2+R3);\n",
+ "x=Rb*r/(Rb+r);\n",
+ "y=Rs*x/(x+Rs);\n",
+ "Tp=y*(C1+2*C2);\n",
+ "print\"%s %.2f %s\"%('\\ntime constant= ',Tp,' ns\\n')\n",
+ "Tp=Tp*10**-3;##micro sec\n",
+ "f=1/(2.*math.pi*Tp);\n",
+ "print\"%s %.2f %s\"%('\\n3dB frequency = ',f,'MHz\\n')\n",
+ "T=C2*Rc*Rl/(Rc+Rl);\n",
+ "print\"%s %.2f %s\"%('\\ntime constant= ',T,'ns\\n')\n",
+ "T=T*0.001;##micro sec\n",
+ "f=1/(2.*math.pi*T);\n",
+ "print\"%s %.2f %s\"%('\\nupper frequency= ',f,' MHz\\n')\n",
+ "x=Rc*Rl/(Rc+Rl);\n",
+ "y=Rb*r/(Rb+r);\n",
+ "Av=gm*x*(y/(y+Rs));\n",
+ "print\"%s %.2f %s\"%('\\nmidband voltage gain= ',Av,' \\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "time constant= 4.16 ns\n",
+ "\n",
+ "\n",
+ "3dB frequency = 38.29 MHz\n",
+ "\n",
+ "\n",
+ "time constant= 13.33 ns\n",
+ "\n",
+ "\n",
+ "upper frequency= 11.94 MHz\n",
+ "\n",
+ "\n",
+ "midband voltage gain= 126.30 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex17-pg447"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "##Example 7.17\n",
+ "V1=5.;\n",
+ "V=-5.;\n",
+ "Rs=0.1;\n",
+ "R1=40;\n",
+ "R2=5.720;\n",
+ "Re=0.5;\n",
+ "Rc=5.;\n",
+ "Rl=10.;\n",
+ "b=150.;\n",
+ "Vbe=0.7;\n",
+ "C1=35.;\n",
+ "C2=4.;\n",
+ "Vt=0.026;\n",
+ "Icq=1.02;\n",
+ "gm=39.2;\n",
+ "r=3.820;\n",
+ "t=r/(1.+b);\n",
+ "t=t*0.001;\n",
+ "f=1/(2.*math.pi*C1*t);\n",
+ "print'%s %.2f %s'%('\\nthe zero occurs at this frequency= ',f,' MHz\\n')\n",
+ "x=1+gm*Re*Rl/(Re+Rl);\n",
+ "Rb=R1*R2/(R1+R2)\n",
+ "d=x*r;\n",
+ "y=d*Rb/(d+Rb);\n",
+ "t=y*Rs/(y+Rs);\n",
+ "Tp=t*(C2+C1/x);\n",
+ "print'%s %.2f %s'%('\\ntime constant= ',Tp,' ns\\n')\n",
+ "Tp=Tp*10**-3;##micro sec\n",
+ "f=1/(2.*math.pi*Tp);\n",
+ "print'%s %.2f %s'%('\\n3dB frequency= ',f,' MHz\\n')"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "the zero occurs at this frequency= 179.75 MHz\n",
+ "\n",
+ "\n",
+ "time constant= 0.57 ns\n",
+ "\n",
+ "\n",
+ "3dB frequency= 281.24 MHz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter8_1.ipynb b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter8_1.ipynb new file mode 100644 index 00000000..fd68eb2b --- /dev/null +++ b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter8_1.ipynb @@ -0,0 +1,447 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:92d1830ec3843ba385a218c6a4322e578c945c5df33293c6543963425e76ab14"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter8-Ouput Stages and Power Amplifier "
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg478"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 8.1\n",
+ "##let thermal resistance parameters be R\n",
+ "Rdcase=1.75;##degree celsius per watt\n",
+ "Rcsnk=1.;##degree celsius per watt\n",
+ "Rsamb=5.;##degree celsius per watt\n",
+ "Rcamb=50.;##degree celsius per watt\n",
+ "Tamb=30.;##ambient temperature \n",
+ "Tjmax=150.;##maximum junction temperature\n",
+ "Tdev=150.;##device temperature\n",
+ "##when no heat sink is used\n",
+ "P=(Tjmax-Tamb)/(Rdcase+Rcamb);\n",
+ "print\"%s %.2f %s\"%('\\nmaximum power dissipation= ',P,' W\\n')\n",
+ "##when heat sink is used\n",
+ "P=(Tjmax-Tamb)/(Rdcase+Rcsnk+Rsamb);\n",
+ "print\"%s %.2f %s\"%('\\nmaximum power dissipation= ',P,' W\\n')\n",
+ "\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "maximum power dissipation= 2.32 W\n",
+ "\n",
+ "\n",
+ "maximum power dissipation= 15.48 W\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg479"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 8.3\n",
+ "Rcsnk=1.;##degree celsius per watt\n",
+ "Rsamb=5.;##degree celsius per watt\n",
+ "Tjmax=175.;##maximum junction temperature\n",
+ "Toc=25.;\n",
+ "Tamb=25.;\n",
+ "Pr=20.;##rated power W\n",
+ "Rdcase=(Tjmax-Toc)/Pr;\n",
+ "print\"%s %.2f %s\"%('\\ndevice to case thermal resistance= ',Rdcase,' C/W\\n')\n",
+ "P=(Tjmax-Tamb)/(Rdcase+Rcsnk+Rsamb);\n",
+ "print\"%s %.2f %s\"%('\\nmaximum power dissipation= ',P,' W\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "device to case thermal resistance= 7.50 C/W\n",
+ "\n",
+ "\n",
+ "maximum power dissipation= 11.11 W\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7-pg492"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 8.7\n",
+ "Vdd=10.;\n",
+ "Rl=20.;\n",
+ "K=0.2;\n",
+ "Vt=1.;\n",
+ "vo=5.;\n",
+ "iL=vo/20.;\n",
+ "print\"%s %.2f %s\"%('\\niL= ',iL,' A\\n')\n",
+ "Idq=0.05;\n",
+ "##Idq=K*(Vbb/2-Vt)\n",
+ "Vbb=(math.sqrt(Idq/K)+1.)*2.;\n",
+ "print\"%s %.2f %s\"%('\\nVbb= ',Vbb,' V\\n')\n",
+ "iD=iL;\n",
+ "Vgsn=math.sqrt(iD/K)+Vt;\n",
+ "print\"%s %.2f %s\"%('\\nVgsn= ',Vgsn,' V\\n')\n",
+ "Vsgp=Vbb-Vgsn;\n",
+ "print\"%s %.2f %s\"%('\\nVsgp= ',Vsgp,' V\\n')\n",
+ "vi=vo+Vgsn-Vbb/2.;\n",
+ "print\"%s %.2f %s\"%('\\ninput voltage= ',vi,' V\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "iL= 0.25 A\n",
+ "\n",
+ "\n",
+ "Vbb= 3.00 V\n",
+ "\n",
+ "\n",
+ "Vgsn= 2.12 V\n",
+ "\n",
+ "\n",
+ "Vsgp= 0.88 V\n",
+ "\n",
+ "\n",
+ "input voltage= 5.62 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex8-pg498"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ " \n",
+ "##Example 8.8\n",
+ "Vcc=24.;\n",
+ "Rl=8.;\n",
+ "P=5.;\n",
+ "Vbe=0.7;\n",
+ "b=100.;\n",
+ "Vp=math.sqrt(2.*Rl*P);\n",
+ "print\"%s %.2f %s\"%('\\npeak output voltage= ',Vp,' V\\n')\n",
+ "Ip=Vp/Rl;\n",
+ "print\"%s %.2f %s\"%('\\npeak output current = ',Ip,'A\\n')\n",
+ "a=0.9*Vcc/Vp;\n",
+ "print\"%s %.2f %s\"%('\\na= ',a,'\\n')\n",
+ "Icq=Ip/(0.9*a);\n",
+ "print\"%s %.2f %s\"%('\\nIcq= ',Icq,' A\\n')\n",
+ "Pq=Vcc*Icq;\n",
+ "print\"%s %.2f %s\"%('\\nmaximum power dissipated in the transistor= ',Pq,' W\\n')\n",
+ "Ibq=Icq/b;\n",
+ "Ibq=Ibq*1000.;##mA\n",
+ "print\"%s %.2f %s\"%('\\nbase current Ibq= ',Ibq,' mA\\n')\n",
+ "Rth=2.500;\n",
+ "##Vth=Vcc*Rth/R1 and Vth=Ibq*Rth+Vbe\n",
+ "R1=Vcc*Rth/(Ibq*Rth+Vbe);\n",
+ "print\"%s %.2f %s\"%('\\nR1= ',R1,' KOhm\\n')\n",
+ "R2=Rth*R1/(R1-Rth);\n",
+ "print\"%s %.2f %s\"%('\\nR2= ',R2,' KOhm\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "peak output voltage= 8.94 V\n",
+ "\n",
+ "\n",
+ "peak output current = 1.12 A\n",
+ "\n",
+ "\n",
+ "a= 2.41 \n",
+ "\n",
+ "\n",
+ "Icq= 0.51 A\n",
+ "\n",
+ "\n",
+ "maximum power dissipated in the transistor= 12.35 W\n",
+ "\n",
+ "\n",
+ "base current Ibq= 5.14 mA\n",
+ "\n",
+ "\n",
+ "R1= 4.42 KOhm\n",
+ "\n",
+ "\n",
+ "R2= 5.75 KOhm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex9-pg500"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 8.9\n",
+ "Iso=3*10**-14;\n",
+ "Isq=10**-13;\n",
+ "b=75.;\n",
+ "Vt=0.026;\n",
+ "Rl=8.;\n",
+ "P=5.;\n",
+ "Vp=math.sqrt(2.*Rl*P);\n",
+ "print\"%s %.2f %s\"%('\\npeak voltage Vp= ',Vp,' V\\n')\n",
+ "Vcc=Vp/0.8;\n",
+ "print\"%s %.2f %s\"%('\\nsupply voltage= ',Vcc,' V\\n')\n",
+ "Ien=Vp/Rl;\n",
+ "print\"%s %.2f %s\"%('\\nemitter current= ',Ien,' A\\n')\n",
+ "Ibn=Ien/(1.+b);\n",
+ "Ibn=Ibn*1000.;##mA\n",
+ "print\"%s %.2f %s\"%('\\nbase current= ',Ibn,' mA\\n')\n",
+ "iD=0.020;\n",
+ "Vbb=2.*Vt*math.log(iD/Iso);\n",
+ "print\"%s %.2f %s\"%('\\nVbb= ',Vbb,' V\\n')\n",
+ "Icq=Isq*math.exp((Vbb/2.)/Vt);\n",
+ "Icq=Icq*1000.;##mA\n",
+ "print\"%s %.2f %s\"%('\\nquiescent collector current= ',Icq,' mA\\n')\n",
+ "Ibias=20.;##mA\n",
+ "iD=Ibias-Ibn;\n",
+ "print\"%s %.2f %s\"%('\\ndrain current= ',iD,' mA\\n')\n",
+ "iD=iD*0.001;##A\n",
+ "Vbb=2.*Vt*math.log(iD/Iso);\n",
+ "print\"%s %.2f %s\"%('\\nVbb= ',Vbb,' V\\n')\n",
+ "Icn=1.12;\n",
+ "Vben=Vt*math.log(Icn/Isq);\n",
+ "print\"%s %.2f %s\"%('\\nB-E voltage of Qn= ',Vben,' V\\n')\n",
+ "Vebp=Vbb-Vben;\n",
+ "print\"%s %.2f %s\"%('\\nemitter base voltage of Qp= ',Vebp,' V\\n')\n",
+ "Icp=Isq*math.exp(Vebp/Vt);\n",
+ "Icp=Icp*1000.;##mA\n",
+ "print\"%s %.2f %s\"%('\\nIcp ',Icp,' mA\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "peak voltage Vp= 8.94 V\n",
+ "\n",
+ "\n",
+ "supply voltage= 11.18 V\n",
+ "\n",
+ "\n",
+ "emitter current= 1.12 A\n",
+ "\n",
+ "\n",
+ "base current= 14.71 mA\n",
+ "\n",
+ "\n",
+ "Vbb= 1.42 V\n",
+ "\n",
+ "\n",
+ "quiescent collector current= 66.67 mA\n",
+ "\n",
+ "\n",
+ "drain current= 5.29 mA\n",
+ "\n",
+ "\n",
+ "Vbb= 1.35 V\n",
+ "\n",
+ "\n",
+ "B-E voltage of Qn= 0.78 V\n",
+ "\n",
+ "\n",
+ "emitter base voltage of Qp= 0.57 V\n",
+ "\n",
+ "\n",
+ "Icp 0.28 mA\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex11-pg505"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 8.11\n",
+ "R1=2.;##KOhm\n",
+ "R2=R1;\n",
+ "Rl=.1;##KOhm\n",
+ "b=60.;\n",
+ "Vbe=0.6;\n",
+ "Veb=0.6;\n",
+ "V1=15.;\n",
+ "V2=V1;\n",
+ "iR1=(V1-Vbe)/R1;\n",
+ "##iR1=iR2=iE1=iE2\n",
+ "print\"%s %.2f %s\"%('\\niR1= ',iR1,' mA\\n')\n",
+ "vo=10.;\n",
+ "io=vo/Rl;\n",
+ "print\"%s %.2f %s\"%('\\noutput current= ',io,' mA\\n')\n",
+ "iB3=100./61.;\n",
+ "print\"%s %.2f %s\"%('\\niB3= ',iB3,'mA\\n')\n",
+ "iR1=(V1-(10.+Vbe))/R1;\n",
+ "print\"%s %.2f %s\"%('\\ncurrent in R1= ',iR1,' mA\\n')\n",
+ "iE1=iR1-iB3;\n",
+ "print\"%s %.2f %s\"%('\\niE1= ',iE1,' mA\\n')\n",
+ "iB1=iE1/(1.+b);\n",
+ "iB1=iB1*1000.;##micro A\n",
+ "print\"%s %.2f %s\"%('\\niB1= ',iB1,' microA\\n')\n",
+ "iE2=(10-0.6+15.)/R1;\n",
+ "print\"%s %.2f %s\"%('\\niE2= ',iE2,' mA\\n')\n",
+ "iB2=iE2/(1.+b);\n",
+ "iB2=iB2*1000.;\n",
+ "print\"%s %.2f %s\"%('\\niB2= ',iB2,' microA\\n')\n",
+ "Ii=iB2-iB1;\n",
+ "print\"%s %.2f %s\"%('\\ninput current= ',Ii,' microA\\n')\n",
+ "Ii=Ii*0.001;##mA\n",
+ "Ai=io/Ii;\n",
+ "print\"%s %.2f %s\"%('\\ncurrent gain=\\n',Ai,'')\n",
+ "Ai=(1.+b)*R1/(2.*Rl);\n",
+ "print\"%s %.2f %s\"%('\\npredicted current gain=\\n',Ai,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "iR1= 7.20 mA\n",
+ "\n",
+ "\n",
+ "output current= 100.00 mA\n",
+ "\n",
+ "\n",
+ "iB3= 1.64 mA\n",
+ "\n",
+ "\n",
+ "current in R1= 2.20 mA\n",
+ "\n",
+ "\n",
+ "iE1= 0.56 mA\n",
+ "\n",
+ "\n",
+ "iB1= 9.19 microA\n",
+ "\n",
+ "\n",
+ "iE2= 12.20 mA\n",
+ "\n",
+ "\n",
+ "iB2= 200.00 microA\n",
+ "\n",
+ "\n",
+ "input current= 190.81 microA\n",
+ "\n",
+ "\n",
+ "current gain=\n",
+ " 524.08 \n",
+ "\n",
+ "predicted current gain=\n",
+ " 610.00 \n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter9_1.ipynb b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter9_1.ipynb new file mode 100644 index 00000000..9ad477cc --- /dev/null +++ b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter9_1.ipynb @@ -0,0 +1,136 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:d282b66b032984b081a8c690d9d63b875908c2e44c5ac2a36021797d10bf6331"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter9-The Ideal Operational Amplifier"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5-pg541"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 9.5\n",
+ "Zl=0.1;\n",
+ "R1=10.;\n",
+ "R2=1.;\n",
+ "R3=1.;\n",
+ "Rf=10.;\n",
+ "Vt=-5.;\n",
+ "iL=-Vt/R2;\n",
+ "print\"%s %.2f %s\"%('\\nload current= ',iL,' mA\\n')\n",
+ "vL=iL*Zl;\n",
+ "print\"%s %.2f %s\"%('\\nvoltage across the load= ',vL,' V\\n')\n",
+ "i4=vL/R2;\n",
+ "print\"%s %.2f %s\"%('\\ni4= ',i4,' mA\\n')\n",
+ "i3=i4+iL;\n",
+ "print\"%s %.2f %s\"%('\\ni3= ',i3,' mA\\n')\n",
+ "Vo=i3*R3+vL;\n",
+ "print\"%s %.2f %s\"%('\\noutput voltage= ',Vo,' V\\n')\n",
+ "i1=Vt/R1;\n",
+ "i2=i1;\n",
+ "print\"%s %.2f %s\"%('\\ni1= ',i1,' mA\\n')\n",
+ "print\"%s %.2f %s\"%('\\ni2= ',i2,' mA\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "load current= 5.00 mA\n",
+ "\n",
+ "\n",
+ "voltage across the load= 0.50 V\n",
+ "\n",
+ "\n",
+ "i4= 0.50 mA\n",
+ "\n",
+ "\n",
+ "i3= 5.50 mA\n",
+ "\n",
+ "\n",
+ "output voltage= 6.00 V\n",
+ "\n",
+ "\n",
+ "i1= -0.50 mA\n",
+ "\n",
+ "\n",
+ "i2= -0.50 mA\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex9-pg552"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "import numpy\n",
+ "import scipy\n",
+ "from scipy import integrate\n",
+ " \n",
+ "##Example 9.9\n",
+ "##Vo=(-1/R1*C2)*integrate((-1)dt) \n",
+ "def fun(x):\n",
+ " y=-1\n",
+ " return y\n",
+ "Vo=10.;\n",
+ "I=scipy.integrate.quad(fun, 0, 1);\n",
+ "I1=I[0]\n",
+ "##let y=R1*C2\n",
+ "y1=I1/Vo;\n",
+ "print\"%s %.2f %s\"%('\\nR1C2= ',y1,' ms\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "R1C2= -0.10 ms\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/screenshots/chapter3.png b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/screenshots/chapter3.png Binary files differnew file mode 100644 index 00000000..08f55569 --- /dev/null +++ b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/screenshots/chapter3.png diff --git a/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/screenshots/chapter4.png b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/screenshots/chapter4.png Binary files differnew file mode 100644 index 00000000..2e4992d7 --- /dev/null +++ b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/screenshots/chapter4.png diff --git a/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/screenshots/chapter5.png b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/screenshots/chapter5.png Binary files differnew file mode 100644 index 00000000..3e2376df --- /dev/null +++ b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/screenshots/chapter5.png diff --git a/Machine_Design_by_T._H._Wentzell,_P._E/Chapter1.ipynb b/Machine_Design_by_T._H._Wentzell,_P._E/Chapter1.ipynb new file mode 100644 index 00000000..e5b48a9e --- /dev/null +++ b/Machine_Design_by_T._H._Wentzell,_P._E/Chapter1.ipynb @@ -0,0 +1,88 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:1d76b1008117b9259d7e6a17a81353d60bd8490c5f9100521ab22a813e31d7f5"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter1-What Is Mechanical Design"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg13"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-1.2 Page 13 ') \n",
+ "##Example 1.2\n",
+ "\n",
+ "Sy=61000. ##[psi] Tensile strength of AISI 1020 cold drawn steel from Appendix 4 Page no 470\n",
+ "SF=2.; ##[] safety factor\n",
+ "F=300.; ##[lb] Weight of the ball\n",
+ "L=36.; ##[in] Length of round bar\n",
+ "Sy=61000.; ##[psi] Tensile strength from Appendix 4\n",
+ "M=F*L; ##[in*lb] Bending moment Appendix 2\n",
+ "\n",
+ "Sall=Sy/SF; ##[psi] Allowable stress \n",
+ "Z=M/Sall; ##[in^3] Section modulus for bending Sall=M/Z\n",
+ "D=(32.*Z/math.pi)**(1./3.); ##[in] Diameter of bar\n",
+ "\n",
+ "##Use 13/8 in bar\n",
+ "D1=1.625;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n\\n Diameter of Bar is ',D1,' in');\n",
+ "\n",
+ "##Checking Deflection\n",
+ "I=math.pi*D1**4/64.; ##[in^4] Moment of inertia Appendix 3\n",
+ "E=30.*10**6.; ##[lb/in^2] Modulus of elasticity\n",
+ "Delta=F*L**3./(3.*E*I); ##[in] Deflection \n",
+ "\n",
+ "##Note- In the book I=0.342 in^4 is used instead of I=0.3422814 in^4\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n The deflection of bar is',Delta,' in');\n",
+ "\n",
+ "\n",
+ "##Note: The deviation of answer from the answer given in the book is due to round off error.(In the book values are rounded while in scilab actual values are taken)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-1.2 Page 13 \n",
+ "\n",
+ "\n",
+ " Diameter of Bar is 1.62 in \n",
+ "\n",
+ " The deflection of bar is 0.45 in \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Machine_Design_by_T._H._Wentzell,_P._E/Chapter10.ipynb b/Machine_Design_by_T._H._Wentzell,_P._E/Chapter10.ipynb new file mode 100644 index 00000000..b0f9cb33 --- /dev/null +++ b/Machine_Design_by_T._H._Wentzell,_P._E/Chapter10.ipynb @@ -0,0 +1,168 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:9f59c6e7288ebefbd1514a29eca292526957ac452562d5554e64076a8e1d7c3c"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter10-Pneumatic and Hydraulic Drives"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg195"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-10.1 Page No.195\\n');\n",
+ "\n",
+ "P=100.; ##[lb/in^2] Hydraulic pressure\n",
+ "F=450.; ##[lb] Extension force\n",
+ "Fr=400.; ##[lb] Retraction force\n",
+ "\n",
+ "A=F/P; ##[in^2] Cross section area\n",
+ "D=math.sqrt(4.*A/math.pi); ##[in] Bore of cylinder\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n The bore of cylinder is ',D,' in.');\n",
+ "\n",
+ "##Use 2.5in bore cylinder\n",
+ "\n",
+ "Dm=2.5; ##[in] Bore of cylinder\n",
+ "Dr=1.; ##[in] Diameter of rod\n",
+ "A2=math.pi*Dm**2/4.-math.pi*Dr**2/4.; ##[in^2]\n",
+ "F2=P*A2; ##[lb] Force\n",
+ "\n",
+ "if F2>=Fr:\n",
+ " print'%s %.2f %s '%('\\n The diameter of rod is ',Dr,' in.');\n",
+ "else: \n",
+ " print'%s %.2f %s '%('\\n This would not meet requirement');\n",
+ "\n",
+ "\n",
+ "##This would meet requirement\n",
+ "\n",
+ "Ab=math.pi*Dm**2/4.; ##[in^2] Cross section area\n",
+ "##Note-In the book V=180.7 is used instead of V=180.64158 \n",
+ "d=20.; ##[in] stroke\n",
+ "V=Ab*d+A2*d; ##[in^3] Volume per cycle\n",
+ "t=2.; ##[s] Cycle time\n",
+ "FR=V/t; ##[in^3/s] Flowrate\n",
+ "\n",
+ "FR=FR*7.48*60/1728.; ##[gal/min] Flowrate\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Flow rate required is ',FR,' gal/min.');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-10.1 Page No.195\n",
+ "\n",
+ "\n",
+ " The bore of cylinder is 2.39 in. \n",
+ "\n",
+ " The diameter of rod is 1.00 in. \n",
+ "\n",
+ " Flow rate required is 23.46 gal/min. \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg198"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-10.2 Page No.198\\n');\n",
+ "\n",
+ "Pa=100.; ##[lb/in^2] Air pressure\n",
+ "Da=4.; ##[in] Diameter\n",
+ "Aa=math.pi*Da**2/4.; ##[in^2] Cross section area\n",
+ "\n",
+ "F1=Pa*Aa; ##[lb] \n",
+ "Do=1.; ##[in] \n",
+ "Ao=math.pi*Do**2/4.; ##[in] \n",
+ "Po=F1/Ao; ##[lb/in^2]\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n The oil pressure is ',Po,' lb/in^2.');\n",
+ "\n",
+ "D2o=3.; ##[in]\n",
+ "A2o=math.pi*D2o**2/4.; ##[in^2]\n",
+ "F2=Po*A2o;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Force F on piston rod is ',F2,' lb.');\n",
+ "\n",
+ "D=1.; ##[in]\n",
+ "d=4.; ##[in] \n",
+ "A=math.pi*D**2/4.; ##[in^2]\n",
+ "\n",
+ "V=A*d; ##[in^3]\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n The volume in 1-inch cylinder for the 4-inch travel is ',V,' in^3.');\n",
+ "\n",
+ "A3=math.pi*3**2/4.; ##[in^2]\n",
+ "l3=V/A3; ##[in]\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Travel for 3-inch cylinder is ',l3,' in.');\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-10.2 Page No.198\n",
+ "\n",
+ "\n",
+ " The oil pressure is 1600.00 lb/in^2. \n",
+ "\n",
+ " Force F on piston rod is 11309.73 lb. \n",
+ "\n",
+ " The volume in 1-inch cylinder for the 4-inch travel is 3.14 in^3. \n",
+ "\n",
+ " Travel for 3-inch cylinder is 0.44 in. \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Machine_Design_by_T._H._Wentzell,_P._E/Chapter11.ipynb b/Machine_Design_by_T._H._Wentzell,_P._E/Chapter11.ipynb new file mode 100644 index 00000000..93750f06 --- /dev/null +++ b/Machine_Design_by_T._H._Wentzell,_P._E/Chapter11.ipynb @@ -0,0 +1,425 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:77d51e561aaa21526a511d7143ff39b4181a0cfc44e0eaa5fd44138712eb9cd6"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter11-Gear Design"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg217"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-11.1 Page No.217\\n');\n",
+ "\n",
+ "N2=60.;\n",
+ "N1=20.;\n",
+ "N3=20.;\n",
+ "N4=60.;\n",
+ "\n",
+ "Vr=(N2/N1)*(N4/N3);\n",
+ "\n",
+ "##Output speed\n",
+ "n1=3600.;\n",
+ "n4=n1/Vr;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n The output speed is ',n4,' rpm.');\n",
+ "\n",
+ "##Output torque\n",
+ "T1=200.;\n",
+ "T4=T1*Vr;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n The output torque is ',T4,' lb*in.');\n",
+ "\n",
+ "##Input horsepower\n",
+ "hpi=T1*n1/63000.;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n The input horsepower is ',hpi,' hp.');\n",
+ "\n",
+ "##Output horsepower\n",
+ "hpo=T4*n4/63000.;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n The output horsepower is ',hpo,' hp.');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-11.1 Page No.217\n",
+ "\n",
+ "\n",
+ " The output speed is 400.00 rpm. \n",
+ "\n",
+ " The output torque is 1800.00 lb*in. \n",
+ "\n",
+ " The input horsepower is 11.43 hp. \n",
+ "\n",
+ " The output horsepower is 11.43 hp. \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg219"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-11.2 Page No.219\\n');\n",
+ "\n",
+ "Na=20.;\n",
+ "Nb=65.;\n",
+ "Nc=20.;\n",
+ "Nd=22.;\n",
+ "Ne=60.;\n",
+ "\n",
+ "##train value\n",
+ "Vr=(Nb/Na)*(Nd/Nc)*(Ne/Nd);\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Train value = ',Vr,'');\n",
+ "\n",
+ "##Output speed\n",
+ "na=3000.;\n",
+ "ne=na/Vr;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n \\Output speed = ',ne,' rpm.');\n",
+ "\n",
+ "##Output torque\n",
+ "Ta=10.;\n",
+ "Te=Ta*Vr;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Output torque = ',Te,' lb*in.');\n",
+ "\n",
+ "##Direction\n",
+ "\n",
+ "print('\\n Direction\\n If Gear A is clockwise,\\n Gear B is counterclockwise.\\n Gear C is counterclockwise.\\n Gear D is clockwise. \\n Gear E is counterclockwise.');\n",
+ "\n",
+ "##Output power\n",
+ "P=Te*ne;\n",
+ "P=P*math.pi/60;\n",
+ "print'%s %.2f %s '%('\\n Output power = ',P,' W.');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-11.2 Page No.219\n",
+ "\n",
+ "\n",
+ " Train value = 9.75 \n",
+ "\n",
+ " \\Output speed = 307.69 rpm. \n",
+ "\n",
+ " Output torque = 97.50 lb*in. \n",
+ "\n",
+ " Direction\n",
+ " If Gear A is clockwise,\n",
+ " Gear B is counterclockwise.\n",
+ " Gear C is counterclockwise.\n",
+ " Gear D is clockwise. \n",
+ " Gear E is counterclockwise.\n",
+ "\n",
+ " Output power = 1570.80 W. \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg231"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ " \n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-11.3 Page No.231\\n');\n",
+ "\n",
+ "Np=16.;\n",
+ "Ng=32.;\n",
+ "Pd=8.;\n",
+ "\n",
+ "##Pitch diameter\n",
+ "Dp=Np/Pd;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Pinion pitch diameter is ',Dp,' in.');\n",
+ "\n",
+ "Dg=Ng/Pd;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Gear pitch diameter is ',Dg,' in.');\n",
+ "\n",
+ "##Circular pitch\n",
+ "Pc=math.pi*Dp/Np;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Circular pitch is ',Pc,' in.');\n",
+ "\n",
+ "##Centerline distance\n",
+ "CC=(Dp+Dg)/2.;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Centerline distance is ',CC,' in.');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-11.3 Page No.231\n",
+ "\n",
+ "\n",
+ " Pinion pitch diameter is 2.00 in. \n",
+ "\n",
+ " Gear pitch diameter is 4.00 in. \n",
+ "\n",
+ " Circular pitch is 0.39 in. \n",
+ "\n",
+ " Centerline distance is 3.00 in. \n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg236"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-11.4 Page No.236\\n');\n",
+ "\n",
+ "##Torque in input shaft\n",
+ "hp=1.5;\n",
+ "n=3450.;\n",
+ "T=63000.*hp/n;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Torque in input shaft is ',T,' lb*in.');\n",
+ "\n",
+ "##Note-In the book T=27.4 in-lb is used instead of T=27.391304\n",
+ "\n",
+ "##Output torque\n",
+ "Ng=24.;\n",
+ "Np=10.;\n",
+ "Tout=(Ng/Np)*T;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Output torque is ',Tout,' lb*in.');\n",
+ "\n",
+ "##Output speed\n",
+ "nout=(Np/Ng)*n;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Output speed is ',nout,' rpm.');\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-11.4 Page No.236\n",
+ "\n",
+ "\n",
+ " Torque in input shaft is 27.39 lb*in. \n",
+ "\n",
+ " Output torque is 65.74 lb*in. \n",
+ "\n",
+ " Output speed is 1437.50 rpm. \n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5-pg241"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-11.5 Page No.241\\n');\n",
+ "\n",
+ "##Gear train value\n",
+ "Na=12.;\n",
+ "Nb=36.;\n",
+ "Nc=16.;\n",
+ "Nd=64.;\n",
+ "Vr=(Nb/Na)*(Nd/Nc);\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Gear train value is ',Vr,'');\n",
+ "\n",
+ "##Motor torque\n",
+ "hp=1.5;\n",
+ "n=1750.;\n",
+ "T=63000.*hp/n;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Motor torque is ',T,' in-lb.');\n",
+ "\n",
+ "##Output torque\n",
+ "Tout=T*Vr;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Output torque is ',Tout,' in-lb.');\n",
+ "\n",
+ "##Output speed\n",
+ "nout=n/Vr;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Output speed is ',nout,' rpm.');\n",
+ "\n",
+ "##Directions\n",
+ "print('\\n Directions\\n Gear A is clockwise.\\n Gear B is counterclockwise.\\n Gear C is counterclockwise.\\n Gear D is clockwise.');\n",
+ "\n",
+ "##Output power\n",
+ "hp=T*n/63000.;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Output power is ',hp,' hp.');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-11.5 Page No.241\n",
+ "\n",
+ "\n",
+ " Gear train value is 12.00 \n",
+ "\n",
+ " Motor torque is 54.00 in-lb. \n",
+ "\n",
+ " Output torque is 648.00 in-lb. \n",
+ "\n",
+ " Output speed is 145.83 rpm. \n",
+ "\n",
+ " Directions\n",
+ " Gear A is clockwise.\n",
+ " Gear B is counterclockwise.\n",
+ " Gear C is counterclockwise.\n",
+ " Gear D is clockwise.\n",
+ "\n",
+ " Output power is 1.50 hp. \n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6-pg243"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-11.6 Page No.243\\n');\n",
+ "\n",
+ "##Velocity ratio\n",
+ "N2=2400.;\n",
+ "N1=20.;\n",
+ "Vr=N2/N1;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Velocity ratio = ',Vr,'');\n",
+ "\n",
+ "print('\\n Possible Solution: \\n Three sets of gears \\n -20 tooth and 80 tooth\\n -20 tooth and 100 tooth\\n -20 tooth and 120 tooth.');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-11.6 Page No.243\n",
+ "\n",
+ "\n",
+ " Velocity ratio = 120.00 \n",
+ "\n",
+ " Possible Solution: \n",
+ " Three sets of gears \n",
+ " -20 tooth and 80 tooth\n",
+ " -20 tooth and 100 tooth\n",
+ " -20 tooth and 120 tooth.\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Machine_Design_by_T._H._Wentzell,_P._E/Chapter12.ipynb b/Machine_Design_by_T._H._Wentzell,_P._E/Chapter12.ipynb new file mode 100644 index 00000000..7b089995 --- /dev/null +++ b/Machine_Design_by_T._H._Wentzell,_P._E/Chapter12.ipynb @@ -0,0 +1,552 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:892138834d98f748fc0090c17011f9f0ff6dd205fe66852833b31f2564ecc8cc"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter12-Spur Gear Design and Selection"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg245"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-12.1 Page No.254\\n');\n",
+ "\n",
+ "P=5.;\n",
+ "n=1725.;\n",
+ "T=63000.*P/n;\n",
+ "\n",
+ "##Pitch circle diameter\n",
+ "Np=20.;\n",
+ "Pd=8.;\n",
+ "Dp=Np/Pd;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Pitch circle diameter = ',Dp,' in.');\n",
+ "\n",
+ "##Transmitted force\n",
+ "Ft=2.*T/Dp;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Transmitted force = ',Ft,' lb.');\n",
+ "\n",
+ "##Separating force\n",
+ "theta=20.*math.pi/180.;\n",
+ "Fn=Ft*math.tan(theta);\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Separating force = ',Fn,' lb.');\n",
+ "\n",
+ "##Maximum force\n",
+ "Fr=Ft/math.cos(theta);\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Maximum force = ',Fr,' lb.');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-12.1 Page No.254\n",
+ "\n",
+ "\n",
+ " Pitch circle diameter = 2.50 in. \n",
+ "\n",
+ " Transmitted force = 146.09 lb. \n",
+ "\n",
+ " Separating force = 53.17 lb. "
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "\n",
+ " Maximum force = 155.46 lb. \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg256"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-12.2 Page No.256\\n');\n",
+ "\n",
+ "##Surface speed\n",
+ "Dp=2.5;\n",
+ "n=1725.;\n",
+ "Vm=math.pi*Dp*n/12.;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Surface speed = ',Vm,' ft/min.');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-12.2 Page No.256\n",
+ "\n",
+ "\n",
+ " Surface speed = 1129.01 ft/min. \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg258"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-12.3 Page No.258\\n');\n",
+ "##Pinion\n",
+ "Su=95.*10**3;\n",
+ "Sn=0.5*Su;\n",
+ "Y=0.320;\n",
+ "b=1.;\n",
+ "Pd=8.;\n",
+ "\n",
+ "Fsp=Sn*b*Y/Pd;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Force allowable for pinion = ',Fsp,' lb.');\n",
+ "\n",
+ "##Gear\n",
+ "Sn=0.5*88.*10**3;\n",
+ "Y=0.421;\n",
+ "Fsg=Sn*b*Y/Pd;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Force allowable for gear = ',Fsg,' lb.');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-12.3 Page No.258\n",
+ "\n",
+ "\n",
+ " Force allowable for pinion = 1900.00 lb. \n",
+ "\n",
+ " Force allowable for gear = 2315.50 lb. \n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg262"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-12.4 Page No.262\\n');\n",
+ "\n",
+ "##Dynamic load\n",
+ "Vm=1129.;\n",
+ "Ft=146.;\n",
+ "Fd=(600.+Vm)*Ft/600.;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Dynamic load = ',Fd,' lb.');\n",
+ "\n",
+ "Fs=1900.;\n",
+ "Nsf=2.;\n",
+ "\n",
+ "##Comparing to the allowable stress\n",
+ "\n",
+ "if (Fs/Nsf)>Fd:\n",
+ " print('\\n This is an acceptable design.');\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-12.4 Page No.262\n",
+ "\n",
+ "\n",
+ " Dynamic load = 420.72 lb. \n",
+ "\n",
+ " This is an acceptable design.\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5-pg263"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-12.5 Page No.263\\n');\n",
+ "\n",
+ "Su=55.*10**3;\n",
+ "Sn=0.5*Su;\n",
+ "\n",
+ "Np=24.;\n",
+ "Pd=12.;\n",
+ "Dp=Np/Pd;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Pitch circle diameter = ',Dp,' in.');\n",
+ "\n",
+ "n=1800.;\n",
+ "Vm=math.pi*Dp*n/12.;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Surface speed = ',Vm,' ft/min.');\n",
+ "\n",
+ "b=3./4.;\n",
+ "Y=0.302;\n",
+ "Fs=Sn*b*Y/Pd;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Allowable stress = ',Fs,' lb.');\n",
+ "\n",
+ "Fd=Fs;\n",
+ "Ft=600.*Fd/(600.+Vm);\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Force transmitted = ',Ft,' lb.');\n",
+ "\n",
+ "T=Ft*Dp/2.;\n",
+ "\n",
+ "P=T*n/63000.;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Power transmitted = ',P,' hp.');\n",
+ "\n",
+ "##Compared to catalog\n",
+ "hp_catalog=4.14;\n",
+ "\n",
+ "Nsf=P/hp_catalog;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Safety factor = .',Nsf,'');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-12.5 Page No.263\n",
+ "\n",
+ "\n",
+ " Pitch circle diameter = 2.00 in. \n",
+ "\n",
+ " Surface speed = 942.48 ft/min. \n",
+ "\n",
+ " Allowable stress = 519.06 lb. \n",
+ "\n",
+ " Force transmitted = 201.91 lb. \n",
+ "\n",
+ " Power transmitted = 5.77 hp. \n",
+ "\n",
+ " Safety factor = . 1.39 \n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6-pg266"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-12.6 Page No.266\\n');\n",
+ "\n",
+ "##Miscellaneous properties\n",
+ "Np=48.;\n",
+ "Pd=12.;\n",
+ "Dp=Np/Pd;\n",
+ "Vr=3.;\n",
+ "Ng=Np*Vr;\n",
+ "\n",
+ "##Surface speed\n",
+ "n=900.;\n",
+ "Vm=math.pi*Dp*n/12.;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Surface speed = ',Vm,' ft/min.');\n",
+ "\n",
+ "##Force on teeth\n",
+ "hp=2.;\n",
+ "Ft=33000.*hp/Vm;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Force on teeth = ',Ft,' lb.');\n",
+ "\n",
+ "##Dynamic force\n",
+ "Fd=(600.+Vm)*Ft/600.;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Dynamic force = ',Fd,' lb.');\n",
+ "\n",
+ "##Width\n",
+ "Su=30.*10**3;\n",
+ "Sn=0.4*Su;\n",
+ "Y=0.344;\n",
+ "Nsf=2.;\n",
+ "b=Fd*Nsf*Pd/(Sn*Y);\n",
+ "b=round(b);\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Width = ',b,' in.');\n",
+ "\n",
+ "if (8/Pd)<b:\n",
+ "\tif b<(12.5/Pd):\n",
+ "\t\tprint('\\n This is an acceptable design.');\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-12.6 Page No.266\n",
+ "\n",
+ "\n",
+ " Surface speed = 942.48 ft/min. \n",
+ "\n",
+ " Force on teeth = 70.03 lb. \n",
+ "\n",
+ " Dynamic force = 180.03 lb. \n",
+ "\n",
+ " Width = 1.00 in. \n",
+ "\n",
+ " This is an acceptable design.\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7-pg270"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-12.7 Page No.270\\n');\n",
+ "\n",
+ "Su=95.*10**3;\n",
+ "Sn=0.5*Su;\n",
+ "Np=24.;\n",
+ "Pd=16.;\n",
+ "Dp=Np/Pd;\n",
+ "\n",
+ "##Torque\n",
+ "n=3450.;\n",
+ "P=3.;\n",
+ "T=P*63000./n;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Torque = ',T,' in-lb.');\n",
+ "\n",
+ "##Force transmitted\n",
+ "Ft=2.*T/Dp;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Force transmitted = ',Ft,' lb.');\n",
+ "\n",
+ "##Surface speed\n",
+ "Vm=math.pi*Dp*n/12.;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Surface speed = ',Vm,' ft/min.');\n",
+ "\n",
+ "##Force allowable\n",
+ "Y=0.337;\n",
+ "b=1.;\n",
+ "Fs=Sn*b*Y/Pd;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Force allowable = ',Fs,' lb.');\n",
+ "\n",
+ "##Dynamic load using Buckingham's equation\n",
+ "C=830.;\n",
+ "Fd=Ft+0.05*Vm*(b*C+Ft)/(0.05*Vm+(b*C+Ft)**0.5);\n",
+ "\n",
+ "Nsf=1.4;\n",
+ "if (Fs/Nsf)>Fd:\n",
+ " print('\\n This is a suitable design');\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-12.7 Page No.270\n",
+ "\n",
+ "\n",
+ " Torque = 54.78 in-lb. \n",
+ "\n",
+ " Force transmitted = 73.04 lb. \n",
+ "\n",
+ " Surface speed = 1354.81 ft/min. \n",
+ "\n",
+ " Force allowable = 1000.47 lb. \n",
+ "\n",
+ " This is a suitable design\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex8-pg272"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-12.8 Page No.272\\n');\n",
+ "\n",
+ "Ng=42.;\n",
+ "Np=24.;\n",
+ "Q=2.*Ng/(Ng+Np);\n",
+ "\n",
+ "Kg=270.;\n",
+ "Dp=1.5;\n",
+ "b=1.;\n",
+ "\n",
+ "Fw=Dp*b*Q*Kg;\n",
+ "Fd=699.;\n",
+ "Nsf=1.2;\n",
+ "\n",
+ "if (Fw/Nsf)<Fd:\n",
+ "\tprint('\\n (Fw/Nsf)<Fd So this would not be suitable design');\n",
+ "\n",
+ "\n",
+ "##If the surfaces each had a BHN = 450\n",
+ "\n",
+ "Kg=470.;\n",
+ "Fw=Dp*b*Q*Kg;\n",
+ "\n",
+ "if(Fw/Nsf)>Fd:\n",
+ " print('\\n\\n If the surfaces each had a BHN = 450');\n",
+ " print('\\n (Fw/Nsf)>Fd So this would be suitable design.');\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-12.8 Page No.272\n",
+ "\n",
+ "\n",
+ " (Fw/Nsf)<Fd So this would not be suitable design\n",
+ "\n",
+ "\n",
+ " If the surfaces each had a BHN = 450\n",
+ "\n",
+ " (Fw/Nsf)>Fd So this would be suitable design.\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Machine_Design_by_T._H._Wentzell,_P._E/Chapter13.ipynb b/Machine_Design_by_T._H._Wentzell,_P._E/Chapter13.ipynb new file mode 100644 index 00000000..bf4a360d --- /dev/null +++ b/Machine_Design_by_T._H._Wentzell,_P._E/Chapter13.ipynb @@ -0,0 +1,513 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:20d03d91cc0494015d6c83c5241f9bec242e7bdca78f00cdb56a9459ce967c2b"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter13-Helical Bevel and Worm Gears"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg280"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-13.1 Page No.280\\n');\n",
+ "\n",
+ "##Pitch-line velocity\n",
+ "Nt=24.;\n",
+ "Pd=12.;\n",
+ "Dp=Nt/Pd;\n",
+ "n=1750.;\n",
+ "Vm=math.pi*Dp*n/12.;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Pitch-line velocity = ',Vm,' ft/min.');\n",
+ "\n",
+ "##Transmitted force\n",
+ "hp=5.;\n",
+ "Ft=33000.*hp/Vm;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Transmitted force = ',Ft,' lb.');\n",
+ "\n",
+ "##Axial force\n",
+ "psi=15.*math.pi/180.;\n",
+ "Fa=Ft*math.tan(psi);\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Axial force = ',Fa,' lb.');\n",
+ "\n",
+ "##Separating force\n",
+ "theta=20.*math.pi/180.;\n",
+ "psit=math.atan(math.tan(theta)/math.cos(psi));\n",
+ "Fn=Ft*math.tan(psit);\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Separating force = ',Fn,' lb.');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-13.1 Page No.280\n",
+ "\n",
+ "\n",
+ " Pitch-line velocity = 916.30 ft/min. \n",
+ "\n",
+ " Transmitted force = 180.07 lb. \n",
+ "\n",
+ " Axial force = 48.25 lb. \n",
+ "\n",
+ " Separating force = 67.85 lb. \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg282"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-13.2 Page No.282\\n');\n",
+ "\n",
+ "##Normal plane pitch\n",
+ "Pd=16.;\n",
+ "psi=45.*math.pi/180;\n",
+ "Pdn=Pd/math.cos(psi);\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Normal plane pitch =',Pdn,' in.');\n",
+ "\n",
+ "N=24.;\n",
+ "S=30000.;\n",
+ "b=0.5;\n",
+ "Ne=N/math.cos(psi)**3;\n",
+ "Y=0.427;\n",
+ "Fs=S*b*Y/Pdn;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Allowable force = ',Fs,' lb.');\n",
+ "\n",
+ "Dp=24./16.;\n",
+ "n=600.;\n",
+ "Vm=math.pi*Dp*n/12.;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Surface speed = ',Vm,' ft/min.');\n",
+ "\n",
+ "Ft=Fs/((600.+Vm)/600.);\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Force transmitted = ',Ft,' lb.');\n",
+ "\n",
+ "P=Ft*Vm/33000.;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Power rating = ',P,' hp.');\n",
+ "\n",
+ "##Note-There is an error in the answer given in textbook\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-13.2 Page No.282\n",
+ "\n",
+ "\n",
+ " Normal plane pitch = 22.63 in. \n",
+ "\n",
+ " Allowable force = 283.06 lb. \n",
+ "\n",
+ " Surface speed = 235.62 ft/min. \n",
+ "\n",
+ " Force transmitted = 203.25 lb. \n",
+ "\n",
+ " Power rating = 1.45 hp. \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg286"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-13.3 Page No.286\\n');\n",
+ "\n",
+ "Np=24.;\n",
+ "Ng=36.;\n",
+ "Pd=8.;\n",
+ "Yp=33.7*math.pi/180.;\n",
+ "Yg=56.3*math.pi/180.;\n",
+ "theta=14.5*math.pi/180.;\n",
+ "\n",
+ "##Pitch diameter\n",
+ "Dp=Np/Pd;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Pitch diameter = ',Dp,' in.');\n",
+ "\n",
+ "##Transmitted force\n",
+ "n=2200.;\n",
+ "P=8.;\n",
+ "T=63000.*P/n;\n",
+ "\n",
+ "Ft=2.*T/Dp;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Transmitted force = ',Ft,' lb.');\n",
+ "\n",
+ "##Separating force - Pinion\n",
+ "Fnp=Ft*math.tan(theta)*math.cos(Yp);\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Separating force-Pinion = ',Fnp,' lb.');\n",
+ "\n",
+ "##Separating force-Gear\n",
+ "Fng=Ft*math.tan(theta)*math.cos(Yg);\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Separating force = ',Fng,' lb.');\n",
+ "\n",
+ "##Axial force-Pinion\n",
+ "Fap=Ft*math.tan(theta)*math.sin(Yp);\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Axial force-Pinion= ',Fap,' lb.');\n",
+ "\n",
+ "##Axial force-Gear\n",
+ "Fag=Ft*math.tan(theta)*math.sin(Yg);\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Axial force-Gear = ',Fag,' lb.');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-13.3 Page No.286\n",
+ "\n",
+ "\n",
+ " Pitch diameter = 3.00 in. \n",
+ "\n",
+ " Transmitted force = 152.73 lb. \n",
+ "\n",
+ " Separating force-Pinion = 32.86 lb. \n",
+ "\n",
+ " Separating force = 21.92 lb. \n",
+ "\n",
+ " Axial force-Pinion= 21.92 lb. \n",
+ "\n",
+ " Axial force-Gear = 32.86 lb. \n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg288"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-13.4 Page No.288\\n');\n",
+ "\n",
+ "##Pitch diameter\n",
+ "Ng=60.;\n",
+ "Pd=6.;\n",
+ "Dp=Ng/Pd;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Pitch diameter = ',Dp,' in.');\n",
+ "\n",
+ "##Circular pitch\n",
+ "Pc=math.pi*Dp/Ng;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Circular pitch = ',Pc,' in.');\n",
+ "\n",
+ "L=Pc;\n",
+ "\n",
+ "##Lead angle\n",
+ "D=2.;\n",
+ "LA=math.atan(L/(math.pi*D));\n",
+ "LA=LA*180./math.pi;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Lead angle = ',LA,' deg.');\n",
+ "\n",
+ "##Centerline distance\n",
+ "CC=(D+Dp)/2.;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Centerline distance = ',CC,' in.');\n",
+ "\n",
+ "##Velocity ratio\n",
+ "Ntgear=60.;\n",
+ "Nstarts_worm=1.;\n",
+ "Vr=Ntgear/Nstarts_worm;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Velocity ratio = ',Vr,'');\n",
+ "\n",
+ "##Output speed\n",
+ "nin=1750.;\n",
+ "nout=nin/Vr;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Output speed = ',nout,' rpm.');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-13.4 Page No.288\n",
+ "\n",
+ "\n",
+ " Pitch diameter = 10.00 in. \n",
+ "\n",
+ " Circular pitch = 0.52 in. \n",
+ "\n",
+ " Lead angle = 4.76 deg. \n",
+ "\n",
+ " Centerline distance = 6.00 in. \n",
+ "\n",
+ " Velocity ratio = 60.00 \n",
+ "\n",
+ " Output speed = 29.17 rpm. \n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5-pg292"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-13.5 Page No.292\\n');\n",
+ "\n",
+ "##Normal circular pitch\n",
+ "Pc=0.524;\n",
+ "LA=4.77*math.pi/180.;\n",
+ "Pcn=Pc*math.cos(LA);\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Normal circular pitch = ',Pcn,'in.');\n",
+ "\n",
+ "##Force transmitted\n",
+ "hp=5.;\n",
+ "n=29.2;\n",
+ "T=63000.*hp/n;\n",
+ "Dp=10.;\n",
+ "Ft=2.*T/Dp;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Force transmitted = ',Ft,' lb.');\n",
+ "\n",
+ "Vm=math.pi*Dp*n/12.;\n",
+ "\n",
+ "##Dynamic load\n",
+ "Fd=(1200.+Vm)*Ft/1200.;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Dynamic load = ',Fd,' lb.');\n",
+ "\n",
+ "##Force allowable\n",
+ "Su=95.*10**3;\n",
+ "Y=0.392;\n",
+ "b=1.;\n",
+ "Sn=0.5*Su;\n",
+ "Fs=Sn*Y*b*Pcn/math.pi;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Force allowable = ',Fs,' lb.');\n",
+ "\n",
+ "##Safty factor\n",
+ "Nsf=Fs/Fd;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Safty factor = ',Nsf,'');\n",
+ "\n",
+ "##Note-There is an error in the answer given in textbook\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-13.5 Page No.292\n",
+ "\n",
+ "\n",
+ " Normal circular pitch = 0.52 in. \n",
+ "\n",
+ " Force transmitted = 2157.53 lb. \n",
+ "\n",
+ " Dynamic load = 2294.98 lb. \n",
+ "\n",
+ " Force allowable = 3094.95 lb. \n",
+ "\n",
+ " Safty factor = 1.35 \n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6-pg294"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-13.6 Page No.294\\n');\n",
+ "\n",
+ "##Efficiency\n",
+ "LA=4.77*math.pi/180.;\n",
+ "f=0.03;\n",
+ "e=math.tan(LA)*(1-f*math.tan(LA))/(f+math.tan(LA));\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Efficiency = ',e,'');\n",
+ "\n",
+ "##Torque input\n",
+ "hp=5.;\n",
+ "n=1750.;\n",
+ "T=63000.*hp/n;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Torque input = ',T,' in-lb.');\n",
+ "\n",
+ "Vr=60.;\n",
+ "Tout=0.73*Vr*T;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Output torque = ',Tout,' in-lb.');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-13.6 Page No.294\n",
+ "\n",
+ "\n",
+ " Efficiency = 0.73 \n",
+ "\n",
+ " Torque input = 180.00 in-lb. \n",
+ "\n",
+ " Output torque = 7884.00 in-lb. \n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7-pg296"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-13.7 Page No.296\\n');\n",
+ "\n",
+ "hpin=5.\n",
+ "e=0.73;\n",
+ "Q=(1.-e)*hpin*2544.;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Heat generated by system = ',Q,' Btu/hr.');\n",
+ "\n",
+ "##Note-There is an error in the answer given in textbook\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-13.7 Page No.296\n",
+ "\n",
+ "\n",
+ " Heat generated by system = 3434.40 Btu/hr. \n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Machine_Design_by_T._H._Wentzell,_P._E/Chapter14.ipynb b/Machine_Design_by_T._H._Wentzell,_P._E/Chapter14.ipynb new file mode 100644 index 00000000..f53e5ab4 --- /dev/null +++ b/Machine_Design_by_T._H._Wentzell,_P._E/Chapter14.ipynb @@ -0,0 +1,328 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:ec639859a82da3b8a2106b72ddcd094decef6e3a8922eacdb7b999d703520f1d"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter14-Belt and Chain Drives"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg306"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-14.1 Page No.306\\n');\n",
+ "\n",
+ "##Torque on small pulley\n",
+ "hp=2.;\n",
+ "n=2450.;\n",
+ "T=63000.*hp/n;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Torque on small pulley = ',T,' in-lb.');\n",
+ "r=6/2.;\n",
+ "Fd=T/r;\n",
+ "\n",
+ "##Front force\n",
+ "Fb=10.;\n",
+ "Ff=Fd+Fb;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Front force = ',Ff,' lb.');\n",
+ "\n",
+ "##Force pulling the shafts\n",
+ "Ft=Ff+Fb\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Force pulling the shafts = ',Ft,' lb.');\n",
+ "\n",
+ "##Surface speed\n",
+ "D=2.*r;\n",
+ "Vm=math.pi*D*n/12.;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Surface speed = ',Vm,' ft/min.');\n",
+ "\n",
+ "##Ratio\n",
+ "D2=10.;\n",
+ "Mw=D2/D;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Ratio = ',Mw,'');\n",
+ "\n",
+ "##Output speed\n",
+ "no=n/Mw;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Output speed = ',no,' rpm.');\n",
+ "\n",
+ "##Note-There is an error in the answer given in textbook\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-14.1 Page No.306\n",
+ "\n",
+ "\n",
+ " Torque on small pulley = 51.43 in-lb. \n",
+ "\n",
+ " Front force = 27.14 lb. \n",
+ "\n",
+ " Force pulling the shafts = 37.14 lb. \n",
+ "\n",
+ " Surface speed = 3848.45 ft/min. \n",
+ "\n",
+ " Ratio = 1.67 \n",
+ "\n",
+ " Output speed = 1470.00 rpm. \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg310"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-14.2 Page No.310\\n');\n",
+ "\n",
+ "##Length of belt\n",
+ "C=19.;\n",
+ "D1=4.;\n",
+ "D2=6.;\n",
+ "\n",
+ "L1=2.*C+1.57*(D1+D2)+(D2-D1)**2./(4.*C);\n",
+ "\n",
+ "##Assuming a 54-inch belt is available\n",
+ "L=54.;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Length of belt = ',L,' in.');\n",
+ "\n",
+ "##Centerline distance\n",
+ "B=4.*L-6.28*(D2+D1);\n",
+ "\n",
+ "C=(B+math.sqrt(B**2.-32.*(D2-D1)**2))/16.;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Centerline distance = ',C,' in.');\n",
+ "\n",
+ "##Ratio\n",
+ "Mw=D2/D1;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Ratio = ',Mw,'');\n",
+ "\n",
+ "##Surface speed\n",
+ "n=1800.;\n",
+ "Vm=math.pi*D1*n/12.;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Surface speed =',Vm,' ft/min.');\n",
+ "\n",
+ "##Angle of contact\n",
+ "\n",
+ "theta=180.-2*(180./math.pi)*math.asin((D2-D1)/(2.*C));\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Angle of contact = ',theta,' deg.');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-14.2 Page No.310\n",
+ "\n",
+ "\n",
+ " Length of belt = 54.00 in. \n",
+ "\n",
+ " Centerline distance = 19.12 in. \n",
+ "\n",
+ " Ratio = 1.50 \n",
+ "\n",
+ " Surface speed = 1884.96 ft/min. \n",
+ "\n",
+ " Angle of contact = 174.01 deg. \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg315"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-14.3 Page No.315\\n');\n",
+ "\n",
+ "##Power rating of belt\n",
+ "P1=27.+2.98;\n",
+ "SF=1.5;\n",
+ "P=P1/SF;\n",
+ "P=round(P);\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Power rating = ',P,' hp.');\n",
+ "\n",
+ "##Length of belt\n",
+ "C=20.;\n",
+ "D1=8.;\n",
+ "D2=16.;\n",
+ "L1=2.*C+1.57*(D1+D2)+(D2-D1)**2/(4.*C);\n",
+ "\n",
+ "##Use an 80-inch belt\n",
+ "L=80.;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Length of belt = ',L,' in.');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-14.3 Page No.315\n",
+ "\n",
+ "\n",
+ " Power rating = 20.00 hp. \n",
+ "\n",
+ " Length of belt = 80.00 in. \n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg321"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-14.4 Page No.321\\n');\n",
+ "\n",
+ "P=5.31;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Horsepower rating = ',P,' hp.');\n",
+ "\n",
+ "Nti=12.;\n",
+ "N1=1800.;\n",
+ "N2=900.;\n",
+ "\n",
+ "##Output sprocket\n",
+ "Nto=(N1/N2)*Nti;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Number of tooth on output sprocket = ',Nto,'');\n",
+ "\n",
+ "##Surface speed\n",
+ "Pc=0.5;\n",
+ "D1=Pc*Nti/math.pi;\n",
+ "n=1800.;\n",
+ "Vm=math.pi*D1*n/12.;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Surface speed = ',Vm,' ft/min.');\n",
+ "\n",
+ "print('\\n Type of lubrication - Bath or disc lubrication');\n",
+ "\n",
+ "##Length of chain\n",
+ "C=10.;\n",
+ "D2=Pc*Nto/math.pi;\n",
+ "\n",
+ "L1=2*C+1.57*(D1+D2)+(D2-D1)**2/(4.*C);\n",
+ "\n",
+ "##Use 29 or 30 inch chain\n",
+ "\n",
+ "L=30.;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Length of chain = ',L,' in.');\n",
+ "\n",
+ "hp=5.31;\n",
+ "\n",
+ "T=63000.*hp/n;\n",
+ "\n",
+ "F=2.*T/D1;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Force in chain = ',F,' lb.');\n",
+ "\n",
+ "##Comparism with ultimate strength 3700 lb - not a valid comparison because of speed etc.\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-14.4 Page No.321\n",
+ "\n",
+ "\n",
+ " Horsepower rating = 5.31 hp. \n",
+ "\n",
+ " Number of tooth on output sprocket = 24.00 \n",
+ "\n",
+ " Surface speed = 900.00 ft/min. \n",
+ "\n",
+ " Type of lubrication - Bath or disc lubrication\n",
+ "\n",
+ " Length of chain = 30.00 in. \n",
+ "\n",
+ " Force in chain = 194.62 lb. \n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Machine_Design_by_T._H._Wentzell,_P._E/Chapter15.ipynb b/Machine_Design_by_T._H._Wentzell,_P._E/Chapter15.ipynb new file mode 100644 index 00000000..ba04fb5b --- /dev/null +++ b/Machine_Design_by_T._H._Wentzell,_P._E/Chapter15.ipynb @@ -0,0 +1,147 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:0149cd235a3b23c9794fbb9de15a07192b350deac4309221cd011faa92bed1d4"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter15-Keys and Couplings "
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg332"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-15.1 Page No.332\\n');\n",
+ "\n",
+ "##Torque\n",
+ "P=5.;\n",
+ "n=1750.;\n",
+ "T=63000.*P/n;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Torque = ',T,' in-lb.');\n",
+ "\n",
+ "##Length of key for shear\n",
+ "Su=61000.;\n",
+ "Ss=0.5*Su;\n",
+ "b=0.125;\n",
+ "D=0.5;\n",
+ "Ls1=2*T/(Ss*b*D);\n",
+ "SF=2.5;\n",
+ "\n",
+ "Ls=SF*Ls1;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Length of key for shear = ',Ls,' in.');\n",
+ "\n",
+ "##Length of key for compression\n",
+ "Sc=51000.;\n",
+ "t=0.125;\n",
+ "Lc1=4.*T/(Sc*t*D);\n",
+ "\n",
+ "Lc=SF*Lc1;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Length of key for compression = ',Lc,' in.');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-15.1 Page No.332\n",
+ "\n",
+ "\n",
+ " Torque = 180.00 in-lb. \n",
+ "\n",
+ " Length of key for shear = 0.47 in. \n",
+ "\n",
+ " Length of key for compression = 0.56 in. \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg335"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-15.2 Page No.335\\n');\n",
+ "\n",
+ "##Torque capacity\n",
+ "Ss=30500.;\n",
+ "D=1.;\n",
+ "L=2.;\n",
+ "T1=Ss*math.pi*D**2*L/16.;\n",
+ "\n",
+ "SF=2.;\n",
+ "\n",
+ "T=T1/SF;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Torque capacity 1 = ',T,' in-lb.');\n",
+ "n=6.;\n",
+ "d=0.81;\n",
+ "A=(D-d)*L*n/2.;\n",
+ "\n",
+ "S=1000.;\n",
+ "rm=(1.+0.810)/4.;\n",
+ "\n",
+ "T2=S*A*rm;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Torque capacity 2 = ',T2,' in-lb.');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-15.2 Page No.335\n",
+ "\n",
+ "\n",
+ " Torque capacity 1 = 5988.66 in-lb. \n",
+ "\n",
+ " Torque capacity 2 = 515.85 in-lb. \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Machine_Design_by_T._H._Wentzell,_P._E/Chapter16.ipynb b/Machine_Design_by_T._H._Wentzell,_P._E/Chapter16.ipynb new file mode 100644 index 00000000..8879a09b --- /dev/null +++ b/Machine_Design_by_T._H._Wentzell,_P._E/Chapter16.ipynb @@ -0,0 +1,316 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:eb606f39fc3092e1440a5967b207e786d25c095ec5ea9cf333a332f93df00b1f"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter16-Clutches and Brakes"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg358"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-16.1 Page No.358\\n');\n",
+ "\n",
+ "##Torque capacity\n",
+ "f=0.3;\n",
+ "N=120.;\n",
+ "ro=12.;\n",
+ "ri=9.;\n",
+ "Tf=f*N*(ro+ri)/2.;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Torque capacity = ',Tf,' in-lb.');\n",
+ "n=2000.;\n",
+ "##Power\n",
+ "\n",
+ "Pf=Tf*n/63000.;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Power = ',Pf,' hp.');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-16.1 Page No.358\n",
+ "\n",
+ "\n",
+ " Torque capacity = 378.00 in-lb. \n",
+ "\n",
+ " Power = 12.00 hp. \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg359"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-16.2 Page No.359\\n');\n",
+ "\n",
+ "##Normal force\n",
+ "W=100.;\n",
+ "L=20.;\n",
+ "a=4.;\n",
+ "N=(W*L)/a;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Normal force = ',N,' lb.');\n",
+ "\n",
+ "##Torque friction\n",
+ "f=0.4;\n",
+ "D=12.;\n",
+ "Tf=f*N*D/2.;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Torque friction = ',Tf,' in-lb.');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-16.2 Page No.359\n",
+ "\n",
+ "\n",
+ " Normal force = 500.00 lb. \n",
+ "\n",
+ " Torque friction = 1200.00 in-lb. \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg360"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-16.3 Page No.360\\n');\n",
+ "\n",
+ "##For alpha=20 deg.\n",
+ "alpha=20.*(math.pi/180.);\n",
+ "f=0.35;\n",
+ "rm=12./2.;\n",
+ "Fa=75.;\n",
+ "Tf=(f*rm*Fa)/(math.sin(alpha)+f*math.cos(alpha));\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Torque capacity (alpha=20 deg.) = ',Tf,' in-lb.');\n",
+ "\n",
+ "##For alpha=10 deg.\n",
+ "alpha=10.*(math.pi/180.);\n",
+ "Tf=(f*rm*Fa)/(math.sin(alpha)+f*math.cos(alpha));\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Torque capacity (alpha=10 deg.) = ',Tf,' in-lb.');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-16.3 Page No.360\n",
+ "\n",
+ "\n",
+ " Torque capacity (alpha=20 deg.) = 234.75 in-lb. \n",
+ "\n",
+ " Torque capacity (alpha=10 deg.) = 303.86 in-lb. \n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg361"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-16.4 Page No.361\\n');\n",
+ "\n",
+ "##Stopping rate\n",
+ "V=60.*5280./3600.;\n",
+ "Va=0.5*V;\n",
+ "D=400.;\n",
+ "t=D/Va;\n",
+ "a=V/t;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Stopping rate = ',a,' ft/sec^2.');\n",
+ "\n",
+ "##Stopping force\n",
+ "W=40000.;\n",
+ "g=32.2;\n",
+ "F=W*a/g;\n",
+ "\n",
+ "##Torque\n",
+ "r=36./2.;\n",
+ "T=F*r;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Torque = ',T,' in-lb.');\n",
+ "\n",
+ "##For each wheel\n",
+ "T=T/10.;\n",
+ "\n",
+ "##Braking normal force\n",
+ "rm=10.;\n",
+ "f=0.4;\n",
+ "N=T/(f*rm);\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Braking normal force = ',N,' lb.');\n",
+ "\n",
+ "##Note-There is an error in the answer given in textbook\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-16.4 Page No.361\n",
+ "\n",
+ "\n",
+ " Stopping rate = 9.68 ft/sec^2. \n",
+ "\n",
+ " Torque = 216447.20 in-lb. \n",
+ "\n",
+ " Braking normal force = 5411.18 lb. \n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5-pg365"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ " \n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-16.5 Page No.365\\n');\n",
+ "W=3500.;\n",
+ "V=73.;\n",
+ "g=32.2;\n",
+ "V=50.*5280./3600.;\n",
+ "V=round(V);\n",
+ "\n",
+ "##Kinetic energy to be absorbed\n",
+ "KE=W*V**2/(2.*g);\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Kinetic energy to be absorbed = ',KE,' ft-lb.');\n",
+ "\n",
+ "##Temperature rise\n",
+ "Uf=KE;\n",
+ "Wb=40.;\n",
+ "c=93.;\n",
+ "deltaT=Uf/(Wb*c);\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Temperature rise = ',deltaT,' deg.');\n",
+ "\n",
+ "##Stopping time\n",
+ "a=20.;\n",
+ "t=V/a;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Stopping time = ',t,' sec.');\n",
+ "\n",
+ "##Frictional power\n",
+ "t=round(t*10.)/10.;\n",
+ "fhp=Uf/(550.*t);\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Frictional power = ',fhp,' hp.')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-16.5 Page No.365\n",
+ "\n",
+ "\n",
+ " Kinetic energy to be absorbed = 289619.57 ft-lb. \n",
+ "\n",
+ " Temperature rise = 77.85 deg. \n",
+ "\n",
+ " Stopping time = 3.65 sec. \n",
+ "\n",
+ " Frictional power = 142.32 hp. \n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Machine_Design_by_T._H._Wentzell,_P._E/Chapter17.ipynb b/Machine_Design_by_T._H._Wentzell,_P._E/Chapter17.ipynb new file mode 100644 index 00000000..5ff36ef9 --- /dev/null +++ b/Machine_Design_by_T._H._Wentzell,_P._E/Chapter17.ipynb @@ -0,0 +1,300 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:79381078ada8815aebb06f3ebe9acf08c8724da775377e36d59d0e4ce701a07f"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter17-Shaft Design"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg379"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-17.1 Page No.379\\n');\n",
+ "\n",
+ "hp=5.;\n",
+ "n=1750.;\n",
+ "T=63000.*hp/n;\n",
+ "\n",
+ "##Torsional stress in the shaft\n",
+ "D=0.75;\n",
+ "Z1=math.pi*D**3/16.;\n",
+ "\n",
+ "Ss=T/Z1;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Torsional stress in the shaft = ',Ss,' lb/in^2.');\n",
+ "\n",
+ "##Load at the gear pitch circle\n",
+ "Nt=40.;\n",
+ "Pd=10.;\n",
+ "Dp=Nt/Pd;\n",
+ "\n",
+ "Ft=2.*T/Dp;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Load at gear pitch circle = ',Ft,' lb.');\n",
+ "\n",
+ "##Resultant force on the shaft\n",
+ "theta=20.*math.pi/180.;\n",
+ "Fr=Ft/math.cos(theta);\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Resultant force = ',Fr,' lb.');\n",
+ "\n",
+ "##Maximum moment\n",
+ "L=15.;\n",
+ "Mm=Fr*L/4.;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Maximum moment = ',Mm,' in-lb.');\n",
+ "\n",
+ "##Stress\n",
+ "D2=0.75;\n",
+ "Z2=math.pi*D2**3/32.;\n",
+ "Z2=round(Z2*1000.)*10**-3;\n",
+ "\n",
+ "S=Mm/Z2;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Stress = ',S,' lb/in^2.');\n",
+ "\n",
+ "##Note-There is an error in the answer given in textbook\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-17.1 Page No.379\n",
+ "\n",
+ "\n",
+ " Torsional stress in the shaft = 2173.00 lb/in^2. \n",
+ "\n",
+ " Load at gear pitch circle = 90.00 lb. \n",
+ "\n",
+ " Resultant force = 95.78 lb. \n",
+ "\n",
+ " Maximum moment = 359.16 in-lb. \n",
+ "\n",
+ " Stress = 8760.00 lb/in^2. \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg383"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-17.2 Page No.383\\n');\n",
+ "\n",
+ "##Combined stress using the maximum shear stress theorem\n",
+ "\n",
+ "Ss=2170.;\n",
+ "S=8780.;\n",
+ "Sr=math.sqrt(Ss**2+(S/2.)**2);\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Combined stress = ',Sr,' lb/in^2.');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-17.2 Page No.383\n",
+ "\n",
+ "\n",
+ " Combined stress = 4897.04 lb/in^2. \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg383"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-17.3 Page No.383\\n');\n",
+ "\n",
+ "##Combined stress using the maximum normal stress theory\n",
+ "Ss=2170.;\n",
+ "S=8780.;\n",
+ "Sr=S/2.+math.sqrt(Ss**2+(S/2.)**2);\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Combined stress = ',Sr,' lb/in^2.');\n",
+ "\n",
+ "##Note-There is an error in the answer given in textbook\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-17.3 Page No.383\n",
+ "\n",
+ "\n",
+ " Combined stress = 9287.04 lb/in^2. \n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg385"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-17.4 Page No.385\\n');\n",
+ "\n",
+ "##Modifying factors for Sn\n",
+ "Su=88000.;\n",
+ "Csize=0.85;\n",
+ "Csurface=0.88;\n",
+ "Ctype=1.;\n",
+ "\n",
+ "Sn=Csize*Csurface*Ctype*(0.5*Su);\n",
+ "Kt=2.3;\n",
+ "S=9300.;\n",
+ "\n",
+ "N=Sn/(Kt*S);\n",
+ "\n",
+ "if N>2:\n",
+ " print('\\n It would be an acceptable design.');\n",
+ "else:\n",
+ " print('\\n N<2,So this is not a suitable design for long term use.');\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-17.4 Page No.385\n",
+ "\n",
+ "\n",
+ " N<2,So this is not a suitable design for long term use.\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5-pg388"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-17.5 Page No.388\\n');\n",
+ "import numpy\n",
+ "##Deflection\n",
+ "D=0.75;\n",
+ "E=30.*10**6;\n",
+ "L=15.;\n",
+ "F=96.;\n",
+ "I=math.pi*D**4/64.;\n",
+ "\n",
+ "delta=F*L**4/(48.*E*I);\n",
+ "delta=numpy.floor(100.*delta)*10**-2;\n",
+ "Nc=188./math.sqrt(delta);\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Critical speed = ',Nc,' rpm.');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-17.5 Page No.388\n",
+ "\n",
+ "\n",
+ " Critical speed = 410.25 rpm. "
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Machine_Design_by_T._H._Wentzell,_P._E/Chapter18.ipynb b/Machine_Design_by_T._H._Wentzell,_P._E/Chapter18.ipynb new file mode 100644 index 00000000..1b8b6808 --- /dev/null +++ b/Machine_Design_by_T._H._Wentzell,_P._E/Chapter18.ipynb @@ -0,0 +1,239 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:8dde649649bb6a0c533ebc9f59be7287570620e70df87a9ce06f703968655982"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter18-Power Screws and Ball Screws "
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg399"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-18.1 Page No.399\\n');\n",
+ "\n",
+ "##Torque\n",
+ "Dp=(1.5+1.208)/2.;\n",
+ "F=5800.;\n",
+ "L=1/3.;\n",
+ "f=0.15;\n",
+ "\n",
+ "Tup=(F*Dp/4.)*(L+math.pi*f*Dp)/(math.pi*Dp-f*L);\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Torque up = ',Tup,' in-lb.');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-18.1 Page No.399\n",
+ "\n",
+ "\n",
+ " Torque up = 453.68 in-lb. \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg400"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ " \n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-18.2 Page No.400\\n');\n",
+ "\n",
+ "##Lead angle\n",
+ "L=1/3.;\n",
+ "Dp=1.354;\n",
+ "LA=math.atan(L/(math.pi*Dp));\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Lead angle = ',LA*180/math.pi,'deg');\n",
+ "\n",
+ "##Efficiency\n",
+ "f=0.15;\n",
+ "e=math.tan(LA)*(1-f*math.tan(LA))/(math.tan(LA)+f);\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Efficiency = ',e*100,'');\n",
+ "\n",
+ "##Power\n",
+ "n=175.;\n",
+ "T=454.;\n",
+ "P=T*n/63000.;\n",
+ "Pt=P*2.;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Power = ',P,' hp per lead screw.');\n",
+ "\n",
+ "if f>math.tan(LA):\n",
+ " print('\\n It is self-locking');\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-18.2 Page No.400\n",
+ "\n",
+ "\n",
+ " Lead angle = 4.48 deg \n",
+ "\n",
+ " Efficiency = 33.91 \n",
+ "\n",
+ " Power = 1.26 hp per lead screw. \n",
+ "\n",
+ " It is self-locking\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg402"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-18.3 Page No.402\\n');\n",
+ "L=1/4.;\n",
+ "\n",
+ "Dp=1.375;\n",
+ "LA=math.atan(L/(math.pi*Dp));\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Lead angle = .',LA*180./math.pi,'deg');\n",
+ "\n",
+ "##Torque\n",
+ "phi=14.5*math.pi/180.;\n",
+ "f=0.15;\n",
+ "F=5800.;\n",
+ "Tup=(F*Dp/4.)*(math.cos(phi)*math.tan(LA)+f)/(math.cos(phi)-f*math.tan(LA));\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Torque = ',Tup,' in-lb.');\n",
+ "\n",
+ "##Power\n",
+ "n=175.*4./3.;\n",
+ "P=Tup*n/63000.;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Power = ',P,' hp per lead screw.')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-18.3 Page No.402\n",
+ "\n",
+ "\n",
+ " Lead angle = . 3.31 deg \n",
+ "\n",
+ " Torque = 428.13 in-lb. \n",
+ "\n",
+ " Power = 1.59 hp per lead screw. \n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg405"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ " \n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-18.4 Page No.405\\n');\n",
+ "\n",
+ "##Torque\n",
+ "L=0.5;\n",
+ "F=5800./2.;\n",
+ "T=0.177*F*L;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Torque = ',T,' in-lb.');\n",
+ "\n",
+ "##Power\n",
+ "n=175.*2./3.;\n",
+ "P=T*n/63000.;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Power = ',P,' hp.');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-18.4 Page No.405\n",
+ "\n",
+ "\n",
+ " Torque = 256.65 in-lb. \n",
+ "\n",
+ " Power = 0.48 hp. \n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Machine_Design_by_T._H._Wentzell,_P._E/Chapter19.ipynb b/Machine_Design_by_T._H._Wentzell,_P._E/Chapter19.ipynb new file mode 100644 index 00000000..913ae2ab --- /dev/null +++ b/Machine_Design_by_T._H._Wentzell,_P._E/Chapter19.ipynb @@ -0,0 +1,130 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:dff10b5eef3c8a9f5e306bcbad24a13a48880bc8597ec40606c4f5e39becb7ba"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter19-Plain Surface Bearings"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg417"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-19.1 Page No.417\\n');\n",
+ "\n",
+ "##Length\n",
+ "F=20.;\n",
+ "n=500.;\n",
+ "PV=3000.;\n",
+ "L1=math.pi*F*n/(12.*PV);\n",
+ "\n",
+ "##Use 7/8-inch or longer bearing\n",
+ "\n",
+ "L=7./8.;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Length of bearing = ',L,' in.');\n",
+ "\n",
+ "##Maximum pressure\n",
+ "A=(3./4.)*(7./8.);\n",
+ "P=F/A;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Maximum pressure = ',P,' lb/in^2.');\n",
+ "\n",
+ "##Maximum velocity\n",
+ "D=3/4.;\n",
+ "V=math.pi*D*n/12.;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Maximum velocity = ',V,' ft/min.');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-19.1 Page No.417\n",
+ "\n",
+ "\n",
+ " Length of bearing = 0.88 in. \n",
+ "\n",
+ " Maximum pressure = 30.48 lb/in^2. \n",
+ "\n",
+ " Maximum velocity = 98.17 ft/min. \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg421"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-19.2 Page No.421\\n');\n",
+ "\n",
+ "##Life in hours of operation\n",
+ "t=0.01;\n",
+ "K=12*10**-10;\n",
+ "P=30.5;\n",
+ "V=98.;\n",
+ "T=t/(K*P*V);\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Life = ',T,' hours.');\n",
+ "\n",
+ "##Note-There is an error in the answer given in textbook\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-19.2 Page No.421\n",
+ "\n",
+ "\n",
+ " Life = 2788.00 hours. \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Machine_Design_by_T._H._Wentzell,_P._E/Chapter2.ipynb b/Machine_Design_by_T._H._Wentzell,_P._E/Chapter2.ipynb new file mode 100644 index 00000000..f354aa3b --- /dev/null +++ b/Machine_Design_by_T._H._Wentzell,_P._E/Chapter2.ipynb @@ -0,0 +1,173 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:e843b59962198e932c75c0393d6620b260b3f31a23a639540cadf7fe87f37855"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter2-Force Work and Power "
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg26"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-2.1 Page 26 ') \n",
+ "##Example 2.1\n",
+ "\n",
+ "T=1080.*12.; ##[in*lb] Torque in axle\n",
+ "d=30.; ##[in] Diameter of tire\n",
+ "F=T/(d/2.); ##[lb] Force exerted on the road surface\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n\\n The tire exerts ',F,'lb force on the road surface');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-2.1 Page 26 \n",
+ "\n",
+ "\n",
+ " The tire exerts 864.00 lb force on the road surface \n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg28"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-2.2 Page 28 ') \n",
+ "##Example 2.2\n",
+ "\n",
+ "G=3.6; ##Diffential ratio\n",
+ "N=3500./G; ##[rpm] Axle rotational speed\n",
+ "d=30.; ##[in] Diameter of tire\n",
+ "dist=N/(60.)*(math.pi*d) ##[in] Distance traveled in 1 sec\n",
+ "dist=dist/12.; ##[ft] Distance traveled in 1 sec\n",
+ "t=1.; ##[sec] Time period\n",
+ "F=864.; ##[lb] Force exerted by tire on road surface\n",
+ "\n",
+ "W=F*dist; ##[ft*lb] Workdone in 1 sec\n",
+ "P=F*dist/t; ##[ft*lb/sec] Power\n",
+ "hp=P/550.; ##[hp] Power in horse power 1hp=550 ft*lb/sec\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n\\n Power to do work ',hp,' hp');\n",
+ "\n",
+ "##Comparing it to motor output:\n",
+ "\n",
+ "Tm=300.*12.; ##[in*lb] Engine torque\n",
+ "Nm=3500.; ##[rpm] Engine speed\n",
+ "Pm=Tm*Nm/63000.; \n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Motor output ',Pm,' hp');\n",
+ "print('\\n The power output equaled the power at tire/road surface.');\n",
+ "\n",
+ "##Note: The deviation of answer from the answer given in the book is due to round off error.(In the book values are rounded while in scilab actual values are taken)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-2.2 Page 28 \n",
+ "\n",
+ "\n",
+ " Power to do work 199.92 hp \n",
+ "\n",
+ " Motor output 200.00 hp \n",
+ "\n",
+ " The power output equaled the power at tire/road surface.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg29"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-2.3 Page 29 ') \n",
+ "##Example 2.3\n",
+ "\n",
+ "T=300.*12.; ##[in*lb] Engine torque \n",
+ "d=8.; ##[in] Crankshaft effective diameter\n",
+ "\n",
+ "F=T/(d/2.); ##[lb] Force exerted by piston\n",
+ "\n",
+ "A=math.pi*(2**2.)/4.; ##[in^2] Area of cross section of piston\n",
+ "P=F/A; ##[lb/in^2] Pressure in cylinder\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n\\n Pressure inside cylinder ',P,' lb/in^2');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-2.3 Page 29 \n",
+ "\n",
+ "\n",
+ " Pressure inside cylinder 286.48 lb/in^2 \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Machine_Design_by_T._H._Wentzell,_P._E/Chapter20.ipynb b/Machine_Design_by_T._H._Wentzell,_P._E/Chapter20.ipynb new file mode 100644 index 00000000..2a62b9af --- /dev/null +++ b/Machine_Design_by_T._H._Wentzell,_P._E/Chapter20.ipynb @@ -0,0 +1,260 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:d68aa72f3d535ee572be0511bcf196976b3a1d760ed33d6a9eb435db965967aa"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter20-Ball and Roller Bearings"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg431"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-20.1 Page No.431\\n');\n",
+ "\n",
+ "##L10 design life\n",
+ "Cd=5050.;\n",
+ "Pd=2400.;\n",
+ "k=3.;\n",
+ "Ld1=(Cd/Pd)**k*10**6;\n",
+ "Ld=Ld1/(1750.*60.);\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n L10 design life = ',Ld,' hr.');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-20.1 Page No.431\n",
+ "\n",
+ "\n",
+ " L10 design life = 88.73 hr. \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg432"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-20.2 Page No.432\\n');\n",
+ "\n",
+ "##Dynamic load capacity\n",
+ "T=200.;\n",
+ "n=1750.;\n",
+ "L=T*n*60./10**6;\n",
+ "Pd=2400.;\n",
+ "Ld=21.;\n",
+ "Lc=1.;\n",
+ "k=1/3.;\n",
+ "\n",
+ "Cd=Pd*(Ld/Lc)**k\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Dynamic load capacity required = ',Cd,' lb.');\n",
+ "\n",
+ "print('\\n Bearing 6211 meets this criterion.');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-20.2 Page No.432\n",
+ "\n",
+ "\n",
+ " Dynamic load capacity required = 6621.42 lb. \n",
+ "\n",
+ " Bearing 6211 meets this criterion.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg434"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-20.3 Page No.434\\n');\n",
+ "\n",
+ "R=1200.;\n",
+ "Ft=500.;\n",
+ "n=1500.;\n",
+ "L10=5000.;\n",
+ "\n",
+ "##Assume thrust factor=1.6\n",
+ "\n",
+ "Y=1.6;\n",
+ "\n",
+ "Pd=0.56*R+Y*Ft;\n",
+ "\n",
+ "Ld=n*L10*60./10**6;\n",
+ "Lc=1.;\n",
+ "k=3.;\n",
+ "Cd=Pd*(Ld/Lc)**(1./k);\n",
+ "\n",
+ "##For bearing number 6215\n",
+ "\n",
+ "Cd1=11400.;\n",
+ "Cs1=9700.;\n",
+ "\n",
+ "##Verify the assumption for Y\n",
+ "Ft_Cs1=Ft/Cs1;\n",
+ "\n",
+ "Y=(0.056-Ft_Cs1)*(1.99-1.71)/(0.056-0.028)+1.71;\n",
+ "\n",
+ "Pd=0.56*R+Y*Ft;\n",
+ "\n",
+ "Cd=Pd*(Ld/Lc)**(1./k);\n",
+ "\n",
+ "if Cd>Cd1:\n",
+ " print('\\n Since Cd of bearing < Cd required, So bearing number 6215 is not acceptable.'); \n",
+ "\n",
+ "##For bearing number 6216\n",
+ "Cd2=12600.;\n",
+ "Cs2=10500.;\n",
+ "\n",
+ "Ft_Cs2=Ft/Cs2;\n",
+ "Y=(0.056-Ft_Cs2)*(1.99-1.71)/(0.056-0.028)+1.71;\n",
+ "\n",
+ "Pd=0.56*R+Y*Ft;\n",
+ "\n",
+ "Cd=Pd*(Ld/Lc)**(1/k);\n",
+ "\n",
+ "if Cd<Cd2:\n",
+ " print('\\n Since Cd of bearing > Cd required, So bearing number 6215 meets the design criteria.');\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-20.3 Page No.434\n",
+ "\n",
+ "\n",
+ " Since Cd of bearing < Cd required, So bearing number 6215 is not acceptable.\n",
+ "\n",
+ " Since Cd of bearing > Cd required, So bearing number 6215 meets the design criteria.\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg436"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-20.4 Page No.436\\n');\n",
+ "\n",
+ "##Thrust factor\n",
+ "Ft=300.;\n",
+ "Cs=2320.;\n",
+ "Ft_Cs=Ft/Cs;\n",
+ "\n",
+ "Y=(0.17-Ft_Cs)*(1.45-1.31)/(0.17-0.11)+1.31;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Thrust factor = ',Y,'');\n",
+ "\n",
+ "V=1.2;\n",
+ "X=0.56;\n",
+ "R=1000.;\n",
+ "\n",
+ "P=V*X*R+Y*Ft;\n",
+ "\n",
+ "Cd=3350.;\n",
+ "Pd=1095.;\n",
+ "k=3.;\n",
+ "\n",
+ "Ld=(Cd/Pd)**k*10**6;\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Life = ',Ld,' revolutions.');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-20.4 Page No.436\n",
+ "\n",
+ "\n",
+ " Thrust factor = 1.40 \n",
+ "\n",
+ " Life = 28634662.16 revolutions. \n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Machine_Design_by_T._H._Wentzell,_P._E/Chapter3.ipynb b/Machine_Design_by_T._H._Wentzell,_P._E/Chapter3.ipynb new file mode 100644 index 00000000..4a59e0a1 --- /dev/null +++ b/Machine_Design_by_T._H._Wentzell,_P._E/Chapter3.ipynb @@ -0,0 +1,438 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:f403d0e3f3fed4dfd33d6fa27b6de2c70e4d2ced3f9a8c482cdf313e279df8a5"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter3-Stress and Deformation "
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg41"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-3.1 Page No-41 \\n');\n",
+ "\n",
+ "F=20000.; ##[lb] Load applied to steel bar\n",
+ "L=6.; ##[in] Length of steel bar\n",
+ "d=1.; ##[in] Diameter of steel bar\n",
+ "A=math.pi*(d**2)/4.; ##[in^2] Area of cross section of steel bar\n",
+ "E=30.*10**6; ##[lb/in^2] Modulus of elasticity for AISI 1020 hot-rolled steel\n",
+ "Sy=30000.; ##[lb/in^2] Yield limit\n",
+ "\n",
+ "S=F/A; ##[lb/in^2] Stress in bar\n",
+ "print'%s %.2f %s '%('\\na. Stress in bar=',S,' lb/in^2.');\n",
+ "\n",
+ "delta=F*L/(A*E); ##[in] Change in length of bar\n",
+ "print'%s %.2f %s '%('\\nb. bar shorten by ',delta,' in.');\n",
+ "\n",
+ "if Sy>S:\n",
+ " print'%s %.2f %s %.2f %s '%('\\nc. The stress of ',S,' psi is less than Sy of ',Sy,' psi, so it will'and '\\n return to its original size because the yield limit was not exceeded.');\n",
+ "else: \n",
+ " print('The bar will not return to its original length')\n",
+ "\n",
+ "\n",
+ "##Note: The deviation of answer from the answer given in the book is due to round off error.(In the book values are rounded while in scilab actual values are taken)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-3.1 Page No-41 \n",
+ "\n",
+ "\n",
+ "a. Stress in bar= 25464.79 lb/in^2. \n",
+ "\n",
+ "b. bar shorten by 0.01 in. \n",
+ "\n",
+ "c. The stress of 25464.79 psi is less than Sy of 30000.00 \n",
+ " return to its original size because the yield limit was not exceeded. \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg43"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-3.2 Page No.43\\n');\n",
+ "\n",
+ "b=2.; ##[in] Width of beam\n",
+ "h=2.; ##[in] Height of beam\n",
+ "I=(b*h**3)/12.; ##[in^4] Moment of inertia\n",
+ "F=3000.; ##[lb] Load applied to beam\n",
+ "L=36.; ##[in] Length of beam\n",
+ "c=1.; ##[in] Distance of outer most fiber from neutral axis\n",
+ "E=30*10**6; ##[lb/in^2] Modulus of elasticity\n",
+ "Sy=30000.; ##[lb/in^2] Yield strength\n",
+ "Su=55000.; ##[lb/in^2] Ultimate strength\n",
+ "SF=2.; ##[] Safety factor based on ultimate stress\n",
+ "\n",
+ "M=F*L/4.; ##[lb*in] Bending moment\n",
+ "S=(M/I)*c; ##[lb/in^2] Bending stress\n",
+ "\n",
+ "##Note-In the book I=1.33 in^4 is used instead of I=1.3333333 in^2\n",
+ "\n",
+ "print'%s %.2f %s '%('\\na. The maximum stress in beam is ',S,' lb/in^2');\n",
+ "\n",
+ "delta=-F*L**3/(48.*E*I); ##[in] Maximum deflection in this beam\n",
+ "\n",
+ "print'%s %.2f %s '%('\\nb. The maximum deflection in this beam is ',delta,' in.');\n",
+ "\n",
+ "if Sy>S:\n",
+ " print'%s %.2f %s %.2f %s '%('\\nc. Yes, the stress of ',S,' lb/in^2'and ' is less than the yield of Sy=',Sy,' lb/in^2.');\n",
+ "else:\n",
+ " print'%s %.2f %s %.2f %s '%('\\nc. No, the stress of ',S,' lb/in^2'and ' is greater than the yield of Sy=',Sy,' lb/in^2');\n",
+ "\n",
+ "Sall=Su/SF; ##[lb/in^2] Allowable stress\n",
+ "\n",
+ "if Sall>S:\n",
+ " print'%s %.2f %s '%('\\nd. It is acceptable because allowable stress is greater than the acttual stress of ',S,' lb/in^2.');\n",
+ "else:\n",
+ " print'%s %.2f %s '%('\\nd. Design is not acceptable because allowable stress is less than the actual stress of ',S,' lb/in^2.')\n",
+ "\n",
+ "##Note: The deviation of answer from the answer given in the book is due to round off error.(In the book values are rounded while in scilab actual values are taken)\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-3.2 Page No.43\n",
+ "\n",
+ "\n",
+ "a. The maximum stress in beam is 20250.00 lb/in^2 \n",
+ "\n",
+ "b. The maximum deflection in this beam is -0.07 in. \n",
+ "\n",
+ "c. Yes, the stress of 20250.00 is less than the yield of Sy= 30000.00 lb/in^2. \n",
+ "\n",
+ "d. It is acceptable because allowable stress is greater than the acttual stress of 20250.00 lb/in^2. \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg45"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ " \n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-3.3 Page No.45\\n');\n",
+ "\n",
+ "Su=80.*10**3; ##[lb/in^2] Ultimate strength\n",
+ "d=0.5; ##[in] Diameter of pin\n",
+ "As=math.pi*d**2./4.; ##[in^2] Area of cross section of pin\n",
+ "F=20*10**3; ##[lb] Load acting\n",
+ "\n",
+ "Ss=F/(2.*As); ##[lb/in^2] Shear stress\n",
+ "\n",
+ "if 0.5*Su>=Ss:\n",
+ " print('Pin would not fail');\n",
+ "else:\n",
+ "\tif 0.6*Su>=Ss:\n",
+ "\t\tprint('Pin would not fail');\n",
+ "\telse:\n",
+ "\t\tprint('\\n Actual stress is too high and the pin would fail.');\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-3.3 Page No.45\n",
+ "\n",
+ "\n",
+ " Actual stress is too high and the pin would fail.\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg46"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-3.4 Page No.46\\n');\n",
+ "\n",
+ "hp=10.; ##[hp] Power transmitted\n",
+ "rpm=1750.; ##[rpm] Turning speed\n",
+ "d=0.5; ##[in] Diameter of shaft\n",
+ "L=12.; ##[in] Length of shaft\n",
+ "G=11.5*10**6 ##[lb/in^2] shear modulus of elasticity\n",
+ "Su=62000.; ##[lb/in^2] \n",
+ "\n",
+ "T=63000.*hp/rpm; ##[in*lb] Torque transmitted\n",
+ "Z=math.pi*d**3/16.; ##[in^3] Polar section modulus\n",
+ "Ss=T/Z; ##[lb/in^2] Torsional shear stress\n",
+ "\n",
+ "##Note- In the book Z=0.025 in^3 is used instead of Z=0.0245437 in^3\n",
+ "\n",
+ "print'%s %.2f %s '%('\\na. Stress in the shaft is ',Ss,' lb/in^2.')\n",
+ "\n",
+ "J=math.pi*d**4/32.; ##[in^4] Polar moment of inertia\n",
+ "theta=T*L/(J*G); ##[radians] \n",
+ "\n",
+ "##Note- In the book J=0.0061 in^4 is used instead of J=0.0061359 in^4\n",
+ "\n",
+ "print'%s %.2f %s '%('\\nb. The angular deflection of shaft would be ',theta,' radians');\n",
+ "\n",
+ "SF=3; ##[] Safety factor based on ultimate strength\n",
+ "\n",
+ "Zd=T/(0.5*Su/SF); ##[in^3] Polar section modulus required for SF=3\n",
+ "Dd=(16.*Zd/math.pi)**(1/3.); ##[in] Diameter of shaft required Z=%pi*d^3/16\n",
+ "\n",
+ "print'%s %.2f %s '%('\\nc. Diameter of shaft required is ',Dd,' in.');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-3.4 Page No.46\n",
+ "\n",
+ "\n",
+ "a. Stress in the shaft is 14667.72 lb/in^2. \n",
+ "\n",
+ "b. The angular deflection of shaft would be 0.06 radians \n",
+ "\n",
+ "c. Diameter of shaft required is 0.56 in. \n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5-pg53"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-3.5 Page No.53\\n');\n",
+ "\n",
+ "L=30.; ##[in] Length of link\n",
+ "d=5/8.; ##[in] Diameter of link\n",
+ "I=math.pi*d**4/64.; ##[in^4] Moment of inertia\n",
+ "A=math.pi*d**2/4.; ##[in^2] Area of cross section\n",
+ "E=30*10**6; ##[lb/in^2] Modulus of elasticity\n",
+ "\n",
+ "r=math.sqrt(I/A); ##[in] Radius of gyration\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n The radius of gyration ',r,' in.');\n",
+ "\n",
+ "K=1; ##[] End support condition factor\n",
+ "\n",
+ "Le=K*L; ##[in] Effective length\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Effective length is ',Le,' in');\n",
+ "\n",
+ "SR=Le/r; ##[] Slenderness ratio\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Slenderness ratio is ',SR,'.')\n",
+ "\n",
+ "Sy=42000.; ##[lb/in^2] Yield strength\n",
+ "\n",
+ "Cc=math.sqrt(2*math.pi**2*E/Sy); ##[] Column constant\n",
+ "\n",
+ "print'%s %.2f %s '%('The column constant is',Cc,'');\n",
+ "\n",
+ "if SR>Cc:\n",
+ " print('\\n Slenderness ratio is greater than column constant, so use the euler formula')\n",
+ "\n",
+ "\n",
+ "I=math.pi*d**4/64.; ##[in^4] Moment of inertia\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n The moment of inertia is ',I,' in^4');\n",
+ "\n",
+ "Pc=math.pi**2*E*I/Le**2; ##[lb] Critical force\n",
+ "\n",
+ "##Note- In the book I=0.0075 in^4 is used instead of I=0.0074901 in^4\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n The critical force is ',Pc,' lb.');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-3.5 Page No.53\n",
+ "\n",
+ "\n",
+ " The radius of gyration 0.16 in. \n",
+ "\n",
+ " Effective length is 30.00 in \n",
+ "\n",
+ " Slenderness ratio is 192.00 . \n",
+ "The column constant is 118.74 \n",
+ "\n",
+ " Slenderness ratio is greater than column constant, so use the euler formula\n",
+ "\n",
+ " The moment of inertia is 0.01 in^4 \n",
+ "\n",
+ " The critical force is 2464.16 lb. \n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6-pg55"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-3.6 Page No.55\\n');\n",
+ "\n",
+ "L=60.; ##[in] Length of column\n",
+ "Sy=36000.; ##[lb/in^2] Yield strength\n",
+ "SF=2.; ##[]Safty factor\n",
+ "E=30*10**6; ##[lb/in^2] Modulus of elasticity\n",
+ "\n",
+ "A=2.26; ##[in^2] Area of cross section (Appendix 5.4)\n",
+ "I=0.764; ##[in^4] Moment of inertia (Appendix 5.4)\n",
+ "\n",
+ "r=math.sqrt(I/A); ##[in] Radius of gyration\n",
+ "\n",
+ "K=0.65; ##[] End support condition factor from Figure 3.8\n",
+ "Le=K*L; ##[in] Effective length\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n The effective length is ',Le,' in.');\n",
+ "\n",
+ "SR=Le/r; ##[] Slenderness ratio\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n The slenderness ratio is ',SR,'');\n",
+ "\n",
+ "Cc=math.sqrt(2*math.pi**2*E/Sy); ##[] Column constant\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n The column constant is ',Cc,'');\n",
+ "\n",
+ "if Cc>SR :\n",
+ " print('\\n The column constant is greater than slenderness ratio, so use the Johnson formula.');\n",
+ "\n",
+ "\n",
+ "F=(A*Sy/SF)*(1.-Sy*SR**2/(4.*math.pi**2*E));\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n The acceptable load for a safty factor of 2 is ',F,' lb.');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-3.6 Page No.55\n",
+ "\n",
+ "\n",
+ " The effective length is 39.00 in. \n",
+ "\n",
+ " The slenderness ratio is 67.08 \n",
+ "\n",
+ " The column constant is 128.25 \n",
+ "\n",
+ " The column constant is greater than slenderness ratio, so use the Johnson formula.\n",
+ "\n",
+ " The acceptable load for a safty factor of 2 is 35116.52 lb. \n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Machine_Design_by_T._H._Wentzell,_P._E/Chapter4.ipynb b/Machine_Design_by_T._H._Wentzell,_P._E/Chapter4.ipynb new file mode 100644 index 00000000..2de5ae9a --- /dev/null +++ b/Machine_Design_by_T._H._Wentzell,_P._E/Chapter4.ipynb @@ -0,0 +1,243 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:2a6b45b6c7166d942ef611d182078312aa93230cc9974f88e551a1cb2d2c7e18"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter4-Combined Stress and Failure Theories"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg66"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-4.1 Page 66 ')\n",
+ " \n",
+ "D=2.; ##[in] Dia. of short column\n",
+ "F=10000.; ##[lb] Load applied\n",
+ "L=15.; ##[in] Length of column\n",
+ "e=2.; ##[in] Offset of load\n",
+ "\n",
+ "A=(math.pi*D**2)/4.; ##[in^2] Area of cross section of column\n",
+ "SA=F/A; ##[lb/in^2] Axial Stress\n",
+ "\n",
+ "Z=(math.pi*D**3)/32.; ##[in^4] Section modulus for bending\n",
+ "M=F*e; ##[lb*in] Bending moment\n",
+ "SB=M/Z; ##[lb/in^2] Bemding stress\n",
+ "\n",
+ "S=-SA-SB; ##S=(+-)SA+(+-)SB Max. stress\n",
+ "\n",
+ "##The bending stress and axial stress are added on inner side of column \n",
+ "\n",
+ "print'%s %.2f %s '%('\\n\\n Maximum stress in column is ',S,' lb/in^2.\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-4.1 Page 66 \n",
+ "\n",
+ "\n",
+ " Maximum stress in column is -28647.89 lb/in^2.\n",
+ " \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg67"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-4.2 Page 67 ')\n",
+ "\n",
+ "F1=800.; ##[lb] Vertical force\n",
+ "F2=600.; ##[lb] Horizontal force\n",
+ "D=0.5; ##[in] Pin diameter\n",
+ "A=(math.pi*D**2)/4.; ##[in^2] Area of cross section of pin\n",
+ "\n",
+ "F=math.sqrt(F1**2+F2**2); ##[lb] Resultant force on pin\n",
+ "S=F/A; ##[lb/in^2] Shear stress in pin\n",
+ "\n",
+ "##If forces were not perpendicular, they would be added vectorially.\n",
+ "print'%s %.2f %s '%('\\n\\n Shear stress in pin is ',S,' lb/in^2.');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-4.2 Page 67 \n",
+ "\n",
+ "\n",
+ " Shear stress in pin is 5092.96 lb/in^2. \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg68"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ " \n",
+ "print('MACHINE DESIGN\\n Timothy H. Wentzell, P.E.\\n Example 4.3 Page no 68');\n",
+ "\n",
+ "P=50.; ##[hp] Power transmitted\n",
+ "N=300.; ##[rpm] Speed\n",
+ "D=10.; ##[in] Effective pitch diameter of sprocket\n",
+ "d=1.; ##[in] Diameter of shaft from figure 4.3\n",
+ "Z=(math.pi*d**3)/16.; ##[in^3] Section modulus of shaft\n",
+ "A=(math.pi*d**2)/4.; ##[in^2] Area of cross section\n",
+ "\n",
+ "T=(63000./N)*P; ##[lb*in] Torque required to transmit power\n",
+ "F=T/(D/2.); ##[lb] Driving force in chain\n",
+ "\n",
+ "Ss=F/A; ##[lb/in^2] Shear stress in shaft\n",
+ "\n",
+ "St=T/Z; ##[lb/in^2] Torsional stress in shaft\n",
+ "\n",
+ "S=Ss+St; ##[lb/in^2] Resultant stress\n",
+ "\n",
+ "##Note-There is mistake in addition of Ss and St.\n",
+ "\n",
+ "##This value would be compared to shear stress allowable for shaft material\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n\\n The combined stress in 1 inch diameter shaft is ',S,' lb/in^2.');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN\n",
+ " Timothy H. Wentzell, P.E.\n",
+ " Example 4.3 Page no 68\n",
+ "\n",
+ "\n",
+ " The combined stress in 1 inch diameter shaft is 56149.86 lb/in^2. \n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg71"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN\\n Timothy H. Wentzell, P.E.\\n Example 4.4 Page no 71')\n",
+ "\n",
+ "P=20.; ##[hp] Power transmitted by chain drive\n",
+ "n=500.; ##[rpm] speed\n",
+ "d=8.; ##[in] Pitch diameter of sprocket\n",
+ "fos=2.;\n",
+ "D=1.25; ##[in] Diameter of shaft\n",
+ "L=12.; ##[in] Distance between two supporting bearings\n",
+ "Z1=math.pi*D**3/16.; ##[in^3] Section modulus for torsion\n",
+ "Z2=math.pi*D**3/32.; ##[in^3] Section modulus for bending\n",
+ "\n",
+ "T=63000.*P/n; ##[in*lb] Torque on shaft\n",
+ "\n",
+ "F=T/(d/2.); ##[lb] Force in chain\n",
+ "\n",
+ "M=F*L/4.; ##[in*lb] Bending moment in shaft\n",
+ "\n",
+ "Ss=T/Z1; ##[lb/in^2] Torsional shear stress\n",
+ "\n",
+ "Sb=M/Z2; ##[lb/in^2] Bending normal stress\n",
+ "\n",
+ "##Note- In the book Sb=9860 lb/in^2 is used instead of Sb=9856.7075 lb/in^2\n",
+ "\n",
+ "S=(Sb/2.)+math.sqrt(Ss**2.+(Sb/2.)**2); ##[lb/in^2] Combined max. stress\n",
+ "\n",
+ "Sy=30000.; ##[lb/in^2]From APPENDIX 4 Page no-470 for AISI 1020 and Hot-rolled steel\n",
+ "FOS=(Sy/2.)/S; ##[]Actual factor of safty\n",
+ "\n",
+ "if S < Sy/2.: ##Strength is greater than combined stress so design is safe\n",
+ " print'%s %.2f %s '%('\\n\\n Design is acceptable and Combined stress is ',S,' lb/in^2');\n",
+ "else:\n",
+ " print('\\n\\n Design is not acceptable');\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN\n",
+ " Timothy H. Wentzell, P.E.\n",
+ " Example 4.4 Page no 71\n",
+ "\n",
+ "\n",
+ " Design is acceptable and Combined stress is 13142.28 lb/in^2 \n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Machine_Design_by_T._H._Wentzell,_P._E/Chapter5.ipynb b/Machine_Design_by_T._H._Wentzell,_P._E/Chapter5.ipynb new file mode 100644 index 00000000..34613b92 --- /dev/null +++ b/Machine_Design_by_T._H._Wentzell,_P._E/Chapter5.ipynb @@ -0,0 +1,382 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:a8a63cc2515e1525ed77022e1ebce23141b45875572a749acb7cb29ba73ced4d"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter5-Repeated Loading"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg93"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-5.1 Page No.93\\n');\n",
+ "\n",
+ "SF=2.; ##[] Safety factor\n",
+ "F=500.; ##[lb] Load\n",
+ "L=40.; ##[in] Length of shaft\n",
+ "Su=95000.; ##[lb/in^2] Ultimate strength (Appendix 4)\n",
+ "Sy=60000.; ##[lb/in^2] Yield strength (Appendix 4)\n",
+ "\n",
+ "Mmax=F*L/4.; ##[lb*in] Maximum bending moment\n",
+ "Mmin=-F*L/4.; ##[lb/in^2] Minimum bending moment\n",
+ "\n",
+ "Csurface=1; ##[] As surface is polished\n",
+ "Csize=0.85; ##[] Assuming 0.5<D<2\n",
+ "Ctype=1; ##[] Bending stress\n",
+ "\n",
+ "Sn=Csize*Csurface*Ctype*(0.5*Su); ##[lb/in^2] Endurance limit\n",
+ "\n",
+ "if Mmax==abs(Mmin):\n",
+ " Sm=0; ##[lb/in^2] Mean stress\n",
+ "\n",
+ "\n",
+ "Sa=Sn/SF; ##[lb/in^2] As (1/SF)=(Sm/Sy)+(Sa/Sn) from soderberg equation\n",
+ "\n",
+ "Sa_Z=(Mmax-Mmin)/2.; ##[lb*in^2] Product of altenating stress and section modulus\n",
+ "\n",
+ "Z=Sa_Z/Sa; ##[in^4] Section modulus\n",
+ "\n",
+ "D=(32.*Z/math.pi)**(1./3.); ##[in] Diameter of shaft\n",
+ "\n",
+ "D1=1.375; ##[in] Next higher available is 1.375 in. so use D1\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n The required diameter of rotating shaft is ',D1,' in.');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-5.1 Page No.93\n",
+ "\n",
+ "\n",
+ " The required diameter of rotating shaft is 1.38 in. \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg95"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ " \n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-5.2 Page No.95\\n');\n",
+ "\n",
+ "Su=90000.; ##[lb/in^2] Ultimate strength (Appendix 8)\n",
+ "Sy=37000.; ##[lb/in^2] Yield strength (Appendix 8)\n",
+ "Sni=34000.; ##[lb/in^2] Endurance limit (Appendix 8)\n",
+ "SF=1.6; ##[] Safety factor\n",
+ "\n",
+ "F=1000.; ##[lb] Load\n",
+ "L=12.; ##[in] Length of cantilever beam\n",
+ "\n",
+ "Mmax=F*L; ##[lb*in] Maximum bending moment\n",
+ "Mmin=0.; ##[lb*in] Minimum bending moment\n",
+ "\n",
+ "Csize=0.85 ##[] Assuming 0.5<D<2 in\n",
+ "Ctype=1.; ##[] Bending stress\n",
+ "Csurface=1.; ##[] As surface is polished\n",
+ "\n",
+ "Malt=(Mmax-Mmin)/2.; ##[lb*in] Alternating bending moment\n",
+ "\n",
+ "Mmean=(Mmax+Mmin)/2.; ##[lb*in] Mean bending moment\n",
+ "\n",
+ "Sn=Csize*Csurface*Ctype*Sni; ##[lb/in^2] Modified endurance limit\n",
+ "\n",
+ "Z=((Mmean/Sy)+(Malt/Sn))*SF; ##[in^3] Section modulus\n",
+ "\n",
+ "D=(32.*(Z)/math.pi)**(1./3.); ##[in] Diameter of bar\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n The required diameter of bar using the soderberg method is ',D,' in.');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-5.2 Page No.95\n",
+ "\n",
+ "\n",
+ " The required diameter of bar using the soderberg method is 1.82 in. \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg97"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-5.3 Page No.97\\n');\n",
+ "\n",
+ "Su=90000.; ##[lb/in^2] Ultimate strength (Appendix 8)\n",
+ "Sy=37000.; ##[lb/in^2] Yield strength (Appendix 8)\n",
+ "Sni=34000.; ##[lb/in^2] Endurance limit (Appendix 8)\n",
+ "SF=1.6; ##[] Safety factor\n",
+ "\n",
+ "F=1000.; ##[lb] Load\n",
+ "L=12.; ##[in] Length of cantilever beam\n",
+ "\n",
+ "Mmax=F*L; ##[lb*in] Maximum bending moment\n",
+ "Mmin=0.; ##[lb*in] Minimum bending moment\n",
+ "\n",
+ "Csize=0.85 ##[] Assuming 0.5<D<2 in\n",
+ "Ctype=1.; ##[] Bending stress\n",
+ "Csurface=1.; ##[] As surface is polished\n",
+ "\n",
+ "Malt=(Mmax-Mmin)/2.; ##[lb*in] Alternating bending moment\n",
+ "\n",
+ "Mmean=(Mmax+Mmin)/2.; ##[lb*in] Mean bending moment\n",
+ "\n",
+ "Sn=Csize*Csurface*Ctype*Sni; ##[lb/in^2] Modified endurance limit\n",
+ "\n",
+ "Z=((Mmean/Su)+(Malt/Sn))*SF; ##[in^3] Section modulus\n",
+ "\n",
+ "D=(32.*(Z)/math.pi)**(1/3.); ##[in] Diameter of bar\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n The required diameter of bar using the soderberg method is ',D,' in.');\n",
+ "\n",
+ "##Note that the modified Goodman results in a less conservative size as would be expected from figure 5.10\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-5.3 Page No.97\n",
+ "\n",
+ "\n",
+ " The required diameter of bar using the soderberg method is 1.65 in. \n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg98"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-5.4 Page No.98\\n');\n",
+ "\n",
+ "Su=95000.; ##[lb/in^2] Ultimate strength\n",
+ "Sy=60000.; ##[lb/in^2] Yield strength\n",
+ "SF=1.5; ##[] Safety factor\n",
+ "\n",
+ "Fmax=1000.; ##[lb] Maximum load\n",
+ "Fmin=-6000.; ##[lb] Minimum load\n",
+ "\n",
+ "Fmean=(Fmax+Fmin)/2.; ##[lb] Mean load\n",
+ "Fmean=abs(Fmean); ##[lb] Considering absolute value\n",
+ "Falt=(Fmax-Fmin)/2.; ##[lb] Alternating load\n",
+ "\n",
+ "Csize=1. ##[] Assuming b<0.5 in\n",
+ "Ctype=0.8 ##[] Axial stress\n",
+ "Csurface=0.86 ##[] Machined surface Figure 5.7b\n",
+ "\n",
+ "Sn=Csize*Csurface*Ctype*(0.5*Su); ##[lb/in^2] Modified endurance limit\n",
+ "\n",
+ "A=((Fmean/Sy)+(Falt/Sn))*SF; ##[in^2] Area of cross section of rod\n",
+ "\n",
+ "b=math.sqrt(A); ##[in] Side of square cross section\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n The required square size in the center section is ',b,' in.');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-5.4 Page No.98\n",
+ "\n",
+ "\n",
+ " The required square size in the center section is 0.47 in. \n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5-pg100"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ " \n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-5.5 Page No.100\\n');\n",
+ "\n",
+ "Su=80000.; ##[lb/in^2] Ultimate strength\n",
+ "Sy=71000.; ##[lb/in^2] Yield strength\n",
+ "\n",
+ "D=0.6; ##[in] Diameter of shaft\n",
+ "d=0.5; ##[in] Diameter of shaft at notch\n",
+ "r=0.05; ##[in] Radius of notch\n",
+ "Z=math.pi*d**3/16.; ##[in^3] Polar section modulus\n",
+ "Tmax=200.; ##[lb*in] Maximum load\n",
+ "Tmin=0.; ##[lb*in] Minimum load\n",
+ "\n",
+ "Smax=Tmax/Z; ##[lb/in^2] Maximum stress\n",
+ "Smin=Tmin/Z; ##[lb/in^2] Minimum stress\n",
+ "\n",
+ "Smean=(Smax+Smin)/2.; ##[lb/in^2] Mean stress\n",
+ "Salt=(Smax-Smin)/2.; ##[lb/in^2] Alternating stress\n",
+ "\n",
+ "Csize=0.85; ##[] Assume 0.5<D<2 in\n",
+ "Csurface=0.88; ##[] Machined surface Figure 5.7b\n",
+ "Ctype=0.6; ##[] Torsional stress\n",
+ "\n",
+ "Sn=Csize*Csurface*Ctype*(0.5*Su); ##[lb/in^2] Modified endurance limit\n",
+ "\n",
+ "Kt=1.32; ##[] (D/d)=1.2, (r/d)=0.1 from Appendix 6c\n",
+ "\n",
+ "N=1/(Smean/(0.5*Sy)+Kt*Salt/Sn); ##[] Safety factor\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n The factor of safety for this design is ',N,'');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-5.5 Page No.100\n",
+ "\n",
+ "\n",
+ " The factor of safety for this design is 2.41 \n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6-pg102"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-5.6 Page No.102\\n');\n",
+ "\n",
+ "##From Example Problem 5.5\n",
+ "Sy=71000.; ##[lb/in^2] Yield strength\n",
+ "Smax=8148.7331 ; ##[lb/in^2] Maximum stress\n",
+ "Smin=0.; ##[lb/in^2] Minimum stress\n",
+ "Smean=(Smax+Smin)/2.; ##[lb/in^2] Mean stress\n",
+ "Salt=(Smax-Smin)/2.; ##[lb/in^2] Alternating stress\n",
+ "Sn=18000.; ##[lb/in^2] Modified endurance strength\n",
+ "Kt=1.32 ##[] Stress concentration factor\n",
+ "\n",
+ "Nd=100000.; ##[cycles] Desired life\n",
+ "\n",
+ "Snn=Sn*(10**6/Nd)**0.09; ##[lb/in^2]\n",
+ "\n",
+ "N=1/(Smean/(0.5*Sy)+Kt*Salt/Snn); ##[] Factor of safety\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n The new factor of safety for this condition is .',N,'');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-5.6 Page No.102\n",
+ "\n",
+ "\n",
+ " The new factor of safety for this condition is . 2.80 \n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Machine_Design_by_T._H._Wentzell,_P._E/Chapter6.ipynb b/Machine_Design_by_T._H._Wentzell,_P._E/Chapter6.ipynb new file mode 100644 index 00000000..4ab24625 --- /dev/null +++ b/Machine_Design_by_T._H._Wentzell,_P._E/Chapter6.ipynb @@ -0,0 +1,221 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:083ec34311017f44e1e671cc0c2306a30b9ade82eac3a36003dab32d9ffbdd8a"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter6-Fasteners and Fastening Methods"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg120"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-6.1 Page No.120\\n');\n",
+ "\n",
+ "As=0.334; ##[in^2] Tensile stress area (Table 6.1)\n",
+ "Sp=85000.; ##[lb/in^2] Proof strength (Table 6.3)\n",
+ "D=3/4.; ##[in] Nominal diameter of thread\n",
+ "\n",
+ "Fi=0.85*As*Sp; ##[lb] Desired intial preload\n",
+ "C=0.2; ##[] Torque coefficient\n",
+ "\n",
+ "T=C*D*Fi; ##[in*lb] Torque\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n The required torque is ',T,' lb*in.');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-6.1 Page No.120\n",
+ "\n",
+ "\n",
+ " The required torque is 3619.73 lb*in. \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg121"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-6.2 Page No.121\\n');\n",
+ "\n",
+ "L=5.; ##[in] Length of engagement\n",
+ "E=30*10**6; ##[lb/in^2] Modulus of elasticity\n",
+ "As=0.334; ##[in^2] Tensile stress area (Table 6.1)\n",
+ "Sp=85000.; ##[lb/in^2] Proof strength (Table 6.3)\n",
+ "Fi=0.85*As*Sp; ##[lb] Desired intial preload\n",
+ "\n",
+ "Delta=Fi*L/(As*E) ##[in] Elongation\n",
+ "\n",
+ "pitch=0.1; ##[in] Pitch for 3/4 UNC\n",
+ "TA=Delta*360./pitch; ##[Degree] Torque angle\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n The angle of rotation needed is ',TA,' degree.');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-6.2 Page No.121\n",
+ "\n",
+ "\n",
+ " The angle of rotation needed is 43.35 degree. \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg122"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-6.3 Page No.122\\n');\n",
+ "\n",
+ "Alpha=6.5*10**-6; ##[in/(in*F)] Thermal expansion coefficient (Appendix 8)\n",
+ "L=5.; ##[in] Length of engagement\n",
+ "\n",
+ "Delta=0.01204; ##[Degree] Elongation\n",
+ "\n",
+ "DT=Delta/(Alpha*L); ##[F] The temperature we would need to heat this bolt above the sevice temperature\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n The temperature we would need to heat this bolt above the sevice temperature is ',DT,' F.');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-6.3 Page No.122\n",
+ "\n",
+ "\n",
+ " The temperature we would need to heat this bolt above the sevice temperature is 370.46 F. \n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg124"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-6.4 Page No.124\\n');\n",
+ "\n",
+ "Dp=20.; ##[in] Pressure vessel head diameter\n",
+ "Ds=1.25; ##[in] Stud diameter\n",
+ "Ls=6.; ##[in] Stud length\n",
+ "Af=50.; ##[in^2] Clamped area of flanges\n",
+ "\n",
+ "E=30*10**6; ##[lb/in^2] Modulus of elasticity\n",
+ "C=0.15; ##[] Torque coefficient\n",
+ "Si=120000.; ##[lb/in^2] Proof strength (Table 6.3)\n",
+ "A=1.073; ##[in^2] Tensile stress area (Table 6.1)\n",
+ "\n",
+ "Fi=0.9*Si*A; ##[lb] Desired intial load\n",
+ "\n",
+ "T=C*Ds*Fi; ##[lb*in] Torque\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n1. The required torque is ',T,' lb*in.');\n",
+ "\n",
+ "Pp=500.; ##[lb/in^2] Pressure inside the pressure vessel\n",
+ "Ap=math.pi*Dp**2/4.; ##[in^2] Pressure vessel head cross section area\n",
+ "\n",
+ "Kb=A*E/Ls; ##[lb/in] Stiffness per stud\n",
+ "Kf=Af*E/Ls; ##[lb/in] Stiffness per flange\n",
+ "Fe=Pp*Ap; ##[lb] Force on pressure vessel head\n",
+ "\n",
+ "Ft=10*Fi+(10*Kb/(10*Kb+Kf))*Fe; ##[lb] Total load on the bolt\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n2. The total load on the bolt is ',Ft,' lb.');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-6.4 Page No.124\n",
+ "\n",
+ "\n",
+ "1. The required torque is 21728.25 lb*in. \n",
+ "\n",
+ "2. The total load on the bolt is 1186593.41 lb. \n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Machine_Design_by_T._H._Wentzell,_P._E/Chapter7.ipynb b/Machine_Design_by_T._H._Wentzell,_P._E/Chapter7.ipynb new file mode 100644 index 00000000..3d9dd10f --- /dev/null +++ b/Machine_Design_by_T._H._Wentzell,_P._E/Chapter7.ipynb @@ -0,0 +1,256 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:b7f52fd241ce8535a82335bfa31e1c6f3b490261728359c13ad5732a698aa8c6"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter7-Impact and Energy Analysis "
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg137"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-7.1 Page No.137\\n');\n",
+ "\n",
+ "D=2.; ##[in] Diameter of bar\n",
+ "W=500.; ##[lb] Weight\n",
+ "h=1.; ##[in] Height from which the weight falls\n",
+ "A=math.pi*D**2/4.; ##[in^2] Area of cross section of bar\n",
+ "L=10.; ##[in] Length of bar\n",
+ "E=30*10**6; ##[lb/in^2] Modulus of elasticity\n",
+ "\n",
+ "S=(W/A)+(W/A)*(1.+(2.*h*E*A/(L*W)))**(0.5); ##[lb/in^2] Stress in the bar\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Stress in the bar is ',S,' lb/in^2.');\n",
+ "\n",
+ "Delta=S*L/E; ##[in] Deflection\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Deflecton in the bar is ',Delta,' in.');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-7.1 Page No.137\n",
+ "\n",
+ "\n",
+ " Stress in the bar is 31061.50 lb/in^2. \n",
+ "\n",
+ " Deflecton in the bar is 0.01 in. \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg139"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-7.2 Page No.139\\n');\n",
+ "\n",
+ "W=2000.; ##[lb] Weight of automobile\n",
+ "L=36.; ##[in] Length of stop\n",
+ "D=2.; ##[in] Diameter of steel bar\n",
+ "V=5.*5280.*12./3600.; ##[in/s] Velocity of automobile\n",
+ "\n",
+ "A=math.pi*D**2/4.; ##[in^2] Area of cross section of bar\n",
+ "E=30.*10**6; ##[lb/in^2] Modulus of elasticity\n",
+ "\n",
+ "k=A*E/L; ##[lb/in] Stiffness of the bar\n",
+ "g=386.; ##[in/s^2] Acceleration due to gravity\n",
+ "\n",
+ "Delta=math.sqrt(2./k*W*(V**2./(2.*g)+0.)); ##[in] Deflection\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n The deflection in the bar is ',Delta,' in.');\n",
+ "\n",
+ "S=Delta*E/L; ##[in] Stress in the bar\n",
+ "\n",
+ "##Note-In the book Delta=0.124 is used instead of Delta=0.123800\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n The stress in the bar is ',S,' lb/in^2.');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-7.2 Page No.139\n",
+ "\n",
+ "\n",
+ " The deflection in the bar is 0.12 in. \n",
+ "\n",
+ " The stress in the bar is 103166.44 lb/in^2. \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg141"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-7.3 Page No.141\\n');\n",
+ "\n",
+ "W=3000.; ##[lb] Weight of automobile\n",
+ "L=40*12; ##[in] Length of the beam\n",
+ "I=64.2; ##[in^4] Moment of inertia of the beam\n",
+ "Sy=48000.; ##[lb/in^2] Yield strength of the beam\n",
+ "c=8/2.; ##[in] Distance from the outermost fiber to neutral axis\n",
+ "E=30.*10**6; ##[lb/in^2] Modulus of elasticity\n",
+ "g=32.2; ##[ft/s^2] Acceleration due to gravity\n",
+ "\n",
+ "M=I*Sy/c; ##[lb*in] Moment at which beam will yield\n",
+ "F=4.*M/L; ##[lb] Force at which beam will yield\n",
+ "\n",
+ "Delta=F*L**3/(48.*E*I); ##[in] Deflection\n",
+ "KE=F*Delta/2.; ##[lb*in] Kinetic energy\n",
+ "\n",
+ "V=math.sqrt(2.*g*KE/W); ##[in/s] Velocity\n",
+ "V=V/5280.*3600.; ##[miles/hr] Velocity\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n At ',V,' miles/hr velocity the beam will yield.');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-7.3 Page No.141\n",
+ "\n",
+ "\n",
+ " At 15.68 miles/hr velocity the beam will yield. \n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg143"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "import numpy\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-7.4 Page No.143\\n');\n",
+ "\n",
+ "D=3/4.; ##[in] Diameter of the bolt\n",
+ "At=0.334; ##[in^2] Area of thread\n",
+ "As=math.pi*D**2/4.; ##[in^2] Area of shank\n",
+ "\n",
+ "##Note-In the book As=0.442 in^2 is used instead of As=0.4417865 in.\n",
+ "\n",
+ "E=30*10**6; ##[lb/in^2] Modulus of elasticity\n",
+ "Lt=2.; ##[in] Length of the thread\n",
+ "Ls=6.; ##[in] Length of the shank\n",
+ "h=0.03; ##[in] Height from which the weight falls\n",
+ "W=500.; ##[lb] Falling load\n",
+ "\n",
+ "Kt=At*E/Lt; ##[lb/in] Stiffness of threaded portion\n",
+ "Ks=As*E/Ls; ##[lb/in] Stiffness of shank\n",
+ "\n",
+ "K=Kt*Ks/(Kt+Ks); ##[lb/in] Overall stiffness\n",
+ "\n",
+ "Delta=(W/K)+(W/K)*math.sqrt(1.+2.*h*K/W); ##[in] Deflection\n",
+ "\n",
+ "A=numpy.matrix([[Ls/E, Lt/E], [0.442, -0.334]]);\n",
+ "b=numpy.matrix([[Delta] ,[0]]);\n",
+ "S=A/b\n",
+ "\n",
+ "\n",
+ "Ln=8.; ##[in] Length when shank has same area as threads\n",
+ "Kn=At*E/Ln; ##[lb/in] Stiffness\n",
+ "Deltan=(W/Kn)+(W/Kn)*math.sqrt(1.+2.*h*Kn/W); ##[in] Deflection\n",
+ "S=Deltan*E/Ln; ##[ln/in^2] Stress\n",
+ "\n",
+ "print'%s %.2f %s %.2f %s '%('\\n If shank has the same area as threads then stress is ',S,' lb/in^2 and deflection is ',Deltan,' in.');\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-7.4 Page No.143\n",
+ "\n",
+ "\n",
+ " If shank has the same area as threads then stress is 19910.79 lb/in^2 and deflection is 0.01 in. \n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Machine_Design_by_T._H._Wentzell,_P._E/Chapter8.ipynb b/Machine_Design_by_T._H._Wentzell,_P._E/Chapter8.ipynb new file mode 100644 index 00000000..042236da --- /dev/null +++ b/Machine_Design_by_T._H._Wentzell,_P._E/Chapter8.ipynb @@ -0,0 +1,316 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:5037d07eaadd647bb4bcc84b30ee35be55f0aa68af7fbc420af7f2ee7fee0915"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter8-Spring Design"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg160"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-8.1 Page No.160\\n');\n",
+ "\n",
+ "Dm=0.625; ##[in] Mean diameter of spring\n",
+ "F=35.; ##[lb] Load\n",
+ "\n",
+ "\n",
+ "K=1.25; ##[] Wahl factor for Dm/Dw=6.25 (figure 8.8)\n",
+ "Q=190000.; ##[lb/in^2] Expected ultimate strength \n",
+ "\n",
+ "LF=0.263; ##[] Loading factor\n",
+ "\n",
+ "Dw=(K*8.*F*Dm/(LF*math.pi*Q))**(1/2.846); ##[in] Wire diameter\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n The wire diameter of spring is ',Dw,' in.');\n",
+ "\n",
+ "##Use U.S Steel 12-gage wire: Dw=0.105 in.\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-8.1 Page No.160\n",
+ "\n",
+ "\n",
+ " The wire diameter of spring is 0.10 in. \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg163"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-8.2 Page No.163\\n');\n",
+ "\n",
+ "Dw=0.105; ##[in] Wire diameter\n",
+ "Dm=0.620; ##[in] Mean diameter of spring\n",
+ "F=35.; ##[lb] Load\n",
+ "G=11.85*10**6; ##[lb/in^2] Shear modulus of elasticity\n",
+ "Delta=0.5; ##[in] Deflection\n",
+ "\n",
+ "Na=Delta*G*Dw**4./(8.*F*Dm**3); ##[] Number of active coils\n",
+ "\n",
+ "Nat=Na+2.; ##[] Total number of coils\n",
+ "\n",
+ "Lf=2.; ##[in] Free length of spring\n",
+ "\n",
+ "P=(Lf-2.*Dw)/Nat; ##[in] Pitch (Table 8.1)\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Pitch is ',P,' in.');\n",
+ "\n",
+ "k=G*Dw**4./(8.*Dm**3*Na); ##[lb/in] Spring rate\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n Spring rate is ',k,' lb/in.');\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n The total number of coils necessary to meet design criteria are .',Nat,'');\n",
+ "\n",
+ "##Note: The deviation of answer from the answer given in the book is due to round off error.(In the book values are rounded while in scilab actual values are taken)\n",
+ "\n",
+ "##Note: The deviation of answer from the answer given in the book is due to round off error.(In the book values are rounded while in scilab actual values are taken)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-8.2 Page No.163\n",
+ "\n",
+ "\n",
+ " Pitch is 0.14 in. \n",
+ "\n",
+ " Spring rate is 70.00 lb/in. \n",
+ "\n",
+ " The total number of coils necessary to meet design criteria are . 12.79 \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg165"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-8.3 Page No.165\\n');\n",
+ "Lf=2.; ##[in] Free length of spring\n",
+ "Dm=0.620; ##[in] Mean diameter of spring\n",
+ "\n",
+ "R=Lf/Dm; ##[] Free lengtth to mean diameter ratio\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n The ratio of the free length of spring to mean diameter of spring is .',R,'');\n",
+ "print(' From Figure 8.9 for squared and ground ends, this is a stable spring.');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-8.3 Page No.165\n",
+ "\n",
+ "\n",
+ " The ratio of the free length of spring to mean diameter of spring is . 3.23 \n",
+ " From Figure 8.9 for squared and ground ends, this is a stable spring.\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg165"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-8.4 Page No.165\\n');\n",
+ "\n",
+ "F=35.; ##[lb] Load\n",
+ "k=73.3; ##[lb/in] Spring rate\n",
+ "\n",
+ "x=F/k; ##[in] Deflection \n",
+ "\n",
+ "print'%s %.2f %s '%('\\n The deflection in the spring would be ',x,' in.');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-8.4 Page No.165\n",
+ "\n",
+ "\n",
+ " The deflection in the spring would be 0.48 in. \n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5-pg166"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-8.5 Page No.166\\n');\n",
+ "\n",
+ "b=12.; ##[in] Width of plate\n",
+ "h=1.; ##[in] Thickness of plate\n",
+ "L=72.; ##[in] Length of plate\n",
+ "I=b*h**3/12.; ##[in^4] Moment of inertia\n",
+ "\n",
+ "Delta=4.; ##[in] Deflection\n",
+ "E=10*10**6; ##[lb/in^2] Modulus of elasticity\n",
+ "\n",
+ "F=3.*Delta*E*I/L**3; ##[lb] Force\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n The force at this point is ',F,' lb.');\n",
+ "\n",
+ "k=F/Delta; ##[lb/in] Stiffness\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n stiffness is ',k,' lb/in.');\n",
+ "\n",
+ "##Note: The deviation of answer from the answer given in the book is due to round off error.(In the book values are rounded while in scilab actual values are taken)\n",
+ "\n",
+ "##Note: The deviation of answer from the answer given in the book is due to round off error.(In the book values are rounded while in scilab actual values are taken)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-8.5 Page No.166\n",
+ "\n",
+ "\n",
+ " The force at this point is 321.50 lb. \n",
+ "\n",
+ " stiffness is 80.38 lb/in. \n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6-pg167"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "print('MACHINE DESIGN \\n Timothy H. Wentzell, P.E. \\n EXAMPLE-8.6 Page No.167\\n');\n",
+ "\n",
+ "F=322.; ##[lb] Force\n",
+ "Delta=4.; ##[in] Deflection\n",
+ "\n",
+ "U=F*Delta/2.; ##[in*lb] Energy\n",
+ "\n",
+ "print'%s %.2f %s '%('\\n The energy from the 4-inch deflection was ',U,' lb*in.');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MACHINE DESIGN \n",
+ " Timothy H. Wentzell, P.E. \n",
+ " EXAMPLE-8.6 Page No.167\n",
+ "\n",
+ "\n",
+ " The energy from the 4-inch deflection was 644.00 lb*in. \n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Machine_Design_by_T._H._Wentzell,_P._E/screenshots/chapter1.png b/Machine_Design_by_T._H._Wentzell,_P._E/screenshots/chapter1.png Binary files differnew file mode 100644 index 00000000..d7ba1198 --- /dev/null +++ b/Machine_Design_by_T._H._Wentzell,_P._E/screenshots/chapter1.png diff --git a/Machine_Design_by_T._H._Wentzell,_P._E/screenshots/chapter2.png b/Machine_Design_by_T._H._Wentzell,_P._E/screenshots/chapter2.png Binary files differnew file mode 100644 index 00000000..e092449f --- /dev/null +++ b/Machine_Design_by_T._H._Wentzell,_P._E/screenshots/chapter2.png diff --git a/Machine_Design_by_T._H._Wentzell,_P._E/screenshots/chapter3.png b/Machine_Design_by_T._H._Wentzell,_P._E/screenshots/chapter3.png Binary files differnew file mode 100644 index 00000000..aab0bbf6 --- /dev/null +++ b/Machine_Design_by_T._H._Wentzell,_P._E/screenshots/chapter3.png |