diff options
Diffstat (limited to 'sample_notebooks')
45 files changed, 16716 insertions, 0 deletions
diff --git a/sample_notebooks/Akshay Ghogare/AKSHAY_GHOGARE.ipynb b/sample_notebooks/Akshay Ghogare/AKSHAY_GHOGARE.ipynb new file mode 100755 index 00000000..fa395760 --- /dev/null +++ b/sample_notebooks/Akshay Ghogare/AKSHAY_GHOGARE.ipynb @@ -0,0 +1,249 @@ +{ + "metadata": { + "celltoolbar": "Raw Cell Format", + "name": "", + "signature": "sha256:4b26d5a062c7df178b102bcb49ca0f8363642f2c290f44d66b774e90f3dc8f59" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "SAMPLE EXAMPLE 1" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "EXAMPLE 2.18.1" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "W1=12.5;#CaCO3 in water in mg/lit#\n", + "W2=8.4;#MgCO3 in water in mg/lit#\n", + "W3=22.2;#CaCl2 in water in mg/lit#\n", + "W4=9.5;#MgCl2 in water in mg/lit#\n", + "W5=33;#CO2 in water in mg/lit#\n", + "W6=6.68;#NaHCO3 in water in mg/lit#\n", + "M1=100.0/100.0;#multiplication factor of CaCO3#\n", + "M2=100.0/84;#multiplication factor of MgCO3#\n", + "M3=100.0/111;#multiplication factor of CaCl2#\n", + "M4=100.0/95;#multiplication factor of MgCl2#\n", + "M6=100.0/84;#multiplication factor of NaHCO3#\n", + "P1=W1*M1;#CaCO3 in terms of CaCO3#\n", + "P2=W2*M2;#MgCO3 in terms of CaCO3#\n", + "P3=W3*M3;#CaCl2 in terms of CaCO3#\n", + "P4=W4*M4;#MgCl2 in terms of CaCO3#\n", + "P6=W6*M6;#NaHCO3 in terms of CaCO3#\n", + "print\"We do not take CO2 since it does not contribute to hardness \" ;\n", + "C=P1+P2+P6;\n", + "print\" Carbonate hardness is\",C,\"mg/l or ppm\";\n", + "NC=P3+P4;\n", + "print\" Non Carbonate hardness is\",NC,\"mg/l or ppm\";" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "We do not take CO2 since it does not contribute to hardness \n", + " Carbonate hardness is 30.4523809524 mg/l or ppm\n", + " Non Carbonate hardness is 30.0 mg/l or ppm\n" + ] + } + ], + "prompt_number": 15 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "EXAMPLE 2.18.2" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "W1=40.5;\n", + "W2=33.3;\n", + "W3=41;\n", + "W4=101;\n", + "W5=33.6;\n", + "M1=100.0/162;\n", + "M2=100.0/111;\n", + "M3=100.0/164;\n", + "M5=100.0/84;\n", + "P1=W1*M1;\n", + "P2=W2*M2;\n", + "P3=W3*M3;\n", + "P5=W5*M5;\n", + "print \"We do not take KNO3 since it does not contribute to hardness \"\n", + "C=P1+P5;\n", + "print \"Carbonate hardness is\",C,\" mg/l or ppm\"\n", + "NC=P2+P3;\n", + "print \"Non Carbonate hardness is\",NC,\" mg/l or ppm\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "We do not take KNO3 since it does not contribute to hardness \n", + "Carbonate hardness is 65.0 mg/l or ppm\n", + "Non Carbonate hardness is 55.0 mg/l or ppm\n" + ] + } + ], + "prompt_number": 14 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "EXAMPLE 2.18.3" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "W1=29.1;#Mg(HCO3 2 in water in mg/lit#\n", + "W2=40.5;#Ca(HCO3 2 in water in mg/lit#\n", + "W3=11.1;#CaCl2 in water in mg/lit#\n", + "W4=15.82;#MgCl2 in water in mg/lit#\n", + "W5=28.5;#NaCl in water in mg/lit#\n", + "W6=22.0;#CO2 in water in mg/lit#\n", + "M1=100.0/146.007;#multiplication factor of Mg(HCO3 2#\n", + "M2=100.0/162;#multiplication factor of Ca(HCO3 2#\n", + "M3=100.0/111;#multiplication factor of CaCl2#\n", + "M4=100.0/95.005;#multiplication factor of MgCl2#\n", + "P1=W1*M1;#Mg(HCO3 2 in terms of CaCO3#\n", + "P2=W2*M2;#Ca(HCO3 2 in terms of CaCO3#\n", + "P3=W3*M3;#CaCl2 in terms of CaCO3#\n", + "P4=W4*M4;#MgCl2 in terms of CaCO3#\n", + "print\"We do not take NaCl and CO2 since they do not contribute to hardness \" ;\n", + "C=P1+P2;\n", + "print\" Carbonate hardness is\",C,\"mg/l or ppm\";\n", + "NC=P3+P4;\n", + "print\" Non Carbonate hardness is\",NC,\"mg/l or ppm\";" + ], + "language": "python", + "metadata": {}, + "outputs": [] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "EXAMPLE 2.18.4" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "W1=16.2;#Ca(HCO3 2 in water in mg/lit#\n", + "W2=14.6;#Mg(HCO3 2 in water in mg/lit#\n", + "W3=9.5;#MgCl2 in water in mg/lit#\n", + "W4=48;#MgSO4 in water in mg/lit#\n", + "W5=12;#KCl in water in mg/lit#\n", + "M1=100.0/162;#multiplication factor of Ca(HCO3 2#\n", + "M2=100.0/146;#multiplication factor of Mg(HCO3 2 #\n", + "M3=100.0/95;#multiplication factor of MgCl2#\n", + "M4=100.0/120;#multiplication factor of MgSO4#\n", + "P1=W1*M1;#Ca(HCO3 2 in terms of CaCO3#\n", + "P2=W2*M2;#Mg(HCO3 2 in terms of CaCO3#\n", + "P3=W3*M3;#MgCl2 in terms of CaCO3#\n", + "P4=W4*M4;#MgSO4 in terms of CaCO3#\n", + "print\"We do not take KCl since it does not contribute to hardness \" ;\n", + "C=P1+P2;\n", + "print\" Carbonate hardness is\",C,\"mg/l or ppm\";\n", + "NC=P3+P4;\n", + "print\" Non Carbonate hardness is\",NC,\"mg/l or ppm\";" + ], + "language": "python", + "metadata": {}, + "outputs": [] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "EXAMPLE 2.18.5" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "W1=16.2;#Ca(HCO3 2 in water in mg/lit#\n", + "W2=14.6;#Mg(HCO3 2 in water in mg/lit#\n", + "W3=9.5;#MgCl2 in water in mg/lit#\n", + "W4=48;#MgSO4 in water in mg/lit#\n", + "W5=12;#KCl in water in mg/lit#\n", + "M1=100.0/162;#multiplication factor of Ca(HCO3 2#\n", + "M2=100.0/146;#multiplication factor of Mg(HCO3 2 #\n", + "M3=100.0/95;#multiplication factor of MgCl2#\n", + "M4=100.0/120;#multiplication factor of MgSO4#\n", + "P1=W1*M1;#Ca(HCO3 2 in terms of CaCO3#\n", + "P2=W2*M2;#Mg(HCO3 2 in terms of CaCO3#\n", + "P3=W3*M3;#MgCl2 in terms of CaCO3#\n", + "P4=W4*M4;#MgSO4 in terms of CaCO3#\n", + "print\"We do not take KCl since it does not contribute to hardness \" ;\n", + "C=P1+P2;\n", + "print\" Carbonate hardness is\",C,\"mg/l or ppm\";\n", + "NC=P3+P4;\n", + "print\" Non Carbonate hardness is\",NC,\"mg/l or ppm\";" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "We do not take KCl since it does not contribute to hardness \n", + " Carbonate hardness is 20.0 mg/l or ppm\n", + " Non Carbonate hardness is 50.0 mg/l or ppm\n" + ] + } + ], + "prompt_number": 16 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [], + "language": "python", + "metadata": {}, + "outputs": [] + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/sample_notebooks/Akshay Ghogare/AKSHAY_GHOGARE_1.ipynb b/sample_notebooks/Akshay Ghogare/AKSHAY_GHOGARE_1.ipynb new file mode 100755 index 00000000..a2326ccb --- /dev/null +++ b/sample_notebooks/Akshay Ghogare/AKSHAY_GHOGARE_1.ipynb @@ -0,0 +1,274 @@ +{ + "metadata": { + "celltoolbar": "Raw Cell Format", + "name": "", + "signature": "sha256:24b52c6a31667b62249d4037d9a99a947845157c2c3e5346e2fea8b2b04412a0" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "SAMPLE EXAMPLE 1" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "EXAMPLE 2.18.1" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "W1=12.5; #CaCO3 in water in mg/lit#\n", + "W2=8.4; #MgCO3 in water in mg/lit#\n", + "W3=22.2; #CaCl2 in water in mg/lit#\n", + "W4=9.5; #MgCl2 in water in mg/lit#\n", + "W5=33; #CO2 in water in mg/lit#\n", + "W6=6.68; #NaHCO3 in water in mg/lit#\n", + "M1=100.0/100.0; #multiplication factor of CaCO3#\n", + "M2=100.0/84; #multiplication factor of MgCO3#\n", + "M3=100.0/111; #multiplication factor of CaCl2#\n", + "M4=100.0/95; #multiplication factor of MgCl2#\n", + "M6=100.0/84; #multiplication factor of NaHCO3#\n", + "P1=W1*M1; #CaCO3 in terms of CaCO3#\n", + "P2=W2*M2; #MgCO3 in terms of CaCO3#\n", + "P3=W3*M3; #CaCl2 in terms of CaCO3#\n", + "P4=W4*M4; #MgCl2 in terms of CaCO3#\n", + "P6=W6*M6; #NaHCO3 in terms of CaCO3#\n", + "print\"We do not take CO2 since it does not contribute to hardness \" \n", + "C=P1+P2+P6;\n", + "print\" Carbonate hardness is\",round(C,4),\"mg/l or ppm\"\n", + "NC=P3+P4;\n", + "print\" Non Carbonate hardness is\",NC,\"mg/l or ppm\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "We do not take CO2 since it does not contribute to hardness \n", + " Carbonate hardness is 30.4524 mg/l or ppm\n", + " Non Carbonate hardness is 30.0 mg/l or ppm\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "EXAMPLE 2.18.2" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "W1=40.5; #Ca(HCO3)2 in water in mg/lit#\n", + "W2=33.3; #CaCl2 in water in mg/lit#\n", + "W3=41; #Ca(NO3)2 in water in mg/lit#\n", + "W4=101; #KNO3 in water in mg/lit#\n", + "W5=33.6; #MgCO3 in water in mg/lit#\n", + "M1=100.0/162; #multiplication factor of Ca(HCO3)2#\n", + "M2=100.0/111; #multiplication factor of CaCl2#\n", + "M3=100.0/164; #multiplication factor of Ca(NO3)2#\n", + "M5=100.0/84; #multiplication factor of MgCO3#\n", + "P1=W1*M1; #Ca(HCO3)2 in terms of CaCO3#\n", + "P2=W2*M2; #CaCl2 in terms of CaCO3#\n", + "P3=W3*M3; #Ca(NO3)2 in terms of CaCO3#\n", + "P5=W5*M5; #MgCO3 in terms of CaCO3#\n", + "print \"We do not take KNO3 since it does not contribute to hardness \"\n", + "C=P1+P5;\n", + "print \"Carbonate hardness is\",C,\" mg/l or ppm\"\n", + "NC=P2+P3;\n", + "print \"Non Carbonate hardness is\",NC,\" mg/l or ppm\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "We do not take KNO3 since it does not contribute to hardness \n", + "Carbonate hardness is 65.0 mg/l or ppm\n", + "Non Carbonate hardness is 55.0 mg/l or ppm\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "EXAMPLE 2.18.3" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "W1=29.1; #Mg(HCO3 2 in water in mg/lit#\n", + "W2=40.5; #Ca(HCO3 2 in water in mg/lit#\n", + "W3=11.1; #CaCl2 in water in mg/lit#\n", + "W4=15.82; #MgCl2 in water in mg/lit#\n", + "W5=28.5; #NaCl in water in mg/lit#\n", + "W6=22.0; #CO2 in water in mg/lit#\n", + "M1=100.0/146.007; #multiplication factor of Mg(HCO3 2#\n", + "M2=100.0/162; #multiplication factor of Ca(HCO3 2#\n", + "M3=100.0/111; #multiplication factor of CaCl2#\n", + "M4=100.0/95.005; #multiplication factor of MgCl2#\n", + "P1=W1*M1; #Mg(HCO3 2 in terms of CaCO3#\n", + "P2=W2*M2; #Ca(HCO3 2 in terms of CaCO3#\n", + "P3=W3*M3; #CaCl2 in terms of CaCO3#\n", + "P4=W4*M4; #MgCl2 in terms of CaCO3#\n", + "print\"We do not take NaCl and CO2 since they do not contribute to hardness \" \n", + "C=P1+P2;\n", + "print\" Carbonate hardness is\",round(C,4),\"mg/l or ppm\"\n", + "NC=P3+P4;\n", + "print\" Non Carbonate hardness is\",round(NC,4),\"mg/l or ppm\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "We do not take NaCl and CO2 since they do not contribute to hardness \n", + " Carbonate hardness is 44.9306 mg/l or ppm\n", + " Non Carbonate hardness is 26.6518 mg/l or ppm\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "EXAMPLE 2.18.4" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "W1=16.2; #Ca(HCO3 2 in water in mg/lit#\n", + "W2=14.6; #Mg(HCO3 2 in water in mg/lit#\n", + "W3=9.5; #MgCl2 in water in mg/lit#\n", + "W4=48; #MgSO4 in water in mg/lit#\n", + "W5=12; #KCl in water in mg/lit#\n", + "M1=100.0/162; #multiplication factor of Ca(HCO3 2#\n", + "M2=100.0/146; #multiplication factor of Mg(HCO3 2 #\n", + "M3=100.0/95; #multiplication factor of MgCl2#\n", + "M4=100.0/120; #multiplication factor of MgSO4#\n", + "P1=W1*M1; #Ca(HCO3 2 in terms of CaCO3#\n", + "P2=W2*M2; #Mg(HCO3 2 in terms of CaCO3#\n", + "P3=W3*M3; #MgCl2 in terms of CaCO3#\n", + "P4=W4*M4; #MgSO4 in terms of CaCO3#\n", + "print\"We do not take KCl since it does not contribute to hardness \" \n", + "C=P1+P2;\n", + "print\" Carbonate hardness is\",C,\"mg/l or ppm\";\n", + "NC=P3+P4;\n", + "print\" Non Carbonate hardness is\",NC,\"mg/l or ppm\";" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "We do not take KCl since it does not contribute to hardness \n", + " Carbonate hardness is 20.0 mg/l or ppm\n", + " Non Carbonate hardness is 50.0 mg/l or ppm\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "EXAMPLE 2.18.5" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "W1=81; #Ca(HCO3 2 in water in mg/lit#\n", + "W2=84; #MgCO3 in water in mg/lit#\n", + "W3=22.2; #CaCl2 in water in mg/lit#\n", + "W4=60; #MgSO4 in water in mg/lit#\n", + "W5=30; #KCl in water in mg/lit#\n", + "M1=100.0/162; #multiplication factor of Ca(HCO3 2#\n", + "M2=100.0/84; #multiplication factor of MgCO3#\n", + "M3=100.0/111; #multiplication factor of CaCl2#\n", + "M4=100.0/120; #multiplication factor of MgSO4#\n", + "P1=W1*M1; #Ca(HCO3 2 in terms of CaCO3#\n", + "P2=W2*M2; #MgCO3 in terms of CaCO3#\n", + "P3=W3*M3; #CaCl2 in terms of CaCO3#\n", + "P4=W4*M4; #MgSO4 in terms of CaCO3#\n", + "print\"We do not take KCl since it does not contribute to hardness \" \n", + "T=P1+P2;\n", + "print\" Temporary hardness is \",T,\"mg/l or ppm\"\n", + "P=P3+P4;\n", + "print\" Permanant hardness is \",P,\"mg/l or ppm\"\n", + "To=T+P;\n", + "print\" Total hardness is \",To,\"mg/l or ppm\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "We do not take KCl since it does not contribute to hardness \n", + " Temporary hardness is 150.0 mg/l or ppm\n", + " Permanant hardness is 70.0 mg/l or ppm\n", + " Total hardness is 220.0 mg/l or ppm\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [], + "language": "python", + "metadata": {}, + "outputs": [] + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/sample_notebooks/AlokDadlani/ALOK_DADLANI.ipynb b/sample_notebooks/AlokDadlani/ALOK_DADLANI.ipynb new file mode 100755 index 00000000..91d82daf --- /dev/null +++ b/sample_notebooks/AlokDadlani/ALOK_DADLANI.ipynb @@ -0,0 +1,181 @@ +{ + "metadata": { + "celltoolbar": "Raw Cell Format", + "name": "", + "signature": "sha256:257a8f491d964b9b4b60a222b425920b6deeb80bc5dff761617e08199ac997af" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "SAMPLE EXAMPLES" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "EXAMPLE NUMBER 1" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "#Given that\n", + "D=80# separation between source and screen in cm\n", + "d=0.18# separation between sources in cm \n", + "n=4# order of fringe\n", + "x_n=1.08# distance from central bright fringe in cm \n", + "print \"Standard formula used x_n= n*lambda1*D/d \"\n", + "\n", + "lambda1=d*x_n/(D*n)*1e7\n", + "print \"Wavelength of light used is\" ,lambda1, \"Angstrom.\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Standard formula used x_n= n*lambda1*D/d \n", + "Wavelength of light used is 6075.0 Angstrom.\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "EXAMPLE NUMBER 2" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "#Given that\n", + "beta=0.0320#fringe width in cm\n", + "D=100# separation between source and screen in cm\n", + "d=0.184# separation between sources in cm \n", + "print \" Standard formula used beta=lambda1*D/d \"\n", + "lambda1=d*beta/D*1e8\n", + "print \"Wavelength of light used is\" ,lambda1,\"Angstrom.\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Standard formula used beta=lambda1*D/d \n", + "Wavelength of light used is 5888.0 Angstrom.\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "EXAMPLE NUMBER 3" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + " #Given that\n", + "beta=0.02 #fringe width in cm\n", + "D=100 # separation between source and screen in cm\n", + "u=30 # separation between slit and convex lens in cm\n", + "I=0.7 # separation between two images of slits on screen in cm\n", + "print\" Standard formula used beta=lambda1*D/d \" \n", + "v=100-u\n", + "O=I*u/v\n", + "d=O\n", + "lambda1=d*beta/D*1e8\n", + "print\" Wavelength of light used is\",lambda1, \"Angstrom.\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Standard formula used beta=lambda1*D/d \n", + " Wavelength of light used is 6000.0 Angstrom.\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "EXAMPLE NUMBER 4" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "#Given that\n", + "x_n=1.88# fringe separation of nth fringe from central fringe in cm \n", + "N=20# order of fringe\n", + "beta=0.02#fringe width in cm\n", + "D=120# separation between source and eyepiece in cm\n", + "d=0.076# separation between sources in cm \n", + "print \" Standard formula used beta= lambda1*D/d \"\n", + "beta=x_n/N # calculation of angle formed\n", + "lambda1=d*beta/D*1e8 # calculation of Wavelength of light\n", + "print \" Wavelength of light used is\", round(lambda1,4) , \"Angstrom.\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Standard formula used beta= lambda1*D/d \n", + " Wavelength of light used is 5953.3333 Angstrom.\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [], + "language": "python", + "metadata": {}, + "outputs": [] + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/sample_notebooks/AnaySonawane/Solid_State_electronics_Ch1.ipynb b/sample_notebooks/AnaySonawane/Solid_State_electronics_Ch1.ipynb new file mode 100755 index 00000000..1839cfe8 --- /dev/null +++ b/sample_notebooks/AnaySonawane/Solid_State_electronics_Ch1.ipynb @@ -0,0 +1,971 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 1 : Introduction to Solid State Electronics"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.1, Page No. 17"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# ne in the doped silicon\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "ni=1.5*10**16 # in m^-3\n",
+ "nh=4.5*10**22 # in m^-3\n",
+ "\n",
+ "#Calculations\n",
+ "ne=ni**2/nh\n",
+ "\n",
+ "#Result\n",
+ "print(\" ne in the doped silicon is,(m^-3) = %.f * 10^9\"%(ne/10**9))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " ne in the doped silicon is,(m^-3) = 5 * 10^9\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.2, Page No. 17"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# resistivity\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "\n",
+ "ne=8.0*10**19 # in m^-3\n",
+ "nh=5.0*10**18 # in m^-3\n",
+ "mu_e=2.3 # in m^2/V-s\n",
+ "mu_h=.01 # in m^2/V-s\n",
+ "e=1.6*10**-19 # in V\n",
+ "\n",
+ "#Calculations\n",
+ "p=1/(e*((ne*mu_e)+(nh*mu_h)));\n",
+ "\n",
+ "#Result\n",
+ "print(\"(b) the resistivity,p(ohm-m)= %.1f * 10^-2\"%(p*10**2))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(b) the resistivity,p(ohm-m)= 3.4 * 10^-2\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.3, Page No. 17"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Density\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "\n",
+ "sigma=500.0 # in ohm^-1 m^-1\n",
+ "mu_e=0.39 # m^2/V-s\n",
+ "e=1.6*10**-19 # in V\n",
+ "\n",
+ "#Calculations\n",
+ "ne=sigma/(e*mu_e);\n",
+ "\n",
+ "#Result\n",
+ "print(\"number density of donor,ne(m^-3) = %.2f * 10^21\"%(ne*10**-21))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "number density of donor,ne(m^-3) = 8.01 * 10^21\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.4, Page No. 18"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Density\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "\n",
+ "e=1.6*10**-19 # in V\n",
+ "Pp=10**-2 # p-type silicon in ohm-m\n",
+ "Pn=10**-2 # n-type silicon in ohm-m\n",
+ "mu_p=0.048 # holes mobilities in m^2/V-s\n",
+ "mu_n=0.135 # electrons mobilities in m^2/V-s\n",
+ "\n",
+ "#Calculations\n",
+ "Na=1/(e*mu_p*Pp);\n",
+ "Nd=1/(e*mu_n*Pn);\n",
+ "\n",
+ "#Result\n",
+ "print(\"(i). the density of impurity,Na (m^-3) = %.1f * 10^22\"%(Na*10**-22))\n",
+ "print(\"(ii). the density of impurity,Nd (m^-3) = %.2f * 10^21\"%(Nd*10**-21))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i). the density of impurity,Na (m^-3) = 1.3 * 10^22\n",
+ "(ii). the density of impurity,Nd (m^-3) = 4.63 * 10^21\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.5, Page No. 18"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Resistivity\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "e=1.6*10**-19 # in V\n",
+ "n=2.5*10**19 # m^3\n",
+ "p=n\n",
+ "ni=n\n",
+ "mu_p=0.17 # holes mobilities in m^2/V-s\n",
+ "mu_n=0.36 # electrons mobilities in m^2/V-s\n",
+ "\n",
+ "#Calculations\n",
+ "sgint=e*(ni*(mu_p+mu_n)) #electrical conductivity in mho/metre\n",
+ "pint=1/sgint #resistivity in ohm-meter\n",
+ "print(\"electrical conductivity is ,(mho/metre)= %.2f\"%sgint)\n",
+ "print(\"resistivity is ,(ohm-metre)= %.2f\"%pint)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "electrical conductivity is ,(mho/metre)= 2.12\n",
+ "resistivity is ,(ohm-metre)= 0.47\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.6, Page No. 18"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Conductivity\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "\n",
+ "e=1.6*10**-19 # in V\n",
+ "ni=1.5*10**16 # in m^3\n",
+ "mu_p=0.13 # holes mobilities in m^2/V-s\n",
+ "mu_n=0.05 # electrons mobilities in m^2/V-s\n",
+ "siat=10.0**8 # number of silicon atoms\n",
+ "ta=5.0*10**28 # silicon atoms in atoms/m^3\n",
+ "mu_n2=0.13 # electrons mobilities in m^2/V-s\n",
+ "siat2=10.0**8 # number of silicon atoms\n",
+ "ta2=5.0*10**28 # silicon atoms in atoms/m^3\n",
+ "mu_p2=0.05 # holes mobilities in m^2/V-s\n",
+ "\n",
+ "#Calculations\n",
+ "sgint=e*(ni*(mu_p+mu_n)) # electrical conductivity in mho/m\n",
+ "Nd=ta/siat # in atoms/m^3\n",
+ "p= ni**2/Nd # holes concentration in holes/m^3\n",
+ "n=Nd\n",
+ "sntype=e*n*mu_n2 # in mho/m\n",
+ "Na=ta2/siat2 # in atoms/m^3\n",
+ "n= ni**2/Na # holes concentration in holes/m^3\n",
+ "sptype=e*Na*mu_p2 # in mho/m\n",
+ "\n",
+ "#Calculations\n",
+ "print(\"(i) electrical conductivity is ,(mhos/m) = %.2f * 10^-4\"%(sgint*10**4))\n",
+ "print(\"(ii) holes concentration is, (holes/m^3) = %.1f *10^11\"%(p*10**-11))\n",
+ "print(\"(ii) conductivity is ,(mho/m) = %.1f\"%sntype)\n",
+ "print(\"(iii) electron concentration is, (holes/m^3)= %.1f * 10^11\"%(n/10**11))\n",
+ "print(\"(iii) conductivity is ,(mho/m) = %.1f\"%sptype)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) electrical conductivity is ,(mhos/m) = 4.32 * 10^-4\n",
+ "(ii) holes concentration is, (holes/m^3) = 4.5 *10^11\n",
+ "(ii) conductivity is ,(mho/m) = 10.4\n",
+ "(iii) electron concentration is, (holes/m^3)= 4.5 * 10^11\n",
+ "(iii) conductivity is ,(mho/m) = 4.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 34
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.7, Page No. 19"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Fermi Level\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "#Nd1=Nc*exp^-(Ec-Ef1)/kT ...Formula Used\n",
+ "Nc=1.0 #assume\n",
+ "kT=0.03 #eV\n",
+ "EcEf1=0.5 #position of Fermi level in V\n",
+ "Nd=1.0 #assume\n",
+ "Nd1=3*Nd #After tripling the donor concentration\n",
+ "\n",
+ "#Calculation\n",
+ "EcEf2=(EcEf1-(kT*(math.log(Nd1/Nd))))\n",
+ "print(\"new position of Fermi-level is %.3f eV below conduction band\"%(math.ceil(EcEf2*1000)/1000))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "new position of Fermi-level is 0.468 eV below conduction band\n"
+ ]
+ }
+ ],
+ "prompt_number": 37
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.8, Page No. 20"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# density\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "e=1.6*10**-19 # in V\n",
+ "Pp=10**-1 # p-type silicon in ohm-m\n",
+ "Pn=10**-1 # n-type silicon in ohm-m\n",
+ "mu_h=0.05 # holes mobilities in m^2/V-s\n",
+ "mu_e=0.13 # electrons mobilities in m^2/V-s\n",
+ "\n",
+ "#Calculations\n",
+ "Na=1/(e*mu_h*Pp);\n",
+ "Nd=1/(e*mu_e*Pn);\n",
+ "\n",
+ "#Result\n",
+ "print(\"(i). the density of impurity,Na (m^-3) = %.2f * 10^21\"%(Na/10**21))\n",
+ "print(\"(ii). the density of impurity,Nd (m^-3) = %.1f * 10^20\"%(Nd/10**20))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i). the density of impurity,Na (m^-3) = 1.25 * 10^21\n",
+ "(ii). the density of impurity,Nd (m^-3) = 4.8 * 10^20\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.9, Page No. 20"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# current\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "e=1.6*10**-19 # in V\n",
+ "Pp=10**-1 # p-type silicon in ohm-m\n",
+ "Pn=10**-1 # n-type silicon in ohm-m\n",
+ "mu_hsi=0.048 # holes mobilities in m^2/V-s\n",
+ "mu_esi=0.135 # electrons mobilities in m^2/V-s\n",
+ "nisi=1.5*10**16 # in m^-3\n",
+ "nesi=nisi\n",
+ "nhsi=nisi\n",
+ "mu_hge=0.19 # holes mobilities in m^2/V-s\n",
+ "mu_ege=0.39 # electrons mobilities in m^2/V-s\n",
+ "A=1*10**-4 # area in m^2\n",
+ "nige=2.4*10**19 # in m^-3\n",
+ "V=2.0 # in V\n",
+ "l=0.1 # in m\n",
+ "\n",
+ "#Calculations\n",
+ "Isi= e*A*(V/l)*((nesi*mu_esi)+(nhsi*mu_hsi))\n",
+ "#Current for silicon is calculated wrong in the textbook\n",
+ "nege=nige\n",
+ "nhge=nige\n",
+ "Ige= e*A*(V/l)*((nege*mu_ege)+(nhge*mu_hge))\n",
+ "\n",
+ "#Result\n",
+ "print(\"Total current for silicon is,(A) = %f\"%Isi)\n",
+ "print(\"Total current for germanium is,(A)= %.2f * 10^-3\"%(math.ceil(Ige*10**5)/100))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total current for silicon is,(A) = 0.000001\n",
+ "Total current for germanium is,(A)= 4.46 * 10^-3\n"
+ ]
+ }
+ ],
+ "prompt_number": 41
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.10, Page No. 21"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# hole concentration and conductivity\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "nh=2*10**21 # acceptor atoms in atoms/m^3\n",
+ "mu_h=0.17 # mobility of holes in m^2/V-s\n",
+ "e=1.6*10**-19 # in C\n",
+ "\n",
+ "#Calculations\n",
+ "Na=nh\n",
+ "sigma=nh*mu_h*e;\n",
+ "\n",
+ "#Result\n",
+ "print(\"hole concentration,Na(atoms/m^3) = %.1f * 10^21\"%(Na/10**21))\n",
+ "print(\"conductivity,(ohm^-1-m^-1) = %.1f\"%sigma)\n",
+ "#conductivity is calculated wrong in the book"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "hole concentration,Na(atoms/m^3) = 2.0 * 10^21\n",
+ "conductivity,(ohm^-1-m^-1) = 54.4\n"
+ ]
+ }
+ ],
+ "prompt_number": 42
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.11, Page No. 22"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# donor concentration\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "p=0.15 # in ohm-m\n",
+ "mu_e=0.39 # mobility of electron in m^2/V-s\n",
+ "e=1.6*10**-19 # in C\n",
+ "\n",
+ "#Calculations\n",
+ "Na=1/(e*mu_e*p);\n",
+ "\n",
+ "#Result\n",
+ "print(\"The value of donor concentration,Na(m^-3) = %.2f * 10^20\"%(Na/10**20))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of donor concentration,Na(m^-3) = 1.07 * 10^20\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.12, Page No. 12"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# resistivity\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "mu_n=0.13 # in m^2/V-s\n",
+ "mu_p=0.05 # in m^2/V-s\n",
+ "ni=1.5*10**16 # in m^-3\n",
+ "e=1.6*10**-19 # in C\n",
+ "\n",
+ "#Calculations\n",
+ "p=1/((e*ni)*(mu_n+mu_p));\n",
+ "\n",
+ "#Result\n",
+ "print(\"The resistivity,p(ohm-m) = %.1f\"%p)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The resistivity,p(ohm-m) = 2314.8\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.13, Page No. 37"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# current\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "e=1.6*10**-19 # electron charge in coulombs\n",
+ "k=1.38*10**-23 # Boltzmann constant in m^2-kg/s^2-K^-1\n",
+ "T=300.0 # in Kelvin\n",
+ "I=240.0 # in mA\n",
+ "eta=2.0\n",
+ "Ve=0.8 # in V\n",
+ "V=0.7 # in V\n",
+ "\n",
+ "\n",
+ "#Calculations\n",
+ "Vt=(k*T)/e # in V\n",
+ "Id=I*math.e**((V-Ve)/(eta*Vt)) #in mA\n",
+ "Ir=(I/((math.e**(Ve/(eta*Vt)))-1))*10**6\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print(\"(i) Current is ,(mA) = %.f\"%(round(Id)))\n",
+ "print(\"(ii) reverse saturation current is ,(nA) = %.f\"%(round(Ir)))\n",
+ "#reverse saturation current is calculated wrong in the textbook"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Current is ,(mA) = 35\n",
+ "(ii) reverse saturation current is ,(nA) = 46\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.14, Page No. 38"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# diode current and voltage\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "e=1.6*10**-19 # electron charge in coulombs\n",
+ "k=1.38*10**-23 # Boltzmann constant in m^2-kg/s^2-K^-1\n",
+ "T=300.0 # in Kelvin\n",
+ "Ir1=10**-10 # in A\n",
+ "Ir2=10**-12 # in A \n",
+ "V211=0.5 # in V\n",
+ "\n",
+ "#Calculations\n",
+ "Vt=(k*T)/e\n",
+ "Vt = math.ceil(Vt*1000)/1000\n",
+ "V21=((Vt)*math.log10(Ir1/Ir2))*2.3026\n",
+ "V21 = math.floor(V21*10000)/10000\n",
+ "V2=(1.0/2)*(V21+V211)\n",
+ "V1=(1.0/2)*(V211-V21)\n",
+ "I1=Ir2*math.e**(V2/Vt)*10**6\n",
+ "I2=I1\n",
+ "\n",
+ "#Result\n",
+ "print(\"diode voltage V2 is ,(V) = %.5f\"%V2)\n",
+ "print(\"diode voltage V1 is ,(V) = %.5f\"%V1)\n",
+ "print(\"diode current is,(micro-A) = %.4f\"%I1)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "diode voltage V2 is ,(V) = 0.30985\n",
+ "diode voltage V1 is ,(V) = 0.19015\n",
+ "diode current is,(micro-A) = 0.1498\n"
+ ]
+ }
+ ],
+ "prompt_number": 50
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.15, Page No. 39"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# voltage\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "e=1.6*10**-19 # electron charge in coulombs\n",
+ "k=1.38*10**-23 # Boltzmann constant in m^2-kg/s^2-K^-1\n",
+ "T=300.0 # in Kelvin\n",
+ "Ir1=10**-12 # in A\n",
+ "Ir2=10**-10 # in A\n",
+ "It=2.0 # mA\n",
+ "\n",
+ "#Calculations\n",
+ "I21=Ir2/Ir1\n",
+ "Vt=(k*T)/e # in V\n",
+ "Vt = math.ceil(Vt*1000)/1000\n",
+ "I1=It/(1+I21)*10**3 # in micro-A\n",
+ "I2=It*10**3-I1 # in micro-A\n",
+ "I1=I2/I21 # in micro-A\n",
+ "x=((I1*10**-6)/Ir1)\n",
+ "V=Vt*math.log10(x)*2.3026\n",
+ "\n",
+ "#Result\n",
+ "print(\"diode voltage is ,(V) = %.3f\"%V)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "diode voltage is ,(V) = 0.437\n"
+ ]
+ }
+ ],
+ "prompt_number": 53
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.16, Page No. 39"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# voltage\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "T=27.0 # degree Celsius\n",
+ "Tk=273+T # in Kelvin\n",
+ "e=1.6*10**-19 # electron charge in coulombs\n",
+ "k=1.38*10**-23 # Boltzmann constant in m^2-kg/s^2-K^-1\n",
+ "J=10**4 # in Amp/m^2\n",
+ "Jo=200.0 #in mA/m^2\n",
+ "\n",
+ "#Calculations\n",
+ "x=(J/(Jo*10**-3))\n",
+ "Ve=((math.log(x))*k*Tk)/e\n",
+ "\n",
+ "#Result\n",
+ "print(\"voltage to be applied is ,(V) = %.2f\"%Ve)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "voltage to be applied is ,(V) = 0.28\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.17, Page No. 40"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# resistance\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "V=3.0 # in V\n",
+ "I=55.0 # in mA\n",
+ "V2=26.0 # in mV\n",
+ "\n",
+ "\n",
+ "#Calculations\n",
+ "Rdc=V/(I*10**-3) # in ohm\n",
+ "Rac=V2/I # in ohm\n",
+ "\n",
+ "#Result\n",
+ "print(\"static resistance is ,(ohm) = %.1f\"%Rdc)\n",
+ "print(\"dynamic resistance is ,(ohm) = %.2f\"%Rac)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "static resistance is ,(ohm) = 54.5\n",
+ "dynamic resistance is ,(ohm) = 0.47\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.18, Page No. 40"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# resistance\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "k=1.38*10**-23 # constant\n",
+ "T=27+273.0 # in K\n",
+ "eta=2.0\n",
+ "e=1.6*10**-19 # in C\n",
+ "Vt=(k*T/e) # in V\n",
+ "V=0.5 # in V\n",
+ "Ir=10**-6 # in A\n",
+ "\n",
+ "#Calculations\n",
+ "I=(Ir*10**3*(math.e**(V/(eta*Vt))-1))\n",
+ "R_dc=V*10**3/I;\n",
+ "R_ac=(eta*k*T)/(e*I*10**-3);\n",
+ "\n",
+ "#Result\n",
+ "print(\"static resistance,R_dc(ohm) = %.1f\"%R_dc)\n",
+ "print(\"Dynamic resistance,R_ac(ohm) = %.1f\"%R_ac)\n",
+ "#answer is wrong in textbook"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "static resistance,R_dc(ohm) = 31.8\n",
+ "Dynamic resistance,R_ac(ohm) = 3.3\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.19, Page No. 40"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# resistance\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "V=1.2 # in V\n",
+ "Vk=0.7 # in V\n",
+ "I_F=100.0 # in mA\n",
+ "V_R=10.0 # in V\n",
+ "I_R=1.0 # in micro-A\n",
+ "I=5.0 # in mA\n",
+ "eta=2\n",
+ "\n",
+ "#Calculations\n",
+ "R_B=(V-Vk)/(I_F*10**-3)\n",
+ "R_R=V_R/I_R\n",
+ "R_ac=eta*26/I\n",
+ "\n",
+ "#Result\n",
+ "print(\"the bulk resistance,R_B(ohm) = %.f\"%R_B)\n",
+ "print(\"the reverse resistance,R_R(M-ohm) = %.f\"%R_R)\n",
+ "print(\"ac resistance,R_ac(ohm) = %.1f\"%R_ac)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the bulk resistance,R_B(ohm) = 5\n",
+ "the reverse resistance,R_R(M-ohm) = 10\n",
+ "ac resistance,R_ac(ohm) = 10.4\n"
+ ]
+ }
+ ],
+ "prompt_number": 54
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.20, Page No. 41"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# capacitance\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "epsilon_0=8.85*10**-12 # in farada/m\n",
+ "K=12.0 # constant for silicon\n",
+ "A=1*10**-8 # in m^2\n",
+ "W=5*10**-7 # in m\n",
+ "\n",
+ "#Calculations\n",
+ "epsilon=epsilon_0*K\n",
+ "Ct=epsilon*A*10**14/W;\n",
+ "\n",
+ "#Result\n",
+ "print(\"the transition capacitance,Ct(PF) = %.1f\"%Ct)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the transition capacitance,Ct(PF) = 212.4\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.21, Page No. 41"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# resistance\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "V=0.2 # in V\n",
+ "I=1.0 # in micro-A\n",
+ "\n",
+ "#Calculations\n",
+ "R_dc=V*10**3/I\n",
+ "R_ac=26/(I*10**3);\n",
+ "\n",
+ "#Result\n",
+ "print(\"The static resistance,R_ac(k-ohm) = %.f\"%R_dc)\n",
+ "print(\"the dynamic resistance,R_ac(ohm) = %.3f\"%R_ac)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The static resistance,R_ac(k-ohm) = 200\n",
+ "the dynamic resistance,R_ac(ohm) = 0.026\n"
+ ]
+ }
+ ],
+ "prompt_number": 55
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/sample_notebooks/Ashish Kumar/Chapter4.ipynb b/sample_notebooks/Ashish Kumar/Chapter4.ipynb new file mode 100755 index 00000000..7bb63a05 --- /dev/null +++ b/sample_notebooks/Ashish Kumar/Chapter4.ipynb @@ -0,0 +1,274 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:941e56f6ccff5ba339ab866b08ad29bc1dd7198143616d650879efd5b419c50b" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter4 - Antenna Arrays" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example No. 4.9.1 : page-116" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "#Given Data\n", + "le=100.0 #m\n", + "Irms=450.0 #A\n", + "f=40000.0 #Hz\n", + "c=3*10**8 #m/s (Speed of light)\n", + "l=c/f #wavelenght in m\n", + "P=160*math.pi**2*(le/l)**2*Irms**2 #mW\n", + "Rr=160*math.pi**2*(le/l)**2 #\u03a9\n", + "P*=10**-3 #W\n", + "print \"Power radiated is %0.2f W \" %P\n", + "print \"Radiation resistance is %0.2f \u03a9\" %Rr" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Power radiated is 56.85 W \n", + "Radiation resistance is 0.28 \u03a9\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example No. 4.9.5 : page-119" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "#Given Data\n", + "L=1.0 #m(Length of element)\n", + "f=10.0 #MHz(Operating frequency)\n", + "c=3*10**8 #m/s##Speed of light\n", + "l=c/(f*10**6) #m(Wavelength)\n", + "Rr=80*math.pi**2*(L/l)**2 #\u03a9(Radiation resistance)\n", + "print \"Radiation resistance is %0.2f \u03a9\" %Rr" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Radiation resistance is 0.88 \u03a9\n" + ] + } + ], + "prompt_number": 15 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example No. 4.9.4 : page-126" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "#Data given\n", + "#l=lambda/8\n", + "lBYlambda=1.0/8 #(length/Wavelength)\n", + "Rr=80*math.pi**2*(lBYlambda)**2 #\u03a9(Radiation resistance)\n", + "print \"Radiation resistance is %0.2f \u03a9\" % Rr" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Radiation resistance is 12.34 \u03a9\n" + ] + } + ], + "prompt_number": 19 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example No. 4.9.3 : page-129" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "#Data given\n", + "le=10.0 #m(effective length)\n", + "Rl=1.5 #\u03a9(resistance)\n", + "Irms=450.0 #A(rms current)\n", + "c=3*10**8 #m/s##Speed of light\n", + "l=c/(f*10**3) #m(Wavelength)\n", + "P=160*math.pi**2*(le/l)**2*Irms**2 #kW(Power)\n", + "P=P*1000 #W(Power)\n", + "Rr=160*math.pi**2*(le/l)**2 #\u03a9(Radiation resistance)\n", + "Eta=Rr/(Rr+Rl)*100 #%(Efficiency)\n", + "print \"Efficiency of antenna is %0.2f %%\" %Eta" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Efficiency of antenna is 0.01 %\n" + ] + } + ], + "prompt_number": 26 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example No. 4.6.1 : page-132" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "#Data Given \n", + "l=1 #m\n", + "Prad=4 #W\n", + "f=1.5 #MHz\n", + "c=3*10**8 #m/s##Speed of light\n", + "l=c/(f*10**6) #m\n", + "#here l/lambda<1/50 tells us it is a Hertzian monopole antenna\n", + "h=1 #m\n", + "Rr=40*math.pi**2*(h/l)**2 #m\u03a9\n", + "Io=(2*Prad/Rr)**1.0/2 #A\n", + "print \"Current required is %0.2f A \"% Io" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Current required is 405.28 A \n" + ] + } + ], + "prompt_number": 31 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example No. 4.5.1 : page-136" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Data given\n", + "f=500.0 #MHz(Operating Frequency)\n", + "Do=1.643 #for half wave dipole\n", + "c=3*10**8 #m/s##Speed of light\n", + "l=c/(f*10**6) #m(Wavelength)\n", + "Aem=l**2/(4*math.pi)*Do #m\u00b2(Effective area)\n", + "print \"Effective area is %0.2f m\u00b2\" %Aem" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Effective area is 0.05 m\u00b2\n" + ] + } + ], + "prompt_number": 34 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example No. 4.9.2 : page-139" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "# Data given\n", + "le=61.4 #m\n", + "Irms=50 #A\n", + "l=625 #m\n", + "P=160*math.pi**2*(le/l)**2*Irms**2 #kW\n", + "Rr=160*math.pi**2*(le/l)**2 #\u03a9\n", + "P*=10**-3 #kW\n", + "print \"Power radiated is %0.2f kW\" %P\n", + "print \"Radiation resistance is %0.2f \u03a9\"% Rr" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Power radiated is 38.10 kW\n", + "Radiation resistance is 15.24 \u03a9\n" + ] + } + ], + "prompt_number": 37 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/sample_notebooks/ChandraShiva/Chapter_1.ipynb b/sample_notebooks/ChandraShiva/Chapter_1.ipynb new file mode 100755 index 00000000..7bea3912 --- /dev/null +++ b/sample_notebooks/ChandraShiva/Chapter_1.ipynb @@ -0,0 +1,241 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:5f4c2f0ce05563ebaa82d1579fc74f4b0a66c01a8b91c63f65c05e0494b44f20"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 1 - Introduction to Electronics"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 8"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the range of tolerance\n",
+ "#soltion\n",
+ "#given\n",
+ "#color coding\n",
+ "orange=3.#\n",
+ "gold=5.#\n",
+ "yellow=4.#\n",
+ "violet=7.#\n",
+ "#band pattern\n",
+ "band1=yellow#\n",
+ "band2=violet#\n",
+ "band3=orange#\n",
+ "band4=gold#\n",
+ "#resistor color coding\n",
+ "r=(band1*10.+band2)*10.**(band3)#\n",
+ "tol=r*(band4/100.)#tolerance\n",
+ "ulr=r+tol##upper limit of resistance\n",
+ "llr=r-tol##lower limit of resistance\n",
+ "print 'The range of resistance =',llr/1000. ,'kOhm','to',ulr/1000,'kOhm'\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The range of resistance = 44.65 kOhm to 49.35 kOhm\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 8"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the range of tolerance\n",
+ "#color coding\n",
+ "blue=6.#\n",
+ "gold=-1.#\n",
+ "gray=8.#\n",
+ "silver=10.#\n",
+ "#band pattern\n",
+ "band1=gray#\n",
+ "band2=blue#\n",
+ "band3=gold#\n",
+ "band4=silver#\n",
+ "#resistor color coding\n",
+ "r=(band1*10.+band2)*10.**(band3)#\n",
+ "tol=r*(band4/100.)#tolerance\n",
+ "ulr=r+tol##upper limit of resistance\n",
+ "llr=r-tol##lower limit of resistance\n",
+ "print 'The Range of resistance is',llr,'ohm','to',ulr,'ohm'\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Range of resistance is 7.74 ohm to 9.46 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 19"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the equivalent current source\n",
+ "#given\n",
+ "Vs=2.;#Volts #dc voltage source\n",
+ "Rs=1.;#ohm #internal resistance\n",
+ "Rl=1.;#ohm #load resistance\n",
+ "Ise=Vs/Rs;#ampere #equivalent current source\n",
+ "\n",
+ "# In accordance to figure 1.23a\n",
+ "Il1=Ise*(Rs/(Rs+Rl));#using current divider concept\n",
+ "Vl1=Il1*Rl;\n",
+ "print \"In accordance to figure 1.23a\\n\"\n",
+ "print \"The Load current (current source Il=\",Il1,'A'\n",
+ "print \"The Load voltage (current source Vl=\",Vl1,'V','\\n'\n",
+ "\n",
+ "# In accordance to figure 1.23b\n",
+ "Vl2=Vs*(Rs/(Rs+Rl));#using voltage divider concept\n",
+ "Il2=Vl2/Rl;\n",
+ "print \"\\nIn accordance to figure 1.23b\"\n",
+ "print \"\\nThe Load voltage (voltage source) Vl=\",Vl2,'V'\n",
+ "print \"The Load current (voltage source) Il=\",Il2,'A'\n",
+ "print \"\\nTherefore they both provide same voltage and current to load\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "In accordance to figure 1.23a\n",
+ "\n",
+ "The Load current (current source Il= 1.0 A\n",
+ "The Load voltage (current source Vl= 1.0 V \n",
+ "\n",
+ "\n",
+ "In accordance to figure 1.23b\n",
+ "\n",
+ "The Load voltage (voltage source) Vl= 1.0 V\n",
+ "The Load current (voltage source) Il= 1.0 A\n",
+ "\n",
+ "Therefore they both provide same voltage and current to load\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 19"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find percentage variation in load current and load voltage\n",
+ "#given\n",
+ "Vs=10.;#volt#Supply voltage\n",
+ "Rs=100.;#ohm#internal resistance\n",
+ "\n",
+ "# In accordance to figure 1.24a\n",
+ "#For 1ohm - 10 ohm\n",
+ "Rl11=1.;#ohm#min extreme value of Rl\n",
+ "Rl12=10.;#ohm#max extreme value of Rl\n",
+ "Il11=Vs/(Rs+Rl11);\n",
+ "Il12=Vs/(Rs+Rl12);\n",
+ "Pi1=(Il11-Il12)*100./Il11;#Percentage variation in current\n",
+ "Vl11=Il11*Rl11;\n",
+ "Vl12=Il12*Rl12;\n",
+ "Pv1=(Vl12-Vl11)*100./Vl12;#Percentage variation in voltage\n",
+ "print '%s' %(\"In accordance to figure 1.24a \\n\");\n",
+ "print '%s %.2f %s' %(\"Percentage variation in Current(1-10 ohm)=\",Pi1,'percent');\n",
+ "print '%s %.1f %s ' %(\"Percentage variation in Voltage(1-10 ohm)=\",Pv1,'percent\\n\\n');\n",
+ "\n",
+ "# In accordance to figure 1.24b\n",
+ "#For 1kohm - 10kohm\n",
+ "Rl21=1000.;#ohm#min extreme value of Rl\n",
+ "Rl22=10000.;#ohm#max extreme value of Rl\n",
+ "Il21=Vs/(Rs+Rl21);\n",
+ "Il22=Vs/(Rs+Rl22);\n",
+ "Pi2=(Il21-Il22)*100./Il21;#Percentage variation in current\n",
+ "Vl21=Il21*Rl21;\n",
+ "Vl22=Il22*Rl22;\n",
+ "Pv2=(Vl22-Vl21)*100./Vl22;#Percentage variation in voltage\n",
+ "print '%s' %(\"In accordance to figure 1.24b \\n\");\n",
+ "print '%s %.f %s' %(\"Percentage variation in Current(1-10 ohm)=\",Pi2,'percent');\n",
+ "print '%s %.f %s ' %(\"Percentage variation in Voltage(1-10 ohm)=\",Pv2,'percent \\n');\n",
+ "print 'In book the percentage variation in voltage(1kohm-10kohm) is 9 percent due to' \n",
+ "print 'the incorrect value of Il22 i.e. 0.000999 Amp correct value is 0.0009901 Amp'\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "In accordance to figure 1.24a \n",
+ "\n",
+ "Percentage variation in Current(1-10 ohm)= 8.18 percent\n",
+ "Percentage variation in Voltage(1-10 ohm)= 89.1 percent\n",
+ "\n",
+ " \n",
+ "In accordance to figure 1.24b \n",
+ "\n",
+ "Percentage variation in Current(1-10 ohm)= 89 percent\n",
+ "Percentage variation in Voltage(1-10 ohm)= 8 percent \n",
+ " \n",
+ "In book the percentage variation in voltage(1kohm-10kohm) is 9 percent due to\n",
+ "the incorrect value of Il22 i.e. 0.000999 Amp correct value is 0.0009901 Amp\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/sample_notebooks/ChandrashekharGourshete/Chapter02.ipynb b/sample_notebooks/ChandrashekharGourshete/Chapter02.ipynb new file mode 100755 index 00000000..52bcf8c4 --- /dev/null +++ b/sample_notebooks/ChandrashekharGourshete/Chapter02.ipynb @@ -0,0 +1,357 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:94249011b6fa028e4fb13e0830b4dd171e4b428548b27716d80b6a2e4fc89f65"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 2. Process Economics"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example Problem 2.1, Page Number 22"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Declaration\n",
+ "Q = 500.0 #Heat TRansfer Area, m2\n",
+ "QB = 80.0 #Base Size, m2\n",
+ "CB = 3.28e4 #Base Cost, $\n",
+ "CEIc = 441.9 #Current CE Index\n",
+ "CEIp = 435.8 #Past CE Index\n",
+ "M = 0.68 #Cost exponent\n",
+ "fM = 2.9 #Factor for capital cost\n",
+ "fPIP = 0.7\n",
+ "fER = 0.4\n",
+ "fINST = 0.2\n",
+ "fELE = 0.1\n",
+ "fUTIL = 0.5\n",
+ "fOS = 0.2\n",
+ "fBUILD = 0.2\n",
+ "fSP = 0.1\n",
+ "fDEC = 1.0\n",
+ "fCONT =0.4\n",
+ "fWS = 0.7\n",
+ "\n",
+ "#Calculations\n",
+ "CE = CB*(Q/QB)**M\n",
+ "CEc = CE*(CEIc/CEIp)\n",
+ "CF1 = fM*(1+fPIP)*CEc + (fER + fINST + fELE + fUTIL + fOS + fBUILD + fSP + fDEC + fCONT + fWS)*CEc\n",
+ "CF2 = fM*(1+fPIP)*CEc + (fER + fINST + fDEC + fCONT)*CEc\n",
+ "#Results\n",
+ "print 'Capital Cost of Carbon steel exchanger $%5.3e'%CE\n",
+ "print CF1, CF2"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example Problem 2.2, Page Number 22"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Declaration\n",
+ "Q = 500.0 #Heat TRansfer Area, m2\n",
+ "QB = 80.0 #Base Size, m2\n",
+ "CB = 3.28e4 #Base Cost, $\n",
+ "CEIc = 441.9 #Current CE Index\n",
+ "CEIp = 435.8 #Past CE Index\n",
+ "M = 0.68 #Cost exponent\n",
+ "fM = 2.9 #Factor for capital cost\n",
+ "fPIP = 0.7\n",
+ "\n",
+ "#Calculations\n",
+ "CE = CB*(Q/QB)**M\n",
+ "CEc = CE*(CEIc/CEIp)\n",
+ "Cpip = fM*fPIP*CEc\n",
+ "#Results\n",
+ "print 'Piping cost $%5.3e'%Cpip"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example Problem 2.3, Page Number 24"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Declaration\n",
+ "Q = 1.5 #Heat TRansfer Area, m2\n",
+ "QB = 0.5 #Base Size, m2\n",
+ "H = 30.0 # Height of Packing, m\n",
+ "CB = 1.8e4 #Base Cost for 5m height of pkg, $\n",
+ "CEIc = 441.9 #Current CE Index\n",
+ "CEIp = 435.8 #Past CE Index\n",
+ "M = 1.7 #Cost exponent\n",
+ "Cr = 0.1 #Cost of removing old packing\n",
+ "Ca = 0.7 #Cost of adding new packing\n",
+ "\n",
+ "#Calculations\n",
+ "CE = CB*(H/5.)*(Q/QB)**M\n",
+ "CEc = CE*(CEIc/CEIp)\n",
+ "Cp = CEc*(1.0+Cr+Ca)\n",
+ "#Results\n",
+ "print 'Cost of packing $%5.2e'%CE\n",
+ "print 'Cost of packing corrected using cost indexes $%5.2e'%CEc\n",
+ "print 'total Cost of Project $%5.2e'%Cp"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example Problem 2.4, Page Number 24"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Declaration\n",
+ "Ci = 1.0e6 #Cost of Distillation column in Dollor\n",
+ "n = 5. #Number of years\n",
+ "i = 0.05 #Interest rate in percent\n",
+ "fi = 5.8 #Installation factor\n",
+ "\n",
+ "#Calculations\n",
+ "CF = fi*Ci\n",
+ "fA = i*(1.+i)**n/((1.+i)**n-1.)\n",
+ "CAnnualized = CF*fA\n",
+ "#Results\n",
+ "print 'Cost of installed Equipment $%8.0f'%CF\n",
+ "print 'Annulization factor $%5.4f'%fA\n",
+ "print 'Annualized cost $%8.0f per year'%CAnnualized"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example Problem 2.5, Page Number 26"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from numpy import array,zeros\n",
+ "from sympy import symbols, integrate\n",
+ "from scipy.interpolate import interp1d\n",
+ "from scipy.optimize import root\n",
+ "\n",
+ "#Variable Declaration\n",
+ "P = array([41.0,10.0,3.0]) #Array of pressure for High medium and low pressures, barg bar gauge\n",
+ "Ieff = 80.0 #Isentropic efficiency of steam turbine\n",
+ "Cfuel = 4.0e-9 #Cost of fuel, $ per J\n",
+ "Cele = 0.07 #Cost of electricity, $ per (kWh)\n",
+ "Tw = 100.0 #Temperature of boiler feed water, \u00b0C\n",
+ "Cpw = 4200.0 #Specific heat of water, K/(kg.K)\n",
+ "effSG = 85.0 #Efficiency of Steam Generation\n",
+ "Ts = 400.0 #Temperature of superheated steam,\u00b0C \n",
+ "Hs = 3212e3 #Enthalpy of steam at 400 \u00b0C and 41 barg, J/kg\n",
+ "Tref = 0.0 #Reference Temperature,\u00b0C\n",
+ "Qloss = 10.0 #Distribution losses in percent\n",
+ "\n",
+ "#Calculations\n",
+ "hw = Cpw*(Tw-Tref) #Enthalpy of water at 100 \u00b0C, J/kg \n",
+ "dHs = Hs-hw\n",
+ "#Cost of steam at 41.0 barg\n",
+ "Csg41 = dHs*Cfuel*100*(1.0+Qloss/100)/effSG\n",
+ "\n",
+ "#Cost of steam at 10.0 barg\n",
+ "Ss = 6747.0 #Entropy of steam at 400 \u00b0C and 41 barg\n",
+ "H10 = 2873000.0 #Enthalpy of steam at 10 barg\n",
+ "S10 = 6747.0 #Entropy of steam at 10 barg\n",
+ "H10dash = Hs - Ieff*(Hs - H10)/100\n",
+ "Pgen10 = Hs-H10dash #Power gernerated per kg of steam to convert it to 10 barg from 41 barg steam\n",
+ "\n",
+ "#Value of power gerneration due to forrmation of 10 barg steam\n",
+ "VP41t10 = Pgen10*Cele/(3600*1000)\n",
+ "Csg10 = Csg41-VP41t10\n",
+ "\n",
+ "#Cost of steam at 3.0 barg\n",
+ "H10 = 2941000.0 #Enthalpy of steam at 3.0 barg\n",
+ "S10 = 6880.0 #Entropy of steam at 3.0 barg\n",
+ "H3 = 2732000.0 #Enthalpy of steam at 3.0 barg\n",
+ "S3 = 6880.0 #Entropy of steam at 3.0 barg\n",
+ "H3dash = H10 -Ieff*(H10-H3)/100\n",
+ "#Value of power gerneration due to forrmation of 3 barg steam\n",
+ "Pgen3 = H10-H3dash #Power gernerated per kg of steam to convert it to 3 barg from 10 barg steam\n",
+ "VP10t3 = Pgen3*Cele/(3600*1000)\n",
+ "Csg3 = Csg10-VP10t3\n",
+ "\n",
+ "#Results\n",
+ "print 'Heat required to generate steam at 41 barg and 400\u00b0C from water: %8.1f J/kg'%dHs\n",
+ "print 'Cost of Steam generation for steam at 41 barg and 400\u00b0C from water: $ %8.6f per kg ' %Csg41\n",
+ "\n",
+ "print 'Power geration when 41 barg steam is converted to 10 barg steam : %8.1f J/kg'%Pgen10\n",
+ "print 'Value of when 41 barg steam is converted to 10 barg steam: $ %8.6f per kg ' %VP41t10\n",
+ "print 'Cost of Steam generation for steam at 10 barg from 41 barg steam: $ %8.6f per kg ' %Csg10\n",
+ "\n",
+ "print 'Power geration when 10 barg steam is converted to 3 barg steam : %8.1f J/kg'%Pgen3\n",
+ "print 'Value of when 10 barg steam is converted to 3 barg steam: $ %8.6f per kg ' %VP10t3\n",
+ "print 'Cost of Steam generation for steam at 3 barg from 10 barg steam: $ %8.6f per kg' %Csg3"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example Problem 2.6, Page Number 28"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Declaration\n",
+ "Qc = 0.5e6 #Cooling load, W\n",
+ "Tc = -20.0 #Cold Sink temperature, \u00b0C\n",
+ "Th = 30.0 #Hot source temperature, \u00b0C\n",
+ "dTmin = 5.0 #Minimum temperature difference, \u00b0C\n",
+ "eff = 0.6\n",
+ "Ce = 0.07 #Cost of electricity, $ per KWh\n",
+ "Hours = 8000.0 #Hours of working per year\n",
+ "\n",
+ "#Calculations\n",
+ "Th = Th + dTmin + 273.15\n",
+ "Tc = Tc - dTmin + 273.15\n",
+ "W = Qc/eff*((Th-Tc)/Tc)\n",
+ "Cele = W*Ce*Hours\n",
+ "\n",
+ "#Results\n",
+ "print 'Actual power required %6.0f W'%W\n",
+ "print 'Cost of Electriciity $ %6.0f '%(Cele/1000)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example Problem 2.7, Page Number 30"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from numpy import array,zeros\n",
+ "from sympy import symbols, integrate\n",
+ "from scipy.interpolate import interp1d\n",
+ "from scipy.optimize import root\n",
+ "\n",
+ "#Variable Declaration\n",
+ "CP = 1.0e6 #Cost of Project, dollor\n",
+ "ACFA = array([-10.,1.6,2.8,4.0,5.2,6.4]) #Annual Cash Flow for Project A\n",
+ "ACFB = array([-10.,6.5,5.2,4.0,2.8,1.6]) #Annual Cash Flow for Project B\n",
+ "ADCFA = zeros(len(ACFA)) #Annual Discounted Cash Flow for Project A\n",
+ "ADCFB = zeros(len(ACFB)) #Annual Discounted Cash Flow for Project B\n",
+ "Y = array([0,1,2,3,4,5]) #Array containing disyear \n",
+ "j = array([20.,25.,30.,35.,40.]) #Array containing Discounted Cash Flow Rate of Return in percent\n",
+ "SADCFA = zeros(len(j)) #Array containing Sum of Annual Discounted Cash Flow for Project A\n",
+ "SADCFB = zeros(len(j)) #Array containing Sum of Annual Discounted Cash Flow for Project B\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "ACFA = ACFA*1e6\n",
+ "ACFB = ACFB*1e6\n",
+ "NPVA = ACFA/(1.0 + i)**Y\n",
+ "NPVB = ACFB/(1.0 + i)**Y\n",
+ "\n",
+ "print 'Project A:'\n",
+ "for n in j:\n",
+ " k = sorted(j).index(n)\n",
+ " print 'Discounted Annual Cash Flow for DCFRR %2d'%n\n",
+ " for m in Y:\n",
+ " ADCFA[m] = ACFA[m]/(1. + n/100.0)**m\n",
+ " SADCFA[k] = SADCFA[k] + ADCFA[m]\n",
+ " print 'For year %2d is %8.0f'%(m,ADCFA[m])\n",
+ " print 'For DCFRR of %2d%% Net Present Value is %9.0f'%(n,SADCFA[k]) \n",
+ " print '---------------------------------------------'\n",
+ "\n",
+ "fA = interp1d(j, SADCFA)\n",
+ "f = lambda x:fA(x)\n",
+ "sol = root(f,21)\n",
+ "DCFRRA = sol.x[0]\n",
+ "print \n",
+ "print 'Project B:'\n",
+ "for n in j:\n",
+ " k = sorted(j).index(n) \n",
+ " print 'Discounted Annual Cash Flow for DCFRR %2d'%n\n",
+ " for m in Y:\n",
+ " ADCFB[m] = ACFB[m]/(1. + n/100.0)**m\n",
+ " SADCFB[k] = SADCFB[k] + ADCFB[m]\n",
+ " ADCFB[m] = ACFB[m]/(1. + n/100.0)**m\n",
+ " print 'For year %2d is %8.0f'%(m, ADCFB[m])\n",
+ " print 'for DCFRR of %2d%% Net Present Value is %9.0f'%(n,SADCFB[k]) \n",
+ " print '---------------------------------------------'\n",
+ "\n",
+ "fB = interp1d(j, SADCFB)\n",
+ "f = lambda x:fB(x)\n",
+ "sol = root(f,35)\n",
+ "DCFRRB = sol.x[0]\n",
+ "\n",
+ "#Results\n",
+ "print 'Discounted Cash flow Rate of Return for Project A is: %4.2f%% and for Project B is %4.2f%%'%(DCFRRA,DCFRRB)\n",
+ "if DCFRRA > DCFRRB:\n",
+ " print 'Discounted Cash flow Rate of Return for Project A is %4.2f%% > %4.2f%% for Project B, \\nhence project A should be preffered'%(DCFRRA,DCFRRB)\n",
+ "else:\n",
+ " print 'Discounted Cash flow Rate of Return for Project A is %4.2f%% < %4.2f%% for Project B, \\nhence project B should be preffered'%(DCFRRA,DCFRRB)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/sample_notebooks/DanishAnsari/chapter_1.ipynb b/sample_notebooks/DanishAnsari/chapter_1.ipynb new file mode 100755 index 00000000..13a30876 --- /dev/null +++ b/sample_notebooks/DanishAnsari/chapter_1.ipynb @@ -0,0 +1,111 @@ +{
+ "metadata": {
+ "name": "chapter 1.ipynb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 1:Vectors"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.1-1,Page no 8"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "#Initialisation of Variables\n",
+ "f1=120 #lb\n",
+ "f2=100 #lb\n",
+ "theta=((60*pi)/180) #radians\n",
+ "#Calculations\n",
+ "R=sqrt(120**2+100**2-(2*120*100*cos(theta))) #Applying Thr rule of Cosines\n",
+ "alpha1=(((arcsin(120*sin(theta)/111))*180)/pi) #Applying the Law of Sines\n",
+ "alpha=alpha1+270 #As the vector lies in the fourth Quadrant by obsrevaton\n",
+ "#Results\n",
+ "print'The Resultant of The force system is equal to',round(R,3),\"lb\" #lb\n",
+ "print'The Resultant is at',round(alpha,3),\"degrees\" #degrees\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Resultant of The force system is equal to 111.355 lb\n",
+ "The Resultant is at 339.43 degrees\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.2-2,Page no 9"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#Initilization of variables\n",
+ "P=100 #lb\n",
+ "Q=120 #lb\n",
+ "theta=((30*pi)/180) #radians\n",
+ "#Calculations\n",
+ "R_x=Q*cos(theta) #lb\n",
+ "R_y=Q*sin(theta)-P #lb\n",
+ "R=sqrt(R_x**2+R_y**2) #lb Triangle law\n",
+ "Theta_1=((arctan(R_y/R_x))*180)/pi #degrees\n",
+ "Theta_R=360+Theta_1 #degrees\n",
+ "#Result\n",
+ "print'The resultant of the force system is',round(R,3),\"lb\"\n",
+ "print'The resultant is at',round(Theta_R,3),\"degrees\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The resultant of the force system is 111.355 lb\n",
+ "The resultant is at 338.948 degrees\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/sample_notebooks/DevikaRaj/Chapter1.ipynb b/sample_notebooks/DevikaRaj/Chapter1.ipynb new file mode 100755 index 00000000..2e5de774 --- /dev/null +++ b/sample_notebooks/DevikaRaj/Chapter1.ipynb @@ -0,0 +1,221 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 1 - Physics and Engineering"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1 - pg 11"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Percentage Error (percentage) = 4.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#calculate the percentage error\n",
+ "#Given:\n",
+ "l=9.3; # length in cm\n",
+ "b=8.5;# breadth in cm\n",
+ "h=5.4;# height in cm\n",
+ "#calculations\n",
+ "V= l*b*h; # Volume in cm**3\n",
+ "delta_l = 0.1; delta_b = 0.1; delta_h = 0.1; # scale has a least count = 0.1 cm\n",
+ "# absolute error \n",
+ "delta_V = (b*h*delta_l + l*h*delta_b +l*b*delta_h); # in cm**3\n",
+ "#relative error \n",
+ "re = delta_V/V;\n",
+ "p= re*100; # Evaluating percentage error\n",
+ "#results\n",
+ "print \"Percentage Error (percentage) = \",round(p,0)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2 - pg 12"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Percentage error (percentage) = 2.86\n",
+ "Result obtained differs from that in textbook, because delta_M walue is taken 0.1 g , instead of 0.2 g as mentioned in the problem statement.\n"
+ ]
+ }
+ ],
+ "source": [
+ "#calculate the percentage error\n",
+ "#Given :\n",
+ "M= 10.0; #weight in g\n",
+ "V= 5.80;#volume in cm**3\n",
+ "#calculations\n",
+ "Rho = M/V; # Density in g/cm**3\n",
+ "delta_M= 0.2 # apparatus has a least count of 0.2 g\n",
+ "delta_V= 0.05# apparatus has a least count of 0.05 cm**3\n",
+ "delta_Rho = (delta_M/V) +((M*delta_V)/V**2);# absolute error in g/cm**3\n",
+ "re = delta_Rho/Rho ; #Evaluating Relative Error\n",
+ "p = re*100;# Evaluating Percentage Error\n",
+ "#results\n",
+ "print \"Percentage error (percentage) = \",round(p,2)\n",
+ "print'Result obtained differs from that in textbook, because delta_M walue is taken 0.1 g , instead of 0.2 g as mentioned in the problem statement.'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3 - pg 16"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(a)Actual Value of c/r ranges between 5.9 - 6.6 and Percentage error = 5.3 percentage. \n",
+ "(b)Actual Value of c/r ranges between 6.281 - 6.288 and Percentage error = 0.06 percentage.\n"
+ ]
+ }
+ ],
+ "source": [
+ "#calculate the Actual val of c/r ranges and percentage error\n",
+ "#Given:\n",
+ "#(a) \n",
+ "import math\n",
+ "lc = 0.1# least count in cm\n",
+ "c = 6.9 #Circumference c in cm\n",
+ "r= 1.1 # radius of circle in cm\n",
+ "val =2*math.pi;\n",
+ "# Circumference,c= 2*pi*r or c/r = 2*pi\n",
+ "# Error in c/r is , delta(c/r)= [(c/r**2)+(1/r)](LC/2) , LC is Least Count .\n",
+ "E= ((c/r**2)+(1./r))*(lc/2.);#Error in c/r is delta(c/r)\n",
+ "ob = c/r; # Observed Value\n",
+ "#Actual Value of c/r ranges between\n",
+ "ac1 = ob-E;# Evaluating Minimum value for c/r \n",
+ "ac2 = ob+E;# Evaluating Maximum value for c/r\n",
+ "p = (E/ob)*100.; #Evaluating percentage error\n",
+ "#results\n",
+ "print \"(a)Actual Value of c/r ranges between\",round(ac1,1), \"-\",round(ac2,1),\" and Percentage error =\",round(p,1),\" percentage. \"\n",
+ "#(b)\n",
+ "lc1 = 0.001;#Now the least count is 0.001 cm\n",
+ "c1 = 6.316;#Circumference in cm\n",
+ "r1=1.005;#Circle radius in cm \n",
+ "E1 =((c1/r1**2) + (1/r1))*(lc1/2); # Error in c/r is delta(c/r)\n",
+ "ob1= c1/r1; #Observed Value\n",
+ "p1=(E1/ob1)*100.;#Evaluating percentage error\n",
+ "#Actual Value of c/r ranges between\n",
+ "a1= ob1-E1;#Evaluating Minimum value for c/r\n",
+ "a2= ob1+E1;#Evaluating Maximum value for c/r\n",
+ "print \"(b)Actual Value of c/r ranges between\",round(a1,3),\"-\",round(a2,3),\"and Percentage error =\",round(p1,2),\" percentage.\"\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4 - pg 17"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(a) It is is 15.0 percentage lower than the experimental value.\n",
+ "(b) It is 0.6 percentage higher than the experimental value.\n"
+ ]
+ }
+ ],
+ "source": [
+ "#calculate the percentage lower or higher than experimental value\n",
+ "#Given\n",
+ "import math\n",
+ "# (a) Newton's Theory\n",
+ "# v= (P/rho)**2 , P= Pressure , rho = density\n",
+ "P = 76.; # 76 cm of Hg pressure\n",
+ "V= 330. ; # velocity of sound in m/s\n",
+ "rho = 0.001293; # density for dry air at 0 degrees celsius in g/cm**3\n",
+ "g = 980.;#gravitational acceleration in cm/s**2\n",
+ "#Density of mercury at room temperature is 13.6 g/cm**3 \n",
+ "# 1 cm**2 = 1.0*10**-4 m**2\n",
+ "#calculations\n",
+ "v = math.sqrt(((P*13.6*g)/rho)*10**-4); # velocity of sound in m/s\n",
+ "p= ((V-v)/V)*100; # % lower than the experimental value\n",
+ "#results\n",
+ "print \"(a) It is is\",round(p,0),\" percentage lower than the experimental value.\"\n",
+ "\n",
+ "# (b) Laplace's Theory \n",
+ "# v= ((gama*P)/rho)**2., gamma = adiabatic index Thus,\n",
+ "#Given :\n",
+ "gama = 1.41 # Adiabatic index\n",
+ "#Density of mercury at room temperature is 13.6 g/cm**3 \n",
+ "# 1 cm**2 = 1.0*10**-4 m**2\n",
+ "v1 = math.sqrt(((gama*P*13.6*g)/rho)*10**-4);# velocity of sound in m/s\n",
+ "p1 = ((V-round(v1))/V)*100;# % higher than the eperimental value\n",
+ "#results\n",
+ "print \"(b) It is\",round(abs(p1),1),\"percentage higher than the experimental value.\""
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.9"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/sample_notebooks/Gopi KrishnaManchukonda/Chapter8.ipynb b/sample_notebooks/Gopi KrishnaManchukonda/Chapter8.ipynb new file mode 100755 index 00000000..c1c1744c --- /dev/null +++ b/sample_notebooks/Gopi KrishnaManchukonda/Chapter8.ipynb @@ -0,0 +1,286 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 8 - Thermal flow"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1 - pg 168"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(a)Final velocity of steam is (m/s) = 636.38\n",
+ "(b)Percentage reduction in velocity is (percent) = 6.19\n"
+ ]
+ }
+ ],
+ "source": [
+ "#calculate the Final velocity and percentage reduction in velocity\n",
+ "#Input data\n",
+ "P1=12.;#Pressure of Dry saturated steam entering a steam nozzle in bar\n",
+ "P2=1.5;#Discharge pressure of Dry saturated steam in bar\n",
+ "f=0.95;#Dryness fraction of the discharged steam\n",
+ "l=12.;#Heat drop lost in friction in percentage\n",
+ "hg1=2784.8;#Specific enthalpy of steam at 12 bar from steam tables in kJ/kg\n",
+ "hg2=2582.3;#Specific enthalpy of 0.95 dry steam at 1.5 bar from steam tables in kJ/kg\n",
+ "\n",
+ "#Calculations\n",
+ "hd=hg1-hg2;#Heat drop in kJ/kg\n",
+ "V1=44.72*(hd)**(0.5);#Velocity of steam at discharge from the nozzle in m/s\n",
+ "n=1-(l/100.);#Nozzle coefficient when 12 percent heat drop is lost in friction\n",
+ "V2=44.72*(n*hd)**(0.5);#Velocity of steam in m/s\n",
+ "percentV=((V1-V2)/V1)*100;#Percentage reduction in velocity\n",
+ "\n",
+ "#Output\n",
+ "print '(a)Final velocity of steam is (m/s) = ',round(V1 ,2)\n",
+ "print '(b)Percentage reduction in velocity is (percent) = ',round(percentV,2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2 - pg 174"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The mass of steam discharged,when the exit diameter of the nozzle is 12mm is (kg/hour) = 236.47\n"
+ ]
+ }
+ ],
+ "source": [
+ "#calculate the mass of steam\n",
+ "#Input data\n",
+ "P1=12.;#Initial pressure of dry saturated steam expanded in a nozzle in bar\n",
+ "P2=0.95;#Final pressure of dry saturated steam expanded in a nozzle in bar\n",
+ "f=10.;#Frictional loss in the nozzle of the total heat drop in percentage\n",
+ "d=12.;#Exit diameter of the nozzle in mm\n",
+ "hd=437.1;#Heat drop in kJ/kg from steam tables\n",
+ "q=0.859;#Dryness fraction of steam at discharge pressure\n",
+ "vg=1.777;#Specific volume of dry saturated steam at 0.95 bar\n",
+ "\n",
+ "#Calculations\n",
+ "n=1-(f/100);#Nozzle coefficient from moiller chart\n",
+ "V2=44.72*(n*hd)**(0.5);#Velocity of steam at nozzle exit in m/s\n",
+ "A=(3.14/4)*(0.012)**(2);#Area of the nozzle at the exit in mm**2\n",
+ "m=((A*V2)/(q*vg))*3600;#Mass of steam discharged through the nozzle per hour in kg/hour\n",
+ "\n",
+ "#Output\n",
+ "print 'The mass of steam discharged,when the exit diameter of the nozzle is 12mm is (kg/hour) = ',round(m,2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3 - pg 176"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(a)Throat area of steam nozzle is (cm^2) = 1.67\n",
+ "(b)Exit area of steam nozzle is (cm^2) = 2.016\n",
+ "(c)Exit velocity of the nozzle is (m/s) = 831.62\n"
+ ]
+ }
+ ],
+ "source": [
+ "#calculate the throat area of steam and exit area,exit velocity\n",
+ "#Input data\n",
+ "P1=12.;#Inlet pressure of steam nozzle in bar\n",
+ "T1=250.;#Inlet temperature of steam nozzle in degrees celcius\n",
+ "P2=2.;#Final pressure of the steam nozzle in bar\n",
+ "n=1.3;#Polytropic constant for superheated steam\n",
+ "St=6.831;#For isentropic expansion, entropy remains constant in kJ/kg\n",
+ "h1=2935.4#Enthalpy of steam at P1 from steam table in kJ/kg\n",
+ "ht=2860.;#Enthalpy of steam at pt in kJ/kg\n",
+ "vt=0.325;#Specific volume of steam at the throat conditions in m**3/kg\n",
+ "m=0.2;#Mass of steam discharged through the nozzle in kg/hour\n",
+ "q=0.947;#The dryness fraction of steam at exit from steam tables\n",
+ "hg=2589.6;#Enthalpy of steam at exit in kJ/kg\n",
+ "vs=0.8854;#Specific volume of saturated steam in m**3/kg\n",
+ "\n",
+ "#Calculations\n",
+ "pt=(P2/(n+1))**(n/(n-1))*P1;#Critical pressure ratio i.e.,Throat pressure in bar\n",
+ "Vt=(2*1000*(h1-ht))**(0.5);#Velocity of steam at throat in m/s\n",
+ "At=((m*vt)/Vt)*10**4;#Area of the throat in cm**2 from continuity equation\n",
+ "ve=q*vs;#Specific volume of steam at exit in m**3/kg\n",
+ "Ve=(2*1000*(h1-hg))**(0.5);#Velocity of steam at nozzle exit in m/s\n",
+ "Ae=((m*ve)/Ve)*10**4;#Exit area in cm**2\n",
+ "\n",
+ "#Output\n",
+ "print '(a)Throat area of steam nozzle is (cm^2) = ',round(At,2)\n",
+ "print '(b)Exit area of steam nozzle is (cm^2) = ',round(Ae,3)\n",
+ "print '(c)Exit velocity of the nozzle is (m/s) = ',round(Ve,2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4 - pg 177"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(a)Final exit velocity of steam is (m/s) = 785.246\n",
+ "(b)Cross sectional area of the nozzle at exit for maximum discharge is (mm^2) = 677.736\n"
+ ]
+ }
+ ],
+ "source": [
+ "#calculate the Final exit velocity, Cross sectional area\n",
+ "#Input data\n",
+ "P1=10.;#Pressure of steam in bar\n",
+ "f=0.9;#Dryness fraction of steam\n",
+ "At=350.;#Throat area in mm**2\n",
+ "Pb=1.4;#Back pressure in bar\n",
+ "h1=2574.8;#Enthalpy of steam at nozzle inlet from steam tables in kJ/kg\n",
+ "ft=0.87;#Dryness fraction of steam at throat pressure\n",
+ "fe=0.81;#Dryness fraction of steam at exit pressure\n",
+ "ht=2481.;#Enthalpy of steam at throat pressure at ft in kJ/kg\n",
+ "vt=0.285;#Specific volume of steam at throat in m**3/kg\n",
+ "he=2266.2;#Enthalpy of steam at exit conditions in kJ/kg\n",
+ "ve=1.001;#Specific volume of steam at exit conditions in m**3/kg\n",
+ "\n",
+ "#Calculations\n",
+ "Pt=0.582*P1;#Steam pressure at the throat in bar\n",
+ "hd=h1-ht;#Enthalpy drop upto the throat in kJ/kg\n",
+ "Vt=44.7*(hd)**(0.5);#Velocity of steam at the throat in m/s\n",
+ "hde=h1-he;#Enthalpy drop from nozzle entrance to exit in kJ/kg\n",
+ "Ve=44.7*(hde)**(0.5);#Velocity of steam at nozzle exit in m/s\n",
+ "Ae=(At*Vt*ve)/(Ve*vt);#Exit area of nozzle from the mass rate of flow equation in mm**2\n",
+ "\n",
+ "#Output\n",
+ "print '(a)Final exit velocity of steam is (m/s) = ',round(Ve,3)\n",
+ "print '(b)Cross sectional area of the nozzle at exit for maximum discharge is (mm^2) = ',round(Ae,3)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5 - pg 192"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(a)Velocity of steam at throat is (m/s) = 530.78\n",
+ "(b)Temperature of steam at the throat is (degrees celcius) = 202.8\n",
+ "(c)Cone angle of the divergent portion is (degrees) = 2.134\n"
+ ]
+ }
+ ],
+ "source": [
+ "#calculate the Velocity of steam at throat, temperature and cone angle\n",
+ "#Input data\n",
+ "import math\n",
+ "P1=7.;#Inlet pressure of a convergent divergent steam nozzle in bar\n",
+ "T1=275.;#Inlet temperature of the nozzle in degrees celcius\n",
+ "P2=1.;#Discharge pressure of steam in bar\n",
+ "l=60.;#Length of diverging portion of the nozzle in mm\n",
+ "dt=6.;#Diameter of the throat in mm\n",
+ "f1=10.;#Percent of total available enthalpy drop lost in friction in the diverging portion in percentage\n",
+ "h1=3006.9;#Enthalpy of steam at 7bar pressure and 275 degrees celcius in kJ/kg\n",
+ "ht=2865.9;#Enthalpy at the throat from Moiller chart in kJ/kg\n",
+ "he=2616.7;#Enthalpy at the exit from moiller chart in kJ/kg\n",
+ "vt=0.555;#Specific volume of steam at throat in m**3/kg\n",
+ "Tt=202.8;#Temperature of steam at throat in degrees celcius from moiller chart\n",
+ "ve=1.65;#Volume of steam at exit in m**3/kg\n",
+ "\n",
+ "#Calculations\n",
+ "Pt=0.546*P1;#The throat pressure for maximum discharge in bar\n",
+ "hd=h1-ht;#Enthalpy drop upto throat in kJ/kg\n",
+ "Vt=44.7*(hd)**(0.5);#Velocity of steam at throat in m/s\n",
+ "hid=h1-he;#Total isentropic drop from 7 bar,275 degrees celcius to 1 bar in kJ/kg\n",
+ "hda=(1-(f1/100.))*(hid);#Actual heat drop in kJ/kg\n",
+ "Ve=44.7*(hda)**(0.5);#Velocity at exit in m/s\n",
+ "At=(3.14/4)*(6./1000)**(2);#Throat area of the nozzle in m**2\n",
+ "m=(At*Vt)/vt;#Mass flow rate at nozzle throat in kg/s\n",
+ "Ae=((m*ve)/Ve)*10**4;#Exit area of the nozzle in cm**2\n",
+ "de=(((Ae*4)/3.14)**(0.5))*10;#Diameter of the nozzle at exit in mm\n",
+ "alpha=math.atan((de-dt)/(2*60))*180/math.pi;#Half of the cone angle of the nozzle in degrees\n",
+ "alpha1=2*alpha;#Cone angle of the nozzle in degrees\n",
+ "\n",
+ "#Output\n",
+ "print '(a)Velocity of steam at throat is (m/s) = ',round(Vt,2)\n",
+ "print '(b)Temperature of steam at the throat is (degrees celcius) =',Tt\n",
+ "print '(c)Cone angle of the divergent portion is (degrees) =',round(alpha1,3)\n"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.9"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/sample_notebooks/GudePrithvi/Chapter_3.ipynb b/sample_notebooks/GudePrithvi/Chapter_3.ipynb new file mode 100755 index 00000000..f808f1b3 --- /dev/null +++ b/sample_notebooks/GudePrithvi/Chapter_3.ipynb @@ -0,0 +1,536 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:f3be7a31a0f3d765e50f86fbfff2be30e114da24ff9eb4121f1f8157ce8ea60f"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 3: Transmission Lines"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example number 3.1, Page number 47"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate Terminating impedance\n",
+ "#Variable declaration\n",
+ "Zo = 100 #o/p impedance(Ohms)\n",
+ "s = 5 #VSWR\n",
+ "\n",
+ "#Calculations\n",
+ "Zmax = Zo*s\n",
+ "\n",
+ "#Results\n",
+ "print \"Terminating impedance = \",Zmax,\"Ohms\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Terminating impedance = 500 Ohms\n"
+ ]
+ }
+ ],
+ "prompt_number": 40
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.2, Page number 47"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate Characteristic impedance,Attenuation constant,Phase constant,Power delivered to the load\n",
+ "import math\n",
+ "import cmath\n",
+ "\n",
+ "#Varaible declaration \n",
+ "R = 8 #resistance(Ohms)\n",
+ "L = 2*10**-3 #inductance(H/km)\n",
+ "C = 0.002*10**-6 #capacitance(F)\n",
+ "G = 0.07*10**-6 #conductance(s/km)\n",
+ "f = 2*10**3 #frequency(Hz)\n",
+ "Vs = 2 #input signal(V)\n",
+ "l = 500. #line length(km)\n",
+ "\n",
+ "#Calculations\n",
+ "w = 2*math.pi*f\n",
+ "x = complex(R,w*L)\n",
+ "y = complex(G,w*C)\n",
+ "Zo = cmath.sqrt(x/y)\n",
+ "gamma = cmath.sqrt(x*y)\n",
+ "Is = Vs/Zo.real\n",
+ "Il = Is*cmath.exp(-1*gamma*l)\n",
+ "P = Il**2*Zo.real\n",
+ "\n",
+ "#Results\n",
+ "print \"Characteristic impedance =\",Zo,\"Ohms\"\n",
+ "print \"Attenuation constant =\",round(gamma.real,6),\"NP/km\"\n",
+ "print \"Phase constant =\", round(gamma.imag,6),\"rad/km\"\n",
+ "print \"\\ncalculation error in the textbook\"\n",
+ "print \"\\nPower delivered to the load =\", round((abs(P)/1E-6),1), \"uW\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Characteristic impedance = (1012.50018135-155.813417548j) Ohms\n",
+ "Attenuation constant = 0.003987 NP/km\n",
+ "Phase constant = 0.025436 rad/km\n",
+ "\n",
+ "calculation error in the textbook\n",
+ "\n",
+ "Power delivered to the load = 73.3 uW\n"
+ ]
+ }
+ ],
+ "prompt_number": 39
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.3, Page number 48"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate Phase velocity\n",
+ "import math\n",
+ "\n",
+ "#Varaible declaration\n",
+ "f = 2*10**3 #frequency(Hz)\n",
+ "B = 0.02543 #phase constant(rad/km)\n",
+ "\n",
+ "#Calculations\n",
+ "w = 2*math.pi*f\n",
+ "Vp = w/B\n",
+ "\n",
+ "#Results\n",
+ "print \"Phase velocity =\",round((Vp/1E+3),2),\"km/sec\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Phase velocity = 494.16 km/sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.4, Page number 48"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate Current drawn from generator,Power delivered to the load,Current flowing through the load\n",
+ "\n",
+ "import cmath\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "f = 37.5*10**6 #frequency(Hz)\n",
+ "V = 200 #Voltage signal(Vrms)\n",
+ "r = 200 #internal resistance(Ohms)\n",
+ "Zo = 200 #characteristic impedance(Ohms)\n",
+ "l = 10 #line length(m)\n",
+ "Zl = 100 #resistive load(Ohms)\n",
+ "c = 3*10**8 #velocity of propagation(m/s)\n",
+ "\n",
+ "#Calculations\n",
+ "#Part a\n",
+ "lamda = c/f\n",
+ "Bl = (5*math.degrees(math.pi))/4\n",
+ "x = complex(Zl,(Zo*math.tan(Bl)))\n",
+ "y = complex(Zo,(Zl*math.tan(Bl)))\n",
+ "Zi = Zo*(x/y)\n",
+ "Vs = (Zi.real*Zo)/(Zi.real+Zo)\n",
+ "Is = Zo/(Zi.real+Zo)\n",
+ "\n",
+ "#Part b\n",
+ "P = Vs*Is\n",
+ "\n",
+ "#Part c\n",
+ "Il = math.sqrt(P/Zl)\n",
+ "\n",
+ "#Results\n",
+ "print \"Please note that the solution given in the textbook is incorrect.Hence the difference in answers\\n\"\n",
+ "print \"Current drawn from generator is\",round(Is,3),\"A\" \n",
+ "print \"Power delivered to the load is\",round(P,2),\"W\"\n",
+ "print \"Current flowing through the load is\",round(Il,3),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Please note that the solution given in the textbook is incorrect.Hence the difference in answers\n",
+ "\n",
+ "Current drawn from generator is 0.41 A\n",
+ "Power delivered to the load is 48.47 W\n",
+ "Current flowing through the load is 0.696 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.5, Page number 50"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate Reflection co-efficient, VSWR\n",
+ "import cmath\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "zo = 50 #characteristic impedance(Ohms)\n",
+ "f = 300*10**6 #frequency(Hz)\n",
+ "zl = complex(50,50) #terminating load(Ohms)\n",
+ "c = 3*10**8 #velocity of propagation(m/s)\n",
+ "\n",
+ "#Calculations\n",
+ "lamda = c/f\n",
+ "rho = (zl-zo)/(zl+zo)\n",
+ "phi = cmath.phase(rho)\n",
+ "s = (1+abs(rho))/(1-abs(rho))\n",
+ "\n",
+ "#Results\n",
+ "print \"Reflection co-efficient =\",round(abs(rho),4),\"with phase =\",round(math.degrees(phi),1)\n",
+ "print \"VSWR =\",round(s,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reflection co-efficient = 0.4472 with phase = 63.4\n",
+ "VSWR = 2.62\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.6, Page number 50"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate position of the stub,Length of stub \n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "Zl = 100. #load resistance(Ohms)\n",
+ "Zo = 600. #characteristic impedance(Ohms)\n",
+ "f = 100*10**6 #frequency(Hz)\n",
+ "c = 3*10**8 #velocity of propagation(m/s)\n",
+ "\n",
+ "#Calculations\n",
+ "lamda = c/f\n",
+ "l = (lamda*math.atan(math.sqrt(Zl/Zo)))/(2*math.pi)\n",
+ "l_dash = (lamda*math.atan(math.sqrt((Zl*Zo)/(Zo-Zl))))/(2*math.pi)\n",
+ "\n",
+ "#Results\n",
+ "print \"The position of the stub is\", round(l,3),\"m\\n\"\n",
+ "print \"Please note that the solution for l_dash given in the textbook is incorrect\"\n",
+ "print \"Length of stub is\",round(l_dash,3),\"m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The position of the stub is 0.185 m\n",
+ "\n",
+ "Please note that the solution for l_dash given in the textbook is incorrect\n",
+ "Length of stub is 0.707 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.7, Page number 50"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate Terminating impedance\n",
+ "import cmath\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "s = 3.2 #VSWR\n",
+ "Xmin = 0.237 #minimum voltage(V)\n",
+ "Zo = 50 #characteristic impedance(Ohms)\n",
+ "\n",
+ "#Calculations\n",
+ "q = math.tan(math.degrees(2*math.pi*Xmin))\n",
+ "x = complex(1,-(s*q))\n",
+ "y = complex(s, -q)\n",
+ "Zl = Zo*(x/y)\n",
+ "\n",
+ "#Result\n",
+ "print \"Please note that the solution given in the textbook is incorrect.Hence the difference in answers\\n\"\n",
+ "print \"Terminating impedance =\", Zl,\"Ohms\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Please note that the solution given in the textbook is incorrect.Hence the difference in answers\n",
+ "\n",
+ "Terminating impedance = (19.6572514629-23.7885950214j) Ohms\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.8, Page number 51"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate VSWR,First Vmax is loacted at load and first Vmin is located at,Vmin,Impedance at Vmin\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "Zo = 50. #characteristic impedance(Ohms)\n",
+ "Zl = 100. #load resistance(Ohms)\n",
+ "f = 300*10**3 #frequency(Hz)\n",
+ "Pl = 50*10**-3 #load power(W)\n",
+ "c = 3*10**8 #velocity of propagation(m/s)\n",
+ "\n",
+ "#Calculations\n",
+ "lamda = c/f\n",
+ "\n",
+ "#Part a\n",
+ "rho = (Zl-Zo)/(Zl+Zo)\n",
+ "s = (1+abs(rho))/(1-abs(rho))\n",
+ "\n",
+ "#Part b\n",
+ "#Since real Zl>Zo, first Vmax is located at the load\n",
+ "Vmin_pos = lamda/4\n",
+ "\n",
+ "#Part c\n",
+ "Vmax = math.sqrt(Pl*Zl)\n",
+ "Vmin = Vmax/s\n",
+ "\n",
+ "#Part d\n",
+ "Zin_at_Vmin = Zo/s\n",
+ "Zin_at_Vmax = Zo*s\n",
+ "\n",
+ "#Results\n",
+ "print \"VSWR = \", s\n",
+ "print \"First Vmax is loacted at load and first Vmin is located at=\", Vmin_pos,\"m from the load\"\n",
+ "print \"Vmax = \",round(Vmax,2),\"V\",\"\\nVmin = \",round(Vmin,2),\"V\"\n",
+ "print \"Impedance at Vmin is \", Zin_at_Vmin,\"Ohm and impedance at Vmax is\",Zin_at_Vmax,\"Ohm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "VSWR = 2.0\n",
+ "First Vmax is loacted at load and first Vmin is located at= 250 m from the load\n",
+ "Vmax = 2.24 V \n",
+ "Vmin = 1.12 V\n",
+ "Impedance at Vmin is 25.0 Ohm and impedance at Vmax is 100.0 Ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.9, Page number 52"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate Reflection loss, transmission loss, return loss\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "Zo = 600. #characteristic impedance(Ohms)\n",
+ "Zs = 50 #source impedance(Ohms)\n",
+ "l = 200 #length of line(m)\n",
+ "Zl = 500. #load resistance(Ohms)\n",
+ "\n",
+ "#Calculations\n",
+ "rho = (Zl-Zo)/(Zl+Zo)\n",
+ "\n",
+ "#Part a\n",
+ "ref_l = math.log10(1/(1-((abs(rho))**2)))\n",
+ "\n",
+ "#Part b\n",
+ "#Since, the line is lossless,\n",
+ "att_l = 0\n",
+ "trans_l = ref_l+att_l\n",
+ "\n",
+ "#Part c\n",
+ "ret_l = math.log10(abs(rho))\n",
+ "\n",
+ "#Results\n",
+ "print \"Reflection loss =\",round(ref_l,4),\"dB\"\n",
+ "print \"Transmission loss =\",round(trans_l,4),\"dB\"\n",
+ "print \"Return loss =\",round(ret_l,3),\"dB (Calculation error in the textbook)\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reflection loss = 0.0036 dB\n",
+ "Transmission loss = 0.0036 dB\n",
+ "Return loss = -1.041 dB (Calculation error in the textbook)\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.10, Page number 52"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate Characteristic impedance,Phase velocity \n",
+ "\n",
+ "import cmath\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "l = 10 #length of line(km)\n",
+ "zsc = complex(1895.47,2234.29) \n",
+ "zoc = complex(216.99,-143.37)\n",
+ "f = 1*10**3 #frequency(Hz)\n",
+ "\n",
+ "#Calculations\n",
+ "zo = cmath.sqrt(zsc*zoc)\n",
+ "x = cmath.sqrt(zsc/zoc)\n",
+ "t = (1+x)/(1-x)\n",
+ "gamma = cmath.log(t)/(l*2)\n",
+ "B = gamma.imag\n",
+ "w = 2*math.pi*f\n",
+ "Vp = w/B\n",
+ "\n",
+ "#Results\n",
+ "print \"There is calculation mistake throughout the problem in the textbook\\n\"\n",
+ "print \"Characteristic impedance =\",zo,\"Ohms\"\n",
+ "print \"Phase velocity =\",round((Vp/1E+3),3),\"*10^3 m/sec\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "There is calculation mistake throughout the problem in the textbook\n",
+ "\n",
+ "Characteristic impedance = (864.190238563+123.274392427j) Ohms\n",
+ "Phase velocity = 45.994 *10^3 m/sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/sample_notebooks/Hrituraj/Various_types_of_tarrifs.ipynb b/sample_notebooks/Hrituraj/Various_types_of_tarrifs.ipynb new file mode 100755 index 00000000..d2ca1e19 --- /dev/null +++ b/sample_notebooks/Hrituraj/Various_types_of_tarrifs.ipynb @@ -0,0 +1,318 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:0f69a839d3ec8a6e20f49cef0966e931497f52ea6c7ffcec43b822cf678199cf" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Various types of tarrifs" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Exa 11.1 page 290" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "#Given Data :\n", + "E=438000.0 #in kWh(Energy consumed per year)\n", + "pf=0.8 #unitless\n", + "cosfi=pf #unitless\n", + "LoadFactor=40.0 #in %\n", + "#tarrif=Rs. 75/year/kw of max demand plus 3 paise per unit per reactive KVA\n", + "h=8760.0 #no. of years in a year\n", + "AvgLoad=E/h #kw\n", + "MaxLoad=AvgLoad/(LoadFactor/100) #in kw\n", + "MaxLoad_KVA=MaxLoad/pf #in KVA\n", + "tanfi=math.tan(math.acos(cosfi)) #unitless\n", + "ReactiveKVAR=h*tanfi*AvgLoad #in KVA\n", + "AnnualBill=75*MaxLoad+(3/100)*E+(1.5/100)*ReactiveKVAR #in Rs.\n", + "CostPerUnit=AnnualBill/E #in Rs.\n", + "CostPerUnit=CostPerUnit*100 #in Paisa\n", + "print \"Cost per unit is %0.2f Paisa\" %CostPerUnit" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Cost per unit is 3.27 Paisa\n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Exa 11.2 page 291" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Given Data :\n", + "#tarrif=Rs. 275/year/KVA of max demand plus 35 paise per unit\n", + "C1=275.0 #in Rs.year/KVA\n", + "C2=35.0 #in paisa/unit\n", + "LoadFactor=30.0 #in %/year\n", + "LoadFactor=30.0/100 #in fraction\n", + "#Let MaxDemand = x KW\n", + "#Case (i) PF=1\n", + "cosfi=1 #unitless\n", + "AnnualBillBYx=C1/cosfi+(C2/100)*LoadFactor*24*365 #in Rs.(Here 24*365 is for No. of hours in a year)\n", + "AnnualBill=AnnualBillBYx*100/(LoadFactor*24*365) #in paisa/unit\n", + "print \"Cost per unit(at unity power factor) is %0.2f paisa/unit\" %AnnualBill \n", + "#Case (i) PF=0.8\n", + "cosfi=0.8 #unitless\n", + "AnnualBillBYx=C1/cosfi+(C2/100)*LoadFactor*24*365 #in Rs.(Here 24*365 is for No. of hours in a year)\n", + "AnnualBill=AnnualBillBYx*100/(LoadFactor*24*365) #in paisa/unit\n", + "print \"Cost per unit(at 0.8 power factor) is %0.2f paisa/unit\" %AnnualBill" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Cost per unit(at unity power factor) is 45.46 paisa/unit\n", + "Cost per unit(at 0.8 power factor) is 48.08 paisa/unit\n" + ] + } + ], + "prompt_number": 15 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Exa 11.3 page 292" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "#Given Data :\n", + "FixedLoad=200.0 #in kW\n", + "PF=0.8 #unitless\n", + "cosfi=PF #unitless\n", + "h=10.0 #in hours/day\n", + "d=300.0 #in days\n", + "Time=h*d #in hours\n", + "Energy=FixedLoad*Time #in kwh/year\n", + "# (i) tarrif=Rs. 100/KVA/Annum plus 20 paise per kwh\n", + "C1=100.0 #in Rs.year/KVA\n", + "C2=20.0 #in paisa/kwh\n", + "KVA=FixedLoad/cosfi #in KVA\n", + "AnnualBill=KVA*C1+(C2/100)*Energy #in Rs.\n", + "print \" Case (i) Annual Payment is %0.2f Rs.\" %AnnualBill \n", + "# (ii) tarrif=Rs. 100/KW/Annum plus 20 paise per kwh plus 2 paise/KVARH\n", + "C1=100.0 #in Rs./year/KW\n", + "C2=20.0 #in paisa/kwh\n", + "C3=2.0 #in paisa/KVARH\n", + "tanfi=math.tan(math.acos(cosfi)) #unitless\n", + "ReactiveKVARH=FixedLoad*tanfi*Time #in KVARH\n", + "AnnualBill=C1*FixedLoad+(C2/100)*Energy+(C3/100)*ReactiveKVARH #in Rs.\n", + "print \" Case (ii) Annual Payment is %0.2f Rs.\" %AnnualBill " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Case (i) Annual Payment is 145000.00 Rs.\n", + " Case (ii) Annual Payment is 149000.00 Rs.\n" + ] + } + ], + "prompt_number": 18 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Exa 11.4 page 292" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Given Data :\n", + "Energy=180000.0 #in kwh\n", + "LoadFactor=45.0 #in %/year\n", + "LoadFactor=45.0/100 #in fraction\n", + "#Charges=Rs. 50/KW/Annum plus 8 paise per unit\n", + "C1=50 #in Rs.year/KW\n", + "C2=8 #in paisa/unit\n", + "h=365*24 #no. of hours per year\n", + "AvgLoad=Energy/h #in KW\n", + "MaxLoad=AvgLoad/LoadFactor #in KW\n", + "FixCharges=MaxLoad*C1 #in Rs.\n", + "PlusCharges=(C2/100)*Energy #in rs.\n", + "TotalTarrif=FixCharges+PlusCharges #in Rs.\n", + "print \"Total Annual electricity charges is %0.2f Rs.\" %TotalTarrif" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Total Annual electricity charges is 2283.11 Rs.\n" + ] + } + ], + "prompt_number": 20 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Exa 11.5 page 293" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Given Data :\n", + "Energy=25.0*10**6 #in kwh\n", + "MaxDemand=1600.0 #in KW\n", + "#(i) Rs. 70/KW max demand plus 2 paise per kwh\n", + "C1=70.0 #in Rs.year/KW\n", + "C2=2 #in paisa/unit\n", + "AnnualCost=MaxDemand*C1+(C2/100)*Energy #in Rs.\n", + "print \"Case (i) Annual cost of energy is %0.2f Rs.\" %AnnualCost \n", + "#(ii) Annual cost at a flat rate of 5p/kwh\n", + "C=5.0 #in paisa/kwh\n", + "AnnualCost=(C/100)*Energy #in Rs.\n", + "print \"Case (ii) Annual cost of energy is %0.2f Rs.\" %AnnualCost \n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Case (i) Annual cost of energy is 112000.00 Rs.\n", + "Case (ii) Annual cost of energy is 1250000.00 Rs.\n" + ] + } + ], + "prompt_number": 22 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Exa 11.6 page 293" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Given Data :\n", + "MaxDemand=20 #in KW\n", + "#(i) Rs. 180/KW/annum max demand plus 15 paise per unit\n", + "#(ii) Flat rate tarrif 40 paise/unit\n", + "C1=180.0 #in Rs.year/KW\n", + "C2=15.0 #in paisa/unit\n", + "#AnnualBill1=C1*MaxDemand+(C2/100)*x x is the energy consumed\n", + "C=40.0 #in paisa/unit\n", + "#AnnualBill2=(C/100)*x x is the energy consumed\n", + "#Puting two bills equal gives :\n", + "x=C1*MaxDemand/((C/100)-(C2/100)) #in kwh\n", + "print \"No. of units to be consumed is %0.2f or in %0.2f kwh \" %(x,x)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "No. of units to be consumed is 14400.00 or in 14400.00 kwh \n" + ] + } + ], + "prompt_number": 26 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Exa 11.7 page 294" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Given Data :\n", + "MaxDemand=500.0 #in KW\n", + "LoadFactor=70.0 #in %/year\n", + "LoadFactor=70.0/100 #in fraction\n", + "cosfi=0.8 #unitless\n", + "#(i) Rs. 80/KVA of max demand\n", + "#(ii) Running chargeare 5 paise/kwh\n", + "C1=80.0 #in Rs./KVA\n", + "C2=5.0 #in paisa/kwh\n", + "AvgLoad=MaxDemand*LoadFactor #in KW\n", + "h=365.0*24 #no. of hours per year\n", + "Energy=AvgLoad*h #in kwh\n", + "MaxDemandKVA=MaxDemand/cosfi #in KVA\n", + "AnnualBill=MaxDemandKVA*C1+(C2/100)*Energy #in RS\n", + "print \"Annual bill of consumer is %0.2f Rs.\" %AnnualBill " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Annual bill of consumer is 203300.00 Rs.\n" + ] + } + ], + "prompt_number": 27 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/sample_notebooks/IshitaTewari/Chapter4.ipynb b/sample_notebooks/IshitaTewari/Chapter4.ipynb new file mode 100755 index 00000000..7225de72 --- /dev/null +++ b/sample_notebooks/IshitaTewari/Chapter4.ipynb @@ -0,0 +1,228 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:11f45017c0b7621dbc0b25eb3397de260e67c21b40c42a2bb181ecd86cc79690"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter04: Analysis of Convection Heat Transfer"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4.1:pg-232"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "print \"Principles of Heat Transfer, 7th Ed. Frank Kreith et. al Chapter - 4 Example # 4.1 \"\n",
+ "\n",
+ "# Temperature of air in C is given as:\n",
+ "Tinfinity = 20;\n",
+ "# Temperature of surface in C is given as:\n",
+ "Ts = 100;\n",
+ "# Therefore avaerage temperature in degree C would be:\n",
+ "Ta = (Ts+Tinfinity)/2;\n",
+ "# From fig. 4.2 on page 232, it can be easily seen that (deltaT/deltaY) at\n",
+ "# y=0 is -66.7 K/mm\n",
+ "# From Table 28 in Appendix 2, at average temperature of air, thermal\n",
+ "# conductivity in W/m-K is\n",
+ "k = 0.028;\n",
+ "\n",
+ "#Therefore from eq. 4.1\n",
+ "print \"The heat transfer coefficient is given by, as per Eq. 4.1, in W/m2K\"\n",
+ "# 1000 is added to convert from mm to m\n",
+ "#heat transfer coefficient in W/m2K\n",
+ "hc = ((-k*(-66.7))/(Ts-Tinfinity))*1000\n",
+ "print round(hc,1)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Principles of Heat Transfer, 7th Ed. Frank Kreith et. al Chapter - 4 Example # 4.1 \n",
+ "The heat transfer coefficient is given by, as per Eq. 4.1, in W/m2K\n",
+ "23.3\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4.3:pg-259"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "print \"Principles of Heat Transfer, 7th Ed. Frank Kreith et. al Chapter - 4 Example # 4.3 \"\n",
+ "\n",
+ "# Width of the collector plate in ft is given:\n",
+ "b = 1.0;\n",
+ "# Surface temperature in F is given:\n",
+ "Ts = 140.0;\n",
+ "# Air temperature in F is given:\n",
+ "Tinfinity = 60.0;\n",
+ "# Air velocity in ft/sec is given as:\n",
+ "Uinfinity = 10.0;\n",
+ "# Average temperature in degree F is given as:\n",
+ "T = (Ts+Tinfinity)/2;\n",
+ "# Properties of air at average temperature are as follows\n",
+ "\n",
+ "Pr = 0.72; #Prandtl number\n",
+ "k = 0.0154; # Thermal conductivity in Btu/h ft \u00b0F\n",
+ "mu = 1.285*10-5; #Viscosity in lbm/ft s\n",
+ "cp = 0.24; #Specific heat in Btu/lbm \u00b0F\n",
+ "rho = 0.071; #Density in lbm/ft3\n",
+ "\n",
+ "# Reynold''s number at x=1ft is\n",
+ "Re1 = ((Uinfinity*rho)*1)/mu;\n",
+ "# Reynold''s number at x=9ft is\n",
+ "Re9 = ((Uinfinity*rho)*1)/mu;\n",
+ "# Assuming that the critical Reynolds number is 5*10**5, the critical distance is\n",
+ "#Critical Reynolds number\n",
+ "Rec = 5.0*(10**5);\n",
+ "#Critical distance in ft\n",
+ "xc = (Rec*mu)/(Uinfinity*rho);\n",
+ "\n",
+ "# From Eq. 4.28, and using the data obtained, we get for part a:\n",
+ "print \"Delta at x=1ft to be 0.0213ft and at x=9ft to be 0.0638ft\"\n",
+ "\n",
+ "# From Eq. 4.30, and using the data obtained, we get for part b:\n",
+ "print \"Cfx at x=1ft to be 0.00283 and at x=9ft to be 0.000942\"\n",
+ "\n",
+ "# From Eq. 4.31, and using the data obtained, we get for part c:\n",
+ "print \"Cfbar at x=1ft to be 0.00566 and at x=9ft to be 0.00189\"\n",
+ "\n",
+ "# From Eq. 4.29, and using the data obtained, we get for part d:\n",
+ "print \"Tau at x=1ft to be 3.12*10**-4 lb/ft**2 and at x=9ft to be 1.04*10**-4 lb/ft**2\"\n",
+ "\n",
+ "# From Eq. 4.32, and using the data obtained, we get for part e:\n",
+ "print \"DeltaTH at x=1ft to be 0.0237ft and at x=9ft to be 0.0712ft\"\n",
+ "\n",
+ "# From Eq. 4.36, and using the data obtained, we get for part f:\n",
+ "print \"hcx at x=1ft to be 1.08Btu/hft**2\u00b0F and at x=9ft to be 0.359Btu/hft**2\u00b0F\"\n",
+ "\n",
+ "# From Eq. 4.39, and using the data obtained, we get for part g:\n",
+ "print \"hcbar at x=1ft to be 2.18Btu/hft**2\u00b0F and at x=9ft to be 0.718Btu/hft**2\u00b0F\"\n",
+ "\n",
+ "# From Eq. 4.35, and using the data obtained, we get for part h:\n",
+ "print \"q at x=1ft to be 172 Btu/h and at x=9ft to be 517 Btu/h\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Principles of Heat Transfer, 7th Ed. Frank Kreith et. al Chapter - 4 Example # 4.3 \n",
+ "Delta at x=1ft to be 0.0213ft and at x=9ft to be 0.0638ft\n",
+ "Cfx at x=1ft to be 0.00283 and at x=9ft to be 0.000942\n",
+ "Cfbar at x=1ft to be 0.00566 and at x=9ft to be 0.00189\n",
+ "Tau at x=1ft to be 3.12*10**-4 lb/ft**2 and at x=9ft to be 1.04*10**-4 lb/ft**2\n",
+ "DeltaTH at x=1ft to be 0.0237ft and at x=9ft to be 0.0712ft\n",
+ "hcx at x=1ft to be 1.08Btu/hft**2\u00b0F and at x=9ft to be 0.359Btu/hft**2\u00b0F\n",
+ "hcbar at x=1ft to be 2.18Btu/hft**2\u00b0F and at x=9ft to be 0.718Btu/hft**2\u00b0F\n",
+ "q at x=1ft to be 172 Btu/h and at x=9ft to be 517 Btu/h\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4.4:pg-275"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "print \"Principles of Heat Transfer, 7th Ed. Frank Kreith et. al Chapter - 4 Example # 4.4 \"\n",
+ "\n",
+ "# Length of the crankcase in m is given as\n",
+ "L = 0.6;\n",
+ "# Width of the crankcase in m is given as\n",
+ "b = 0.2;\n",
+ "# Depth of the crankcase in m is given as\n",
+ "d = 0.1;\n",
+ "# Surface temperature in K is given as\n",
+ "Ts = 350.0;\n",
+ "# Air temperature in K is given as\n",
+ "Tinfinity = 276.0;\n",
+ "# Air velocity in m/sec is given as\n",
+ "Uinfinity = 30.0;\n",
+ "# It is stated that boundary layer is turbulent over the entire surface\n",
+ "\n",
+ "#Average air temperature in degree K is\n",
+ "T = (Ts+Tinfinity)/2;\n",
+ "# At this average temperature, we get the following for air\n",
+ "rho = 1.092;#density in kg/m**3\n",
+ "mu = 0.000019123;#vismath.cosity in SI units\n",
+ "Pr = 0.71;#Prandtl number\n",
+ "k = 0.0265;#Thermal conductivity in W/m-K\n",
+ "\n",
+ "# Reynold''s number is therefore given as\n",
+ "ReL = ((rho*Uinfinity)*L)/mu;\n",
+ "\n",
+ "#From eq. 4.82, average nusselt number could be given as\n",
+ "Nu = (0.036*(Pr**(1/3.0)))*(ReL**0.8);\n",
+ "\n",
+ "#We can write from the basic math.expression, Nu=hc*L/k, that\n",
+ "#Heat transfer coefficient in W/m**2-K\n",
+ "hc = (Nu*k)/L;\n",
+ "\n",
+ "# The surface area that dissipates heat is 0.28 m2\n",
+ "print \"Total heat loss from the surface in W is therefore\"\n",
+ "#Heat loss from the surface in W\n",
+ "q = (hc*0.28)*(Ts-Tinfinity)\n",
+ "print round(q)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Principles of Heat Transfer, 7th Ed. Frank Kreith et. al Chapter - 4 Example # 4.4 \n",
+ "Total heat loss from the surface in W is therefore\n",
+ "1896.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/sample_notebooks/JagadeeshwarGoshika/chapter1.ipynb b/sample_notebooks/JagadeeshwarGoshika/chapter1.ipynb new file mode 100755 index 00000000..dd94bb77 --- /dev/null +++ b/sample_notebooks/JagadeeshwarGoshika/chapter1.ipynb @@ -0,0 +1,292 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 1:Fluid properties"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.1"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "## Finding Specific weight,Density,Specific Gravity\n",
+ "##Given\n",
+ "V = 0.001 ##volume in m^3\n",
+ "w = 9.6 ##weight in Newton\n",
+ "g = 9.81 ##gravitational force in m/s^2\n",
+ "\n",
+ "##calculation\n",
+ "spwt = (w/V) ##Specific weight in N/m^3\n",
+ "rho = (spwt/g) ##density in kg/m^3\n",
+ "spgr = (rho/1000) ##Specific gravity no units\n",
+ "\n",
+ "#Results\n",
+ "print \"specific weight = \",round(spwt),\"N/m^3\"\n",
+ "print \"density = \",round(rho),\"kg/m^3\"\n",
+ "print \"specific gravity = \",round(spgr,2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "specific weight = 9600.0 N/m^3\n",
+ "density = 979.0 kg/m^3\n",
+ "specific gravity = 0.98\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.3"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Finding of Viscosity\n",
+ "##Given\n",
+ "dy=0.025E-3 ##distance in meter\n",
+ "du=0.5 ##velocity in m/s \n",
+ "tau=1.471 ##shear stress in N/m^2\n",
+ "##To Find\n",
+ "mu=tau*dy/du ##viscosity in Ns/m^2 \n",
+ "mu1=mu*10 ## Viscosity in poise\n",
+ "print \"Viscosity =\",mu,\" in Ns/m^2\"\n",
+ "print \"Viscosity =\",mu1,\" in poise\" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Viscosity = 7.355e-05 in Ns/m^2\n",
+ "Viscosity = 0.0007355 in poise\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.4"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Finding of Diameter of water droplet\n",
+ "##Given\n",
+ "st=0.716 ##Surface Tension in N/m\n",
+ "p=0.147E4 ##Pressure in N/m^2\n",
+ "##To Find \n",
+ "d=4*st/p ##Diameter in meter \n",
+ "d1=d*1E2 ##Diameter in centimeter \n",
+ "d2=d*1E3 ##Diameter in millimeter\n",
+ "print \"Diameter =\",round(d,5),\"m\"\n",
+ "print \"Diameter =\",round(d1,5),\"cm\"\n",
+ "print \"Diameter =\",round(d2,5),\"mm\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Diameter = 0.00195 m\n",
+ "Diameter = 0.19483 cm\n",
+ "Diameter = 1.9483 mm\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.5"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Finding of Shear Stress\n",
+ "##Given\n",
+ "##du/dy = vg\n",
+ "vg=0.25 ##Velocity gradient in m/sec/meter\n",
+ "nu=6.30E-4 ##Kinematic viscosity in m^2/sec\n",
+ "rho=1268.4 ##Mass density in Kg/m^3\n",
+ "mu=rho*nu ##Dynamic Viscosity\n",
+ "##To Find\n",
+ "tau=mu*vg ##Shear stress in N/m^2\n",
+ "print \"Shear Stress =\",round(tau,3),\"N/m^2\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Shear Stress = 0.2 N/m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.6"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Finding of increase of Pressure\n",
+ "##Given\n",
+ "k=2.07*1E6 ## Bulk Modulus in kN/m^2\n",
+ "dv=0.01 ##Change in Volume\n",
+ "##To Find\n",
+ "p=k*(dv) ##Change in pressure\n",
+ "print \"Increase in Pressure =\",p,\"kN/m^2\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Increase in Pressure = 20700.0 kN/m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.7"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import numpy as np\n",
+ "##Finding of Cappilary rise\n",
+ "##Given\n",
+ "d=0.03*1E-2 ##Diameter in meter\n",
+ "st=0.0735 ##Surface Tension in N/m\n",
+ "x=0 ##contact angle in degree\n",
+ "w=1000*9.81\n",
+ "##To Find\n",
+ "h=(4*st)*np.cos(x)/(w*d)\n",
+ "h1=h*1E2\n",
+ "print \"Capillary rise =\",round(h,4),\"m\"\n",
+ "print \"Capillary rise =\",round(h1,4),\"cm\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Capillary rise = 0.0999 m\n",
+ "Capillary rise = 9.9898 cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.8"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Finding of Kinematic Viscosity\n",
+ "##Given\n",
+ "tau=0.2158 ##Shear stress in N/m^2\n",
+ "vg=0.218 ##Velocity Gradient in sec^-1\n",
+ "rho=959.5 ##Density in Kg/m^3;\n",
+ "##To Find \n",
+ "mu=tau*1/vg\n",
+ "print \"Dynamic Viscosity =\",round(mu,5),\"Ns/m^2\"\n",
+ "nu=mu/rho\n",
+ "print \"Kinematic Viscosity =\",round(nu,5),\"m^2/sec\"\n",
+ "nu1=nu*1E4\n",
+ "print \"Kinematic Viscosity =\",round(nu1,5),\"cm^2/sec\"\n",
+ "nu2=nu1*1E-4\n",
+ "print \"Kinematic Viscosity =\",round(nu2,5),\"strokes\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Dynamic Viscosity = 0.98991 Ns/m^2\n",
+ "Kinematic Viscosity = 0.00103 m^2/sec\n",
+ "Kinematic Viscosity = 10.31692 cm^2/sec\n",
+ "Kinematic Viscosity = 0.00103 strokes\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/sample_notebooks/JagadeeshwarGoshika/chapter1_1.ipynb b/sample_notebooks/JagadeeshwarGoshika/chapter1_1.ipynb new file mode 100755 index 00000000..8cf957b1 --- /dev/null +++ b/sample_notebooks/JagadeeshwarGoshika/chapter1_1.ipynb @@ -0,0 +1,330 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 1:Fluid properties"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.1, Page No.9"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "## Finding Specific weight,Density,Specific Gravity\n",
+ "##Given\n",
+ "V = 0.001 ##volume in m^3\n",
+ "w = 9.6 ##weight in Newton\n",
+ "g = 9.81 ##gravitational force in m/s^2\n",
+ "\n",
+ "##calculation\n",
+ "spwt = (w/V) ##Specific weight in N/m^3\n",
+ "rho = (spwt/g) ##density in kg/m^3\n",
+ "spgr = (rho/1000) ##Specific gravity no units\n",
+ "\n",
+ "#Results\n",
+ "print \"Specific weight = \",spwt,\"N/m^3\"\n",
+ "print \"Density = \",round(rho,3),\"kg/m^3\"\n",
+ "print \"Specific gravity = \",round(spgr,6)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Specific weight = 9600.0 N/m^3\n",
+ "Density = 978.593 kg/m^3\n",
+ "Specific gravity = 0.978593\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.3, Page No.10"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Finding of Viscosity\n",
+ "##Given\n",
+ "dy=0.025E-3 ##distance in meter\n",
+ "du=0.5 ##velocity in m/s \n",
+ "tau=1.471 ##shear stress in N/m^2\n",
+ "##To Find\n",
+ "mu=tau*dy/du ##viscosity in Ns/m^2 \n",
+ "mu1=mu*10 ## Viscosity in Poise\n",
+ "print \"Viscosity =\",mu,\" in Ns/m^2\"\n",
+ "print \"Viscosity =\",mu1,\" in Poise\" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Viscosity = 7.355e-05 in Ns/m^2\n",
+ "Viscosity = 0.0007355 in Poise\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.4, Page No.10"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Finding of Diameter of water droplet\n",
+ "##Given\n",
+ "st=0.716 ##Surface Tension in N/m\n",
+ "p=0.147E4 ##Pressure in N/m^2\n",
+ "##To Find \n",
+ "d=4*st/p ##Diameter in meter \n",
+ "d1=d*1E2 ##Diameter in centimeter \n",
+ "d2=d*1E3 ##Diameter in millimeter\n",
+ "\n",
+ "print \"d =\",round(d1,4),\"cm\"\n",
+ "print \"d =\",round(d2,3),\"mm\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "d = 0.1948 cm\n",
+ "d = 1.948 mm\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.5, Page No.10"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Finding of Shear Stress\n",
+ "##Given\n",
+ "##du/dy = vg\n",
+ "vg=0.25 ##Velocity gradient in m/sec/meter\n",
+ "nu=6.30E-4 ##Kinematic viscosity in m^2/sec\n",
+ "rho=1268.4 ##Mass density in Kg/m^3\n",
+ "mu=rho*nu ##Dynamic Viscosity\n",
+ "##To Find\n",
+ "tau=mu*vg ##Shear stress in N/m^2\n",
+ "print \"Shear stress =\",tau,\"N/m^2\",\"=\",round(tau,1),\"N/m^2\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Shear stress = 0.199773 N/m^2 = 0.2 N/m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.6, Page No.10"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Finding of increase of Pressure\n",
+ "##Given\n",
+ "k=2.07*1E6 ## Bulk Modulus in kN/m^2\n",
+ "dv=0.01 ##Change in Volume\n",
+ "##To Find\n",
+ "p=k*(dv) ##Change in pressure\n",
+ "print \"Increase in pressure =\",p,\"KN/m^2\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Increase in pressure = 20700.0 KN/m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.7, Page No.10"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import numpy as np\n",
+ "##Finding of Cappilary rise\n",
+ "##Given\n",
+ "d=0.03*1E-2 ##Diameter in meter\n",
+ "st=0.0735 ##Surface Tension in N/m\n",
+ "x=0 ##contact angle in degree\n",
+ "w=1000*9.81\n",
+ "##To Find\n",
+ "h=(4*st)*np.cos(x)/(w*d)\n",
+ "h1=h*1E2\n",
+ "print \"Capillary rise =\",round(h,6),\"m\"\n",
+ "print \"Capillary rise =\",round(h1,4),\"cm\"\n",
+ "print \"Capillary rise =\",round(h1,2),\"cm\" \n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Capillary rise = 0.099898 m\n",
+ "Capillary rise = 9.9898 cm\n",
+ "Capillary rise = 9.99 cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.8, Page No.10"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Finding of Kinematic Viscosity\n",
+ "##Given\n",
+ "tau=0.2452 ##Shear stress in N/m^2\n",
+ "vg=0.2 ##Velocity Gradient in sec^-1\n",
+ "rho=981 ##Density in Kg/m^3;\n",
+ "##To Find \n",
+ "mu=tau*1/vg\n",
+ "print \"Dynamic Viscosity =\",round(mu,3),\"Ns/m^2\"\n",
+ "nu=mu/rho\n",
+ "nu1=nu*10000\n",
+ "print \"Kinematic Viscosity =\",round(nu1,3),\"STOKE\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Dynamic Viscosity = 1.226 Ns/m^2\n",
+ "Kinematic Viscosity = 12.497 STOKE\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.9, Page No.10"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Finding of Kinematic Viscosity\n",
+ "##Given\n",
+ "tau=0.2158 ##Shear stress in N/m^2\n",
+ "vg=0.218 ##Velocity Gradient in sec^-1\n",
+ "rho=959.5 ##Density in Kg/m^3;\n",
+ "##To Find \n",
+ "mu=tau*1/vg\n",
+ "print \"Dynamic viscosity =\",round(mu,2),\"N-s/m^2\"\n",
+ "nu=mu/rho\n",
+ "nu1=nu*10000\n",
+ "print \"Kinematic viscosity =\",round(nu1,1),\"stokes\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Dynamic viscosity = 0.99 N-s/m^2\n",
+ "Kinematic viscosity = 10.3 stokes\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/sample_notebooks/Jaya PratyushaKothuri/Chapter1.ipynb b/sample_notebooks/Jaya PratyushaKothuri/Chapter1.ipynb new file mode 100755 index 00000000..fdb0119c --- /dev/null +++ b/sample_notebooks/Jaya PratyushaKothuri/Chapter1.ipynb @@ -0,0 +1,548 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 1 - Philosophy of Measurement"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1 - pg 33"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "arithmetic mean is (V)= 100.0\n",
+ "average deviation is (V)= 0.084\n",
+ "standard deviation is (V)= 0.1192\n",
+ "probable error is (V)= 0.0804\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Example 1.1:#ARITHEMATIC MEAN,AVERAGE DEVIATION ,STANDARD DEVIATION AND PROBABLE ERROR\n",
+ "#calculate the ARITHEMATIC MEAN,AVERAGE DEVIATION ,STANDARD DEVIATION AND PROBABLE ERROR\n",
+ "#given\n",
+ "import math, numpy\n",
+ "T=numpy.array([99.7,99.8,99.9,100,100.1,100.2,100.3]);#VOLTS\n",
+ "f=numpy.array([2,8,20,40,21,6,3]);#frequency of occurence\n",
+ "q=numpy.array([T[0]*f[0],T[1]*f[1],T[2]*f[2],T[3]*f[3],T[4]*f[4],T[5]*f[5],T[6]*f[6]]);#\n",
+ "#calculations\n",
+ "AM=(q[0]+q[1]+q[2]+q[3]+q[4]+q[5]+q[6])/100;#arithematic mean in mm\n",
+ "qb=numpy.zeros(7)\n",
+ "for i in range(0,7):\n",
+ " qb[i]= T[i]-AM\n",
+ "\n",
+ "Q= numpy.array([qb[0],qb[1],qb[2],qb[3],qb[4],qb[5],qb[6]]);#\n",
+ "AV=(-qb[0]*f[0]-qb[1]*f[1]-qb[2]*f[2]-qb[3]*f[3]+qb[4]*f[4]+qb[5]*f[5]+qb[6]*f[6])/100;#\n",
+ "SD=math.sqrt(((qb[0]**2*f[0])+(qb[1]**2*f[1])+(qb[2]**2*f[2])+(qb[3]**2*f[3])+(qb[4]**2*f[4])+(qb[5]**2*f[5])+(qb[6]**2*f[6]))/100);#standard deviation\n",
+ "r1= 0.6745*SD;#PROBABLE ERROR OF ONE READING\n",
+ "#results\n",
+ "print\"arithmetic mean is (V)=\",AM\n",
+ "print\"average deviation is (V)=\",AV\n",
+ "print\"standard deviation is (V)=\",round(SD,4)\n",
+ "print\"probable error is (V)=\",round(r1,4)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2 - pg 34"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "when current reading is 5mA\n",
+ "apparent resistance in kilo ohms is 20.0\n",
+ "percentage gross error is 13.33\n",
+ "when current reading is 50mA\n",
+ "apparent resistance in kilo ohms is 2.0\n",
+ "percentage gross error is 1.33\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Example 1.2:#APPRABET RESISTANCE AND PERCENTAGE GROSS ERROR\n",
+ "#calculate the APPARENT RESISTANCE AND PERCENTAGE GROSS ERROR\n",
+ "#given\n",
+ "print\"when current reading is 5mA\"\n",
+ "vr=100.;#voltmeter reading\n",
+ "ir=5.;#mA\n",
+ "#calculations and results\n",
+ "rt=vr/(ir);#in kilo ohms\n",
+ "print\"apparent resistance in kilo ohms is\",rt\n",
+ "vm=150.;#range of voltmeter\n",
+ "s=1.;#kilo ohms per volts sensivity\n",
+ "rv=s*vm;#kilo ohms\n",
+ "rx=((rt*rv)/(rv-rt));#kilo ohms\n",
+ "ge=((rx-rt)/rx)*100;#percentage gross error\n",
+ "print\"percentage gross error is\",round(ge,2)\n",
+ "print\"when current reading is 50mA\"\n",
+ "vr=100.;#voltmeter reading\n",
+ "ir1=50.;#mA\n",
+ "rt1=vr/(ir1);#in kilo ohms\n",
+ "print\"apparent resistance in kilo ohms is\",rt1\n",
+ "vm=150.;#range of voltmeter\n",
+ "s=1;#kilo ohms per volts sensivity\n",
+ "rv=s*vm;#kilo ohms\n",
+ "rx1=((rt1*rv)/(rv-rt1));#kilo ohms\n",
+ "ge1=((rx1-rt1)/rx1)*100;#percentage gross error\n",
+ "print\"percentage gross error is\",round(ge1,2)\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3 - pg 35"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "limiting error at 150 V is (%)= 5.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Example 1.3:#limiting error\n",
+ "#calculate the limiting error\n",
+ "#given\n",
+ "fs=1.5;#full scale in percentage\n",
+ "vr=500.;#voltmeter reading\n",
+ "#calculations\n",
+ "ea=(fs/100)*vr;#volts\n",
+ "le=150;#limiting error voltage\n",
+ "lep=((ea/le)*100);#limiting error\n",
+ "#results\n",
+ "print \"limiting error at 150 V is (%)=\",lep\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4 - pg 35"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "arithmetic mean is, (V)= 100.0\n",
+ "average deviation is, (V)= 0.2\n",
+ "standard deviation is, (V)= 0.228\n",
+ "Variance is ,(V)= 0.052\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Example 1.4:#ARITHMETIC MEAN,AVERAGE DEVIATION ,STANDARD DEVIATION AND PROBABLE ERROR\n",
+ "#calculate the ARITHMETIC MEAN,AVERAGE DEVIATION ,STANDARD DEVIATION AND PROBABLE ERROR\n",
+ "#given\n",
+ "import math,numpy\n",
+ "T=numpy.array([99.7,99.8,100,100.2,100.3]);#VOLTS\n",
+ "q=numpy.array([T[0],T[1],T[2],T[3],T[4]]);#\n",
+ "#calculations\n",
+ "AM=(q[0]+q[1]+q[2]+q[3]+q[4])/5;#arithematic mean in mm\n",
+ "qb=numpy.zeros(6)\n",
+ "for i in range(0,5):\n",
+ " qb[i]= T[i]-AM;\n",
+ "\n",
+ "Q= numpy.array([qb[0],qb[1],qb[2],qb[3],qb[4]]);#\n",
+ "AV=(-qb[0]-qb[1]-qb[2]+qb[3]+qb[4])/5;#\n",
+ "SD=math.sqrt(((qb[0]**2)+(qb[1]**2)+(qb[2]**2)+(qb[3]**2)+(qb[4]**2))/5);#standard deviation\n",
+ "V=SD**2;#\n",
+ "#results\n",
+ "print\"arithmetic mean is, (V)=\",AM\n",
+ "print\"average deviation is, (V)=\",AV\n",
+ "print\"standard deviation is, (V)=\",round(SD,3)\n",
+ "print\"Variance is ,(V)=\",V"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5 - pg 36"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "power is,(W)= 1344.8\n",
+ "error in power is,(W)= 40.606\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Example 1.5:#error\n",
+ "#calculate the error in power\n",
+ "#given\n",
+ "i=8.2;#in amperes\n",
+ "r=20.;#ohms\n",
+ "nd=100.;#divisions\n",
+ "ra=10.;#range in amperes\n",
+ "d=0.5;#divisions\n",
+ "amcr=1.;#ammemeter constant error\n",
+ "crr=-0.2;#construction error\n",
+ "#calculations\n",
+ "p=i**2*r;#watts\n",
+ "rd1=ra/nd;#reading of one division\n",
+ "per=((d*rd1)/i)*100;#possible ameter rwading error\n",
+ "ter=amcr+per;#total ammeter error\n",
+ "ep=(((2*ter)+crr)/nd)*p;#\n",
+ "#results\n",
+ "print \"power is,(W)=\",p\n",
+ "print \"error in power is,(W)=\",round(ep,3)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6 - pg 37"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "arithmetic mean is (V)= 100.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Example 1.6:#ARITHMETIC MEAN\n",
+ "#calculate the arithmetic mean\n",
+ "#given\n",
+ "import numpy\n",
+ "T=numpy.array([99.7,99.8,99.9,100,100.1,100.2,100.3]);#VOLTS\n",
+ "f=numpy.array([2,8,20,40,21,6,3]);#frequency of occurence\n",
+ "#calculations\n",
+ "qb=numpy.zeros(8)\n",
+ "for i in range (0,7):\n",
+ " qb[i]=T[i]-T[5];\n",
+ "\n",
+ "prdtc=(qb[0]*f[0])+(qb[1]*f[1])+(qb[2]*f[2])+(qb[3]*f[3])+(qb[4]*f[4])+(qb[5]*f[5])+(qb[6]*f[6])\n",
+ "am=T[5]+(prdtc/100);#arithemetic mean\n",
+ "#results\n",
+ "print \"arithmetic mean is (V)=\",am\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7 - pg 37"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "limiting error for power is, (%)= 3.3\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Example 1.7:#limiting error\n",
+ "#calculate the limiting error for power\n",
+ "#given\n",
+ "fse=1.;#full scale deflection\n",
+ "vr=150.;#range in volts\n",
+ "v1=100.;#volts\n",
+ "ve=100.;#range in mA\n",
+ "#calculations\n",
+ "ev=(fse/100)*vr;#voltas\n",
+ "le100=((ev)/v1)*100;#in percentage\n",
+ "ee=(fse/100)*ve;#mA\n",
+ "e1=55;#mA\n",
+ "le50=((ee/e1)*100);#in percentage\n",
+ "ler=le100+le50;#\n",
+ "#results\n",
+ "print \"limiting error for power is, (%)=\",round(ler,1)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8 - pg 37"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "volume is,(m^3)= 0.216\n",
+ "percentage error in volume is,(%)= 3.0\n",
+ "error in volume is,(m^3)= 0.00648\n"
+ ]
+ }
+ ],
+ "source": [
+ "#pg 37\n",
+ "#Example 1.8:# error\n",
+ "#calculate the volume, percentage error\n",
+ "#given\n",
+ "fse=1.;#full scale deflection\n",
+ "e=0.60;#meters\n",
+ "#calculations\n",
+ "v=(e)**3;#volume in m^3\n",
+ "ev=3*fse;#error in volume\n",
+ "evv=(ev/100)*v;#\n",
+ "#results\n",
+ "print \"volume is,(m^3)=\",v\n",
+ "print \"percentage error in volume is,(%)=\",ev\n",
+ "print \"error in volume is,(m^3)=\",evv\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 9 - pg 38"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "current in the circuit is,(A)= 2.375\n",
+ "error in current is,(A)= 0.0356\n",
+ "percentage error in current is,(%)= 1.5\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Example 1.9:#error\n",
+ "#calculate the error in circuit\n",
+ "#given\n",
+ "v=95.;#volts\n",
+ "r=40.;#ohms\n",
+ "evv=0.95;#error in voltage\n",
+ "err=-0.2;#error in resistance\n",
+ "#calculations\n",
+ "i=v/r;#amperes\n",
+ "err1=(err/r)*100;#percentage error \n",
+ "evv1=(evv/v)*100;#percentage error\n",
+ "x=evv1-err1;#\n",
+ "ei=(x/100)*i;#\n",
+ "#results\n",
+ "print \"current in the circuit is,(A)=\",i\n",
+ "print \"error in current is,(A)=\",round(ei,4)\n",
+ "print \"percentage error in current is,(%)=\",x"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 10 - pg 38"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "parralel resistance case\n",
+ "magnitude of resistance in ohms is = 17.391\n",
+ "limiting error in ohms is = 4.348\n",
+ "percentage error (%) = 25.0\n",
+ "series resistance case\n",
+ "magnitude of resistance in ohms is = 170.0\n",
+ "percentage error (%) = 5.0\n",
+ "limiting error in ohms is = 8.5\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Example 1.10:#MAGNITUDE AND LIMITING ERROR\n",
+ "#calculate the magnitude of resistance and limiting error\n",
+ "#given\n",
+ "print \"parralel resistance case\"\n",
+ "r1=40.;#ohms\n",
+ "er1=5.;#percentage error\n",
+ "r2=80.;#ohms\n",
+ "er2=5.;#percentage error\n",
+ "r3=50.;#ohms\n",
+ "er3=5.;#percentage error\n",
+ "#calculations\n",
+ "rp=((r1*r2*r3)/(r1*r2+r2*r3+r3*r1));#ohms\n",
+ "Y=(r1*r2+r2*r3+r3*r1);#ohms\n",
+ "ex=er1+er2+er3;#percentage error\n",
+ "ey1=er1+er2;#\n",
+ "ey2=er2+er3;#\n",
+ "ey3=er3+er1;#\n",
+ "y=(((r1*r2*ey1)/Y)+((r2*r3*ey2)/Y)+((r3*r1*ey3)/Y));#error\n",
+ "mer=(y+ex)*rp;#\n",
+ "#results\n",
+ "print \"magnitude of resistance in ohms is = \",round(rp,3)\n",
+ "print \"limiting error in ohms is = \",round(mer/100,3)\n",
+ "print \"percentage error (%) = \",(y+ex)\n",
+ "print \"series resistance case\"\n",
+ "rs=r1+r2+r3;#ohms\n",
+ "er=(((r1/rs)*er1)+((r2/rs)*er2)+((r3/rs)*er3));#\n",
+ "mer1=(er/100)*rs;#ohms\n",
+ "print \"magnitude of resistance in ohms is = \",rs\n",
+ "print \"percentage error (%) = \",er\n",
+ "print \"limiting error in ohms is = \",mer1\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11 - pg 39"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 17,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "magnitude in ohm = 151.0\n",
+ "percentage error when error in both (PS) and (Q) is positive (%) = 0.5\n",
+ "error in ohms when error in both (PS) and (Q) is positive (ohms) = 0.755\n",
+ "percentage error when error in (PS) is positive and (Q) is negative (%) = 1.5\n",
+ "error in ohms when error in (PS) is positive and (Q) is negative (ohms) = 2.265\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Example 1.11:#MAGNITUDE AND LIMITING ERROR\n",
+ "#calculate the magintude of resistance in ohm and error\n",
+ "#given\n",
+ "r1=50;#ohms\n",
+ "er1=0.5;#percentage error\n",
+ "r2=100;#ohms\n",
+ "er2=0.5;#percentage error\n",
+ "r3=75.5;#ohms\n",
+ "er3=0.5;#percentage error\n",
+ "#calculations\n",
+ "x=((r2/r1)*r3);#ohms\n",
+ "eps=er1+er2;#\t\n",
+ "erpsq=eps-er3;#when error in both (PS) and (Q) is positive\n",
+ "erpsq1=eps+er3;#when error in (PS) is positive and (Q) is negetive\n",
+ "oer1=(erpsq/100)*x;#ohms\n",
+ "oer2=(erpsq1/100)*x;#ohms\n",
+ "#results\n",
+ "print \"magnitude in ohm = \",x\n",
+ "print \"percentage error when error in both (PS) and (Q) is positive (%) = \",erpsq\n",
+ "print \"error in ohms when error in both (PS) and (Q) is positive (ohms) = \",oer1\n",
+ "print \"percentage error when error in (PS) is positive and (Q) is negative (%) = \",erpsq1\n",
+ "print \"error in ohms when error in (PS) is positive and (Q) is negative (ohms) = \",oer2\n"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.9"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/sample_notebooks/KAVANA B/CHAPTER.ipynb b/sample_notebooks/KAVANA B/CHAPTER.ipynb new file mode 100755 index 00000000..13237c6c --- /dev/null +++ b/sample_notebooks/KAVANA B/CHAPTER.ipynb @@ -0,0 +1,175 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER 2: THERMAL STATIONS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.1, Page number 25-26"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "M = 15000.0+10.0 #Water evaporated(kg)\n",
+ "C = 5000.0+5.0 #Coal consumption(kg)\n",
+ "time = 8.0 #Generation shift time(hours)\n",
+ "\n",
+ "#Calculation\n",
+ "#Case(a)\n",
+ "M1 = M-15000.0\n",
+ "C1 = C-5000.0\n",
+ "M_C = M1/C1\n",
+ "#Case(b)\n",
+ "kWh = 0 #Station output at no load\n",
+ "consumption_noload = 5000+5*kWh #Coal consumption at no load(kg)\n",
+ "consumption_noload_hr = consumption_noload/time #Coal consumption per hour(kg)\n",
+ "\n",
+ "#Result\n",
+ "print('Case(a): Limiting value of water evaporation , M/C = %.1f kg' %M_C)\n",
+ "print('Case(b): Coal per hour for running station at no load = %.f kg' %consumption_noload_hr)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Case(a): Limiting value of water evaporation , M/C = 2.0 kg\n",
+ "Case(b): Coal per hour for running station at no load = 625 kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.2, Page number 26"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "amount = 25.0*10**5 #Amount spent in 1 year(Rs)\n",
+ "value_heat = 5000.0 #Heating value(kcal/kg)\n",
+ "cost = 500.0 #Cost of coal per ton(Rs)\n",
+ "n_ther = 0.35 #Thermal efficiency\n",
+ "n_elec = 0.9 #Electrical efficiency\n",
+ "\n",
+ "#Calculation\n",
+ "n = n_ther*n_elec #Overall efficiency\n",
+ "consumption = amount+cost*value_heat #Coal consumption i 1 year(kg)\n",
+ "combustion = consumption*value_heat #Heat of combustion(kcal)\n",
+ "output = n*combustion #Heat output(kcal)\n",
+ "kWh = output/860.0 #Annual heat generated(kWh). 1 kWh = 860 kcal\n",
+ "time = 365*24.0 #Total time in a year(hour)\n",
+ "load_average = kWh/time #Average load on the power plant(kW)\n",
+ "\n",
+ "#Result\n",
+ "print('Average load on power plant = %.2f kW' %load_average)\n",
+ "print('\\nNOTE: ERROR: Calculation mistake in the final answer in textbook')"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Average load on power plant = 1045.32 kW\n",
+ "\n",
+ "NOTE: ERROR: Calculation mistake in the final answer in textbook\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.3, Page number 26"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "consumption = 0.5 #Coal consumption per kWh output(kg)\n",
+ "cal_value = 5000.0 #Calorific value(kcal/kg)\n",
+ "n_boiler = 0.8 #Boiler efficiency\n",
+ "n_elec = 0.9 #Electrical efficiency\n",
+ "\n",
+ "#Calculation\n",
+ "input_heat = consumption*cal_value #Heat input(kcal)\n",
+ "input_elec = input_heat/860.0 #Equivalent electrical energy(kWh). 1 kWh = 860 kcal\n",
+ "loss_boiler = input_elec*(1-n_boiler) #Boiler loss(kWh)\n",
+ "input_steam = input_elec-loss_boiler #Heat input to steam(kWh)\n",
+ "input_alter = 1/n_elec #Alternator input(kWh)\n",
+ "loss_alter = input_alter*(1-n_elec) #Alternate loss(kWh)\n",
+ "loss_turbine = input_steam-input_alter #Loss in turbine(kWh)\n",
+ "loss_total = loss_boiler+loss_alter+loss_turbine #Total loss(kWh)\n",
+ "output = 1.0 #Output(kWh)\n",
+ "Input = output+loss_total #Input(kWh)\n",
+ "\n",
+ "#Result\n",
+ "print('Heat Balance Sheet')\n",
+ "print('LOSSES: Boiler loss = %.3f kWh' %loss_boiler)\n",
+ "print(' Alternator loss = %.2f kWh' %loss_alter)\n",
+ "print(' Turbine loss = %.3f kWh' %loss_turbine)\n",
+ "print(' Total loss = %.2f kWh' %loss_total)\n",
+ "print('OUTPUT: %.1f kWh' %output)\n",
+ "print('INPUT: %.2f kWh' %Input)\n",
+ "print('\\nNOTE: Changes in the obtained answer from that of textbook is due to precision')"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat Balance Sheet\n",
+ "LOSSES: Boiler loss = 0.581 kWh\n",
+ " Alternator loss = 0.11 kWh\n",
+ " Turbine loss = 1.214 kWh\n",
+ " Total loss = 1.91 kWh\n",
+ "OUTPUT: 1.0 kWh\n",
+ "INPUT: 2.91 kWh\n",
+ "\n",
+ "NOTE: Changes in the obtained answer from that of textbook is due to precision\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/sample_notebooks/KRISHNACHAITANYA/Chapter4.ipynb b/sample_notebooks/KRISHNACHAITANYA/Chapter4.ipynb new file mode 100755 index 00000000..49292516 --- /dev/null +++ b/sample_notebooks/KRISHNACHAITANYA/Chapter4.ipynb @@ -0,0 +1,499 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "#4: Wave Optics"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 4.1, Page number 92"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The wavelength of light used is 640 nm\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "n=125; #number of fingers cross the field of view\n",
+ "d=0.04*10**-3; #distance of one of mirror moved(m)\n",
+ "\n",
+ "#Calculation\n",
+ "w=2*d/n; #wavelength of light used(m)\n",
+ "\n",
+ "#Result\n",
+ "print \"The wavelength of light used is\",int(w*10**9),\"nm\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 4.2, Page number 92"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The wavelength of light used is 600.0 nm\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Ri=1.5; #refractive index of thin film of glass\n",
+ "n=30; #number of fringes of sodium light is observed across the field of view\n",
+ "t=0.018*10**-3; #thickness of glass film(m)\n",
+ "\n",
+ "#Calculation\n",
+ "w=2*(Ri-1)*t/n; #wavelength of the light used(m)\n",
+ "\n",
+ "#Result\n",
+ "print \"The wavelength of light used is\",w*10**9,\"nm\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 4.3, Page number 92"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The wavelength of the monochromatic source used is 589.0 nm\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "n=200; #number of fringes cross the field of view\n",
+ "d=0.0589*10**-3; #distance of mirror displaced(m)\n",
+ "\n",
+ "#Calculation\n",
+ "w=2*d/n; #wavelength of the monochromatic source used(m)\n",
+ "\n",
+ "#Result\n",
+ "print \"The wavelength of the monochromatic source used is\",w*10**9,\"nm\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 4.4, Page number 92"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false,
+ "scrolled": true
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The thickness of the film is 1.9636 *10**-4 m\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "x=1.55; #refractive index of transparent film of glass \n",
+ "w=480*10**-9; #wavelength of light(m)\n",
+ "n=450; #number of fringes to sweep across the field\n",
+ "\n",
+ "#Calculation\n",
+ "t=n*w/(2*(x-1)); #thickness of the film(m)\n",
+ "\n",
+ "#Result\n",
+ "print \"The thickness of the film is\",round(t*10**4,4),\"*10**-4 m\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 4.5, Page number 93"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The refractive index of material is 1.675\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "t=0.004*10**-2; #thickness of transparent sheet(m)\n",
+ "d=0.0027*10**-2; #distance of mirror displaced(m)\n",
+ "\n",
+ "#Calculation\n",
+ "X=(d/t)+1; #refractive index of the material\n",
+ "\n",
+ "#Result\n",
+ "print \"The refractive index of material is\",X"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 4.6, Page number 93"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The number of fringes shifted across the cross wire of eye piece of the telescope is 110\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "d=0.03205*10**-3; #distance of movable mirror displaced(m)\n",
+ "w=580.9*10**-9; #wavelength of light(m)\n",
+ "\n",
+ "#Calculation\n",
+ "n=2*d/w; #number of fringes shifted across the cross wire of eye piece of the telescope\n",
+ "\n",
+ "#Result\n",
+ "print \"The number of fringes shifted across the cross wire of eye piece of the telescope is\",int(n)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 4.7, Page number 101"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 17,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The thickness of a quarter wave plate of quartz for sodium light is 7.36625 micro m\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "w=5893*10**-10; #wavelength of sodium light(m)\n",
+ "Re=1.5532; #Refractive index of quartz for e ray\n",
+ "Ro=1.5332; #Refractive index of quartz for o ray\n",
+ "\n",
+ "#Calculation\n",
+ "t=w/(4*(Re-Ro)); #thickness of a quarter wave plate of quartz for sodium light(m)\n",
+ "\n",
+ "#Result\n",
+ "print \"The thickness of a quarter wave plate of quartz for sodium light is\",t*10**6,\"micro m\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 4.8, Page number 102"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 19,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The thickness of a double refracting crystal required at w/2 is 2.727 micro m\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "w=6000*10**-10; #wavelength(m)\n",
+ "Re=1.54; #Refractive index of double refracting crystal for e ray\n",
+ "Ro=1.65; #Refractive index of double refracting crystal for o ray\n",
+ "\n",
+ "#Calculation\n",
+ "t=w/(2*(Ro-Re)); #thickness of a double refracting crystal required at w/2(m)\n",
+ "\n",
+ "#Result\n",
+ "print \"The thickness of a double refracting crystal required at w/2 is\",round(t*10**6,3),\"micro m\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 4.9, Page number 102"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 21,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The least thickness of a plate when the emergent beam will be plane polarised is 9.54 micro m\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "w=5*10**-7; #wavelength(m)\n",
+ "Re=1.5573; #Refractive index for e ray when the emergent beam will be plane polarised\n",
+ "Ro=1.5442; #Refractive index for o ray when the emergent beam will be plane polarised\n",
+ "\n",
+ "#Calculation\n",
+ "t=w/(4*(Re-Ro)); #least thickness of a plate(m)\n",
+ "\n",
+ "#Result\n",
+ "print \"The least thickness of a plate when the emergent beam will be plane polarised is\",round(t*10**6,2),\"micro m\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 4.10, Page number 102"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 24,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The thickness of the quarter wave plate for calcite is 1.713 *10**-6 m\n",
+ "answer given in the book is wrong\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "w=5893*10**-10; #wavelength of sodium light(m)\n",
+ "Ro=1.658; #Refractive index of calcite for o ray\n",
+ "Re=1.486; #Refractive index of calcite for e ray\n",
+ "\n",
+ "#Calculation\n",
+ "t=w/(2*(Ro-Re)); #thickness of the quarter wave plate for calcite(m)\n",
+ "\n",
+ "#Result\n",
+ "print \"The thickness of the quarter wave plate for calcite is\",round(t*10**6,3),\"*10**-6 m\"\n",
+ "print \"answer given in the book is wrong\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 4.11, Page number 102"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 26,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The wavelength for which it can act as a half wave plate is 600.0 *10**-9 m\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "t=30*10**-6; #thickness of wave plate(m)\n",
+ "Ro=1.55; #Refractive index of wave plate for o ray\n",
+ "Re=1.54; #Refractive index of wave plate for e ray\n",
+ "\n",
+ "#Calculation\n",
+ "w=2*t*(Ro-Re); #wavelength for which it can act as a half wave plate(m)\n",
+ "\n",
+ "#Result\n",
+ "print \"The wavelength for which it can act as a half wave plate is\",w*10**9,\"*10**-9 m\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 4.12, Page number 102"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 28,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The thickness of a mica sheet required for making a half wave plate for a light is 4.5508 *10**-5 m\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "w=546.1*10**-9; #wavelength of light(m)\n",
+ "Re=1.592; #Refractive index of mica for e ray\n",
+ "Ro=1.586; #Refractive index of mica for o ray\n",
+ "\n",
+ "#Calculation\n",
+ "t=w/(2*(Re-Ro)); #thickness of a mica sheet(m)\n",
+ "\n",
+ "#Result\n",
+ "print \"The thickness of a mica sheet required for making a half wave plate for a light is\",round(t*10**5,4),\"*10**-5 m\""
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.9"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/sample_notebooks/MayurSabban/Chapter6.ipynb b/sample_notebooks/MayurSabban/Chapter6.ipynb new file mode 100755 index 00000000..ffc62fd3 --- /dev/null +++ b/sample_notebooks/MayurSabban/Chapter6.ipynb @@ -0,0 +1,248 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 06 : Crystal Imperfection"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.1, Page No 148"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "t1 = 0 #temperature in kelvin\n",
+ "t2 = 300.0 #temperature in kelvin\n",
+ "t3 = 900.0 #temperature in kelvin\n",
+ "R = 8.314 #universal gas constant\n",
+ "del_hf_al = 68.0 #Enthalpy of formation of aluminium crystal in KJ\n",
+ "del_hf_ni = 168.0 #Enthalpy of formation of nickel crystal in KJ\n",
+ "print(\" Example 6.1\")\n",
+ "\n",
+ "#Calculations\n",
+ "print(\"Equilibrium concentration of vacancies of aluminium at %.2f K is 0\" %t1)\n",
+ "n_N = math.exp(-del_hf_al*1e3/(R*t2))\n",
+ "print(\" Equilibrium concentration of vacancies of aluminium at %.2f K \" %t2) # answer in book is 1.45e-12\n",
+ "print(\"is %.2e\" %(n_N))\n",
+ "n_N = math.exp(-del_hf_al*1e3/(R*t3))\n",
+ "print(\" Equilibrium concentration of vacancies of aluminium at %.2f K \" %t3) # answer in book is 1.12e-4\n",
+ "print(\"is %.2e \" %(n_N))\n",
+ "\n",
+ "#Results\n",
+ "print(\"Equilibrium concentration of vacancies of Nickel at %.2f K is 0\" %t1)\n",
+ "n_N = math.exp(-del_hf_ni*1e3/(R*t2))\n",
+ "print(\" Equilibrium concentration of vacancies of Nickel at %.2fK \" %t2) # answer in book is 1.45e-12\n",
+ "print(\"is %.2e\" %(n_N))\n",
+ "n_N = math.exp(-del_hf_ni*1e3/(R*t3))\n",
+ "print(\" Equilibrium concentration of vacancies of Nickel at %.2f K \" %t3) # answer in book is 1.78e-10\n",
+ "print(\"is %.2e \" %(n_N))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Example 6.1\n",
+ "Equilibrium concentration of vacancies of aluminium at 0.00 K is 0\n",
+ " Equilibrium concentration of vacancies of aluminium at 300.00 K \n",
+ "is 1.44e-12\n",
+ " Equilibrium concentration of vacancies of aluminium at 900.00 K \n",
+ "is 1.13e-04 \n",
+ "Equilibrium concentration of vacancies of Nickel at 0.00 K is 0\n",
+ " Equilibrium concentration of vacancies of Nickel at 300.00K \n",
+ "is 5.59e-30\n",
+ " Equilibrium concentration of vacancies of Nickel at 900.00 K \n",
+ "is 1.77e-10 \n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.2, Page No 149"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "a = 2.87 #lattice parameter in angstrom\n",
+ "b= 2.49 #magnitude of burgers vector in angstrom\n",
+ "G = 80.2 #shear modulus in GN\n",
+ "\n",
+ "#Calculations\n",
+ "E = G*1e9*(b*1e-10)**2*1.0/2 \n",
+ "\n",
+ "#Results\n",
+ "print(\"Line energy of dislocation is %.2e J m^-1\" %E)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Line energy of dislocation is 2.49e-09 J m^-1\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.4, Page No 149"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "a = 1.0e10 # total number of edge dislocation \n",
+ "N = 6.023e23 \t# Avogadro number\n",
+ "R = 8.314 \t# Universal gas constant\n",
+ "t1 = 0 \t# initial temperature in K\n",
+ "t2 = 1000.0\t # Final temperature in K\n",
+ "del_hf = 100.0 \t # Enthalpy of vacancy formation in KJ\n",
+ "d = 2.0 # length of one step in angstrom\n",
+ "\n",
+ "#Calculations\n",
+ "v = 5.5/10**6 # volume of one mole crystal\n",
+ "n = N*math.exp(-(del_hf*1e03)/(R*(t2-t1)))/v\n",
+ "k = 1.0/(d*1e-10 ) # atoms required for 1 m climb\n",
+ "b = n/(k*a)# average amount of climb\n",
+ "c = b*d*1e-10 \n",
+ "\n",
+ "#Results\n",
+ "print(\"Average down climb of crystal is %.2e m\" %c)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Average down climb of crystal is 2.62e-06 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.5 Page No 150"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "\n",
+ "E = 56.4 #bond energy in KJ\n",
+ "N_a = 6.023e23 #Avogadro\u2019s number\n",
+ "n = 12.0 #number of bonds\n",
+ "m = 3.0 #number of broken bonds \n",
+ "N = 1.77e19 #number of atoms in copper crystal of type {111} per m^2\n",
+ "\n",
+ "#Calculations\n",
+ "b_e = 1.0/2*E*1e3*n/N_a #bond energy per atom\n",
+ "e_b = b_e*m/n #energy of broken bond at surface\n",
+ "s_e = e_b*N #surface enthalpy of copper\n",
+ "\n",
+ "#Results\n",
+ "print(\"Surface enthalpy of copper is %0.2f J m^-2\" %s_e)\n",
+ "print(\"Surface enthalpy of copper is %0.2f erg cm^-2\" %(s_e*1e3))\n",
+ "# Answer in book is 2490 erg cm^-2\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Surface enthalpy of copper is 2.49 J m^-2\n",
+ "Surface enthalpy of copper is 2486.17 erg cm^-2\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.6, Page No 151"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "Gamma_gb = 1.0 #let, energy of grain boundary\n",
+ "\n",
+ "#Calculations\n",
+ "Gamma_s = 3.0*Gamma_gb #energy of free surface\n",
+ "theta = 2*math.degrees(math.acos(1.0/2*Gamma_gb/Gamma_s))\n",
+ "\n",
+ "#Results\n",
+ "print(\"Angle at the bottom of groove of a boundary is %0.2f degrees.\" %math.ceil(theta))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Angle at the bottom of groove of a boundary is 161.00 degrees.\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/sample_notebooks/MukteshChaudhary/ch1.ipynb b/sample_notebooks/MukteshChaudhary/ch1.ipynb new file mode 100755 index 00000000..ec327a6f --- /dev/null +++ b/sample_notebooks/MukteshChaudhary/ch1.ipynb @@ -0,0 +1,818 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:d510303f7e7e2853fb2cf56867915796aa62fb3bbb679ce357903afade2bd69c" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 1: Fundamentals" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.1, Page 3" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "I =.000018; # Electric current, A\n", + "V = 15000; # Electric potential, V\n", + "P = 250000000 # Electric Power, W\n", + "\n", + "#Calculations&Results\n", + "# Display standard form \n", + "print \"Standard form:\"\n", + "print \"==============\"\n", + "print \"%f A = %3.1e A\"%(I, I)\n", + "print \"%5.0f V = %3.1e V\"%(V, V)\n", + "print \"%9.0f W = %3.1e W\"%(P, P)\n", + "# Display scientific notation \n", + "print \"\\n\\nScientific form:\"\n", + "print \"================\"\n", + "print \"%f A = %2d micro-ampere\"%(I, I/1e-06)\n", + "print \"%5.0f V = %2d kilo-volt\"%(V, V/1e+03)\n", + "print \"%9.0f W = %3d mega-watt\"%(P, P/1e+06)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Standard form:\n", + "==============\n", + "0.000018 A = 1.8e-05 A\n", + "15000 V = 1.5e+04 V\n", + "250000000 W = 2.5e+08 W\n", + "\n", + "\n", + "Scientific form:\n", + "================\n", + "0.000018 A = 18 micro-ampere\n", + "15000 V = 15 kilo-volt\n", + "250000000 W = 250 mega-watt\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.2, Page 3" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "I = 25e-05; # Electric Current,A\n", + "P = 3e-04; # Electric Power, W\n", + "W = 850000.; # Work done, J\n", + "V = 0.0016; # Electric Potential, V\n", + "\n", + "#Calculations&Results\n", + "print \"Scientific (Engineering) notation:\";\n", + "print \"===================================\";\n", + "print \"%2e A = %3d micro-ampere = %3.2f mA\"%(I, I/1e-06, I/1e-03);\n", + "print \"%1.0e W = %.e milli-watt\"%(P, P/1e-03);\n", + "print \"%6d J = %3d kJ = %3.2f MJ\"%(W, W/1e+03, W/1e+06);\n", + "print \"%5.4f V = %3.1f milli-volt\"%(V, V/1e-03)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Scientific (Engineering) notation:\n", + "===================================\n", + "2.500000e-04 A = 250 micro-ampere = 0.25 mA\n", + "3e-04 W = 3e-01 milli-watt\n", + "850000 J = 850 kJ = 0.85 MJ\n", + "0.0016 V = 1.6 milli-volt\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.3, Page 5" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "m = 750/1e+03; # Mass of the body, kg\n", + "F = 2; # Force acting on the mass, N\n", + "\n", + "#Calculations\n", + "# Since F = m * a, (Newton's Second Law of motion), solving for a\n", + "a = F/m; # Acceleration produced in the body, metre per second square\n", + "\n", + "# Result\n", + "print \"The acceleration produced in the body = %5.3f metre per second square\"%a\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The acceleration produced in the body = 2.667 metre per second square\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.4, Page 9" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "Q = 35e-03; # Electric charge, C\n", + "t = 20e-03; # Time for transference of charge between two points, s\n", + "\n", + "#Calculations\n", + "# Since Q = I * t, solving for I\n", + "I = Q/t; # Electric current flowing between the two points, A\n", + "\n", + "# Result\n", + "print \"The value of electric current flowing = %4.2f A\"%I\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The value of electric current flowing = 1.75 A\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.5, Page 9" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "I = 120e-06; # Electric current, A\n", + "t = 15; # Time for transference of charge between two points, s\n", + "\n", + "#Calculations\n", + "# Since I = Q/t, solving for Q\n", + "Q = I*t; # Electric charge transferred, C\n", + "\n", + "# Result\n", + "print \"The value of electric charge transferred = %3.1f mC\"%(Q/1e-03)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The value of electric charge transferred = 1.8 mC\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.6, Page 10" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "Q = 80; # Electric charge, C\n", + "I = 0.5; # Electric current, A\n", + "\n", + "#Calculations\n", + "# Since Q = I*t, solving for t\n", + "t = Q/I; # Time for transference of charge between two points, s\n", + "\n", + "# Result\n", + "print \"The duration of time for which the current flowed = %3d s\"%t\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The duration of time for which the current flowed = 160 s\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.7, Page 13" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "I = 5.5e-03; # Electric current, A\n", + "R = 33000; # Resistance, ohms\n", + "\n", + "#Calculations\n", + "# From Ohm's law, V = I*R\n", + "V = I*R; # Potential difference across resistor, V\n", + "\n", + "# Result\n", + "print \"The potential difference developed across resistor = %5.1f V\"%V\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The potential difference developed across resistor = 181.5 V\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.8, Page 14" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "V = 24.; # Potential difference,V\n", + "R = 15; # Resistance, ohms\n", + "\n", + "#Calculations\n", + "# From Ohm's law, V = I*R, then solving for I\n", + "I = V/R; # Electric current, A\n", + "\n", + "# Result\n", + "print \"The current flowing through the resistor = %3.1f A\"%I\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The current flowing through the resistor = 1.6 A\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.9, Page 16" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "E = 6; # E.m.f of battery, V\n", + "r = 0.15; # Internal resistance of battery, ohm\n", + "I_1 = .5; # Electric current, A\n", + "I_2 = 2; # Electric current, A\n", + "I_3 = 10; # Electric current, A\n", + "\n", + "#Calculations\n", + "# Using relation V = E - I*R and substituting the values of I_1, I_2 and I_3 one by one in it\n", + "V_1 = E - I_1*r; # Terminal potential difference, V\n", + "V_2 = E - I_2*r; # Terminal potential difference, V\n", + "V_3 = E - I_3*r; # Terminal potential difference, V\n", + "\n", + "# Results\n", + "print \"The terminal potential difference developed across resistor for a current of %3.1f A = %5.3f V\"%(I_1,V_1)\n", + "print \"The terminal potential difference developed across resistor for a current of %1d A = %3.1f V\"%(I_2,V_2)\n", + "print \"The terminal potential difference developed across resistor for a current of %2d A = %3.1f V\"%(I_3,V_3)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The terminal potential difference developed across resistor for a current of 0.5 A = 5.925 V\n", + "The terminal potential difference developed across resistor for a current of 2 A = 5.7 V\n", + "The terminal potential difference developed across resistor for a current of 10 A = 4.5 V\n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.10, Page 16" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "E = 12; # E.m.f, V\n", + "I = 5; # Electric current, A\n", + "V = 11.5; # Terminal potential difference, V\n", + "\n", + "#Calculations\n", + "# Using relation V = E - I*r, solving for r\n", + "r = ( E - V )/I; # Internal resistance of battery, ohm\n", + "# From Ohm's law, V = I*R, then solving for R\n", + "R = V/I; # Resistance, ohms\n", + "\n", + "# Results\n", + "print \"The internal resistance of battery = %3.1f ohm\"%r\n", + "print \"The resistance of external circuit = %3.1f ohm\"%R\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The internal resistance of battery = 0.1 ohm\n", + "The resistance of external circuit = 2.3 ohm\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.11, Page 17" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "I = 200e-03; # Electric current, A\n", + "t = 300; # Time for which current flows, s\n", + "R = 750; # Resistance, ohms\n", + "\n", + "#Calculations\n", + "# Using Ohm's law, V = I*R\n", + "V = I*R; # Electric potential difference, V\n", + "W = I**2*R*t; # Energy dissipated, joule\n", + "\n", + "# Result\n", + "print \"The potential difference developed across the resistor = %3d V\\nThe energy dissipated across the resistor = %4.0f J or %1d kJ\"%(V, W, W*1e-03)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The potential difference developed across the resistor = 150 V\n", + "The energy dissipated across the resistor = 9000 J or 9 kJ\n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.12, Page 18" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "\n", + "#Variable declaration\n", + "R = 680; # Resistance, ohms\n", + "P = 85e-03; # Electric power, W\n", + "\n", + "#Calculations\n", + "# Using P = V**2/R, solving for V\n", + "V = math.sqrt( P*R ); # Potential difference, V\n", + "# Using P = I**2*R, solving for I\n", + "I = math.sqrt( P/R ); # Electric current, A\n", + "\n", + "# Result\n", + "print \"The potential difference developed across the resistance = %3.1f V\\nThe current flowing through the resistor = %5.2f mA\"%(V, I/1e-03)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The potential difference developed across the resistance = 7.6 V\n", + "The current flowing through the resistor = 11.18 mA\n" + ] + } + ], + "prompt_number": 21 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.13, Page 19" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "I = 1.4; # Electric current, A\n", + "t = 900; # Time for which current flows, s\n", + "W = 200000; # Energy dissipated, J\n", + "\n", + "#Calculations\n", + "# Using relation W = V*I*t, solving for V\n", + "V = W/( I*t ); # Potential difference, V\n", + "# Using relation P = V*I\n", + "P = V*I; # Electric power, W\n", + "# From Ohm's law, V = I*R, solving for R\n", + "R = V/I; # Resistance, ohm\n", + "\n", + "# Result\n", + "print \"The potential difference developed = %5.1f V\\nThe power dissipated = %5.1f W\\nThe resistance of the circuit = %5.1f ohm\"%(V, P, R)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The potential difference developed = 158.7 V\n", + "The power dissipated = 222.2 W\n", + "The resistance of the circuit = 113.4 ohm\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.14, Page 20" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "P = 12.5; # Power of the machine, kW\n", + "t = 8.5; # Time for which the machine is operated, h\n", + "\n", + "#Calculations\n", + "W = P*t; # Electric energy, kWh\n", + "# Cost per unit = 7.902 p, therefore calculating the cost of 106.25 units\n", + "cost = ( W*7.902 ); # Cost for operating machine, p\n", + "\n", + "# Result\n", + "print \"The cost of operating the machine = %4.2f pounds\"%(cost*1e-02)\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The cost of operating the machine = 8.40 pounds\n" + ] + } + ], + "prompt_number": 14 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.15, Page 20" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "Total_bill = 78.75; # pounds\n", + "Standing_charge = 15.00; # pounds\n", + "Units_used = 750; # kWh\n", + "\n", + "#Calculations\n", + "Cost_per_unit = ( Total_bill - Standing_charge )/Units_used; # p\n", + "Cost_of_energy_used = 67.50; # pounds\n", + "Total_bill = Cost_of_energy_used + Standing_charge; # pounds\n", + "\n", + "# Result\n", + "print \"The cost per unit = %5.3f pounds or %3.1f p\\nTotal bill = %5.2f pounds\"%(Cost_per_unit,Cost_per_unit/1e-02,Total_bill)\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The cost per unit = 0.085 pounds or 8.5 p\n", + "Total bill = 82.50 pounds\n" + ] + } + ], + "prompt_number": 15 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.16, Page 22" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "l = 200; # Length of Cu wire, metre\n", + "rho = 2e-08; # Resistivity of Cu, ohm-metre\n", + "A = 8e-07; # Cross sectional area of Cu wire, metre square\n", + "\n", + "#Calculations\n", + "# Using relation R = ( rho*l )/A\n", + "R = ( rho*l )/A; # Resistance, ohm\n", + "\n", + "# Result\n", + "print \"The resistance of the coil = %1d ohm\"%R\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The resistance of the coil = 5 ohm\n" + ] + } + ], + "prompt_number": 16 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.17, Page 22" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "\n", + "#Variable declaration\n", + "l = 250; # Length of Cu wire, metre\n", + "d = 5e-04; # Diameter of Cu wire, metre\n", + "rho = 1.8e-08; # Resistivity of Cu wire, ohm-metre\n", + "\n", + "#Calculations\n", + "A = (math.pi*d**2 )/4; # Cross sectional area of Cu wire, metre square\n", + "# Using relation R = rho*l/A\n", + "R = rho*l/A; # Resistance, ohm\n", + "\n", + "# Result\n", + "print \"The resistance of the coil = %5.2f ohm\"%R\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The resistance of the coil = 22.92 ohm\n" + ] + } + ], + "prompt_number": 22 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.18, Page 23" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "R_1 = 250; # Resistance of field coil, ohm\n", + "Theta_1 = 15; # Initial temperature of motor, degree celcius \n", + "Theta_2 = 45; # Final temperature of motor, degree celcius\n", + "Alpha = 4.28e-03; # Temperature coefficient of resistance, per degree celcius\n", + "\n", + "#Calculations\n", + "# Using relation, R_1/R_2 = ( 1 + Alpha*Theta_1 )/( 1 + Alpha*Theta_2 ), solving for R_2\n", + "R_2 = R_1 * (( 1 + Alpha*Theta_2 )/( 1 + Alpha*Theta_1 )); # Resistance, ohms\n", + "\n", + "# Result\n", + "print \"The resistance of field coil at %2d degree celcius = %5.1f ohm\"%(Theta_2, R_2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The resistance of field coil at 45 degree celcius = 280.2 ohm\n" + ] + } + ], + "prompt_number": 18 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.19, Page 24" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "R_0 = 350; # Resistance, ohms\n", + "Theta_1 = 60; # Temperature, degree celcius \n", + "Alpha = 4.26e-03; # Temperature coefficient, per degree celcius\n", + "\n", + "#Calculations\n", + "# Using relation R_1 = R_0 * ( 1 + Alpha*Theta_1 )\n", + "R_1 = R_0 * ( 1 + Alpha*Theta_1 ); # Resistance, ohms\n", + "\n", + "# Result\n", + "print \"The resistance of the wire at %2d degree celcius = %5.1f ohm\"%(Theta_1, R_1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The resistance of the wire at 60 degree celcius = 439.5 ohm\n" + ] + } + ], + "prompt_number": 19 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.20, Page 24" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "R_1 = 120; # Resistance, ohms\n", + "Theta_1 = 16; # Temperature, degree celcius \n", + "Theta_2 = 32; # Temperature, degree celcius\n", + "Alpha = -4.8e-04; # Temperature coefficient, per degree celcius\n", + "\n", + "#Calculations\n", + "# Using relation, R_1/R_2 = ( 1 + Alpha*Theta_1 )/( 1 + Alpha*Theta_2 ), solving for R_2\n", + "R_2 = R_1 * (( 1 + Alpha*Theta_2 )/( 1 + Alpha*Theta_1 )); # Resistance, ohm\n", + "\n", + "# Result\n", + "print \"The resistance of carbon resistor at %2d degree celcius = %5.1f ohm\"%(Theta_2, R_2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The resistance of carbon resistor at 32 degree celcius = 119.1 ohm\n" + ] + } + ], + "prompt_number": 20 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/sample_notebooks/Nitin Kumar/Chapter3.ipynb b/sample_notebooks/Nitin Kumar/Chapter3.ipynb new file mode 100755 index 00000000..42c62c0c --- /dev/null +++ b/sample_notebooks/Nitin Kumar/Chapter3.ipynb @@ -0,0 +1,248 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:4dd75e820655e4b9c7b707a16e607a97dc80135f17b0fdcdf8960be3f0fc80b3" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 3 - Operational Amplifiers and their parameters" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 3.1, page 76" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "fBW=4 #MHz\n", + "fo=10 #Hz\n", + "AOL=fBW*10**6/fo #unitless\n", + "print \"Open loop gain is %.0e \" %AOL" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Open loop gain is 4e+05 \n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 3.2, page 78" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "V1=-10 #V\n", + "V2=10 #V\n", + "SR=0.5 #V/micro second\n", + "delta_Vo=V2-V1 #V\n", + "delta_t=delta_Vo/SR #micro second\n", + "print \"Time taken by op-amp is %d us\" %delta_t" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Time taken by op-amp is 40 us\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 3.3, page 78" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "SR=0.6 #V/micro second\n", + "f=100 #kHz\n", + "Vm=(SR/10**-6)/(2*math.pi*f*1000) #V\n", + "print \"Maximum voltage, Vm is %0.3f V\" %Vm" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Maximum voltage, Vm is 0.955 V\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 3.4, page 79" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "SR=0.5 #V/micro second\n", + "Vm=10 #V\n", + "f=100 #kHz\n", + "fm=(SR/10**-6)/(2*math.pi*Vm)/1000 #kHz\n", + "print \"Maximum frequency, fm is %.2f kHz\" %fm" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Maximum frequency, fm is 7.96 kHz\n" + ] + } + ], + "prompt_number": 16 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 3.5, page 79" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "delta_t=0.3/2 #micro second\n", + "V1=-3 #V\n", + "V2=3 #V\n", + "delta_Vo=V2-V1 #V\n", + "SR=delta_Vo/delta_t #V/micro second\n", + "print \"Slew rate is %d V/us\" %SR" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Slew rate is 40 V/us\n" + ] + } + ], + "prompt_number": 17 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 3.6, page 80" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "SR=2 #V/micro second\n", + "delta_Vin=0.8 #V\n", + "delta_t=10 #micro second\n", + "Acl_max=SR/(delta_Vin/delta_t) #unitless\n", + "print \"Maximum close loop voltage gain is %d\" %Acl_max" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Maximum close loop voltage gain is 25\n" + ] + } + ], + "prompt_number": 18 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 3.7, page 80" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "SR=6 #V/micro second\n", + "#Part (i)\n", + "Vm=1 #V\n", + "fm=(SR/10**-6)/(2*math.pi*Vm)/1000 #kHz\n", + "print \"part (i) Maximum frequency, fm is %d kHz\" %fm\n", + "#Part (i)\n", + "Vm=10 #V\n", + "fm=(SR/10**-6)/(2*math.pi*Vm)/1000 #kHz\n", + "print \"part (ii) Maximum frequency, fm is %.1f kHz\" %fm" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "part (i) Maximum frequency, fm is 954 kHz\n", + "part (ii) Maximum frequency, fm is 95.5 kHz\n" + ] + } + ], + "prompt_number": 21 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/sample_notebooks/Nitin Kumar/Chapter3_1.ipynb b/sample_notebooks/Nitin Kumar/Chapter3_1.ipynb new file mode 100755 index 00000000..42c62c0c --- /dev/null +++ b/sample_notebooks/Nitin Kumar/Chapter3_1.ipynb @@ -0,0 +1,248 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:4dd75e820655e4b9c7b707a16e607a97dc80135f17b0fdcdf8960be3f0fc80b3" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 3 - Operational Amplifiers and their parameters" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 3.1, page 76" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "fBW=4 #MHz\n", + "fo=10 #Hz\n", + "AOL=fBW*10**6/fo #unitless\n", + "print \"Open loop gain is %.0e \" %AOL" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Open loop gain is 4e+05 \n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 3.2, page 78" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "V1=-10 #V\n", + "V2=10 #V\n", + "SR=0.5 #V/micro second\n", + "delta_Vo=V2-V1 #V\n", + "delta_t=delta_Vo/SR #micro second\n", + "print \"Time taken by op-amp is %d us\" %delta_t" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Time taken by op-amp is 40 us\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 3.3, page 78" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "SR=0.6 #V/micro second\n", + "f=100 #kHz\n", + "Vm=(SR/10**-6)/(2*math.pi*f*1000) #V\n", + "print \"Maximum voltage, Vm is %0.3f V\" %Vm" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Maximum voltage, Vm is 0.955 V\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 3.4, page 79" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "SR=0.5 #V/micro second\n", + "Vm=10 #V\n", + "f=100 #kHz\n", + "fm=(SR/10**-6)/(2*math.pi*Vm)/1000 #kHz\n", + "print \"Maximum frequency, fm is %.2f kHz\" %fm" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Maximum frequency, fm is 7.96 kHz\n" + ] + } + ], + "prompt_number": 16 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 3.5, page 79" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "delta_t=0.3/2 #micro second\n", + "V1=-3 #V\n", + "V2=3 #V\n", + "delta_Vo=V2-V1 #V\n", + "SR=delta_Vo/delta_t #V/micro second\n", + "print \"Slew rate is %d V/us\" %SR" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Slew rate is 40 V/us\n" + ] + } + ], + "prompt_number": 17 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 3.6, page 80" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "SR=2 #V/micro second\n", + "delta_Vin=0.8 #V\n", + "delta_t=10 #micro second\n", + "Acl_max=SR/(delta_Vin/delta_t) #unitless\n", + "print \"Maximum close loop voltage gain is %d\" %Acl_max" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Maximum close loop voltage gain is 25\n" + ] + } + ], + "prompt_number": 18 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 3.7, page 80" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "SR=6 #V/micro second\n", + "#Part (i)\n", + "Vm=1 #V\n", + "fm=(SR/10**-6)/(2*math.pi*Vm)/1000 #kHz\n", + "print \"part (i) Maximum frequency, fm is %d kHz\" %fm\n", + "#Part (i)\n", + "Vm=10 #V\n", + "fm=(SR/10**-6)/(2*math.pi*Vm)/1000 #kHz\n", + "print \"part (ii) Maximum frequency, fm is %.1f kHz\" %fm" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "part (i) Maximum frequency, fm is 954 kHz\n", + "part (ii) Maximum frequency, fm is 95.5 kHz\n" + ] + } + ], + "prompt_number": 21 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/sample_notebooks/PadmajaGude/Chapter_2.ipynb b/sample_notebooks/PadmajaGude/Chapter_2.ipynb new file mode 100755 index 00000000..8c187291 --- /dev/null +++ b/sample_notebooks/PadmajaGude/Chapter_2.ipynb @@ -0,0 +1,379 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:e24e8c5532aa0cc5567a0ced227977b5bbd55d1c64a3a566571c73c87a2dff24"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 2 - Distribution System"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 20"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the most economical cross sectional area\n",
+ "import math\n",
+ "#soltion\n",
+ "#given\n",
+ "id=0.15;#interest & depreciation charges\n",
+ "i=260.;#ampere#max current\n",
+ "d=0.173;#ohm#resistance of conductor\n",
+ "cst=.03;#rs# cost of energy per unit\n",
+ "t=(365.*24.)/2.;#time of energy loss\n",
+ "print '%s' %(\"Annual cost of 2 core feeder cable is Rs(90a+10)per meter\\n\");\n",
+ "P3=(2.*i**2.*d*t*cst)/1000.#kWh#annual cost of energy loss\n",
+ "print '%s %.2f %s' %(\"Energy loss per annum= P3/a=\",P3,\"/a\\n\");\n",
+ "P2=90.*1000.*id;#energy lost per annum\n",
+ "print '%s %.2f %s' %(\"Capital cost= P2*a=\",P2,\"*a\\n\");\n",
+ "a=math.sqrt(P3/P2);\n",
+ "print '%s %.2f %s' %(\"Economic cross section of conductor is= math.sqrt(P3/P2)=\",a,\"square cm\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Annual cost of 2 core feeder cable is Rs(90a+10)per meter\n",
+ "\n",
+ "Energy loss per annum= P3/a= 3073.39 /a\n",
+ "\n",
+ "Capital cost= P2*a= 13500.00 *a\n",
+ "\n",
+ "Economic cross section of conductor is= math.sqrt(P3/P2)= 0.48 square cm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 20"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the most economical current density\n",
+ "import math\n",
+ "#soltion\n",
+ "#given\n",
+ "id=0.1;#interest & depreciation charges\n",
+ "d=1.78*10.**-8.;#ohm m#resistivity\n",
+ "R=(d*1000.)/10.**-4.;#ohm#resistance of conductor\n",
+ "cst=.50;#rs# cost of energy per unit\n",
+ "t=(365.*24.);#time of energy loss\n",
+ "lf=.7;#load factor of losses\n",
+ "print '%s' %(\"Annual cost of cable is Rs(2800a+1300)per km\\n\");\n",
+ "print '%s %.2f %s' %(\"Resistance of each conductor=\",R,\"/a\\n\");\n",
+ "P3=(R*t*cst*lf)/1000.;#*I**2#kWh#annual cost of energy loss\n",
+ "print '%s %.2f %s' %(\"Annual cost of energy loss= P3/a=\",P3,\"(*I**2)/a\\n\");\n",
+ "P2=2800.*id;#energy lost per annum\n",
+ "print '%s %.2f %s' %(\"Annual charge on account of intrest and depreciation on variable cost of line= P2*a=\",P2,\"*a\\n\");\n",
+ "J=math.sqrt(P2/P3);#current density I/a\n",
+ "print '%s %.2f %s' %(\"Economic current density of conductor is\",J,\"A/cm square\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Annual cost of cable is Rs(2800a+1300)per km\n",
+ "\n",
+ "Resistance of each conductor= 0.18 /a\n",
+ "\n",
+ "Annual cost of energy loss= P3/a= 0.55 (*I**2)/a\n",
+ "\n",
+ "Annual charge on account of intrest and depreciation on variable cost of line= P2*a= 280.00 *a\n",
+ "\n",
+ "Economic current density of conductor is 22.65 A/cm square\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 25"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the most economical current density and diameter of conductor\n",
+ "import math\n",
+ "#soltion\n",
+ "#given\n",
+ "id=0.1;#interest & depreciation charges\n",
+ "cst=.02;#rs# cost of energy per unit\n",
+ "d=0.173;#ohm#resistance of conductor\n",
+ "pf=.8;#lagging\n",
+ "P=1500.*10.**3.;#Watts#load\n",
+ "V=11000.;#volts#supply voltage\n",
+ "t=200.*8.;#hours\n",
+ "print '%s' %(\"annual cost of 3 core feeder cable is Rs(8000 + 20000 a)per km\\n\");\n",
+ "print '%s %.2f %s' %(\"Resistance of each conductor=\",d,\"/a\\n\");\n",
+ "i=P/(math.sqrt(3.)*V*pf);#ampere\n",
+ "print '%s %.2f %s' %(\"Current in each conductor=\",i,\"A\\n\");\n",
+ "P2=20000.*id;#energy lost per annum\n",
+ "print '%s %.2f %s' %(\"Capital cost= P2*a=\",P2,\"*a\\n\");\n",
+ "P3=(3.*i**2.*d*t*cst)/1000.;#kWh#annual cost of energy loss\n",
+ "print '%s %.2f %s' %(\"Energy loss per annum= P3/a=\",P3,\"/a\\n\");\n",
+ "a=math.sqrt(P3/P2);\n",
+ "print '%s %.2f %s' %(\"Economic cross section of conductor is= math.sqrt(P3/P2)=\",a,\"square cm \\n\");\n",
+ "print '%s %.2f %s' %(\"Diameter of conductor=\",math.sqrt(4*a/math.pi),\"cm\\n\");\n",
+ "print '%s %.2f %s' %(\"Current density=\",i/a,\"A/cm square\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "annual cost of 3 core feeder cable is Rs(8000 + 20000 a)per km\n",
+ "\n",
+ "Resistance of each conductor= 0.17 /a\n",
+ "\n",
+ "Current in each conductor= 98.41 A\n",
+ "\n",
+ "Capital cost= P2*a= 2000.00 *a\n",
+ "\n",
+ "Energy loss per annum= P3/a= 160.85 /a\n",
+ "\n",
+ "Economic cross section of conductor is= math.sqrt(P3/P2)= 0.28 square cm \n",
+ "\n",
+ "Diameter of conductor= 0.60 cm\n",
+ "\n",
+ "Current density= 347.02 A/cm square\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 26"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the most economical cross sectional area\n",
+ "import math\n",
+ "#soltion\n",
+ "#given\n",
+ "id=0.1;#interest & depreciation charges\n",
+ "pf=.8;#lagging\n",
+ "P=10.**6.;#Watts#load\n",
+ "V=11000.;#volts#supply voltage\n",
+ "cst=.15;#rs# cost of energy per unit\n",
+ "d=1.75*10.**-6.;#ohm cm#specific resistance\n",
+ "l=1000.#m#length of the cable\n",
+ "t=3000.;#hours\n",
+ "print '%s' %(\"Annual cost of 2 core feeder cable is Rs(30 + 500a)per meter\\n\");\n",
+ "R=(d*1000.*100.);#ohm#resistance of conductor\n",
+ "print '%s %.2f %s' %(\"Resistance of each conductor=\",R,\"/a\\n\");\n",
+ "i=P/(V*pf);#ampere\n",
+ "print '%s %.2f %s' %(\"Current in each conductor=\",i,\"A\\n\");\n",
+ "P2=500.*10.**3.*id;#energy lost per annum\n",
+ "print '%s %.2f %s' %(\"Capital cost= P2*a=\",P2,\"*a\\n\");\n",
+ "P3=(2.*i**2.*R*t*cst)/1000.;#kWh#annual cost of energy loss\n",
+ "print '%s %.2f %s' %(\"Energy loss per annum= P3/a=\",P3,\"/a\\n\");\n",
+ "a=math.sqrt(P3/P2);\n",
+ "print '%s %.2f %s' %(\"Economic cross section of conductor is= math.sqrt(P3/P2)=\",a,\"square cm \\n\");\n",
+ "print '%s %.2f %s' %(\"Diameter of conductor=\",math.sqrt(4*a/math.pi),\"cm\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Annual cost of 2 core feeder cable is Rs(30 + 500a)per meter\n",
+ "\n",
+ "Resistance of each conductor= 0.18 /a\n",
+ "\n",
+ "Current in each conductor= 113.64 A\n",
+ "\n",
+ "Capital cost= P2*a= 50000.00 *a\n",
+ "\n",
+ "Energy loss per annum= P3/a= 2033.83 /a\n",
+ "\n",
+ "Economic cross section of conductor is= math.sqrt(P3/P2)= 0.20 square cm \n",
+ "\n",
+ "Diameter of conductor= 0.51 cm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 26"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "#Calculate the most economical cross sectional area\n",
+ "import math\n",
+ "#soltion\n",
+ "#given\n",
+ "id=0.1;#interest & depreciation charges\n",
+ "pf=.85;#lagging\n",
+ "Pm=10.**3.;#Watts#Max Demand\n",
+ "Pt=5.*10.**6.#kWh#Toatal energy consumption\n",
+ "V=11000.;#volts#supply voltage\n",
+ "cst=.05;#rs# cost of energy per unit\n",
+ "d=1.72*10.**-6.;#ohm cm#specific resistance\n",
+ "t=(365.*24.);#time of energy loss\n",
+ "print '%s' %(\"Annual cost of cable is Rs(80000a + 20000)per km\\n\");\n",
+ "lf=Pt/(Pm*t)#Annual load factor\n",
+ "print '%s %.2f %s' %(\"Annual load factor=\",lf,\"\\n\");\n",
+ "llf=.25*lf+.75*lf**2.;#Loss load factor\n",
+ "print '%s %.2f %s' %(\"Loss load factor=\",llf,\"\\n\");\n",
+ "i=Pm*1000./(math.sqrt(3.)*V*pf);#ampere\n",
+ "print '%s %.2f %s' %(\"Current in each conductor=\",i,\"A\\n\");\n",
+ "P2=80000.*id;#energy lost per annum\n",
+ "print '%s %.2f %s' %(\"Capital cost= P2*a=\",P2,\"*a*l\\n\");\n",
+ "R=d*100*1000;#ohm\n",
+ "P3=(3.*i**2.*R*t*cst*llf)/1000.;#kWh#annual cost of energy loss\n",
+ "print '%s %.2f %s' %(\"Energy loss per annum= (P3*l)/a=\",P3,\"(*l)/a\\n\");\n",
+ "a=math.sqrt(P3/P2);\n",
+ "print '%s %.2f %s' %(\"Economic cross section of conductor is= math.sqrt(P3/P2)=\",a,\"square cm\\n\");\n",
+ "#THERE IS TYPOGRAPHICAL ERROR IN THE ANS IN BOOK IT IS 0.2404 cm**2\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Annual cost of cable is Rs(80000a + 20000)per km\n",
+ "\n",
+ "Annual load factor= 0.57 \n",
+ "\n",
+ "Loss load factor= 0.39 \n",
+ "\n",
+ "Current in each conductor= 61.75 A\n",
+ "\n",
+ "Capital cost= P2*a= 8000.00 *a*l\n",
+ "\n",
+ "Energy loss per annum= (P3*l)/a= 333.52 (*l)/a\n",
+ "\n",
+ "Economic cross section of conductor is= math.sqrt(P3/P2)= 0.20 square cm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 27"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the most economical cross sectional area\n",
+ "import math\n",
+ "#soltion\n",
+ "#given\n",
+ "id=0.1;#interest & depreciation charges\n",
+ "V=20000.;#volts#supply voltage\n",
+ "d=1.72*10.**-6.;#ohm cm#specific resistance\n",
+ "cst=.6;#rs# cost of energy per unit\n",
+ "p1=1500.#kilowatts\n",
+ "t1=8.#hours\n",
+ "pf1=.8#power factor\n",
+ "p2=1000.#kilowatts\n",
+ "t2=10.#hours\n",
+ "pf2=.9#power factor\n",
+ "p3=100.#kilowatts\n",
+ "t3=6.#hours\n",
+ "pf3=1.#power factor\n",
+ "t=365.#no. of days\n",
+ "i1=p1*1000./(math.sqrt(3.)*V*pf1);#ampere#current at time t1\n",
+ "i2=p2*1000./(math.sqrt(3.)*V*pf2);#ampere#current at time t2\n",
+ "i3=p3*1000./(math.sqrt(3.)*V*pf3);#ampere#current at time t3\n",
+ "R=d*100.*1000.;#ohm\n",
+ "P2=8000.*id;#Loss load factor\n",
+ "print '%s' %(\"Annual cost of cable is Rs(80000a + 20000)per km\\n\");\n",
+ "print '%s %.2f %s' %(\"Capital cost= P2*a=\",P2,\"*a*l\\n\");\n",
+ "P3=(3.*((i1**2.*t1)+(i2**2.*t2)+(i3**2.*t3))*R*t*cst)/1000.;#kWh#annual cost of energy loss\n",
+ "print '%s %.2f %s' %(\"Energy loss per annum= (P3*l)/a=\",P3,\"(*l)/a\\n\");\n",
+ "a=math.sqrt(P3/P2);\n",
+ "print '%s %.2f %s' %(\"Economic cross section of conductor is= math.sqrt(P3/P2)=\",a,\"square cm \\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Annual cost of cable is Rs(80000a + 20000)per km\n",
+ "\n",
+ "Capital cost= P2*a= 800.00 *a*l\n",
+ "\n",
+ "Energy loss per annum= (P3*l)/a= 3816.77 (*l)/a\n",
+ "\n",
+ "Economic cross section of conductor is= math.sqrt(P3/P2)= 2.18 square cm \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/sample_notebooks/PreetiRani/Operational_Amplifiers.ipynb b/sample_notebooks/PreetiRani/Operational_Amplifiers.ipynb new file mode 100755 index 00000000..ffbfbdf3 --- /dev/null +++ b/sample_notebooks/PreetiRani/Operational_Amplifiers.ipynb @@ -0,0 +1,299 @@ +{ + "metadata": { + "name": "Preeti", + "signature": "sha256:b8dcb8af15a997e111f6feb032fec7a056888e6b8b149ec767b2b1cbf63692d5" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 1 : Operational Amplifiers" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Exa 1.1 : page 11" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Given data\n", + "G= -100.0 # Gain\n", + "R1= 2.2 # in kohm\n", + "R1=R1*10**3 # in ohm\n", + "# Formula G=-Rf/R1\n", + "Rf= -G*R1 # ohm\n", + "Rf*= 10**-3 # kohm\n", + "print \"The value of Rf is %d kohm\" %Rf" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The value of Rf is 220 kohm\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Exa 1.2 : page 11" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Given data\n", + "Rf= 200 # in kohm\n", + "R1= 2 # in kohm\n", + "vin=2.5 # in mV\n", + "vin=vin*10**-3 # in volt\n", + "G= -Rf/R1 \n", + "vo= G*vin # in V\n", + "print \"The output voltage is %0.2f volt\" %vo" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The output voltage is -0.25 volt\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Exa 1.3 : page 12" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Given data\n", + "G=-10.0 \n", + "Ri= 100.0 # in kohm\n", + "R1= Ri # in kohm\n", + "R1=R1*10**3 # in ohm\n", + "R1*= 10**-3 # kohm\n", + "# Formula G=-R2/R1\n", + "R2= R1*abs(G) # ohm\n", + "R2*= 10**-3 # Mohm\n", + "print \"Value of R1 is %0.2f kohm\" %R1\n", + "print \"and value of R2 is %0.2f Mohm\" %R2" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Value of R1 is 100.00 kohm\n", + "and value of R2 is 1.00 Mohm\n" + ] + } + ], + "prompt_number": 16 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Exa 1.4 : page 37" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Given data\n", + "R1= 100.0 # in kohm\n", + "R2= 500 # in kohm\n", + "V1= 2.0 # in volt\n", + "Vo= (1+R2/R1)*V1 # in volt\n", + "print \"Output voltage for noninverting amplifier is %0.2f volt\" %Vo" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Output voltage for noninverting amplifier is 12.00 volt\n" + ] + } + ], + "prompt_number": 19 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Exa 1.5 : page 38" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Given data\n", + "Rf= 1 # in Mohm\n", + "Rf=Rf*10**6 #in ohm\n", + "\n", + "# Part(a)\n", + "V1=1.0 #in volt\n", + "V2=2.0 #in volt\n", + "V3=3.0 #in volt\n", + "R1= 500.0 # in kohm\n", + "R1=R1*10**3 #in ohm\n", + "R2= 1 # in Mohm\n", + "R2=R2*10**6 #in ohm\n", + "R3= 1.0 # in Mohm\n", + "R3=R3*10**6 #in ohm\n", + "Vo= -Rf*(V1/R1+V2/R2+V3/R3) # in volt\n", + "print \"(a) Output voltage is %0.2f volt\" %Vo\n", + "\n", + "# Part(b)\n", + "V1=-2.0 #in volt\n", + "V2=3.0 #in volt\n", + "V3=1.0 #in volt\n", + "R1= 200.0 # in kohm\n", + "R1=R1*10**3 #in ohm\n", + "R2= 500.0 # in kohm\n", + "R2=R2*10**3 #in ohm\n", + "R3= 1.0 # in Mohm\n", + "R3=R3*10**6 #in ohm\n", + "Vo= -Rf*(V1/R1+V2/R2+V3/R3) # in volt\n", + "print \"(b) Output voltage is %0.2f volt\" %Vo" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a) Output voltage is -7.00 volt\n", + "(b) Output voltage is 3.00 volt\n" + ] + } + ], + "prompt_number": 22 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Exa 1.6 : page 38" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Given data\n", + "print \"Minimum closed loop voltage gain for R2=0 and R1= 2 kohm is \"\n", + "R2=0 \n", + "R1=2.0 # in kohm\n", + "R1=R1*10**3 # in ohm\n", + "Av_min= (1+R2/R1)\n", + "print Av_min\n", + "\n", + "print \"Maximum closed loop voltage gain for maximum value of R2=100 kohm and R1= 2 kohm is\"\n", + "R2=100 # in kohm\n", + "R1=2 # in kohm\n", + "Av_max= (1+R2/R1)\n", + "print Av_max " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Minimum closed loop voltage gain for R2=0 and R1= 2 kohm is \n", + "1.0\n", + "Maximum closed loop voltage gain for maximum value of R2=100 kohm and R1= 2 kohm is\n", + "51\n" + ] + } + ], + "prompt_number": 26 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Exa 1.7 : page 39" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Given data\n", + "V1= 745 # in \u00b5V\n", + "V2= 740 # in \u00b5V\n", + "V1=V1*10**-6 # in volt\n", + "V2=V2*10**-6 # in volt\n", + "CMRR=80 # in dB\n", + "Av=5*10**5 \n", + "# (i)\n", + "# CMRR in dB= 20*log(Ad/Ac)\n", + "Ad=Av \n", + "Ac= Ad/10**(CMRR/20) \n", + "# (ii)\n", + "Vo= Ad*(V1-V2)+Ac*(V1+V2)/2 \n", + "print \"Output voltage is %0.2f volt\" %Vo" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Output voltage is 2.54 volt\n" + ] + } + ], + "prompt_number": 27 + } + ], + "metadata": {} + } + ] +} diff --git a/sample_notebooks/PriyankaSaini/chapter-1.ipynb b/sample_notebooks/PriyankaSaini/chapter-1.ipynb new file mode 100755 index 00000000..b9e335d0 --- /dev/null +++ b/sample_notebooks/PriyankaSaini/chapter-1.ipynb @@ -0,0 +1,253 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:a1991f0c2ad3cdd162c5a3598633b434636cdfbb3e50ee12bef51cec75158259" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 1 - Differential Amplifiers" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Exa 1.8 - pg:19" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#given data\n", + "BETAac=100 #unitless\n", + "BETAdc=100 #unitless\n", + "VBE3=0.715 #in volts\n", + "VD1=0.715 #in Volts\n", + "VZ=6.2 #in Volts\n", + "VT=25 #in mVolts\n", + "IZt=41 #in mA \n", + "VCC=10 #in Volts\n", + "VEE=-10 #in Volts\n", + "RC1=2.7 #in kohm\n", + "RC=4.7 #in kohm\n", + "#Part (a)\n", + "VB3=VEE+VZ+VD1 #in volts\n", + "VE3=VB3-VBE3\n", + "IE3=(VE3-VEE)/RC1 #in mA\n", + "#As the differential amplifier is symmetrical, ICQ1=IE1=ICQ2=IE2\n", + "IE2=IE3/2 #in mA\n", + "ICQ1=IE2 #in mA\n", + "ICQ2=IE2 #in mA\n", + "IE1=IE2 #in mA\n", + "VCEQ=VCC+VBE3-RC*ICQ1# formula for VCEQ \n", + "print \"Operating point for Q1 and Q2 are : \"\n", + "print \"VCEQ is \",round(VCEQ,2),\" V\"\n", + "print \"ICQ is \",round(ICQ1,2),\" mA\"\n", + "print \"and the operating point for Q3 will be : \"\n", + "VCE3=-VBE3-VE3 #in Volts\n", + "print \"VCE3 is \",round(VCE3,2),\" V\"\n", + "IC3=IE3 #in mA\n", + "print \"IE3 is \",round(IE3,2),\" mA\"\n", + "#Part (b)\n", + "re=(2*VT)/IC3 #in ohm\n", + "Ad=(RC*1000)/re #unitless\n", + "print \"Differential voltage gain is \",round(Ad,2)\n", + "#Part (c)\n", + "Ri=2*BETAac*re #in ohm\n", + "Ri/=1000 # kohm\n", + "print \"Input resistance is \",round(Ri,2),\" kohm\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Operating point for Q1 and Q2 are : \n", + "VCEQ is 5.32 V\n", + "ICQ is 1.15 mA\n", + "and the operating point for Q3 will be : \n", + "VCE3 is 3.08 V\n", + "IE3 is 2.3 mA\n", + "Differential voltage gain is 215.85\n", + "Input resistance is 4.35 kohm\n" + ] + } + ], + "prompt_number": 14 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Exa 1.9 : pg-29" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#given data\n", + "Io=180 #in uA\n", + "Vcc=20 #in Volts\n", + "VBE=0.7 #in Volts\n", + "BETA=120 #unitless\n", + "IR=Io*(1+2/BETA) #in uA\n", + "R=(Vcc-VBE)/(IR*10**-3) #in kohm\n", + "print \"Value of IR is \",round(IR,2),\" uA\"\n", + "print \"Value of R is \",round(R,2),\" kohm\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Value of IR is 180.0 uA\n", + "Value of R is 107.22 kohm\n" + ] + } + ], + "prompt_number": 19 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Exa 1.16 : pg-31" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#given data\n", + "BETAac=100 #unitless\n", + "BETAdc=100 #unitless\n", + "VBEon=0.7 #in volts\n", + "VCC=5 #in volts\n", + "VEE=-5 #in volts\n", + "VT=25 #in mVolts\n", + "R=18.6 #in kohm\n", + "Ad=200 #unitless\n", + "IR=(VCC-VBEon -VEE)/R #in mA\n", + "IC1=IR/2 #in mA\n", + "IC2=IC1 #in mA\n", + "re1=(2*VT)/IR #in ohm\n", + "re2=re1 #in ohm\n", + "RC=Ad*re1*10**-3 #in kohm\n", + "print \"Rc is \",round(RC,2),\" kohm\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Rc is 20.0 kohm\n" + ] + } + ], + "prompt_number": 20 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Exa 1.18 : pg-33" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#given data\n", + "Iload=20 #in uA\n", + "VBE=0.7 #in volts\n", + "VCC=10 #in Volts\n", + "IR=Iload #in mA\n", + "R=(VCC-2*VBE)/(IR*10**-3) #in kohm\n", + "print \"R is \",round(R,2),\" kohm\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "R is 430.0 kohm\n" + ] + } + ], + "prompt_number": 22 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Exa 1.23 : pg-26" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#given data\n", + "Vo=5 #in volts\n", + "BETAac=150 #unitless\n", + "BETAdc=150 #unitless\n", + "VT=25 #in mV\n", + "VCC=10 #in mV\n", + "VD=0.7 #in mV\n", + "R1=2.7 #in kohm\n", + "R2=1.5 #in kohm\n", + "# part (i) #\n", + "# IC1/IC2=exp((VBE1-VBE2)/VT)\n", + "# Writing KVL for the loop\n", + "IR=(VCC-VD)/R1 #in mA\n", + "IC=(IR-VD/R2)/(1+2/BETAac) #in mA\n", + "IC1=IC #in mA\n", + "IC2=IC #in mA\n", + "RC=(VCC-Vo)/IC #in kohm\n", + "print \"IC1 is \",round(IC1,2),\" mA\"\n", + "print \"IC2 is \",round(IC2,2),\" mA\"\n", + "print \"RC is \",round(RC,2),\" kohm\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "IC1 is 2.98 mA\n", + "IC2 is 2.98 mA\n", + "RC is 1.68 kohm\n" + ] + } + ], + "prompt_number": 17 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/sample_notebooks/Raj Kumar/Chapter14.ipynb b/sample_notebooks/Raj Kumar/Chapter14.ipynb new file mode 100755 index 00000000..3837e900 --- /dev/null +++ b/sample_notebooks/Raj Kumar/Chapter14.ipynb @@ -0,0 +1,257 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:887dc8fe96ce5749275f69e533e7f68525ad7b355888b111befa3adaae8219e6" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter14 - Ground wave propagation" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex-14.10.2, pg-356" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "ht=100 #feet\n", + "hr=50 #feet\n", + "d=1.4142*((ht)**1.0/2+(hr)**1.0/2) #miles\n", + "print \"Radio horizon is \", round(d,2),\" miles\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Radio horizon is 106.06 miles\n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex-14.6.2, pg-359" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "f=150 #MHz\n", + "c=3*10**8 #m/s\n", + "GT=1.64 #dB\n", + "PT=20 #W\n", + "d=50 #km\n", + "l=c/(f*10**6) #m\n", + "E=(30*GT*PT)**1.0/2/(d*1000) #V/m\n", + "le=l/math.pi #m\n", + "Voc=E*le #V/m\n", + "Voc*=10**6 #uV\n", + "print \"Open circuit voltage is \",round(Voc,2),\" uV\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Open circuit voltage is 6264.34 uV\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex-14.10.6, pg-364" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "P=35 #W\n", + "ht=45 #m\n", + "hr=25 #m\n", + "f=90 #MHz\n", + "c=3*10**8 #m/s\n", + "d=4.12*((ht)**1.0/2+(hr)**1.0/2) #km\n", + "print \"Distance of line of sight communication is \", round(d,2),\" km\"\n", + "l=c/(f*10**6) #m\n", + "ER=88*(P)**1.0/2*ht*hr/(l*(d*1000)**2) #V/m\n", + "ER*=10**6 #uV/m\n", + "print \"Field strength is \",round(ER,2),\" uV/m\" \n", + "#Answer is wrong in the textbook." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Distance of line of sight communication is 144.2 km\n", + "Field strength is 27.77 uV/m\n" + ] + } + ], + "prompt_number": 14 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex-14.10.5, pg-368" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "ht=100 #m\n", + "d=4.12*(ht)**1.0/2 #km\n", + "print \"Horizon distance is \",round(d,2),\" km\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Horizon distance is 206.0 km\n" + ] + } + ], + "prompt_number": 15 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex-14.6.1(i), pg-372" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "d=36000.0 #km\n", + "f=4000.0 #MHz\n", + "GT=20.0 #dB\n", + "GR=40.0 #dB\n", + "PT=200.0 #W\n", + "PT_dB=10*math.log10(PT) #dB\n", + "Ls=32.44+20*math.log10(f)+20*math.log10(d) #dB\n", + "PR_dB=PT_dB+GT+GR-Ls #dB\n", + "PR=10**(PR_dB/10) #W\n", + "PR*=10**12 # pW\n", + "print \"Received power is \",round(PR,2),\" pW\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Received power is 5.5 pW\n" + ] + } + ], + "prompt_number": 21 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex-14.10.1, pg-375\n" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "ht=100.0 #m\n", + "hr=100 #m\n", + "d=3.57*(ht**1.0/2+hr**1.0/2) #km\n", + "print \"Range of space wave propagation is \",round(d,2),\" km\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Range of space wave propagation is 357.0 km\n" + ] + } + ], + "prompt_number": 22 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex-14.10.4, pg-379" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "ht=100 #m\n", + "d=80 #km\n", + "hr=(d/4.12-ht**1.0/2)**2 #m\n", + "print \"Required height of receiving antenna is \",round(hr,2),\" meter\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Required height of receiving antenna is 935.29 meter\n" + ] + } + ], + "prompt_number": 23 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/sample_notebooks/RaviTeja/Chapter1.ipynb b/sample_notebooks/RaviTeja/Chapter1.ipynb new file mode 100755 index 00000000..e5603984 --- /dev/null +++ b/sample_notebooks/RaviTeja/Chapter1.ipynb @@ -0,0 +1,489 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 1 - Electronic Voltmeters"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1 - pg 1_17"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "required multiplier resistance (kohm) = 4.3\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Chapter-1,Example1_1,pg 1_17\n",
+ "#calculate the required multiplier resistance\n",
+ "import math\n",
+ "#given\n",
+ "Erms=10.\n",
+ "Rm=200\n",
+ "#calculations\n",
+ "Ep=math.sqrt(2)*Erms\n",
+ "Eav=0.6*Ep\n",
+ "E=Eav/2.\n",
+ "Edc=0.45*Erms\n",
+ "Idc=1*10**-3\n",
+ "Rs=(Edc/Idc)-Rm\n",
+ "#results\n",
+ "print\"required multiplier resistance (kohm) = \",Rs/1000."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2 - pg 1_18"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "required multiplier resistance(kohm) = 4.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Chapter-1,Example1_2,pg 1_18\n",
+ "#calculate the required multiplier resistance\n",
+ "#given\n",
+ "Eav=9.\n",
+ "Erms=10.\n",
+ "Rm=500.\n",
+ "Idc=2*10**-3\n",
+ "#calculations\n",
+ "Edc=0.9*Erms\n",
+ "Rs=(Edc/Idc)-Rm\n",
+ "#results\n",
+ "print \"required multiplier resistance(kohm) = \",Rs/1000.\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3 - pg 1_20"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "percentage error = -11.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Chapter-1,Example1_3,pg 1_20\n",
+ "#calculate the percentage error\n",
+ "#given\n",
+ "Kf=1#Erms=Em for 1 time period\n",
+ "Kf1=1.11#Kf(sine)/Kf(square)\n",
+ "#calculations\n",
+ "pere=(Kf-Kf1)/Kf*100.#percentage error\n",
+ "#results\n",
+ "print\"percentage error = \",pere\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4 - pg 1_20"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "percentage error (percent) = 3.87\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Chapter-1,Example1_4,pg 1_20\n",
+ "#calculate the percentage error\n",
+ "import math\n",
+ "import scipy\n",
+ "from scipy import integrate\n",
+ "#given\n",
+ "A=50.\n",
+ "T=2.\n",
+ "Kf2=1.11\n",
+ "#calculations\n",
+ "def f(t):\n",
+ "\tE=(50*t)**2#e=At(ramp function)\n",
+ "\treturn E\n",
+ "\n",
+ "\n",
+ "I=scipy.integrate.quad(f,0,T)\n",
+ "\n",
+ "Erms=math.sqrt((1./T)*I[0])\n",
+ "def f1(t):\n",
+ "\te=50*t#e=At(ramp function)\n",
+ "\treturn e\n",
+ "\n",
+ "\n",
+ "I1=scipy.integrate.quad(f1,0,T)\n",
+ "Eav=(1./T)*I1[0]\n",
+ "Kf=Erms/Eav\n",
+ "kfr=Kf2/Kf #Kf(sine)/Kf(sawtooth)\n",
+ "pere=(1-kfr)/1*100#percentage error\n",
+ "#results\n",
+ "print\"percentage error (percent) = \",round(pere,2)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5 - pg 1_27"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "total meter resistance (ohm) = 6100.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Chapter-1,Example1_5,pg 1_27\n",
+ "#calculate the total meter resistance\n",
+ "#given\n",
+ "Idc=25*10**-3\n",
+ "Erms=200.\n",
+ "Rm=100.\n",
+ "Rf=500.\n",
+ "#calculations\n",
+ "Rd=2*Rf\n",
+ "Rm1=Rm+Rd#total meter resistance\n",
+ "Rs=(0.9*Erms)/Idc-Rm1\n",
+ "#results\n",
+ "print \"total meter resistance (ohm) = \",Rs\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6 - pg 1_38"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "meter current (mA) = 5.99\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Chapter-1,Example1_6,pg 1_38\n",
+ "#calculate the meter current\n",
+ "#given\n",
+ "V1=2.\n",
+ "Rm=50.\n",
+ "Rd=15.*10**3\n",
+ "gm=0.006\n",
+ "rd=100*10**3\n",
+ "#calculations\n",
+ "Im=(gm*rd*Rd/(rd+Rd)*V1)/((2*(rd*Rd/(rd+Rd))+Rm))\n",
+ "#results\n",
+ "print \"meter current (mA) = \",round(Im*1000.,2)\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7 - pg 1_38"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "meter current (mA) = 3.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Chapter-1,Example1_7,pg 1_38\n",
+ "#calculate the meter current\n",
+ "#given\n",
+ "V1=1\n",
+ "Rm=50\n",
+ "Rd=15*10**3\n",
+ "gm=0.006\n",
+ "rd=100*10**3\n",
+ "#calculations\n",
+ "Im=(gm*rd*Rd/(rd+Rd)*V1)/((2*(rd*Rd/(rd+Rd))+Rm))\n",
+ "#results\n",
+ "print \"meter current (mA) = \",round(Im*1000.,1)\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8 - pg 1_39"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "resistance values are\n",
+ "R1 (Mohm) = 8.7\n",
+ "R2 (kohm) = 120.0\n",
+ "R3 (kohm) = 90.0\n",
+ "R4 (kohm) = 90.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Chapter-1,Example1_8,pg 1_39\n",
+ "#calculate the resistance values\n",
+ "#given\n",
+ "V1=1.\n",
+ "Vin=30.\n",
+ "Rin=9.*10**6\n",
+ "#calcuations\n",
+ "R4=Rin/100.#for Vin=100V\n",
+ "R3=(Rin-50*R4)/50#for Vin=50V\n",
+ "R2=(Rin-30*R3-30*R4)/30#for Vin=30V\n",
+ "R1=Rin-R2-R3-R4\n",
+ "#results\n",
+ "print \"resistance values are\"\n",
+ "print \"R1 (Mohm) = \",round(R1/10**6,1)\n",
+ "print \"R2 (kohm) = \",round(R2/10**3,1)\n",
+ "print \"R3 (kohm) = \",round(R3/10**3,1)\n",
+ "print \"R4 (kohm) = \",round(R4/10**3,1)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 9 - pg 1_40"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "current Im (mA) = 0.3896\n",
+ "series resistance (kohm) = 7.042\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Chapter-1,Example1_9,pg 1_40\n",
+ "#calculate the current, series resistance\n",
+ "#given\n",
+ "rd=10*10**3\n",
+ "gm=0.003\n",
+ "Rs=15*10**3\n",
+ "V1=1#input voltage\n",
+ "Rm=1800.\n",
+ "Img=0.1*10**-3#meter current given\n",
+ "#calculations\n",
+ "rdf=rd/(1+gm*rd)#actual rd\n",
+ "Vo=(gm*rdf*Rs)*V1/(rdf+Rs)\n",
+ "Rth=(2*Rs*rdf/(Rs+rdf))\n",
+ "Im=Vo/(Rth+Rm)\n",
+ "Rf=(Vo/Img)-Rth-Rm#series resistance\n",
+ "#results\n",
+ "print \"current Im (mA) = \",round(Im*1000.,4)\n",
+ "print \"series resistance (kohm) = \",round(Rf/10**3,3)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 10 - pg 1_41"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "calibration resistance (kohm) = 18.4\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Chapter-1,Example1_10,pg 1_41\n",
+ "#calculate the calibration resistance\n",
+ "#given\n",
+ "rd=200.*10**3\n",
+ "gm=0.004\n",
+ "Rs=40.*10**3\n",
+ "Rm=1000.\n",
+ "V1=1\n",
+ "#calculations\n",
+ "rdf=rd/(1+gm*rd)#actual rd\n",
+ "Rth=(2*Rs*rdf/(Rs+rdf))\n",
+ "Vo=(gm*rdf*Rs)*V1/(rdf+Rs)\n",
+ "Im=50*10**-6\n",
+ "Rcal=(Vo/Im)-Rth-Rm#calibration resistance\n",
+ "#results\n",
+ "print \"calibration resistance (kohm) = \",round(Rcal/1000.,1)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11 - pg 1_42"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Resistances are \n",
+ "R1(kohm) = 666.67\n",
+ "R2(kohm) = 300.0\n",
+ "R3(kohm) = 23.33\n",
+ "R4(kohm) = 10.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Chapter-1,Example1_11,pg 1_42\n",
+ "#calculate the resistances\n",
+ "#given\n",
+ "Vin=3.\n",
+ "V1=1.\n",
+ "Rin=1.*10**6#input resistance of FET\n",
+ "#calculations\n",
+ "R4=Rin/100.#for Vin=100V\n",
+ "R3=(Rin-30*R4)/30.#for Vin=30V\n",
+ "R2=(Rin-3*R3-3*R4)/3.#for Vin=3V\n",
+ "R1=Rin-R2-R3-R4\n",
+ "#results\n",
+ "print \"Resistances are \"\n",
+ "print \"R1(kohm) = \",round(R1/1000.,2)\n",
+ "print \"R2(kohm) = \",round(R2/1000.,0)\n",
+ "print \"R3(kohm) = \",round(R3/1000.,2)\n",
+ "print \"R4(kohm) = \",round(R4/1000.,0)\n"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.9"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/sample_notebooks/Samiksha Srivastava/Chapter6.ipynb b/sample_notebooks/Samiksha Srivastava/Chapter6.ipynb new file mode 100755 index 00000000..b0cb88b7 --- /dev/null +++ b/sample_notebooks/Samiksha Srivastava/Chapter6.ipynb @@ -0,0 +1,317 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:ac520a54154462ad172aef8bbb865642cb1f987c781ea69ea1084ba6e27e7f6b"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter06: Advanced Optical Systems"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6.5.1:Pg-6.11"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "import math\n",
+ "lamda_p= 980*10**-9 \n",
+ "lamda_s=1550*10**-9 \n",
+ "P_in=30 # in mW....\n",
+ "G=100 \n",
+ "\n",
+ "Ps_max= ((lamda_p*P_in)/lamda_s)/(G-1) \n",
+ "print \" \\nMaximum input power in mW = \",round(Ps_max,5) \n",
+ " \n",
+ "Ps_out= Ps_max + (lamda_p*P_in/lamda_s) \n",
+ "Ps_out= 10*math.log10(Ps_out) \n",
+ "print \" \\n\\nOutput power in dBm = \",round(Ps_out,2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " \n",
+ "Maximum input power in mW = 0.19159\n",
+ " \n",
+ "\n",
+ "Output power in dBm = 12.82\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6.5.2:Pg-6.12"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given\n",
+ "import math\n",
+ "Ps_out= 30.0 # in uW...\n",
+ "Ps_in=1.0 \n",
+ "Noise_power = 0.5 \n",
+ "\n",
+ "G= Ps_out/Ps_in \n",
+ "\n",
+ "G= 10*math.log10(G) \n",
+ "print \" \\nThe Gain EDFA in dB = \",round(G,2) \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " \n",
+ "The Gain EDFA in dB = 14.77\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6.10.1:Pg-6.22"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "import math\n",
+ "P0=200.0 \n",
+ "P1=90.0 \n",
+ "P2=85.0 \n",
+ "P3=6.3 \n",
+ " # All powers in uW...\n",
+ "coupling_ratio= P2/(P1+P2)*100 \n",
+ "print \" \\n\\n Coupling Ratio in % = \",round(coupling_ratio,2) \n",
+ "excess_ratio= 10*math.log10(P0/(P1+P2))\n",
+ "print \" \\n\\n The Excess Ratio in % = \",round(excess_ratio,4) \n",
+ "insertion_loss=10*math.log10(P0/P1) \n",
+ "print \" \\n\\n The Insertion Loss (from Port 0 to Port 1) in dB= \",round(insertion_loss,2) \n",
+ "insertion_loss1=10*math.log10(P0/P2) \n",
+ "print \" \\n\\n The Insertion Loss (from Port 0 to Port 2) in dB= \",round(insertion_loss1,2) \n",
+ "cross_talk=10*math.log10(P3/P0) \n",
+ "print \" \\n\\n The Cross Talk in dB= \",int(cross_talk) \n",
+ "print \" \\n\\n***NOTE: Cross Talk calculated wrognly in book... Value of P3 wrognly taken\" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " \n",
+ "\n",
+ " Coupling Ratio in % = 48.57\n",
+ " \n",
+ "\n",
+ " The Excess Ratio in % = 0.5799\n",
+ " \n",
+ "\n",
+ " The Insertion Loss (from Port 0 to Port 1) in dB= 3.47\n",
+ " \n",
+ "\n",
+ " The Insertion Loss (from Port 0 to Port 2) in dB= 3.72\n",
+ " \n",
+ "\n",
+ " The Cross Talk in dB= -15\n",
+ " \n",
+ "\n",
+ "***NOTE: Cross Talk calculated wrognly in book... Value of P3 wrognly taken\n"
+ ]
+ }
+ ],
+ "prompt_number": 34
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6.10.2:Pg-6.23"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "import math\n",
+ "P0= 300.0 \n",
+ "P1=150.0 \n",
+ "P2=65.0 \n",
+ "P3=8.3*10**-3 \n",
+ " # All powers in uW...\n",
+ "splitting_ratio= P2/(P1+P2)*100 \n",
+ "print \" \\n\\n Splitting Ratio in %= \",round(splitting_ratio,2) \n",
+ "excess_ratio= 10*math.log10(P0/(P1+P2))\n",
+ "print \" \\n\\n The Excess Ratio in dB= \",round(excess_ratio,4)\n",
+ "insertion_loss=10*math.log10(P0/P1) \n",
+ "print \" \\n\\n The Insertion Loss (from Port 0 to Port 1) in dB= \",round(insertion_loss,2) \n",
+ "cross_talk=10*math.log10(P3/P0) \n",
+ "print \" \\n\\n The Cross Talk in dB= \",round(cross_talk,2) \n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " \n",
+ "\n",
+ " Splitting Ratio in %= 30.23\n",
+ " \n",
+ "\n",
+ " The Excess Ratio in dB= 1.4468\n",
+ " \n",
+ "\n",
+ " The Insertion Loss (from Port 0 to Port 1) in dB= 3.01\n",
+ " \n",
+ "\n",
+ " The Cross Talk in dB= -45.58\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6.10.3:Pg-6.25"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "import math\n",
+ "N=32.0 \n",
+ "Ft=(100-5)/100.0 \n",
+ "Total_loss= 10*(1-3.322*math.log10(Ft))*math.log10(N) \n",
+ "print \" The total loss in the coupler in dB = \",round(Total_loss,2) \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The total loss in the coupler in dB = 16.17\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6.10.4:Pg-6.28"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "N=10 \n",
+ "L=0.5 \n",
+ "alpha=0.4 \n",
+ "Lthru=0.9 \n",
+ "Lc=1 \n",
+ "Ltap=10 \n",
+ "Li=0.5 \n",
+ "Total_loss= N*(alpha*L +2*Lc +Lthru+Li)-(alpha*L)-(2*Lthru)+(2*Ltap) \n",
+ "print \" The total loss in the coupler in dB = \",int(Total_loss)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The total loss in the coupler in dB = 54\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6.11.1:Pg-6.33"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "del_v=10*10**9 \n",
+ "N_eff= 1.5 \n",
+ "c=3*10**11 # speed of light in mm/sec\n",
+ "del_L= c/(2*N_eff*del_v) \n",
+ "print \" The wave guide length differenc in mm= \",int(del_L) \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The wave guide length differenc in mm= 10\n"
+ ]
+ }
+ ],
+ "prompt_number": 33
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/sample_notebooks/SayanDas Karmakar/Chapter_4.ipynb b/sample_notebooks/SayanDas Karmakar/Chapter_4.ipynb new file mode 100755 index 00000000..09f41e0f --- /dev/null +++ b/sample_notebooks/SayanDas Karmakar/Chapter_4.ipynb @@ -0,0 +1,339 @@ +{ + "metadata": { + "celltoolbar": "Raw Cell Format", + "name": "", + "signature": "sha256:61bd0df995c71f463ddf51b756707a8ae69406d81e9ac36b5c0b23d29319f2ab" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 4: Cotrol System Components" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.1 Page No. 61" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "print(\"Given \\n a)Excitation voltage(Ein)=2V \\n b) Setting Ratio(a)= 0.4 \\n\")\n", + "Ein=2;\n", + "print \"Ein=\", Ein\n", + "a=0.4;\n", + "print \"a=\",a\n", + "Rt=10**3;\n", + "print \"Rt=\",Rt\n", + "Rl=5*10**3;\n", + "print \"Rl=\",Rl\n", + "print \"Eo = (a*Ein)/(1+(a*(1-a)*Rt)/Rl)\" ;\n", + "Eo = (a*Ein)/(1+(a*(1-a)*Rt)/Rl);\n", + "print \"output voltage(E0)=\",round(Eo,3)\n", + "print \"e=((a**2)*(1-a))/((a*(1-a))+(Rl/Rt)) \"\n", + "e=((a**2)*(1-a))/((a*(1-a))+(Rl/Rt));\n", + "print \"loading error=\",round(e,4)\n", + "print \"E= Ein*e \"\n", + "E=Ein*e; #Voltage error=Excitation voltage(Ein)*Loading error(e)\n", + "print \"Voltage error=\",round(E,4),\"V\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Given \n", + " a)Excitation voltage(Ein)=2V \n", + " b) Setting Ratio(a)= 0.4 \n", + "\n", + "Ein= 2\n", + "a= 0.4\n", + "Rt= 1000\n", + "Rl= 5000\n", + "Eo = (a*Ein)/(1+(a*(1-a)*Rt)/Rl)\n", + "output voltage(E0)= 0.763\n", + "e=((a**2)*(1-a))/((a*(1-a))+(Rl/Rt)) \n", + "loading error= 0.0183\n", + "E= Ein*e \n", + "Voltage error= 0.0366 V\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.2 Page No. 62" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "print \"Helical turn \"\n", + "n=5; #Helical turn\n", + "print \"n=\",n \n", + "print \"\\n Winding Turn \"\n", + "N=9000; #Winding Turn\n", + "print \"N=\",N\n", + "print \"\\n Potentiometer Resistance \"\n", + "R=10000; #Potentiometer Resistance\n", + "print \"R=\",R\n", + "print \"\\n Input voltage \"\n", + "Ein=90; #Input voltage\n", + "print \"Ein=\",Ein\n", + "print \"\\n Resistance at mid point \"\n", + "r=5050; #Resistance at mid point \n", + "print \"r=\",r\n", + "print \"\\n Deviation from nominal at mid-point \"\n", + "D=r-5000; #Deviation from nominal at mid-point\n", + "print \"D=\",D\n", + "print \"\\n Linearity \"\n", + "L=D/R*100; #Linearity\n", + "print \"L=\",L\n", + "print \"\\n Resolution \"\n", + "R=Ein/N; #Resolution\n", + "print \"R=\",R\n", + "print \"\\n Potentiometer Constant \"\n", + "Kp=Ein/(2*math.pi*n); #Potentiometer Constant\n", + "print \"Kp=\",round(Kp,3),\"V/rad\"\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Helical turn \n", + "n= 5\n", + "\n", + " Winding Turn \n", + "N= 9000\n", + "\n", + " Potentiometer Resistance \n", + "R= 10000\n", + "\n", + " Input voltage \n", + "Ein= 90\n", + "\n", + " Resistance at mid point \n", + "r= 5050\n", + "\n", + " Deviation from nominal at mid-point \n", + "D= 50\n", + "\n", + " Linearity \n", + "L= 0\n", + "\n", + " Resolution \n", + "R= 0\n", + "\n", + " Potentiometer Constant \n", + "Kp= 2.865 V/rad\n" + ] + } + ], + "prompt_number": 16 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.3 Page No. 65" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "\n", + "print \"Since S2 is the referance stator winding , Es2=KVcos(theta) \\n where Es2 & Er are rms voltages \\n\"\n", + "k=1\n", + "Theta=60;\n", + "print \"Theta=\",Theta\n", + "V=28;\n", + "print \"V(applied)=\",V,\"V\"\n", + "print \"Es2=V*cos(Theta) \\n\"\n", + "Es2=k*V*cos(Theta*(math.pi/180));\n", + "print \"Es2=\",Es2,\"V\"\n", + "print \"Es1=k*V*cos(Theta-120)\\n\"\n", + "Es1=k*V*cos((Theta-120)*(math.pi/180)); # Given Theta=60 in degrees\n", + "print \"Es1=\",Es1,\"V\"\n", + "print \"Es3=k*V*cos(Theta+120) \\n\"\n", + "Es3=k*V*cos((Theta+120)*(math.pi/180));\n", + "print \"Es3=\",Es3,\"V\"\n", + "print \"Es31=sqrt(3)*k*Er*sin(Theta)\"\n", + "Es31=sqrt(3)*k*V*sin(Theta*(math.pi/180));\n", + "print \"Es31=\",Es31,\"V\"\n", + "print \"Es12=sqrt(3)*k*Er*sin((Theta-120)\"\n", + "Es12=sqrt(3)*k*V*sin((Theta-120)*(math.pi/180));\n", + "print \"Es12=\",Es12,\"V\"\n", + "print \"Es23=sqrt(3)*k*Er*sin((Theta+120)\"\n", + "Es23=sqrt(3)*k*V*sin((Theta+120)*(math.pi/180));\n", + "print \"Es23=\",round(Es23,1),\"V\"\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Since S2 is the referance stator winding , Es2=KVcos(theta) \n", + " where Es2 & Er are rms voltages \n", + "\n", + "Theta= 60\n", + "V(applied)= 28\n", + "Es2=V*cos(Theta) \n", + "\n", + "Es2= 14.0 V\n", + "Es1=k*V*cos(Theta-120)\n", + "\n", + "Es1= 14.0 V\n", + "Es3=k*V*cos(Theta+120) \n", + "\n", + "Es3= -28.0 V\n", + "Es31=sqrt(3)*k*Er*sin(Theta)\n", + "Es31= 42.0 V\n", + "Es12=sqrt(3)*k*Er*sin((Theta-120)\n", + "Es12= -42.0 V\n", + "Es23=sqrt(3)*k*Er*sin((Theta+120)\n", + "Es23= 0.0 V\n" + ] + } + ], + "prompt_number": 21 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.4 Page No. 67" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "print \"Sensitivity = 5v/1000rpm \\n\"\n", + "Vg=5;\n", + "print \"Vg=\",Vg,\"\\n\"\n", + "print \"w(in radians/sec)=(1000/60)*2* pi \\n\"\n", + "w=(1000/60)*2*math.pi;\n", + "print \"w=\",round(w,6),\"radians/sec\",\"\\n\"\n", + "print \"Kt=Vg/w \\n\"\n", + "Kt=Vg/w;\n", + "print \"Gain constant(Kt)=\",round(Kt,4),\"V/rad/sec\" # Answer given in textbook is after taking appoximation." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Sensitivity = 5v/1000rpm \n", + "\n", + "Vg= 5 \n", + "\n", + "w(in radians/sec)=(1000/60)*2* pi \n", + "\n", + "w= 100.530965 radians/sec \n", + "\n", + "Kt=Vg/w \n", + "\n", + "Gain constant(Kt)= 0.0497 V/rad/sec\n" + ] + } + ], + "prompt_number": 34 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.5 Page No. 80" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "print \"Torque = KmVm = 2 \\n\"\n", + "t=2;\n", + "print \"Torque(t) = \",t,\"\\n\"\n", + "Fm=0.2;\n", + "print \"Coefficient of Viscous friction(Fm)=\",Fm,\"\\n\"\n", + "N=4\n", + "I=0.2\n", + "F1=0.05\n", + "print \"Wnl = t/Fm \\n\"\n", + "Wnl = t/Fm;\n", + "print \"No Load Speed(Wnl) = \",Wnl,\"rad/sec \\n\"\n", + "print \"Fwt = I+(N^2*F1) \\n\"\n", + "Fwt = I+(N**2*F1);\n", + "print \"Total Viscous Friction(Fwt) = \",Fwt,\"lb ft sec\\n\"\n", + "print \"Te = t-(Fwt*w) \\n\"\n", + "Te=0.8 #load\n", + "w=(t-Te)/Fwt;\n", + "print \"Speed of Motor(w) = \",w,\"rad/sec \\n\"\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Torque = KmVm = 2 \n", + "\n", + "Torque(t) = 2 \n", + "\n", + "Coefficient of Viscous friction(Fm)= 0.2 \n", + "\n", + "Wnl = t/Fm \n", + "\n", + "No Load Speed(Wnl) = 10.0 rad/sec \n", + "\n", + "Fwt = I+(N^2*F1) \n", + "\n", + "Total Viscous Friction(Fwt) = 1.0 lb ft sec\n", + "\n", + "Te = t-(Fwt*w) \n", + "\n", + "Speed of Motor(w) = 1.2 rad/sec \n", + "\n" + ] + } + ], + "prompt_number": 2 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/sample_notebooks/TestUser/chapter1.ipynb b/sample_notebooks/TestUser/chapter1.ipynb new file mode 100755 index 00000000..cf45a409 --- /dev/null +++ b/sample_notebooks/TestUser/chapter1.ipynb @@ -0,0 +1,423 @@ +{ + "metadata": { + "name": "" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 1: Tension Comprssion and Shear" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.1, page no. 9" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\"\"\"\n", + "Find compressive stress and strain in the post\n", + "\"\"\"\n", + "\n", + "import math\n", + "\n", + "#initialisation\n", + "\n", + "d_1 = 4 # inner diameter (inch)\n", + "d_2 = 4.5 #outer diameter (inch)\n", + "P = 26000 # pressure in pound\n", + "L = 16 # Length of cylinder (inch)\n", + "my_del = 0.012 # shortening of post (inch)\n", + "\n", + "#calculation\n", + "A = (math.pi/4)*((d_2**2)-(d_1**2)) #Area (inch^2)\n", + "s = P/A # stress\n", + "\n", + "print \"compressive stress in the post is \", round(s), \"psi\"\n", + "\n", + "e = my_del/L # strain\n", + "\n", + "print \"compressive strain in the post is %e\" %e" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "compressive stress in the post is 7789.0 psi\n", + "compressive strain in the post is 7.500000e-04\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.2, page no. 10" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\"\"\"\n", + "formula for maximum stress & calculating maximum stress\n", + "\"\"\"\n", + "\n", + "import math \n", + "\n", + "#initialisation\n", + "W = 1500 # weight (Newton)\n", + "d = 0.008 #diameter(meter) \n", + "g = 77000 # Weight density of steel\n", + "L = 40 # Length of bar (m)\n", + "\n", + "#calculation\n", + "\n", + "A = (math.pi/4)*(d**2) # Area\n", + "s_max = (1500/A) + (g*L) # maximum stress\n", + "\n", + "#result\n", + "print \"Therefore the maximum stress in the rod is \", round(s_max,1), \"Pa\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Therefore the maximum stress in the rod is 32921551.8 Pa\n" + ] + } + ], + "prompt_number": 16 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.3. page no. 26" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\"\"\"\n", + "calculating change in lenght of pipe, strain in pipe, increase in diameter & increase in wall thickness\n", + "\"\"\"\n", + "\n", + "import math \n", + "\n", + "#initialisation\n", + "d1 = 4.5 # diameter in inch\n", + "d2 = 6 # diameter in inch\n", + "A = (math.pi/4)*((d2**2)-(d1**2)) # Area\n", + "P = 140 # pressure in K\n", + "s = -P/A # stress (compression)\n", + "E = 30000 # young's modulus in Ksi\n", + "e = s/E # strain\n", + "\n", + "#calculation\n", + "\n", + "# Part (a)\n", + "my_del = e*4*12 # del = e*L \n", + "print \"Change in length of the pipe is\", round(my_del,3), \"inch\"\n", + "\n", + "# Part (b)\n", + "v = 0.30 # Poissio's ratio\n", + "e_ = -(v*e)\n", + "print \"Lateral strain in the pipe is %e\" %e_\n", + "\n", + "# Part (c)\n", + "del_d2 = e_*d2 \n", + "del_d1 = e_*d1\n", + "print \"Increase in the inner diameter is \", round(del_d1,6), \"inch\"\n", + "\n", + "# Part (d)\n", + "t = 0.75\n", + "del_t = e_*t\n", + "print \"Increase in the wall thicness is %f\" %del_t, \"inch\"\n", + "del_t1 = (del_d2-del_d1)/2 \n", + "print \"del_t1 = del_t\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Change in length of the pipe is -0.018 inch\n", + "Lateral strain in the pipe is 1.131768e-04\n", + "Increase in the inner diameter is 0.000509 inch\n", + "Increase in the wall thicness is 0.000085 inch\n", + "del_t1 = del_t\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.4, page no. 35" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\"\"\"\n", + "calculate average shear stress and compressive stress\n", + "\"\"\"\n", + "\n", + "import math \n", + "\n", + "#initialisation\n", + "d = 0.02 # diameter in m\n", + "t = 0.008 # thickness in m\n", + "A = math.pi*d*t # shear area\n", + "P = 110000 # prassure in Newton\n", + "\n", + "#calculation\n", + "A1 = (math.pi/4)*(d**2) # Punch area\n", + "t_aver = P/A # Average shear stress \n", + "\n", + "\n", + "print \"Average shear stress in the plate is \", t_aver, \"Pa\"\n", + "s_c = P/A1 # compressive stress\n", + "print \"Average compressive stress in the plate is \", s_c, \"Pa\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Average shear stress in the plate is 218838046.751 Pa\n", + "Average compressive stress in the plate is 350140874.802 Pa\n" + ] + } + ], + "prompt_number": 37 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Eample 1.5, page no. 36" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\"\"\"\n", + "calculate bearing stress, shear stress in pin,\n", + "bearing stress between pin and gussets,\n", + "shear stress in anchor bolts\n", + "\"\"\"\n", + "\n", + "import math \n", + "\n", + "#initialisation\n", + "\n", + "P = 12.0 # Pressure in K\n", + "t = 0.375 # thickness of wall in inch\n", + "theta = 40.0 # angle in degree\n", + "d_pin = 0.75 # diameter of pin in inch\n", + "t_G = 0.625 # thickness of gusset in inch\n", + "t_B = 0.375 #thickness of base plate in inch\n", + "d_b = 0.50 # diameter of bolt in inch\n", + "\n", + "#calculation\n", + "\n", + "#Part (a)\n", + "s_b1 = P/(2*t*d_pin) # bearing stress\n", + "print \"Bearing stress between strut and pin\", round(s_b1,1), \"ksi\"\n", + "\n", + "#Part (b)\n", + "t_pin = (4*P)/(2*math.pi*(d_pin**2)) # average shear stress in the \n", + "print \"Shear stress in pin is \", round(t_pin,1), \"ksi\"\n", + "\n", + "# Part (c)\n", + "s_b2 = P/(2*t_G*d_pin) # bearing stress between pin and gusset\n", + "print \"Bearing stress between pin and gussets is\", s_b2, \"ksi\"\n", + "\n", + "# Part (d)\n", + "s_b3 = (P*math.cos(math.radians(40))/(4*t_B*d_b)) # bearing stress between anchor bolt and base plate\n", + "print \"Bearing stress between anchor bolts & base plate\", round(s_b3,1), \"ksi\"\n", + "\n", + "# Part (e)\n", + "t_bolt = (4*math.cos(math.radians(40))*P)/(4*math.pi*(d_b**2)) # shear stress in anchor bolt\n", + "print \"Shear stress in anchor bolts is\", round(t_bolt,1), \"ksi\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Bearing stress between strut and pin 21.3 ksi\n", + "Shear stress in pin is 13.6 ksi\n", + "Bearing stress between pin and gussets is 12.8 ksi\n", + "Bearing stress between anchor bolts & base plate 12.3 ksi\n", + "Shear stress in anchor bolts is 11.7 ksi\n" + ] + } + ], + "prompt_number": 39 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.7, page no. 42" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\"\"\"\n", + "determine stress at various parts\n", + "\"\"\"\n", + "\n", + "import math\n", + "\n", + "#initialisation\n", + "b1 = 1.5 # width of recmath.tangular crosssection in inch\n", + "t = 0.5 # thickness of recmath.tangular crosssection in inch\n", + "b2 = 3.0 # width of enlarged recmath.tangular crosssection in inch\n", + "d = 1.0 # diameter in inch\n", + "\n", + "#calculation\n", + "\n", + "# Part (a)\n", + "s_1 = 16000 # maximum allowable tensile stress in Psi\n", + "P_1 = s_1*t*b1 \n", + "print \"The allowable load P1 is\", P_1, \"lb\"\n", + "\n", + "# Part (b)\n", + "s_2 = 11000 # maximum allowable tensile stress in Psi\n", + "P_2 = s_2*t*(b2-d) \n", + "print \"allowable load P2 at this section is\", P_2, \"lb\"\n", + "\n", + "#Part (c)\n", + "s_3 = 26000 # maximum allowable tensile stress in Psi\n", + "P_3 = s_3*t*d \n", + "print \"The allowable load based upon bearing between the hanger and the bolt is\", P_3, \"lb\"\n", + "\n", + "# Part (d)\n", + "s_4 = 6500 # maximum allowable tensile stress in Psi\n", + "P_4 = (math.pi/4)*(d**2)*2*s_4 \n", + "print \"the allowable load P4 based upon shear in the bolt is\", round(P_4), \"lb\"\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The allowable load P1 is 12000.0 lb\n", + "allowable load P2 at this section is 11000.0 lb\n", + "The allowable load based upon bearing between the hanger and the bolt is 13000.0 lb\n", + "the allowable load P4 based upon shear in the bolt is 10210.0 lb\n" + ] + } + ], + "prompt_number": 42 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.8, page no. 46" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\"\"\"\n", + "calculating the cross sectional area \n", + "\"\"\"\n", + "\n", + "import math \n", + "\n", + "#initialisation\n", + "R_ah = (2700*0.8 + 2700*2.6)/2 # Horizontal component at A in N\n", + "R_ch = R_ah # Horizontal component at C in N\n", + "R_cv = (2700*2.2 + 2700*0.4)/3 # vertical component at C in N\n", + "R_av = 2700 + 2700 - R_cv # vertical component at A in N\n", + "R_a = math.sqrt((R_ah**2)+(R_av**2))\n", + "R_c = math.sqrt((R_ch**2)+(R_cv**2))\n", + "Fab = R_a # Tensile force in bar AB\n", + "Vc = R_c # Shear force acting on the pin at C\n", + "s_allow = 125000000 # allowable stress in tension \n", + "t_allow = 45000000 # allowable stress in shear\n", + "\n", + "#calculation\n", + "Aab = Fab / s_allow # required area of bar \n", + "Apin = Vc / (2*t_allow) # required area of pin\n", + "\n", + "\n", + "print \"Required area of bar is %f\" %Apin, \"m^2\"\n", + "d = math.sqrt((4*Apin)/math.pi) # diameter in meter\n", + "print \"Required diameter of pin is %f\" %d, \"m\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Required area of bar is 0.000057 m^2\n", + "Required diameter of pin is 0.008537 m\n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [], + "language": "python", + "metadata": {}, + "outputs": [] + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/sample_notebooks/TestUser/chapter1_1.ipynb b/sample_notebooks/TestUser/chapter1_1.ipynb new file mode 100755 index 00000000..cf45a409 --- /dev/null +++ b/sample_notebooks/TestUser/chapter1_1.ipynb @@ -0,0 +1,423 @@ +{ + "metadata": { + "name": "" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 1: Tension Comprssion and Shear" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.1, page no. 9" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\"\"\"\n", + "Find compressive stress and strain in the post\n", + "\"\"\"\n", + "\n", + "import math\n", + "\n", + "#initialisation\n", + "\n", + "d_1 = 4 # inner diameter (inch)\n", + "d_2 = 4.5 #outer diameter (inch)\n", + "P = 26000 # pressure in pound\n", + "L = 16 # Length of cylinder (inch)\n", + "my_del = 0.012 # shortening of post (inch)\n", + "\n", + "#calculation\n", + "A = (math.pi/4)*((d_2**2)-(d_1**2)) #Area (inch^2)\n", + "s = P/A # stress\n", + "\n", + "print \"compressive stress in the post is \", round(s), \"psi\"\n", + "\n", + "e = my_del/L # strain\n", + "\n", + "print \"compressive strain in the post is %e\" %e" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "compressive stress in the post is 7789.0 psi\n", + "compressive strain in the post is 7.500000e-04\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.2, page no. 10" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\"\"\"\n", + "formula for maximum stress & calculating maximum stress\n", + "\"\"\"\n", + "\n", + "import math \n", + "\n", + "#initialisation\n", + "W = 1500 # weight (Newton)\n", + "d = 0.008 #diameter(meter) \n", + "g = 77000 # Weight density of steel\n", + "L = 40 # Length of bar (m)\n", + "\n", + "#calculation\n", + "\n", + "A = (math.pi/4)*(d**2) # Area\n", + "s_max = (1500/A) + (g*L) # maximum stress\n", + "\n", + "#result\n", + "print \"Therefore the maximum stress in the rod is \", round(s_max,1), \"Pa\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Therefore the maximum stress in the rod is 32921551.8 Pa\n" + ] + } + ], + "prompt_number": 16 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.3. page no. 26" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\"\"\"\n", + "calculating change in lenght of pipe, strain in pipe, increase in diameter & increase in wall thickness\n", + "\"\"\"\n", + "\n", + "import math \n", + "\n", + "#initialisation\n", + "d1 = 4.5 # diameter in inch\n", + "d2 = 6 # diameter in inch\n", + "A = (math.pi/4)*((d2**2)-(d1**2)) # Area\n", + "P = 140 # pressure in K\n", + "s = -P/A # stress (compression)\n", + "E = 30000 # young's modulus in Ksi\n", + "e = s/E # strain\n", + "\n", + "#calculation\n", + "\n", + "# Part (a)\n", + "my_del = e*4*12 # del = e*L \n", + "print \"Change in length of the pipe is\", round(my_del,3), \"inch\"\n", + "\n", + "# Part (b)\n", + "v = 0.30 # Poissio's ratio\n", + "e_ = -(v*e)\n", + "print \"Lateral strain in the pipe is %e\" %e_\n", + "\n", + "# Part (c)\n", + "del_d2 = e_*d2 \n", + "del_d1 = e_*d1\n", + "print \"Increase in the inner diameter is \", round(del_d1,6), \"inch\"\n", + "\n", + "# Part (d)\n", + "t = 0.75\n", + "del_t = e_*t\n", + "print \"Increase in the wall thicness is %f\" %del_t, \"inch\"\n", + "del_t1 = (del_d2-del_d1)/2 \n", + "print \"del_t1 = del_t\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Change in length of the pipe is -0.018 inch\n", + "Lateral strain in the pipe is 1.131768e-04\n", + "Increase in the inner diameter is 0.000509 inch\n", + "Increase in the wall thicness is 0.000085 inch\n", + "del_t1 = del_t\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.4, page no. 35" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\"\"\"\n", + "calculate average shear stress and compressive stress\n", + "\"\"\"\n", + "\n", + "import math \n", + "\n", + "#initialisation\n", + "d = 0.02 # diameter in m\n", + "t = 0.008 # thickness in m\n", + "A = math.pi*d*t # shear area\n", + "P = 110000 # prassure in Newton\n", + "\n", + "#calculation\n", + "A1 = (math.pi/4)*(d**2) # Punch area\n", + "t_aver = P/A # Average shear stress \n", + "\n", + "\n", + "print \"Average shear stress in the plate is \", t_aver, \"Pa\"\n", + "s_c = P/A1 # compressive stress\n", + "print \"Average compressive stress in the plate is \", s_c, \"Pa\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Average shear stress in the plate is 218838046.751 Pa\n", + "Average compressive stress in the plate is 350140874.802 Pa\n" + ] + } + ], + "prompt_number": 37 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Eample 1.5, page no. 36" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\"\"\"\n", + "calculate bearing stress, shear stress in pin,\n", + "bearing stress between pin and gussets,\n", + "shear stress in anchor bolts\n", + "\"\"\"\n", + "\n", + "import math \n", + "\n", + "#initialisation\n", + "\n", + "P = 12.0 # Pressure in K\n", + "t = 0.375 # thickness of wall in inch\n", + "theta = 40.0 # angle in degree\n", + "d_pin = 0.75 # diameter of pin in inch\n", + "t_G = 0.625 # thickness of gusset in inch\n", + "t_B = 0.375 #thickness of base plate in inch\n", + "d_b = 0.50 # diameter of bolt in inch\n", + "\n", + "#calculation\n", + "\n", + "#Part (a)\n", + "s_b1 = P/(2*t*d_pin) # bearing stress\n", + "print \"Bearing stress between strut and pin\", round(s_b1,1), \"ksi\"\n", + "\n", + "#Part (b)\n", + "t_pin = (4*P)/(2*math.pi*(d_pin**2)) # average shear stress in the \n", + "print \"Shear stress in pin is \", round(t_pin,1), \"ksi\"\n", + "\n", + "# Part (c)\n", + "s_b2 = P/(2*t_G*d_pin) # bearing stress between pin and gusset\n", + "print \"Bearing stress between pin and gussets is\", s_b2, \"ksi\"\n", + "\n", + "# Part (d)\n", + "s_b3 = (P*math.cos(math.radians(40))/(4*t_B*d_b)) # bearing stress between anchor bolt and base plate\n", + "print \"Bearing stress between anchor bolts & base plate\", round(s_b3,1), \"ksi\"\n", + "\n", + "# Part (e)\n", + "t_bolt = (4*math.cos(math.radians(40))*P)/(4*math.pi*(d_b**2)) # shear stress in anchor bolt\n", + "print \"Shear stress in anchor bolts is\", round(t_bolt,1), \"ksi\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Bearing stress between strut and pin 21.3 ksi\n", + "Shear stress in pin is 13.6 ksi\n", + "Bearing stress between pin and gussets is 12.8 ksi\n", + "Bearing stress between anchor bolts & base plate 12.3 ksi\n", + "Shear stress in anchor bolts is 11.7 ksi\n" + ] + } + ], + "prompt_number": 39 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.7, page no. 42" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\"\"\"\n", + "determine stress at various parts\n", + "\"\"\"\n", + "\n", + "import math\n", + "\n", + "#initialisation\n", + "b1 = 1.5 # width of recmath.tangular crosssection in inch\n", + "t = 0.5 # thickness of recmath.tangular crosssection in inch\n", + "b2 = 3.0 # width of enlarged recmath.tangular crosssection in inch\n", + "d = 1.0 # diameter in inch\n", + "\n", + "#calculation\n", + "\n", + "# Part (a)\n", + "s_1 = 16000 # maximum allowable tensile stress in Psi\n", + "P_1 = s_1*t*b1 \n", + "print \"The allowable load P1 is\", P_1, \"lb\"\n", + "\n", + "# Part (b)\n", + "s_2 = 11000 # maximum allowable tensile stress in Psi\n", + "P_2 = s_2*t*(b2-d) \n", + "print \"allowable load P2 at this section is\", P_2, \"lb\"\n", + "\n", + "#Part (c)\n", + "s_3 = 26000 # maximum allowable tensile stress in Psi\n", + "P_3 = s_3*t*d \n", + "print \"The allowable load based upon bearing between the hanger and the bolt is\", P_3, \"lb\"\n", + "\n", + "# Part (d)\n", + "s_4 = 6500 # maximum allowable tensile stress in Psi\n", + "P_4 = (math.pi/4)*(d**2)*2*s_4 \n", + "print \"the allowable load P4 based upon shear in the bolt is\", round(P_4), \"lb\"\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The allowable load P1 is 12000.0 lb\n", + "allowable load P2 at this section is 11000.0 lb\n", + "The allowable load based upon bearing between the hanger and the bolt is 13000.0 lb\n", + "the allowable load P4 based upon shear in the bolt is 10210.0 lb\n" + ] + } + ], + "prompt_number": 42 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.8, page no. 46" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\"\"\"\n", + "calculating the cross sectional area \n", + "\"\"\"\n", + "\n", + "import math \n", + "\n", + "#initialisation\n", + "R_ah = (2700*0.8 + 2700*2.6)/2 # Horizontal component at A in N\n", + "R_ch = R_ah # Horizontal component at C in N\n", + "R_cv = (2700*2.2 + 2700*0.4)/3 # vertical component at C in N\n", + "R_av = 2700 + 2700 - R_cv # vertical component at A in N\n", + "R_a = math.sqrt((R_ah**2)+(R_av**2))\n", + "R_c = math.sqrt((R_ch**2)+(R_cv**2))\n", + "Fab = R_a # Tensile force in bar AB\n", + "Vc = R_c # Shear force acting on the pin at C\n", + "s_allow = 125000000 # allowable stress in tension \n", + "t_allow = 45000000 # allowable stress in shear\n", + "\n", + "#calculation\n", + "Aab = Fab / s_allow # required area of bar \n", + "Apin = Vc / (2*t_allow) # required area of pin\n", + "\n", + "\n", + "print \"Required area of bar is %f\" %Apin, \"m^2\"\n", + "d = math.sqrt((4*Apin)/math.pi) # diameter in meter\n", + "print \"Required diameter of pin is %f\" %d, \"m\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Required area of bar is 0.000057 m^2\n", + "Required diameter of pin is 0.008537 m\n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [], + "language": "python", + "metadata": {}, + "outputs": [] + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/sample_notebooks/TestUser/chapter5.ipynb b/sample_notebooks/TestUser/chapter5.ipynb new file mode 100755 index 00000000..9042fcb6 --- /dev/null +++ b/sample_notebooks/TestUser/chapter5.ipynb @@ -0,0 +1,800 @@ +{ + "metadata": { + "name": "" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 5: Stresses in Beams Basic Topics" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.1, page no. 307" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\"\"\"\n", + "calculate radius of curvature, curvature & deflection of beam\n", + "\"\"\"\n", + "\n", + "import math\n", + "import numpy\n", + "\n", + "#initialisation\n", + "\n", + "L = 8.0 # length of beam in ft\n", + "h = 6.0 # Height of beam in inch\n", + "e = 0.00125 # elongation on the bottom surface of the beam\n", + "y = -3.0 # Dismath.tance of the bottom surface to the neutral surface of the beam in inch\n", + "\n", + "#Calculations\n", + "r = -(y/e) # Radius of curvature\n", + "print \"radius of curvature is\", round(r), \"inch\"\n", + "k = 1/r # curvature in in-1\n", + "print \"curvature\", round(k,5), \"ft-1\"\n", + "theta = numpy.degrees(numpy.arcsin(((L*12.0)/(2.0*r)))) # angle in degree\n", + "print \"Angle of twist\", round(theta,3), \"degree\"\n", + "my_del = r*(1-math.cos(math.radians(theta))) #Deflection in inch\n", + "print \"Deflection in the beam is \", round(my_del,4), \"inch\" " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "radius of curvature is 2400.0 inch\n", + "curvature 0.00042 ft-1\n", + "Angle of twist 1.146 degree\n", + "Deflection in the beam is 0.48 inch\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.2, page no. 315" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\"\"\"\n", + "Evaluate bending moment & maximum bending stress in the wire\n", + "\"\"\"\n", + "\n", + "import math \n", + "\n", + "#initialisation\n", + "d = 0.004 # thickness of wire in m\n", + "R0 = 0.5 # radius of cylinder in m\n", + "E = 200e09 # Modulus of elasticity of steel\n", + "s = 1200e06 # proportional limit of steel\n", + "\n", + "#calculation\n", + "\n", + "M = (math.pi*E*d**4)/(32*(2*R0+d)) # Bending moment in wire in N-m\n", + "print \"Bending moment in the wire is \", round(M,2), \"N-m\"\n", + "s_max = (E*d)/(2*R0+d) # Maximum bending stress in wire in Pa\n", + "print \"Maximum bending stress in the wire is %e\" %(s_max), \"Pa\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Bending moment in the wire is 5.01 N-m\n", + "Maximum bending stress in the wire is 7.968127e+08 Pa\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.3, page no. 316" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\"\"\"\n", + "find maximum tensile and compressive stress in the beam\n", + "\"\"\"\n", + "\n", + "import math \n", + "\n", + "#initialisation\n", + "L = 22 # Span of beam in ft\n", + "q = 1.5 # Uniform load intensity in k/ft\n", + "P = 12 # Concentrated in k\n", + "b = 8.75 # width of cross section of beam in inch\n", + "h = 27 # height of cross section of beam in inch\n", + "Ra = 23.59 # Reaction at point A\n", + "Rb = 21.41 # Reacyion at point B\n", + "Mmax = 151.6 # Maximum bending moment\n", + "\n", + "#calculation\n", + "\n", + "S = (b*h**2)/6 # Section modulus\n", + "s = (Mmax*12)/S # stress in k\n", + "st = s*1000 # Tensile stress\n", + "print \"Maximum tensile stress in the beam\", round(st), \"psi\"\n", + "sc = -s*1000 # Compressive stress\n", + "print \"Maximum compressive stress in the beam\", round(sc), \"psi\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Maximum tensile stress in the beam 1711.0 psi\n", + "Maximum compressive stress in the beam -1711.0 psi\n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.4, page no. 318" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\"\"\"\n", + "because of uniform load in the beam, calculate maximum tensile & compressive stress\n", + "\"\"\"\n", + "\n", + "import math \n", + "\n", + "#initialisation\n", + "q = 3200.0 # Uniform load intensity in N/m\n", + "b = 0.3 # width of beam in m\n", + "h = 0.08 # Height of the beam in m\n", + "t = 0.012 # thickness of beam in m\n", + "Ra = 3600.0 # Reaction at A in N\n", + "Rb = 10800.0 # Reaction at B in N\n", + "Mpos = 2025.0 # Moment in Nm\n", + "Mneg = -3600.0 # Moment in Nm\n", + "\n", + "#calculation\n", + "y1 = t/2.0\n", + "A1 = (b-2*t)*t \n", + "y2 = h/2\n", + "A2 = h*t \n", + "A3 = A2 \n", + "c1 = ((y1*A1)+(2*y2*A2))/((A1)+(2*A2))\n", + "c2 = h - c1 \n", + "Ic1 = (b-2*t)*(t**3)*(1.0/12.0)\n", + "d1 = c1-(t/2.0)\n", + "Iz1 = (Ic1)+(A1*(d1**2))\n", + "Iz2 = 956600e-12\n", + "Iz3 = Iz2 \n", + "Iz = Iz1 + Iz2 + Iz3 # Moment of inertia of the beam cross section\n", + "\n", + "# Section Modulli\n", + "S1 = Iz / c1 # for the top surface\n", + "S2 = Iz / c2 # for the bottom surface\n", + "\n", + "# Maximum stresses for the positive section\n", + "st = Mpos / S2 \n", + "print \"Maximum tensile stress in the beam in positive section is\", st, \"Pa\"\n", + "sc = -Mpos / S1 \n", + "print \"Maximum compressive stress in the beam in positive section is\", sc, \"Pa\"\n", + "\n", + "# Maximum stresses for the negative section\n", + "snt = -Mneg / S1 \n", + "print \"Maximum tensile stress in the beam in negative section is\", snt, \"Pa\"\n", + "snc = Mneg / S2 \n", + "print \"Maximum compressive stress in the beam in negative section is\", snc, \"Pa\"\n", + "\n", + "# Conclusion\n", + "st_max = st\n", + "sc_max = snc" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Maximum tensile stress in the beam in positive section is 50468539.6422 Pa\n", + "Maximum compressive stress in the beam in positive section is -15157118.8248 Pa\n", + "Maximum tensile stress in the beam in negative section is 26945989.0219 Pa\n", + "Maximum compressive stress in the beam in negative section is -89721848.2528 Pa\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Exampe 5.5, page no. 325" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\"\"\"\n", + "choose a suitable size for the beam\n", + "\"\"\"\n", + "\n", + "import math \n", + "\n", + "#initialisation\n", + "L = 12 # Length of beam in ft\n", + "q = 420 # Uniform load intensity in lb/ft\n", + "s = 1800 # Allowable bending stress in psi\n", + "w = 35 # weight of wood in lb/ft3\n", + "\n", + "#calculation\n", + "M = (q*L**2*12)/8 # Bending moment in lb-in\n", + "S = M/s # Section Modulli in in3\n", + "\n", + "# From Appendix F\n", + "q1 = 426.8 # New uniform load intensity in lb/ft\n", + "S1 = S*(q1/q) # New section modulli in in3\n", + "\n", + "# From reference to appendix F, a beam of cross section 3*12 inch is selected\n", + "print (\"Beam of crosssection 3*12 is sufficient\")" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Beam of crosssection 3*12 is sufficient\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.6, page no. 326" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\"\"\"\n", + "find min. req. diameter of the woodpost & req. outer diameter of aluminum tube\n", + "\"\"\"\n", + "\n", + "import math\n", + "\n", + "#initialisation\n", + "P = 12000 # Lataeral load at the upper end in N\n", + "h = 2.5 # Height of post in m\n", + "Mmax = P*h # Maximum bending moment in Nm\n", + "\n", + "#calculation\n", + "# Part (a) : Wood Post\n", + "s1 = 15e06 # Maximum allowable stress in Pa\n", + "S1 = Mmax/s1 # Section Modulli in m3\n", + "d1 = ((32.0*S1)/math.pi)**(1.0/3.0) # diameter in m\n", + "print \"the minimum required diameter d1 of the wood post is\", round(d1,3), \"m\"\n", + "\n", + "# Part (b) : Alluminium tube\n", + "s2 = 50e06 # Maximum allowable stress in Pa\n", + "S2 = Mmax/s2 # Section Modulli in m3\n", + "d2 = (S2/0.06712)**(1.0/3.0) # diameter in meter.....(1) \n", + "print \"minimum required outer diameter d2 of the aluminum tube is\", round(d2,3),\"m\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "the minimum required diameter d1 of the wood post is 0.273 m\n", + "minimum required outer diameter d2 of the aluminum tube is 0.208 m\n" + ] + } + ], + "prompt_number": 18 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.7, page no. 326" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\"\"\"\n", + "evaluate and select a structural steel beam of wide-flange shape to support the loads\n", + "\"\"\"\n", + "\n", + "import math \n", + "\n", + "#initialisation\n", + "q = 2000.0 # Uniform load intensity in lb/ft\n", + "s = 18000.0 # Maximum allowable load in Psi\n", + "Ra = 18860.0 # Reaction at point A\n", + "Rb = 17140.0 # Reaction at point B\n", + "\n", + "#calculation\n", + "x1 = Ra/q # Distance in ft from left end to the point of zero shear\n", + "Mmax = (Ra*x1)-((q*(x1**2))/2.0) # Maximum bending moment in lb-ft\n", + "S = (Mmax*12.0)/s # Section Modulli in in3\n", + "\n", + "# Trial Beam\n", + "Ra_t = 19380.0 # Reaction at point A\n", + "Rb_t = 17670.0 # Reaction at point B\n", + "\n", + "#in Python the value for x1 differes by some points and hence the subsequent results differ\n", + "x1_t = Ra_t/q # Distance in ft from left end to the point of zero shear\n", + "Mmax_t = (Ra_t*x1_t)-((q*(x1_t**2))/2.0) # Maximum bending moment in lb-ft\n", + "S_t = (Mmax_t*12.0)/s # Section Modulli in in3\n", + "# From table E beam 12*50 is selected \n", + "print \"Beam of crosssection 12*50 is selected with section modulli\", round(S_t,1), \"in^3\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Beam of crosssection 12*50 is selected with section modulli 62.6 in^3\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.8, page 329" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\"\"\"\n", + "find min. req. dimension of the posts\n", + "\"\"\"\n", + "\n", + "import math\n", + "\n", + "#initialisation \n", + "g = 9810 # Specific weight of water in N/m3\n", + "h = 2 # Height of dam in m\n", + "s = 0.8 # Dismath.tance between square cross section in m\n", + "sa = 8e06 # Maximum allowable stress in Pa\n", + "\n", + "#Calculations\n", + "b = ((g*(h**3)*s)/sa)**(1.0/3.0) # Dimension of croossection in m\n", + "\n", + "#Result\n", + "print \"the minimum required dimension b of the posts\", round(b,3), \"m\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "the minimum required dimension b of the posts 0.199 m\n" + ] + } + ], + "prompt_number": 15 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.11, page no. 341" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\"\"\"\n", + "find normal & shear stress at point C\n", + "\"\"\"\n", + "\n", + "import math \n", + "\n", + "#initialisation\n", + "L = 3 # Span of beam in ft\n", + "q = 160 # Uniform load intensity in lb/in\n", + "b = 1 # Width of cross section\n", + "h = 4 # Height of cross section\n", + "\n", + "# Calculations from chapter 4\n", + "Mc = 17920 # Bending moment in ld-in\n", + "Vc = -1600 # Loading in lb\n", + "I = (b*(h**3))/12.0 # Moment of inertia in in4\n", + "sc = -(Mc*1)/I # Compressive stress at point C in psi\n", + "Ac = 1*1 # Area of section C in inch2\n", + "yc = 1.5 # dismath.tance between midlayers od section C and cross section of beam\n", + "Qc = Ac*yc # First moment of C cross section in inch3\n", + "tc = (Vc*Qc)/(I*b) # Shear stress in Psi\n", + "print \"Normal stress at C\", sc, \"psi\"\n", + "print \"Shear stress at C\", tc, \"psi\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Normal stress at C -3360.0 psi\n", + "Shear stress at C -450.0 psi\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.12, page no. 342" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\"\"\"\n", + "calculate max. permissible value\n", + "\"\"\"\n", + "\n", + "import math\n", + "\n", + "#initialisation\n", + "s = 11e06 # allowable tensile stress in pa\n", + "t = 1.2e06 # allowable shear stress in pa\n", + "b = 0.1 # Width of cross section in m\n", + "h = 0.15 # Height of cross section in m\n", + "a = 0.5 # in m\n", + "\n", + "#Calculations\n", + "P_bending = (s*b*h**2)/(6.0*a) # Bending stress in N\n", + "P_shear = (2*t*b*h)/3.0 # shear stress in N\n", + "Pmax = P_bending # Because bending stress governs the design\n", + "\n", + "#Result\n", + "print \"the maximum permissible value Pmax of the loads\", Pmax, \"N\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "the maximum permissible value Pmax of the loads 8250.0 N\n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.13, page no. 345" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\"\"\"\n", + "evaluate max. shear stress in the pole & diameter of solid pole\n", + "\"\"\"\n", + "\n", + "import math\n", + "\n", + "#initialisation\n", + "d2 = 4 # Outer diameter in inch\n", + "d1 = 3.2 # Inner diameter in inch\n", + "r2 = d2/2 # Outer radius in inch\n", + "r1 = d1/2 # inner radius in inch\n", + "P = 1500 # Horizontal force in lb\n", + "\n", + "#calculation\n", + "# Part (a)\n", + "t_max = ((r2**2+(r2*r1)+r1**2)*4*P)/(3*math.pi*((r2**4)-(r1**4))) # Mximum shear stress in Psi\n", + "print \"Maximum shear stress in the pole is\", round(t_max), \"psi\"\n", + "\n", + "# Part (b)\n", + "d0 = math.sqrt((16*P)/(3*math.pi*t_max)) # Diameter of solid circular cross section in meter\n", + "print \"Diameter of solid circular cross section is \", round(d0,2), \"m\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Maximum shear stress in the pole is 658.0 psi\n", + "Diameter of solid circular cross section is 1.97 m\n" + ] + } + ], + "prompt_number": 20 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.14, page no. 351" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\"\"\"\n", + "maximum shear stress, minimum shear stress, and total shear force in the web.\n", + "\"\"\"\n", + "\n", + "import math\n", + "\n", + "#initialisation\n", + "b = 0.165 # in m\n", + "h = 0.320 # in m\n", + "h1 = 0.290 # in m\n", + "t = 0.0075 # in m\n", + "V = 45000.0 # Vertical force in N\n", + "\n", + "#calculation\n", + "I = (1.0/12.0)*((b*(h**3))-(b*(h1**3))+(t*(h1**3))) # Moment of inertia of the cros section\n", + "t_max = (V/(8.0*I*t))*((b*(h**2))-(b*(h1**2))+(t*(h1**2))) # Maximum shear stress in Pa\n", + "t_min = ((V*b)/(8*I*t))*(h**2-h1**2) # Minimum shear stress in Pa\n", + "T = ((t*h1)/3.0)*(2*t_max + t_min) # Total shear force in Pa\n", + "t_avg = V/(t*h1) # Average shear stress in Pa\n", + "\n", + "#Result\n", + "print \"Maximum shear stress in the web is\", round(t_max,2), \"Pa\"\n", + "print \"Minimum shear stress in the web is\", round(t_min,2), \"Pa\"\n", + "print \"Total shear stress in the web is\", round(T,2), \"N\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Maximum shear stress in the web is 20985785.26 Pa\n", + "Minimum shear stress in the web is 17359517.46 Pa\n", + "Total shear stress in the web is 43015.04 N\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.15, page no. 352" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\"\"\"\n", + "find shear stress at top of the web\n", + "\"\"\"\n", + "\n", + "import math \n", + "\n", + "#initialisation\n", + "V = 10000 # Vertical shear force in lb\n", + "b = 4 # in inch\n", + "t = 1 # in inch\n", + "h = 8 # in inch\n", + "h1 = 7 # in inch\n", + "\n", + "#calculation\n", + "A = b*(h-h1) + t*h1 # Area of cross section \n", + "Qaa = ((h+h1)/2.0)*b*(h-h1) + (h1/2.0)*(t*h1) # First moment of cross section\n", + "c2 = Qaa/A # Position of neutral axis in inch\n", + "c1 = h-c2 # Position of neutral axis in inch\n", + "Iaa = (b*h**3)/3.0 - ((b-t)*h1**3)/3.0 # Moment of inertia about the line aa\n", + "I = Iaa - A*c2**2 # Moment of inertia of crosssection\n", + "Q1 = b*(h-h1)*(c1-((h-h1)/2.0)) # First moment of area above the line nn\n", + "t1 = (V*Q1)/(I*t) # Shear stress at the top of web in Psi\n", + "Qmax = (t*c2)*(c2/2.0) # Maximum first moment of inertia below neutral axis\n", + "t_max = (V*Qmax)/(I*t) # Maximum Shear stress in Psi\n", + "\n", + "#Result\n", + "print \"Shear stress at the top of the web is\", round(t1), \"psi\"\n", + "print \"Maximum Shear stress in the web is\", round(t_max), \"Psi\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Shear stress at the top of the web is 1462.0 psi\n", + "Maximum Shear stress in the web is 1762.0 Psi\n" + ] + } + ], + "prompt_number": 24 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.16, page no. 357" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\"\"\"\n", + "maximum permissible longitudinal spacing of the screws\n", + "\"\"\"\n", + "\n", + "import math \n", + "\n", + "#initialisation\n", + "\n", + "Af = 40*180 # Area of flange in mm2\n", + "V = 10500 # Shear force acting on cross section\n", + "F = 800 # Allowable load in shear\n", + "df = 120 # Dismath.tance between centroid of flange and neutral axis in mm\n", + "\n", + "#calculation\n", + "Q = Af*df # First moment of cross section of flange\n", + "I = (1.0/12.0)*(210*280**3) - (1.0/12.0)*(180*200**3) # Moment of inertia of entire cross section in mm4\n", + "f = (V*Q)/I # Shear flow\n", + "s = (2*F)/f # Spacing between the screw\n", + "\n", + "#Result\n", + "print \"The maximum permissible longitudinal spacing s of the screws is\", round(s,1), \"mm\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The maximum permissible longitudinal spacing s of the screws is 46.6 mm\n" + ] + } + ], + "prompt_number": 25 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.17, page no. 362" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\"\"\"\n", + "maximum tensile and compressive stress in the beam\n", + "\"\"\"\n", + "\n", + "import math \n", + "\n", + "#initialisation\n", + "L = 60 # Length of beam in inch\n", + "d = 5.5 # dismath.tance from the point of application of the load P to the longitudinal axis of the tube in inch\n", + "b = 6 # Outer dimension of tube in inch\n", + "A = 20 # Area of cross section of tube in inch\n", + "I = 86.67 # Moment of inertia in in4\n", + "P = 1000 # in lb\n", + "theta = 60 # in degree\n", + "Ph = P*math.sin(math.radians(60)) # Horizontal component\n", + "Pv = P*math.cos(math.radians(60)) # Vertical component\n", + "\n", + "#Calculations\n", + "M0 = Ph*d # Moment in lb-in\n", + "y = -3 # Point at which maximum tensile stress occur in inch\n", + "N = Ph # Axial force\n", + "M = 9870 # Moment in lb-in\n", + "st_max = (N/A)-((M*y)/I) # Maximum tensile stress in Psi\n", + "yc = 3 # in inch\n", + "M1 = 5110 # moment in lb-in\n", + "sc_left = (N/A)-((M*yc)/I) # Stress at the left of point C in Psi\n", + "sc_right = -(M1*yc)/I # Stress at the right of point C in Psi\n", + "sc_max = min(sc_left,sc_right) # Because both are negative quantities\n", + "\n", + "#Result\n", + "print \"The maximum compressive stress in the beam is\", round(sc_max), \"psi\"\n", + "print \"The maximum tensile stress in the beam is\", round(st_max), \"psi\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The maximum compressive stress in the beam is -298.0 psi\n", + "The maximum tensile stress in the beam is 385.0 psi\n" + ] + } + ], + "prompt_number": 26 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/sample_notebooks/VijayaLakshmi/Chapter_2.ipynb b/sample_notebooks/VijayaLakshmi/Chapter_2.ipynb new file mode 100755 index 00000000..5ea140dc --- /dev/null +++ b/sample_notebooks/VijayaLakshmi/Chapter_2.ipynb @@ -0,0 +1,1165 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:8348cd510a8decc7c29711936ea5626abb44a586c7009cdee153feac4272922d"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 2 - Energy Bands And Charge Carriers in Semiconductor"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 35"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 2.1\n",
+ "# Given data\n",
+ "lembda = 11000.;#\n",
+ "lembda = lembda * 10.**-10.;# in m\n",
+ "h = 6.625*10.**-34.;# Planck constant\n",
+ "c = 3.*10.**8.;#speed of light in m/s\n",
+ "e = 1.6*10.**-19.;#charge of electron in C\n",
+ "# Energy of the incident photon should at least be, h*v= Eg, so\n",
+ "E_g = (h*c)/(lembda*e);# in eV\n",
+ "print '%s %.2f %s' %(\"The energy gap in eV is\",E_g,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The energy gap in eV is 1.13 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 35"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 2.2\n",
+ "# Given data\n",
+ "E_g = 0.75;# in eV\n",
+ "e = 1.6*10.**-19.;# in C\n",
+ "h = 6.63*10.**-34.;# in J\n",
+ "c = 3*10**8.;# in m/s\n",
+ "#Formula E_g = (h*c)/(lembda*e);\n",
+ "lembda = (h*c)/(E_g*e);# in m\n",
+ "lembda = lembda * 10.**10.;# in A\n",
+ "print '%s %.2f %s' %(\"The wavelength in A is\",lembda,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The wavelength in A is 16575.00 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 36"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 2.3\n",
+ "# Given data\n",
+ "del_E = 0.3;# in eV\n",
+ "T1 = 300.;# in K\n",
+ "T2 = 330.;# in K\n",
+ "# del_E = K * T1 * log(N/N_c) where del_E= E_C-E_F\n",
+ "# del_E1 = K * T2 * log(N/N_c) where del_E1= E_C-E_F at T= 330 degree K\n",
+ "del_E1 = del_E*(T2/T1);# in eV \n",
+ "print '%s %.2f %s' %(\"The Fermi level will be eV below the conduction band\",del_E1,\"\\n\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Fermi level will be eV below the conduction band 0.33 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 37"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 2.4\n",
+ "# Given data\n",
+ "import math\n",
+ "N_c = 2.8 * 10.**3.;# in cm**-3\n",
+ "del_E = 0.25;# fermi energy in eV\n",
+ "KT = 0.0259;# where K is Boltzmann constant\n",
+ "f_F = math.exp(-(del_E)/KT);\n",
+ "print '%s %.6f %s' %(\"The probability in the conduction band is occupied by an electron is \",f_F,\"\\n\");\n",
+ "# Evaluation of electron concentration\n",
+ "n_o = N_c * math.exp(-(del_E)/KT);# in cm**-3\n",
+ "print '%s %.2f %s' %(\"The thermal equilibrium electron concentration in cm**-3 is\",n_o,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The probability in the conduction band is occupied by an electron is 0.000064 \n",
+ "\n",
+ "The thermal equilibrium electron concentration in cm**-3 is 0.18 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 43"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa2.5\n",
+ "# Given data\n",
+ "import math\n",
+ "T1 = 300.;# in K\n",
+ "T2 = 400.;# in K\n",
+ "del_E = 0.27;# Fermi level in eV\n",
+ "KT = (0.0259) * (T2/T1);# in eV\n",
+ "N_v = 1.04 * 10.**3.;# in cm**-3\n",
+ "N_v = N_v * (T2/T1)**(3./2.);# in cm**-3 \n",
+ "# Hole concentration\n",
+ "p_o = N_v * math.exp(-(del_E)/KT);# in per cm**3\n",
+ "print '%s %.2f %s' %(\"The thermal equilibrium hole concentration per cm**3 is\",p_o,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The thermal equilibrium hole concentration per cm**3 is 0.64 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 43"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 2.6\n",
+ "# Given data\n",
+ "At = 63.5;# atomic weight\n",
+ "Rho = 1.7*10.**-6.;# in ohm cm\n",
+ "d = 8.96;# in gm/cc\n",
+ "N_A = 6.02*10.**23.;# in /gm.mole\n",
+ "e = 1.6*10.**-19.;# in C\n",
+ "#Number of atoms of copper persent per unit volume\n",
+ "n = (N_A/At)*d;\n",
+ "Miu_e = 1./(Rho*n*e);# in cm**2/volt.sec\n",
+ "print '%s %.2f %s' %(\"The electron mobility in cm**2/volt-sec is\",Miu_e,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The electron mobility in cm**2/volt-sec is 43.28 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 45"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 2.7\n",
+ "# Given data\n",
+ "l = 0.1;# in m\n",
+ "A = 1.7;# in mm**2\n",
+ "A = A * 10.**-6.;# in m**2\n",
+ "R = 0.1;# in ohm\n",
+ "At = 63.5;# atomic weight\n",
+ "N_A = 6.02*10.**23.;\n",
+ "d = 8.96;# in gm/cc\n",
+ "n = (N_A/At)*d;# in /cc\n",
+ "n = n * 10.**6.;# in /m**3\n",
+ "e = 1.6*10.**-19.;#electron charge in C\n",
+ "# Resistivity of copper\n",
+ "#Formula R = Rho*(l/A);\n",
+ "Rho = (R*A)/l;# in ohm m\n",
+ "# Conductivity of copper\n",
+ "Sigma = 1./Rho;# in mho/m\n",
+ "# Formula Sigma = n*e*Miu_e\n",
+ "Miu_e = Sigma/(n*e);# in m**2/V.sec\n",
+ "print '%s %.6f %s' %(\"The mobility in m**2/V-sec is\",Miu_e,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The mobility in m**2/V-sec is 0.000043 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E8 - Pg 47"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 2.8\n",
+ "# Given data\n",
+ "import math\n",
+ "d = 10.5;# in gm/cc\n",
+ "At = 108.;# atomic weight\n",
+ "N_A = 6.025*10.**23.;# in /gm mole\n",
+ "r = 10**-3.;# in m\n",
+ "q = 1.6*10.**-19.;# in C\n",
+ "# The number of electrons per unit volume\n",
+ "n = (N_A/At)*d;# in /cm**3\n",
+ "n = n * 10.**6.;# in /m**3\n",
+ "A = math.pi*((r)**2.);# in m**2\n",
+ "I = 2.;# in A\n",
+ "# Evaluation of drivt velocity with the help of current\n",
+ "# I = q*n*A*V;\n",
+ "V = I/(n*q*A);# in m/s\n",
+ "print '%s %.6f %s' %(\"The drift velocity in m/s is\",V,\"\\n\");\n",
+ "\n",
+ "# Note: Calculation in the book is wrong, so the answer in the book is wrong.\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The drift velocity in m/s is 0.000068 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E9 - Pg 48"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 2.9\n",
+ "import math\n",
+ "# Given data\n",
+ "d = 1.03;# in mm\n",
+ "d = d *10.**-3.;# in m\n",
+ "r = d/2.;# in m\n",
+ "R = 6.51;# in ohm\n",
+ "l = 300.;# in mm\n",
+ "e = 1.6*10.**-19.;# electron charge in C\n",
+ "n = 8.4*10.**28.;# in /m**3\n",
+ "A = math.pi*r**2.;# cross section area\n",
+ "#Formula R = Rho*(l/A);\n",
+ "Rho = (R* A)/l;#in ohm m\n",
+ "Sigma = 1./Rho;# in mho/m\n",
+ "print '%s %.2f %s' %(\"The conductivity of copper in mho/m is\",Sigma,\"\\n\");\n",
+ "# Evaluation of mobility\n",
+ "#Formula sigma = n*e*Miu_e\n",
+ "Miu_e = Sigma/(n*e);# in m**2/V.sec\n",
+ "print '%s %.6f %s' %(\"The mobility in m**2/V-sec is\",Miu_e,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The conductivity of copper in mho/m is 55306469.41 \n",
+ "\n",
+ "The mobility in m**2/V-sec is 0.004115 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E10 - Pg 53"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 2.10\n",
+ "# Given data\n",
+ "Mu_e = 1500.;# in cm**2/volt sec\n",
+ "Mu_h = 500.;# in cm**2/volt sec\n",
+ "n_i = 1.6 * 10.**10.;# in per cm**3\n",
+ "e = 1.6 * 10.**-19.;# in C\n",
+ "# The conductivity of pure semiconductor \n",
+ "Sigma = n_i * (Mu_e + Mu_h) * e;# in mho/cm\n",
+ "print '%s %.6f %s' %(\"The conductivity of pure semiconductor in mho/cm is\",Sigma,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The conductivity of pure semiconductor in mho/cm is 0.000005 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E11 - Pg 53"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 2.11\n",
+ "# Given data\n",
+ "Rho = 10.;# in ohm-cm\n",
+ "Mu_d = 500.;# in cm**2/v.s.\n",
+ "e = 1.6*10.**-3.;# electron charge in C\n",
+ "# The number of donor atom\n",
+ "n_d = 1./(Rho * e * Mu_d);# in per cm**3\n",
+ "print '%s %.2f %s' %(\"The number of donor atom per cm**3 is \",n_d,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The number of donor atom per cm**3 is 0.12 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E12 - Pg 53"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 2.12\n",
+ "#Given data\n",
+ "AvagadroNumber = 6.02 * 10.**23.;# in atoms/gm.mole\n",
+ "at_Ge = 72.6;# atom weight of Ge\n",
+ "e = 1.6 * 10.**-19.;# in C\n",
+ "D_Ge = 5.32;# density of Ge in gm/c.c\n",
+ "Mu = 3800.;# in cm**2/v.s.\n",
+ "C_Ge = (AvagadroNumber/at_Ge) * D_Ge;# concentration of Ge atoms in per cm**3\n",
+ "n_d = C_Ge/10.**8.;# in per cc\n",
+ "Sigma = n_d * Mu * e;# in mho/cm\n",
+ "print '%s %.2f %s' %(\"The conductivity in mho/cm is\",Sigma,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The conductivity in mho/cm is 0.27 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E13 - Pg 57"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa2.13\n",
+ "# Given data\n",
+ "Rho = 0.3623 * 10.**-3.;# in Ohm m\n",
+ "Sigma = 1/Rho;#in mho/m\n",
+ "D = 4.42 * 10.**28.;# Ge density in atom/m**3\n",
+ "n_d = D / 10.**6.;# in atom/m**3\n",
+ "e = 1.6 * 10.**-19.;# in C\n",
+ "# The mobility of electron in germanium \n",
+ "Mu = Sigma/(n_d * e);# in m**2/V.sec\n",
+ "print '%s %.2f %s' %(\"The mobility of electron in germanium in m**2/V.sec is\",Mu,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The mobility of electron in germanium in m**2/V.sec is 0.39 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E14 - Pg 57"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 2.14\n",
+ "# Given data\n",
+ "AvagadroNumber = 6.025 * 10.**26.;# in kg.Mole\n",
+ "W = 72.59;# atomic weight of Ge\n",
+ "D = 5.36 * 10.**3.;#density of Ge in kg/m**3\n",
+ "Rho = 0.42;# resistivity in Ohm m\n",
+ "e = 1.6 * 10.**-19.;# in C\n",
+ "Sigma = 1./Rho;# in mho/m\n",
+ "n = (AvagadroNumber/W) * D;# number of Ge atoms present per unit volume\n",
+ "# Holes per unit volume, H = n*10**-6%\n",
+ "H= n*10.**-8.;\n",
+ "a=H;\n",
+ "# Formula sigma= a*e*Mu_h\n",
+ "Mu_h = Sigma/(a * e);# in m**2/V.sec\n",
+ "print '%s %.2f %s' %(\"Mobility of holes in m**2/V.sec is\",Mu_h,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mobility of holes in m**2/V.sec is 0.03 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E15 - Pg 58"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 2.15\n",
+ "# Given data\n",
+ "e = 1.6 * 10.**-19.;# in C\n",
+ "n_i = 2 * 10.**19.;# in /m**3\n",
+ "Mu_e = 0.36;# in m**2/v.s\n",
+ "Mu_h = 0.17;# in m**2/v.s\n",
+ "A = 1. * 10.**-4.;# in m**2\n",
+ "V = 2.;#in volts\n",
+ "l = 0.3;# in mm\n",
+ "l = l * 10.**-3.;# in m\n",
+ "E=V/l;# in volt/m\n",
+ "Sigma = n_i * e * (Mu_e + Mu_h);# in mho/m\n",
+ "# J = I/A = Sigma * E\n",
+ "I= Sigma*E*A;\n",
+ "print '%s %.2f %s' %(\"The current produced in a small germanium plate in amp is\",I,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The current produced in a small germanium plate in amp is 1.13 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E16 - Pg 59"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 2.16\n",
+ "# Given data\n",
+ "D = 4.2 * 10.**28.;#density of Ge atoms per m**3\n",
+ "N_d = D / 10.**6.;# per m**3\n",
+ "e = 1.6 * 10.**-19.;# in C\n",
+ "Mu_e = 0.36;# in m**2/V-sec\n",
+ "# Donor concentration is very large as compared to intrinsic carrier concentration\n",
+ "Sigma_n = N_d * e * Mu_e;# in mho/m (intrinsic concentration can be neglected)\n",
+ "Rho_n = 1./Sigma_n;# in ohm m\n",
+ "print '%s %.6f %s' %(\"The resistivity of drop Ge in ohm m is \",Rho_n,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The resistivity of drop Ge in ohm m is 0.000413 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E17 - Pg 60"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 2.17\n",
+ "# given data\n",
+ "e = 1.6 * 10.**-19.;# in C\n",
+ "n_i = 1 * 10.**19.;# in per m**3\n",
+ "Mu_e = 0.36;# in m**2/volt.sec\n",
+ "Mu_h = 0.17;# in m**2/volt.sec \n",
+ "A = 2.;# in cm**2\n",
+ "A = A * 10.**-4.;# im m**2\n",
+ "t = 0.1;# in mm\n",
+ "t = t * 10.**-3.;# in m\n",
+ "V = 4.;# in volts\n",
+ "Sigma_i = n_i * e * (Mu_e + Mu_h);# in mho/m\n",
+ "J = Sigma_i * (V/t);# in Amp/m**2\n",
+ "# Current produced, I= J*A\n",
+ "I = J * A;# in Amp\n",
+ "print '%s %.2f %s' %(\"The current produced in a Ge sample in Amp is\",I,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The current produced in a Ge sample in Amp is 6.78 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E18 - Pg 60"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 2.18\n",
+ "# Given data\n",
+ "e = 1.6 * 10.**-19.;# in C\n",
+ "Mu_h = 500.;# in cm**2/V.s.\n",
+ "Mu_e = 1500.;# in cm**2/V.s.\n",
+ "n_i = 1.6 * 10.**10.;# in per cm**3\n",
+ "# Conductivity of pure silicon at room temperature \n",
+ "Sigma_i = n_i * e * ( Mu_h + Mu_e);# in mho/cm\n",
+ "print '%s %.6f %s' %(\"Conductivity of pure silicon at room temperature in mho/cm is\",Sigma_i,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Conductivity of pure silicon at room temperature in mho/cm is 0.000005 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E19 - Pg 63"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 2.19\n",
+ "#Given data\n",
+ "l= 0.50*10.**-2.;# width of ribbon in m\n",
+ "d= 0.10*10.**-3.;# thickness of ribbon in m\n",
+ "A= l*d;# area of ribbon in m**2\n",
+ "B = 0.8;# in Tesla\n",
+ "D = 10.5;#density in gm/cc\n",
+ "I = 2.;# in amp\n",
+ "q = 1.6 * 10.**-19.;# in C\n",
+ "n=6.*10.**28.;# number of elec. per m**3\n",
+ "V_H = ( I * B * d)/(n * q * A);# in volts\n",
+ "print '%s %.8f %s' %(\"The hall Voltage produced in volts is\",V_H,\"\\n\");\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The hall Voltage produced in volts is 0.00000003 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E20 - Pg 63"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 2.20\n",
+ "# Given data\n",
+ "l = 1.;# in m\n",
+ "d = 1.;# in cm\n",
+ "d = d * 10.**-2.;# in m\n",
+ "W = 1.;# in mm\n",
+ "W = W * 10.**-3.;# in m\n",
+ "A = d * W;# in m**2\n",
+ "I= 1.;# in A\n",
+ "B = 1.;# Tesla\n",
+ "V_H = 0.074 * 10.**-6.;# in volts\n",
+ "Sigma = 5.8 * 10.**7.;# in mho/m\n",
+ "# The hall coefficient \n",
+ "R_H = (V_H * A)/(B*I*d);# in m**3/c\n",
+ "print '%s %.10f %s' %(\"The hall coefficient in m**3/c is\",R_H,\"\\n\");\n",
+ "# Mobility of electrons in copper \n",
+ "Mu = Sigma * R_H;# in m**2/volt-sec\n",
+ "print '%s %.4f %s' %(\"The mobility of electrons in copper in m**2/volt-sec is \",Mu,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The hall coefficient in m**3/c is 0.0000000001 \n",
+ "\n",
+ "The mobility of electrons in copper in m**2/volt-sec is 0.0043 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E21 - Pg 64"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa2.21\n",
+ "# Given data\n",
+ "n_i = 1.4 * 10.**3.;# in /m**3\n",
+ "n_D = 1.4 * 10.**4.;# in /m**3\n",
+ "# Concentration of electrons\n",
+ "n=n_D;# in /m**3\n",
+ "p = n_i**2./n;# in /m**3\n",
+ "# The ratio of electrons to hole concentration\n",
+ "R = n/p;\n",
+ "print '%s %.2f %s' %(\"The ratio of electrons to hole concentration is\",R,\"\\n\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The ratio of electrons to hole concentration is 100.00 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E22 - Pg 64"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 2.22\n",
+ "#Given data\n",
+ "R = 9. * 10.**-3.;# in ohm-m\n",
+ "R_H = 3.6 * 10.**-4.;# in m**3\n",
+ "e = 1.6 * 10.**-3.;# in C\n",
+ "Sigma = 1./R;# in (ohm-m)**-1\n",
+ "Rho = 1./R_H;# in coulomb/m**3\n",
+ "# Density of charge carriers \n",
+ "n = Rho/e;# in /m**3\n",
+ "print '%s %.2f %s' %(\"Density of charge carriers per m**3 is\",n,\"\\n\");\n",
+ "# Mobility of charge carriers \n",
+ "Mu = Sigma * R_H;# in m**2/v-s\n",
+ "print '%s %.2f %s' %(\"Mobility of charge carriers in m**2/V-s is\",Mu,\"\\n\");\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Density of charge carriers per m**3 is 1736111.11 \n",
+ "\n",
+ "Mobility of charge carriers in m**2/V-s is 0.04 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E23 - Pg 70"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 2.23\n",
+ "# Given data\n",
+ "e = 1.6 * 10.**-19.;# in C\n",
+ "R_H = 0.0145;# in m**3/coulomb\n",
+ "Mu_e = 0.36;# in m**2/v-s\n",
+ "E = 100.;# in V/m\n",
+ "n = 1./(e * R_H);# in /m**3\n",
+ "# The current density of specimen \n",
+ "J = n * e * Mu_e * E;# in A/m**2\n",
+ "print '%s %.2f %s' %(\"The current density of specimen in A/m**2 is\",J,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The current density of specimen in A/m**2 is 2482.76 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E24 - Pg 70"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 2.24\n",
+ "import math\n",
+ "#Given data\n",
+ "Mu_e = 7.04 * 10.**-3.;# in m**2/v-s\n",
+ "m = 9.1 * 10.**-31.;\n",
+ "E_F = 5.5;# in eV\n",
+ "n = 5.8 * 10.**28.;\n",
+ "e = 1.6 * 10.**-19.;# in C\n",
+ "# Relaxation Time \n",
+ "Torque = (Mu_e/e) * m;# in sec\n",
+ "print '%s %.2f %s' %(\"Relaxation Time in sec is \",Torque,\"\\n\");\n",
+ "# Resistivity of conductor \n",
+ "Rho = 1. /(n * e * Mu_e);# in ohm-m\n",
+ "print '%s %.2f %s' %(\"Resistivity of conductor in ohm-m is \",Rho,\"\\n\");\n",
+ "# Velocity of electrons with fermi-energy \n",
+ "V_F = math.sqrt((2 * E_F * e)/m);# in m/s\n",
+ "print '%s %.2f %s' %(\"Velocity of electrons with fermi-energy in m/s is\",V_F,\"\\n\");\n",
+ "\n",
+ "#Note: The calculated value of Resistivity of conductor is wrong.\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Relaxation Time in sec is 0.00 \n",
+ "\n",
+ "Resistivity of conductor in ohm-m is 0.00 \n",
+ "\n",
+ "Velocity of electrons with fermi-energy in m/s is 1390706.99 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E25 - Pg 72"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 2.25\n",
+ "import math\n",
+ "# Given data\n",
+ "E= 5.95;# in eV\n",
+ "EF= 6.25;# in eV\n",
+ "delE= 0.01;\n",
+ " # delE= 1-1/(1+exp((E-EF)/KT))\n",
+ "K=1.38*10.**-23.;# Boltzmann Constant in J/K\n",
+ "# The temperature at which there is a 1 % probability that a state 0.30 eV below the Fermi energy level\n",
+ "T = ((E-EF)/math.log(1./(1.-delE) -1.)*1.6*10.**-19.)/K;# in K\n",
+ "print '%s %.2f %s' %(\"The temperature in K is : \",T,\"\\n\")\n",
+ " \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The temperature in K is : 756.95 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E26 - Pg 72"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 2.26\n",
+ "# Given data \n",
+ "import math\n",
+ "N_V = 1.04 * 10.**3.;# in cm**-3\n",
+ "T1 = 300.;# in K\n",
+ "T2 = 400.;# in K\n",
+ "del_E = 0.27;# in eV\n",
+ "# The value of N_V at T=400 K,\n",
+ "N_V = N_V * (T2/T1)**1.5;# in cm**-3\n",
+ "KT = (0.0259) * (T2/T1);# in eV\n",
+ "# The thermal equilibrium hole concentration in silicon \n",
+ "P_o = N_V * math.exp(-(del_E)/KT);# in cm**-3\n",
+ "print '%s %.2f %s' %(\"The thermal equilibrium hole concentration in silicon in cm**-3 is \",P_o,\"\\n\");\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The thermal equilibrium hole concentration in silicon in cm**-3 is 0.64 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E27 - Pg 74"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 2.27\n",
+ "import math\n",
+ "#Given data\n",
+ "N_c = 2.8 * 10.**3.;\n",
+ "N_V = 1.04 *10.**3.;\n",
+ "T1 = 550.;# in K\n",
+ "T2 = 300.;# in K\n",
+ "E_g = 1.12;\n",
+ "KT = (0.0259) ;\n",
+ "n_i = math.sqrt(N_c *N_V *(T1/T2)**3.* math.exp(-(E_g)/KT*T2/T1));# in cm**-3\n",
+ "# n_o = N_d/2 + sqrt((N_d/2)**2 + (n_i)**2)\n",
+ "# 1.05*N_d -N_d/2= sqrt((N_d/2)**2 + (n_i)**2)\n",
+ "# Minimum donor concentration required \n",
+ "N_d=math.sqrt((n_i)**2./((0.55)**2.-1./4.));\n",
+ "print '%s %.2f %s' %(\"Minimum donor concentration required in cm**-3 is\",N_d,\"\\n\"); \n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Minimum donor concentration required in cm**-3 is 0.14 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E28 - Pg 75"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 2.28\n",
+ "import math\n",
+ "#Given data\n",
+ "T = 300.;# in K\n",
+ "n_o = 10.**15.;# in cm**-3\n",
+ "n_i = 10.**10.;# in cm**-3\n",
+ "p_o = 10.**5.;# in cm**-3\n",
+ "del_n = 10.**13.;# in cm**-3\n",
+ "del_p = del_n;# in cm**-3\n",
+ "KT = 0.0259;# in eV\n",
+ "delta_E1= KT*math.log(n_o/n_i);# value of E_F-E_Fi in eV\n",
+ "delta_E2= KT*math.log((n_o+del_n)/n_i);# value of E_Fn-E_Fi in eV\n",
+ "delta_E3= KT*math.log((p_o+del_p)/n_i);# value of E_Fi-E_Fp in eV\n",
+ "print '%s %.2f %s' %(\"The Fermi level for thermal equillibrium in eV is : \",delta_E1,\"\\n\")\n",
+ "print '%s %.2f %s' %(\"The quase-Fermi level for electrons in non equillibrium in eV is : \",delta_E2,\"\\n\")\n",
+ "print '%s %.2f %s' %(\"The quasi-Fermi level for holes in non equillibrium in eV is : \",delta_E3,\"\\n\")\n",
+ "print '%s' %(\"The quasi-Fermi level for electrons is above E_Fi \")\n",
+ "print '%s' %(\"While the quasi-Fermi level for holes is below E_Fi\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Fermi level for thermal equillibrium in eV is : 0.30 \n",
+ "\n",
+ "The quase-Fermi level for electrons in non equillibrium in eV is : 0.30 \n",
+ "\n",
+ "The quasi-Fermi level for holes in non equillibrium in eV is : 0.18 \n",
+ "\n",
+ "The quasi-Fermi level for electrons is above E_Fi \n",
+ "While the quasi-Fermi level for holes is below E_Fi\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/sample_notebooks/bharthkumar/Untitled1.ipynb b/sample_notebooks/bharthkumar/Untitled1.ipynb new file mode 100755 index 00000000..c2fe40ea --- /dev/null +++ b/sample_notebooks/bharthkumar/Untitled1.ipynb @@ -0,0 +1,185 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:2206f2855e4232dc4600c4e414262a1e7f06df22f4a8f22ba905ba92f7813175"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter1-Introduction"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg16"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##calculate the\n",
+ "## initialization of variables\n",
+ "import math\n",
+ "## part (a)\n",
+ "a=700. ## M Pa from figure 1.8\n",
+ "b=100. ## M Pafrom figure 1.8\n",
+ "m=1/6. ## from figure 1.8\n",
+ "Y=450. ## M Pa from figure 1.9\n",
+ "##calculations\n",
+ "sigma_u=a+m*b\n",
+ "## results\n",
+ "print('\\n part (a) \\n')\n",
+ "print\"%s %.2f %s\"%(' The ultimate strength is sigma = ',sigma_u,' M Pa')\n",
+ "print\"%s %.2f %s\"%('\\n and the yield strength is Y = ',Y,'M Pa')\n",
+ "\n",
+ "## part (b)\n",
+ "c1=62. ## from figure 1.8\n",
+ "d1=0.025 ## from figure 1.8\n",
+ "c2=27. ## from figure 1.10a\n",
+ "d2=0.04 ## from figure 1.10a\n",
+ "## calculations\n",
+ "U_f1=c1*b*d1*10**6\n",
+ "U_f2=c2*b*d2*10**6\n",
+ "## results\n",
+ "print('\\n part (b)')\n",
+ "print\"%s %.2e %s\"%('\\n The modulus of toughness for alloy steel is Uf = ',U_f1,' N/m^2')\n",
+ "print\"%s %.2e %s\"%('\\n and structural steel is Uf = ',U_f2,' N/m^2')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " part (a) \n",
+ "\n",
+ " The ultimate strength is sigma = 716.67 M Pa\n",
+ "\n",
+ " and the yield strength is Y = 450.00 M Pa\n",
+ "\n",
+ " part (b)\n",
+ "\n",
+ " The modulus of toughness for alloy steel is Uf = 1.55e+08 N/m^2\n",
+ "\n",
+ " and structural steel is Uf = 1.08e+08 N/m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg16"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##calculate the permanet strain\n",
+ "## initialization of variables\n",
+ "import math\n",
+ "sigma=500. ## Stress M Pa\n",
+ "eps=0.0073 ## Strain\n",
+ "sigma_A=343. ## M Pa from figure 1.9\n",
+ "eps_A=0.00172 ## from figure 1.9\n",
+ "## part (a)\n",
+ "E=sigma_A/eps_A\n",
+ "\n",
+ "## part (B)\n",
+ "eps_e=sigma/E\n",
+ "eps_p=eps-eps_e\n",
+ "## results\n",
+ "print(' part (a) \\n')\n",
+ "print\"%s %.2f %s\"%(' The modulus of elasticity of the rod is E = ',E/1000,' G Pa')\n",
+ "print('\\n part (b)')\n",
+ "print\"%s %.4f %s\"%('\\n the permanent strain is = ',eps_p,'')\n",
+ "print\"%s %.4f %s\"%('\\n and the strain recovered is =',eps_e,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " part (a) \n",
+ "\n",
+ " The modulus of elasticity of the rod is E = 199.42 G Pa\n",
+ "\n",
+ " part (b)\n",
+ "\n",
+ " the permanent strain is = 0.0048 \n",
+ "\n",
+ " and the strain recovered is = 0.0025 \n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg19"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##calculate the diameter\n",
+ "## initialization of variables\n",
+ "import math\n",
+ "D=25. ## kN\n",
+ "L=60. ## kN\n",
+ "W=30. ##kN\n",
+ "Y=250. ## M Pa\n",
+ "safety=5./3. ## AISC, 1989\n",
+ "## calculations\n",
+ "Q=(D+L+W)*10**3. ## converted to N\n",
+ "A=safety*Q/Y\n",
+ "r=math.sqrt(A/math.pi)+0.5 ## additional 0.5 mm is for extra safety\n",
+ "d=1.8*r ## diameter\n",
+ "## results\n",
+ "print('Part (a) \\n ')\n",
+ "print\"%s %.2f %s %.2f %s \"%('A rod of ',d,' mm'and ' in diameter, with a cross sectional area of ',math.pi*(d**2./4.),' mm^2, is adequate')\n",
+ "## The diameter is correct as given in the textbook. Area doesn't match due to rounding off error and partly because it's a design problem.\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Part (a) \n",
+ " \n",
+ "A rod of 29.02 in diameter, with a cross sectional area of 661.39 mm^2, is adequate \n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/sample_notebooks/bikashbehera/Chapter1.ipynb b/sample_notebooks/bikashbehera/Chapter1.ipynb new file mode 100755 index 00000000..2349fbd8 --- /dev/null +++ b/sample_notebooks/bikashbehera/Chapter1.ipynb @@ -0,0 +1,274 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:85e9fe66492d8e2bf21b397989dbba9327240cd1300820fe26869c1390e3cf15"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter1-Introduction fluid mechanics"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg13"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "##initialization of new variables\n",
+ "#calculate density \n",
+ "M=29. ## Molecular weight of air\n",
+ "R=8314.3 ## J/mol K Gas constant\n",
+ "T=300. ##K Temperature\n",
+ "P=1. ##kg/cm^2 Pressure\n",
+ "g=9.8 ##m/s^2 Acceleration due to gravity\n",
+ "##calculations\n",
+ "R=R/M\n",
+ "P=P*g*10**4\n",
+ "rho=P/(R*T)\n",
+ "##result\n",
+ "print'%s %.2f %s'%(' Density = ',rho,' kg/m^3 ')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Density = 1.14 kg/m^3 \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg13"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "##initialization of new variables\n",
+ "#calculate shear stress\n",
+ "t=2. ##cm thickness\n",
+ "U=3. ##m/s Velocity\n",
+ "mu=0.29 ##kg/m s Coefficient of Viscocity\n",
+ "##calculations\n",
+ "tau=mu*U/(t*10**-2)\n",
+ "##results\n",
+ "print'%s %.2f %s'%(' Shear = ',tau,' N/m^2')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Shear = 43.50 N/m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg13"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "##initialization of new variables\n",
+ "#calculate pressure differnce\n",
+ "sigma=2.5*10**-2 ##N/m\n",
+ "D=10 ##cm\n",
+ "##calculations\n",
+ "R=D/2.\n",
+ "dP=2.*sigma/(R*10**-2)\n",
+ "##result\n",
+ "print'%s %.2f %s'%('The pressure difference is = ',dP,' N/m^2')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The pressure difference is = 1.00 N/m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg15"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "##initialization of new variables\n",
+ "#calculate rise of water and rise of mercury\n",
+ "R=1. ##mm\n",
+ "sigma=0.073 ##N/m\n",
+ "theta=0. ##degrees\n",
+ "rho=1000. ##kg/m^3\n",
+ "g=9.8 ##m/s^2\n",
+ "##calculations\n",
+ "theta=theta*math.pi/180 ##radians\n",
+ "h=2*sigma*math.cos(theta)/(rho*g*R*10**-3)\n",
+ "##result\n",
+ "print'%s %.2f %s'%('The rise of water = ',h,' m')\n",
+ "R=1. ##mm\n",
+ "sigma=0.48 ##N/m\n",
+ "theta=130. ##degrees\n",
+ "rho=13600. ##kg/m^3\n",
+ "g=9.8 ##m/s^2\n",
+ "##calculations\n",
+ "theta=theta*math.pi/180 ##radians\n",
+ "h=2*sigma*math.cos(theta)/(rho*g*R*10**-3)\n",
+ "##result\n",
+ "print'%s %.2e %s'%('\\n The rise of mercury = ',h,' m')\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The rise of water = 0.01 m\n",
+ "\n",
+ " The rise of mercury = -4.63e-03 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5-pg15"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "##initialization of new variables\n",
+ "#calculate chenge in pressure and change in volume\n",
+ "E=2.34*10**9 ##N/m^2 Modulus of Elasticity\n",
+ "d=1 ##km depth\n",
+ "rho=1000. ##kg/m^3 density\n",
+ "g=9.8 ##m/s^2 Acceleration due to gravity\n",
+ "##calculations\n",
+ "d=d*1000. \n",
+ "dp=rho*g*d\n",
+ "dVV=dp/E\n",
+ "##result\n",
+ "print'%s %.2e %s'%('The change in pressure is ',dp,' N/m^2 ')\n",
+ "print'%s %.3e %s'%('\\n Change in volume is ',dVV,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The change in pressure is 9.80e+06 N/m^2 \n",
+ "\n",
+ " Change in volume is 4.188e-03 \n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6-pg16"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "##initialization of new variables\n",
+ "#calculate speed of sound in air and speed of sound in sea water\n",
+ "T=300. ##K\n",
+ "gama=1.4\n",
+ "R=286.6\n",
+ "##calculation\n",
+ "## for air\n",
+ "a=math.sqrt(gama*R*T)\n",
+ "##result\n",
+ "print'%s %.2f %s'%('The speed of sound in air is ',a,' m/s ')\n",
+ "## for sea water\n",
+ "E=2.34*10**9 ## N/m^2\n",
+ "rho=1000. ##kg/cm^2\n",
+ "a=math.sqrt(E/rho)\n",
+ "##result\n",
+ "print'%s %.2f %s'%(' \\n The speed of sound in sea waer is ',a,' m/s ')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The speed of sound in air is 346.95 m/s \n",
+ " \n",
+ " The speed of sound in sea waer is 1529.71 m/s \n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/sample_notebooks/karansingh/Thyristors_Principles_&_Characeristics.ipynb b/sample_notebooks/karansingh/Thyristors_Principles_&_Characeristics.ipynb new file mode 100755 index 00000000..4e252985 --- /dev/null +++ b/sample_notebooks/karansingh/Thyristors_Principles_&_Characeristics.ipynb @@ -0,0 +1,209 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:4abf44c9c11389b267bffebabb50666e37ae7ef97c6e1f36ae4dc72c5936a6d7" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Thyristors Principles & Characeristics" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1_1 - page : 5" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Given data\n", + "alfa1=0.35 \n", + "alfa2=0.4 \n", + "IG=40*10**-3 #A\n", + "#Solution :\n", + "IA=alfa2*IG/(1-(alfa1+alfa2)) #A\n", + "print \"Anode current is %0.3f A\" %IA" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Anode current is 0.064 A\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1_2 - page : 7" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Given data\n", + "dv_dt=190 #V/\u00b5s\n", + "IC=8*10**-3 #A\n", + "#Solution :\n", + "C=IC/(dv_dt/10**-6) #F\n", + "print \"Capacitance of depletion layer is %0.1E F : \" %C" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Capacitance of depletion layer is 4.2E-11 F : \n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1_3 - page : 8" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Given data\n", + "RG=2000 #ohm\n", + "VCC=20 #V\n", + "VT=0.75 #V\n", + "Vthy=0.7 #V(Voltage across thyristor)\n", + "R=200 #ohm\n", + "IT=7*10**-3 #A\n", + "Ih=5*10**-3 #A\n", + "#Solution :\n", + "#part (a)\n", + "Vo=VCC #V##thyristor not conducting\n", + "print \"(a) When thyristor is in off state, Output voltage is %0.2f V\" %Vo\n", + "#part (b)\n", + "Vs=VT+IT*RG #V\n", + "print \"(b) Voltage necessary to turn on the thyristor is %0.2f V\" %Vs\n", + "#part (c)\n", + "VR1=Ih*R #V\n", + "print \"(c) Current through thyristor should be less than holding current. Voltage should be reduced to less than %0.2f V\" %VR1\n", + "#part (d)\n", + "VR2=VR1+Vthy #V\n", + "print \"(d) VCC should be reduced to less than %0.2f V\" %VR2" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a) When thyristor is in off state, Output voltage is 20.00 V\n", + "(b) Voltage necessary to turn on the thyristor is 14.75 V\n", + "(c) Current through thyristor should be less than holding current. Voltage should be reduced to less than 1.00 V\n", + "(d) VCC should be reduced to less than 1.70 V\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1_5 - page : 8" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Given data\n", + "Vdc=100 #V\n", + "L=10 #H\n", + "i=80*10**-3 #A\n", + "#Solution :\n", + "t=i*L/Vdc #s\n", + "t*=1000 # ms\n", + "print \"Width of pulse should be more than %0.1f milli-seconds.\" %t" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Width of pulse should be more than 8.0 milli-seconds.\n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1_6 - page : 9" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "#Given data\n", + "Vdc=100 #V\n", + "R=10 #ohm\n", + "L=5 #H\n", + "i=50*10**-3 #A\n", + "#Solution :\n", + "#i=Vdc/R*(1-exp(-R*t/L))\n", + "t=-math.log(1-i/Vdc*R)/R*L #s\n", + "t*=1000 #ms\n", + "print \"Minimum width of gate pulse is %0.1f milli-seconds.\" %t\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Minimum width of gate pulse is 2.5 milli-seconds.\n" + ] + } + ], + "prompt_number": 14 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/sample_notebooks/keerthi vanigundla/r.k.shukla.ipynb b/sample_notebooks/keerthi vanigundla/r.k.shukla.ipynb new file mode 100755 index 00000000..19a84998 --- /dev/null +++ b/sample_notebooks/keerthi vanigundla/r.k.shukla.ipynb @@ -0,0 +1,379 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 4:Behaviour of Dielectric Materials in ac and dc Fields"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Example 4.1,Page No:4.8"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "dielectric constant of argon = 1.0005466\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "alpha = 1.8*10**-40; #polarisability of argon in Fm**2\n",
+ "e0 = 8.85*10**-12; #dielectric constant F/m\n",
+ "N1 = 6.02*10**23; #avagadro number in mol**-1\n",
+ "x = 22.4*10**3; #volume in m^3\n",
+ " \n",
+ "#formula\n",
+ "#er-1=N*p/e0*E=(N/e0)*alpha\n",
+ "#calculation\n",
+ "N = N1/float(x); #number of argon atoms in per unit volume in cm**3\n",
+ "N2 = N*10**6; #number of argon atoms in per unit volume in m**3\n",
+ "er = 1+((N2/float(e0)))*(alpha); #dielectric constant F/m\n",
+ "\n",
+ "\n",
+ "#result\n",
+ "print'dielectric constant of argon = %3.7f'%er;"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Example 4.2,Page No:4.9"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 18,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "displacement = 1.25e-17 m\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "alpha = 1.8*10**-40; #polarisability of argon in F*m^2\n",
+ "E = 2*10**5; # in V/m\n",
+ "z = 18;\n",
+ "e = 1.6*10**-19;\n",
+ " \n",
+ " \n",
+ "#formula\n",
+ "#p=18*e*x\n",
+ "#calculation\n",
+ "p = alpha*E;\n",
+ "x = p/float(18*e); #shift of electron in m\n",
+ "\n",
+ " \n",
+ "#result\n",
+ "print'displacement = %3.2e'%x,'m';"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Example 4.3,Page No:4.9"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 20,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "local field of benzene=4.40e+03 V/m\n",
+ "local field of water=-1.57e+06 V/m\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "E0 = 300*10**2; #local field in V/m\n",
+ "P1 = 3.398*10**-7; #dipole moment Coulomb/m\n",
+ "P2 = 2.124*10**-5; #dipole moment Coulomb/m\n",
+ "e0 = 8.85*10**-12; #permittivity in F/m\n",
+ " \n",
+ " \n",
+ "#formula\n",
+ "#E10Ci=E0-(2*Pi/3*e0)\n",
+ "#calculation\n",
+ "E10C1 = E0-((2*P1)/float(3*e0)); #local field of benzene in V/m\n",
+ "E10C2 = E0-((2*P2)/float(3*e0)); #local field of water in V/m\n",
+ " \n",
+ "#result\n",
+ "print'local field of benzene=%3.2e'%E10C1,'V/m';\n",
+ "print'local field of water=%3.2e'%E10C2,'V/m';"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Example 4.4,Page No:4.9"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+ "source": [
+ "# import math\n",
+ "\n",
+ "#variable declaration\n",
+ "p1 = 5.12*10**-34; #p of benzene kg/m**3\n",
+ "p2 = 6.34*10**-34; #p of water kg/m**3\n",
+ "e10C1 = 4.4*10**3; #local field of benzene in V/m\n",
+ "e10C2 = 1570*10**3; #local field of water in V/m\n",
+ " \n",
+ " \n",
+ "#formula\n",
+ "#p=alphai*e10Ci\n",
+ "#calculation\n",
+ "alpha1 = p1/float(e10C1); #polarisability of benzene in F*m**2\n",
+ "alpha2 = p2/float(e10C2); #polarisability of water in F*m**2\n",
+ " \n",
+ "\n",
+ "#result\n",
+ "print'polarisability of benzene = %3.2e'%alpha1,'F*m**2';\n",
+ "print'polarisability of water = %3.2e'%alpha2,'F*m**2';\n",
+ "print'Note: mistake in textbok,alpha1 value is printed as 1.16*10**-38 instead of 1.16*10**-37';"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Example 4.5,Page No:4.10"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 25,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "polarisation of benzene = 6.80e-07 c/m**2\n",
+ "polarisation of water = 4.25e-05. c/m**2\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "e0 = 8.85*10**-12; #abslute permitivity in (m**-3)*(kg**-1)*(s**4)*(A**2)\n",
+ "E = 600*10**2; #strength in V/cm\n",
+ "er1 = 2.28; #dielectric constant of benzene in coulomb/m\n",
+ "er2 = 81; #dielectric constant of water in coulomb/m\n",
+ "\n",
+ "\n",
+ "#fomula\n",
+ "#p=e0*E*(er-1)\n",
+ "#calculation\n",
+ "pB = e0*E*(er1-1); #polarisation of benzene in c/m**2\n",
+ "pW = e0*E*(er2-1); #polarisation of water in c/m**2\n",
+ " \n",
+ "\n",
+ "#result\n",
+ "print'polarisation of benzene = %3.2e'%pB,'c/m**2';\n",
+ "print'polarisation of water = %3.2e.'%pW,'c/m**2';"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Example 4.6,Page No:4.10"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "percentage contribution from ionic polaristion = 59.82 %\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "er0 = 5.6; #static dielectric cnstant of NaCl \n",
+ "n = 1.5; #optical index of refraction\n",
+ " \n",
+ "\n",
+ "#calculation\n",
+ "er = er0-n**2;\n",
+ "d = ((er/float(er0))*100); #percentage contribution from ionic polaristion in %\n",
+ " \n",
+ "#result \n",
+ "print'percentage contribution from ionic polaristion = %3.2f'%d,'%';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Example 4.7,Page No:4.10"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 29,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "separation=1.69e-17 m\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "alpha = 0.18*10**-40; #polarisability of He in F *m**2\n",
+ "E = 3*10**5; #constant in V/m\n",
+ "N = 2.6*10**25; #number of atoms in per m**3\n",
+ "e = 1.6*10**-19;\n",
+ " \n",
+ " \n",
+ "#formula\n",
+ "#P=N*p\n",
+ "#charge of He=2*electron charge\n",
+ "#p=2(e*d)\n",
+ "#calculation\n",
+ "P = N*alpha*E; #in coul/m**2\n",
+ "p = P/float(N); #polarisation of He in coul.m\n",
+ "d = p/float(2*e); #separation between charges in m\n",
+ " \n",
+ " \n",
+ "#result \n",
+ "print'separation=%3.2e'%d,'m';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "collapsed": true
+ },
+ "source": [
+ "# Example 4.8,Page No:4.10"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "oriental polarisation=9.66e-08 coul/m**2\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "N = 10**27; #number of HCl molecules in molecules/m**3\n",
+ "E = 10**5; #electric field in V/m\n",
+ "P = 1.04*3.33*10**-30; #permanent dipole moment in coul.m\n",
+ "T = 300; #temperature in kelvin\n",
+ "K = 1.38*10**-23;\n",
+ " \n",
+ " \n",
+ "#calculation\n",
+ "P0 = (N*(P**2)*E)/float(3*K*T); #oriental polarisation in coul/m^2\n",
+ "\n",
+ " \n",
+ "#result\n",
+ "print'oriental polarisation=%3.2e'%P0,'coul/m**2';"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+ "source": []
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.6"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/sample_notebooks/kiruthikagowthaman/sample.ipynb b/sample_notebooks/kiruthikagowthaman/sample.ipynb new file mode 100755 index 00000000..cb4b710b --- /dev/null +++ b/sample_notebooks/kiruthikagowthaman/sample.ipynb @@ -0,0 +1 @@ +{"nbformat_minor": 0, "cells": [{"source": "# 02 Basic Structures: Sets, Functions, Sequences, Sums and Matrices", "cell_type": "markdown", "metadata": {}}, {"source": "##Example 07: Page 158", "cell_type": "markdown", "metadata": {}}, {"execution_count": 1, "cell_type": "code", "source": "f=[0,1,0,0,0,0,0] #assingning a[0],a[1] to the given values\nprint \"Fibonacci series is\"\nfor i in range(2,7): # iterations to find the successive values. If values are to be found for further terms the for loop \"stop\" has to be modified\n f[i]=f[i-1]+f[i-2]\n print \"f[\",i,\"]=f[\",i-1,\"]+f[\",i-2,\"]=\",f[i]", "outputs": [{"output_type": "stream", "name": "stdout", "text": "Fibonacci series is\nf[ 2 ]=f[ 1 ]+f[ 0 ]= 1\nf[ 3 ]=f[ 2 ]+f[ 1 ]= 2\nf[ 4 ]=f[ 3 ]+f[ 2 ]= 3\nf[ 5 ]=f[ 4 ]+f[ 3 ]= 5\nf[ 6 ]=f[ 5 ]+f[ 4 ]= 8\n"}], "metadata": {"collapsed": false, "trusted": true}}, {"execution_count": null, "cell_type": "code", "source": "", "outputs": [], "metadata": {"collapsed": true, "trusted": true}}], "nbformat": 4, "metadata": {"kernelspec": {"display_name": "Python 2", "name": "python2", "language": "python"}, "language_info": {"mimetype": "text/x-python", "nbconvert_exporter": "python", "version": "2.7.9", "name": "python", "file_extension": ".py", "pygments_lexer": "ipython2", "codemirror_mode": {"version": 2, "name": "ipython"}}}}
\ No newline at end of file diff --git a/sample_notebooks/lalithap/CHAPTER_10.ipynb b/sample_notebooks/lalithap/CHAPTER_10.ipynb new file mode 100755 index 00000000..d98f5fa8 --- /dev/null +++ b/sample_notebooks/lalithap/CHAPTER_10.ipynb @@ -0,0 +1,438 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:3d39a49f35ba76bcb7868f57a95e89d561517d277091abd70ccf055ceb540b97"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER 10-Wireless Communication Systems\n"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 10.1- PG NO.351"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#page 351\n",
+ "BW=12.5*10.**3.\n",
+ "TDR1=512.#transmission data rate\n",
+ "SPef1=TDR1/BW#spectral efficiency\n",
+ "\n",
+ "TDR2=1200.\n",
+ "SPef2=TDR2/BW\n",
+ "\n",
+ "TDR3=2400.\n",
+ "SPef3=TDR3/BW\n",
+ "print'%s %.2f' %('the spectral efficiency in bps/Hz at 512 bps transmission data rate',SPef1)\n",
+ "print'%s %.3f' %('the spectral efficiency in bps/Hz at 1200 bps transmission data rate',SPef2)\n",
+ "print'%s %.3f' %('the spectral efficiency in bps/Hz at 2400 bps transmission data rate',SPef3)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the spectral efficiency in bps/Hz at 512 bps transmission data rate 0.04\n",
+ "the spectral efficiency in bps/Hz at 1200 bps transmission data rate 0.096\n",
+ "the spectral efficiency in bps/Hz at 2400 bps transmission data rate 0.192\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 10.2- PG NO.352"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#page no.352\n",
+ "import math\n",
+ "P4dBW=-34.\n",
+ "PdBm4=P4dBW-30.\n",
+ "PW4=10**((PdBm4/10))\n",
+ "print '%s %.10f' %('minimum power level of class IV phone in mW',PW4)\n",
+ "\n",
+ "ERP1dBW=6.\n",
+ "PdBm1=ERP1dBW-30.\n",
+ "PW1=10.**((PdBm1/10.))\n",
+ "\n",
+ "print '%s %.6f' %('ERP of class I phone in mW',PW1)\n",
+ "R=PW1/PW4\n",
+ "RdB=10.*math.log(R)\n",
+ "\n",
+ "print '%s %.10f %s %.10f' %('minimum power level for a class I phone is greater than \\nminimum power level of class IV phone by factor of',RdB,'dB or',R)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "minimum power level of class IV phone in mW 0.0000003981\n",
+ "ERP of class I phone in mW 0.003981\n",
+ "minimum power level for a class I phone is greater than \n",
+ "minimum power level of class IV phone by factor of 92.1034037198 dB or 10000.0000000000\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 10.3- PG NO.353"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#page no.353\n",
+ "BW=25.*10.**3.#bandwidth of POCSAG=bandwidth of FLEX system\n",
+ "\n",
+ "TDR1=1200.# transmission data rate\n",
+ "SPef1=TDR1/BW#spectral efficiency\n",
+ "\n",
+ "TDR2=6400.\n",
+ "SPef2=TDR2/BW\n",
+ "print '%s %.3f' %('the spectral efficiency in bps/Hz at 1200 bps transmission data rate in POCSAG paging system',SPef1)\n",
+ "print '%s %.3f' %('the spectral efficiency in bps/Hz at 6400 bps transmission data rate in FLEX paging system',SPef2,)\n",
+ "\n",
+ "Cinc=TDR2/TDR1\n",
+ "print '%s %.1f' %('estimating increase in capacity in times',Cinc)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the spectral efficiency in bps/Hz at 1200 bps transmission data rate in POCSAG paging system 0.048\n",
+ "the spectral efficiency in bps/Hz at 6400 bps transmission data rate in FLEX paging system 0.256\n",
+ "estimating increase in capacity in times 5.3\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 10.6- PG NO.367"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#page no.367\n",
+ "Bt=12.5*10.**6.\n",
+ "Bg=10.*10.**3.\n",
+ "B2g=2.*Bg#Guard band on both the ends\n",
+ "ABW=Bt-B2g\n",
+ "Bc=30000.#channel bandwidth\n",
+ "N=ABW/Bc\n",
+ "print '%s %d' %('total no. of channels available in the system',N)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "total no. of channels available in the system 416\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 10.8- PG NO.374"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#page no.374\n",
+ "ERPmax1dB=6.\n",
+ "ERPmax2dB=-2.\n",
+ "DiffdB=ERPmax1dB-ERPmax2dB\n",
+ "Diff=10.**(DiffdB/10.)\n",
+ "Rfree=5.*(Diff)**(1./2.)#free space-case(a)\n",
+ "Rtypc=5.*(Diff)**(1./4.)#signal attenuation is proportional to 4th power-case(b)\n",
+ "print '%s %.1f' %('maximum communication range in km in a free space propogation condition-case(a)',Rfree)\n",
+ "print '%s %.2f' %('maximum communication range in km when signal attenuation is proportional to 4th power-case(b)',Rtypc)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "maximum communication range in km in a free space propogation condition-case(a) 12.6\n",
+ "maximum communication range in km when signal attenuation is proportional to 4th power-case(b) 7.92\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 10.11- PG NO.385"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#page no. 385\n",
+ "import math\n",
+ "P4dBW=-34.\n",
+ "PdBm4=P4dBW-30.\n",
+ "PW4=10.**((PdBm4/10.))\n",
+ "print '%s %.10f' %('minimum power level of class IV phone in mW',PW4)\n",
+ "\n",
+ "ERP1dBW=6.\n",
+ "PdBm1=ERP1dBW-30.\n",
+ "PW1=10.**((PdBm1/10.))\n",
+ "\n",
+ "print '%s %.6f' %('ERP of class I phone in mW',PW1)\n",
+ "R=PW1/PW4\n",
+ "RdB=10.*math.log(R)\n",
+ "\n",
+ "print '%s %.6f %s %.6f' %('minimum power level for a class I phone is greater than\\nminimum power level of class IV phone by factor of',RdB,'dB or',R)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "minimum power level of class IV phone in mW 0.0000003981\n",
+ "ERP of class I phone in mW 0.003981\n",
+ "minimum power level for a class I phone is greater than\n",
+ "minimum power level of class IV phone by factor of 92.103404 dB or 10000.000000\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 10.12- PG NO.387"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#page no.387\n",
+ "spfl=810*10**6\n",
+ "spfu=826*10**6\n",
+ "sprl=940*10**6\n",
+ "spru=956*10**6\n",
+ "BWf=spfu-spfl\n",
+ "BWr=spru-sprl\n",
+ "\n",
+ "BWc=10./100.*BWf#BWf=BWr(universal standard)\n",
+ "BWv=BWf-BWc\n",
+ "nsc=1150.\n",
+ "BWmax=BWv/nsc\n",
+ "SPef=1.68\n",
+ "CDRmax=BWmax*SPef\n",
+ "FECcr=0.5\n",
+ "DRnmax=FECcr*CDRmax\n",
+ "print '%s %.6f' %('there is a speech coder with a max. data rate of in bps',DRnmax)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "there is a speech coder with a max. data rate of in bps 10518.260870\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 10.13- PG NO.388"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#page no.388\n",
+ "d=40.*10.**0.\n",
+ "npf=6.\n",
+ "dts=d/npf#duration of a time slot of a voice frame\n",
+ "nbv=1944.\n",
+ "nbpts=nbv/npf#no. of bits per time slot\n",
+ "db=d/nbv#duration of a bit in secs\n",
+ "npg=6.\n",
+ "tg=db*npg#guard time in secs\n",
+ "c=3.*10.**8.\n",
+ "Disrt=c*tg\n",
+ "Dismx=Disrt/2.#max. distance\n",
+ "print '%s %.4f' %('duration of a time slot of a voice frame in secs',dts)\n",
+ "print '%s %d' %('no. of bits per time slot',nbpts)\n",
+ "print '%s %.2f' %('duration of a bit in microsecs',db*1000)\n",
+ "print '%s %d' %('guard time in microsecs',tg*1000)\n",
+ "print '%s %.2f' %('maximum distance between a cell site and a mobile in kilometres',Dismx/1000000)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "duration of a time slot of a voice frame in secs 6.6667\n",
+ "no. of bits per time slot 324\n",
+ "duration of a bit in microsecs 20.58\n",
+ "guard time in microsecs 123\n",
+ "maximum distance between a cell site and a mobile in kilometres 18.52\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 10.14- PG NO.389"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#page no.389\n",
+ "dv=40.*10.**-3.\n",
+ "nps=1./dv\n",
+ "nbpv=1944.\n",
+ "TGrbr=nbpv*25.\n",
+ "TGrbaur=TGrbr/2.#2 bits/symbol for pi/4 qpsk mod\n",
+ "CBW=30.*10.**3.\n",
+ "BWef=TGrbr/CBW\n",
+ "print '%s %.1f' %('total gross bit rate for the RF signal in Kbps',TGrbr/1000)\n",
+ "print '%s %.1f' %('total gross baud rate for the RF signal in Kbps',TGrbaur/1000)\n",
+ "print '%s %.1f' %('bandwidth efficiency in bps/Hz',BWef)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "total gross bit rate for the RF signal in Kbps 48.6\n",
+ "total gross baud rate for the RF signal in Kbps 24.3\n",
+ "bandwidth efficiency in bps/Hz 1.6\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 10.15- PG NO.391"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#PAGE NO.391\n",
+ "Bt=12.5*10.**6.\n",
+ "Bc=30.*10.**3.\n",
+ "K=7.#frequency reuse factor\n",
+ "N=Bt/Bc#total no. of available channels\n",
+ "M=N*(1./K)#user capacity per cell \n",
+ "\n",
+ "Nu=3.#no. of users/channel\n",
+ "NU=N*Nu\n",
+ "K1=4.\n",
+ "M1=NU*(1./K1)\n",
+ "\n",
+ "print '%s %d' %('capacity of 1G AMPS FDMA analog cellular system in users/cell',M)\n",
+ "print '%s %d' %('capacity of 2G IS-136 TDMA digital cellular system in users/cell',M1)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "capacity of 1G AMPS FDMA analog cellular system in users/cell 59\n",
+ "capacity of 2G IS-136 TDMA digital cellular system in users/cell 312\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/sample_notebooks/nemichand /Chapter1.ipynb b/sample_notebooks/nemichand /Chapter1.ipynb new file mode 100755 index 00000000..7cc7b973 --- /dev/null +++ b/sample_notebooks/nemichand /Chapter1.ipynb @@ -0,0 +1,561 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:04b8728a2a112ab03efb0f888eacfe0c6847d92d7043fbf038fc0d7708b1bf9e"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter1-Introduction of Electronic Device"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg34"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Ex1.1\n",
+ "#calcualte fusing current for given values\n",
+ "import math\n",
+ "print(\"I = K(d^1.5)\") ##formula used for fusing current\n",
+ "d=0.0031\n",
+ "print\"%s %.3f %s\"%(\"d = \",d,\"inches\") ##initializing values of diameter\n",
+ "I1=10244*(d**1.5);\n",
+ "I2=7585*(d**1.5);\n",
+ "I3=5320*(d**1.5); \n",
+ "I4=3148*(d**1.5); I5=1642*(d**1.5) ##calculation for fusing current\n",
+ "print\"%s %.2f %s\"%(\"for Copper, I = 10244*(d^1.5) = \",I1,\"Amp.\")\n",
+ "print\"%s %.2f %s\"%(\"for Aluminum, I = 7585*(d^1.5) = \",I2,\"Amp.\")\n",
+ "print\"%s %.2f %s\"%(\"for Silver, I = 5320*(d^1.5) = \",I3,\"Amp.\")\n",
+ "print\"%s %.2f %s\"%(\"for Iron, I = 3148*(d^1.5) = \",I4,\"Amp.\")\n",
+ "print\"%s %.2f %s\"%(\"for Tin, I = 1642*(d^1.5) = \",I5,\"Amp.\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "I = K(d^1.5)\n",
+ "d = 0.003 inches\n",
+ "for Copper, I = 10244*(d^1.5) = 1.77 Amp.\n",
+ "for Aluminum, I = 7585*(d^1.5) = 1.31 Amp.\n",
+ "for Silver, I = 5320*(d^1.5) = 0.92 Amp.\n",
+ "for Iron, I = 3148*(d^1.5) = 0.54 Amp.\n",
+ "for Tin, I = 1642*(d^1.5) = 0.28 Amp.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg34"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Ex1.2\n",
+ "#calculate fusing current for given values\n",
+ "print(\"fusing current, I = K(d**1.5) Amp.\")##formula used for fusing current\n",
+ "d=0.0201\n",
+ "print\"%s %.2f %s\"%(\"d = \",d,\"inches\") ##initializing value of diameter\n",
+ "I1=10244*(d**1.5);I2=7585*(d**1.5); I3=5320*(d**1.5); I4=3148*(d**1.5); I5=1642*(d**1.5) ##calculation for fusing current\n",
+ "print\"%s %.2f %s\"%(\"for Copper, I = 10244*(d**1.5) = \",I1,\"Amp.\")\n",
+ "print\"%s %.2f %s\"%(\"for Aluminum, I = 7585*(d**1.5) = \",I2,\"Amp.\")\n",
+ "print\"%s %.2f %s\"%(\"for Silver, I = 5320*(d**1.5) = \",I3,\"Amp.\")\n",
+ "print\"%s %.2f %s\"%(\"for Iron, I = 3148*(d**1.5) = \",I4,\"Amp.\")\n",
+ "print\"%s %.2f %s\"%(\"for Tin, I = 1642*(d**1.5) = \",I5,\"Amp.\")\n",
+ "\n",
+ "\n",
+ "## note : calculation for fusing current of Iron is wrong.\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "fusing current, I = K(d**1.5) Amp.\n",
+ "d = 0.02 inches\n",
+ "for Copper, I = 10244*(d**1.5) = 29.19 Amp.\n",
+ "for Aluminum, I = 7585*(d**1.5) = 21.61 Amp.\n",
+ "for Silver, I = 5320*(d**1.5) = 15.16 Amp.\n",
+ "for Iron, I = 3148*(d**1.5) = 8.97 Amp.\n",
+ "for Tin, I = 1642*(d**1.5) = 4.68 Amp.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg35"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Ex1.3\n",
+ "#calculate for fusing current in all four cases\n",
+ "import math\n",
+ "print(\"fusing current, I = K(d**1.5) Amp.\") ##formula used for fusing current\n",
+ "print(\"(a)\") \n",
+ "d=0.0159\n",
+ "print\"%s %.2f %s\"%(\"d = \",d,\"inches\") ##initializing value of diameter\n",
+ "I1=10244*(d**1.5);I2=7585*(d**1.5); I3=5320*(d**1.5); I4=3148*(d**1.5); I5=1642*(d**1.5) ##calculation for fusing current\n",
+ "print\"%s %.2f %s\"%(\"for Copper, I = 10244*(d**1.5) = \",I1,\"Amp.\")\n",
+ "print\"%s %.2f %s\"%(\"for Aluminum, I = 7585*(d**1.5) = \",I2,\"Amp.\")\n",
+ "print\"%s %.2f %s\"%(\"for Silver, I = 5320*(d**1.5) = \",I3,\"Amp.\")\n",
+ "print\"%s %.2f %s\"%(\"for Iron, I = 3148*(d**1.5) = \",I4,\"Amp.\")\n",
+ "print\"%s %.2f %s\"%(\"for Tin, I = 1642*(d**1.5) = \",I5,\"Amp.\")\n",
+ "\n",
+ "\n",
+ "print(\"(b)\")\n",
+ "d=0.0063\n",
+ "print\"%s %.2f %s\"%(\"d = \",d,\"inches\") ##initializing value of diameter\n",
+ "I1=10244*(d**1.5);I2=7585*(d**1.5); I3=5320*(d**1.5); I4=3148*(d**1.5); I5=1642*(d**1.5) ##calculation for fusing current\n",
+ "print\"%s %.2f %s\"%(\"for Copper, I = 10244*(d**1.5) = \",I1,\"Amp.\")\n",
+ "print\"%s %.2f %s\"%(\"for Aluminum, I = 7585*(d**1.5) = \",I2,\"Amp.\")\n",
+ "print\"%s %.2f %s\"%(\"for Silver, I = 5320*(d**1.5) = \",I3,\"Amp.\")\n",
+ "print\"%s %.2f %s\"%(\"for Iron, I = 3148*(d**1.5) = \",I4,\"Amp.\")\n",
+ "print\"%s %.2f %s\"%(\"for Tin, I = 1642*(d**1.5) = \",I5,\"Amp.\")\n",
+ "\n",
+ "\n",
+ "print(\"(c)\")\n",
+ "d=0.0403\n",
+ "print\"%s %.2f %s\"%(\"d = \",d,\"inches\") ##initializing value of diameter\n",
+ "I1=10244*(d**1.5);I2=7585*(d**1.5); I3=5320*(d**1.5); I4=3148*(d**1.5); I5=1642*(d**1.5) ##calculation for fusing current\n",
+ "print\"%s %.2f %s\"%(\"for Copper, I = 10244*(d**1.5) = \",I1,\"Amp.\")\n",
+ "print\"%s %.2f %s\"%(\"for Aluminum, I = 7585*(d**1.5) = \",I2,\"Amp.\")\n",
+ "print\"%s %.2f %s\"%(\"for Silver, I = 5320*(d**1.5) = \",I3,\"Amp.\")\n",
+ "print\"%s %.2f %s\"%(\"for Iron, I = 3148*(d**1.5) = \",I4,\"Amp.\")\n",
+ "print\"%s %.2f %s\"%(\"for Tin, I = 1642*(d**1.5) = \",I5,\"Amp.\")\n",
+ "\n",
+ "\n",
+ "print(\"(d)\")\n",
+ "d=0.0452\n",
+ "print\"%s %.2f %s\"%(\"d = \",d,\"inches\") ##initializing value of diameter\n",
+ "I1=10244*(d**1.5);I2=7585*(d**1.5); I3=5320*(d**1.5); I4=3148*(d**1.5); I5=1642*(d**1.5) ##calculation for fusing current\n",
+ "print\"%s %.2f %s\"%(\"for Copper, I = 10244*(d**1.5) = \",I1,\"Amp.\")\n",
+ "print\"%s %.2f %s\"%(\"for Aluminum, I = 7585*(d**1.5) = \",I2,\"Amp.\")\n",
+ "print\"%s %.2f %s\"%(\"for Silver, I = 5320*(d**1.5) = \",I3,\"Amp.\")\n",
+ "print\"%s %.2f %s\"%(\"for Iron, I = 3148*(d**1.5) = \",I4,\"Amp.\")\n",
+ "print\"%s %.2f %s\"%(\"for Tin, I = 1642*(d**1.5) = \",I5,\"Amp.\")\n",
+ "\n",
+ "\n",
+ "print(\"(e)\")\n",
+ "d=0.0508\n",
+ "print\"%s %.2f %s\"%(\"d = \",d,\"inches\") ##initializing value of diameter\n",
+ "I1=10244*(d**1.5);I2=7585*(d**1.5); I3=5320*(d**1.5); I4=3148*(d**1.5); I5=1642*(d**1.5) ##calculation for fusing current\n",
+ "print\"%s %.2f %s\"%(\"for Copper, I = 10244*(d**1.5) = \",I1,\"Amp.\")\n",
+ "print\"%s %.2f %s\"%(\"for Aluminum, I = 7585*(d**1.5) = \",I2,\"Amp.\")\n",
+ "print\"%s %.2f %s\"%(\"for Silver, I = 5320*(d**1.5) = \",I3,\"Amp.\")\n",
+ "print\"%s %.2f %s\"%(\"for Iron, I = 3148*(d**1.5) = \",I4,\"Amp.\")\n",
+ "print\"%s %.2f %s\"%(\"for Tin, I = 1642*(d**1.5) = \",I5,\"Amp.\")\n",
+ "\n",
+ "\n",
+ "print(\"(f)\")\n",
+ "d=0.162\n",
+ "print\"%s %.2f %s\"%(\"d = \",d,\"inches\") ##initializing value of diameter\n",
+ "I1=10244*(d**1.5);I2=7585*(d**1.5); I3=5320*(d**1.5); I4=3148*(d**1.5); I5=1642*(d**1.5) ##calculation for fusing current\n",
+ "print\"%s %.2f %s\"%(\"for Copper, I = 10244*(d**1.5) = \",I1,\"Amp.\")\n",
+ "print\"%s %.2f %s\"%(\"for Aluminum, I = 7585*(d**1.5) = \",I2,\"Amp.\")\n",
+ "print\"%s %.2f %s\"%(\"for Silver, I = 5320*(d**1.5) = \",I3,\"Amp.\")\n",
+ "print\"%s %.2f %s\"%(\"for Iron, I = 3148*(d**1.5) = \",I4,\"Amp.\")\n",
+ "print\"%s %.2f %s\"%(\"for Tin, I = 1642*(d**1.5) = \",I5,\"Amp.\")\n",
+ "\n",
+ "\n",
+ "\n",
+ "## note : in part (e) ... calculation for fusing current of silver is wrong.\n",
+ "## note : in part (f) ... calculation for fusing current of Iron is wrong.\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "fusing current, I = K(d**1.5) Amp.\n",
+ "(a)\n",
+ "d = 0.02 inches\n",
+ "for Copper, I = 10244*(d**1.5) = 20.54 Amp.\n",
+ "for Aluminum, I = 7585*(d**1.5) = 15.21 Amp.\n",
+ "for Silver, I = 5320*(d**1.5) = 10.67 Amp.\n",
+ "for Iron, I = 3148*(d**1.5) = 6.31 Amp.\n",
+ "for Tin, I = 1642*(d**1.5) = 3.29 Amp.\n",
+ "(b)\n",
+ "d = 0.01 inches\n",
+ "for Copper, I = 10244*(d**1.5) = 5.12 Amp.\n",
+ "for Aluminum, I = 7585*(d**1.5) = 3.79 Amp.\n",
+ "for Silver, I = 5320*(d**1.5) = 2.66 Amp.\n",
+ "for Iron, I = 3148*(d**1.5) = 1.57 Amp.\n",
+ "for Tin, I = 1642*(d**1.5) = 0.82 Amp.\n",
+ "(c)\n",
+ "d = 0.04 inches\n",
+ "for Copper, I = 10244*(d**1.5) = 82.88 Amp.\n",
+ "for Aluminum, I = 7585*(d**1.5) = 61.36 Amp.\n",
+ "for Silver, I = 5320*(d**1.5) = 43.04 Amp.\n",
+ "for Iron, I = 3148*(d**1.5) = 25.47 Amp.\n",
+ "for Tin, I = 1642*(d**1.5) = 13.28 Amp.\n",
+ "(d)\n",
+ "d = 0.05 inches\n",
+ "for Copper, I = 10244*(d**1.5) = 98.44 Amp.\n",
+ "for Aluminum, I = 7585*(d**1.5) = 72.89 Amp.\n",
+ "for Silver, I = 5320*(d**1.5) = 51.12 Amp.\n",
+ "for Iron, I = 3148*(d**1.5) = 30.25 Amp.\n",
+ "for Tin, I = 1642*(d**1.5) = 15.78 Amp.\n",
+ "(e)\n",
+ "d = 0.05 inches\n",
+ "for Copper, I = 10244*(d**1.5) = 117.29 Amp.\n",
+ "for Aluminum, I = 7585*(d**1.5) = 86.85 Amp.\n",
+ "for Silver, I = 5320*(d**1.5) = 60.91 Amp.\n",
+ "for Iron, I = 3148*(d**1.5) = 36.04 Amp.\n",
+ "for Tin, I = 1642*(d**1.5) = 18.80 Amp.\n",
+ "(f)\n",
+ "d = 0.16 inches\n",
+ "for Copper, I = 10244*(d**1.5) = 667.95 Amp.\n",
+ "for Aluminum, I = 7585*(d**1.5) = 494.57 Amp.\n",
+ "for Silver, I = 5320*(d**1.5) = 346.88 Amp.\n",
+ "for Iron, I = 3148*(d**1.5) = 205.26 Amp.\n",
+ "for Tin, I = 1642*(d**1.5) = 107.06 Amp.\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg37"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Ex1.4\n",
+ "#calculate resistance for given resistivity\n",
+ "import math\n",
+ "A=0.5189*10**-6##wire cross sectional area\n",
+ "rho=1.725*10**-8##resistivity\n",
+ "l=100 ##wire length\n",
+ "print\"%s %.3e %s\"%(\"A =\",A,\"merer square\") \n",
+ "print\"%s %.2e %s\"%(\"rho =\",rho,\"ohm-m\")\n",
+ "print\"%s %.2f %s\"%(\"l =\",l,\"m\")\n",
+ "print\"%s %.2f %s\"%(\"R = rho*l/A = \",rho*l/A,\"ohm\") ##resistance\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "A = 5.189e-07 merer square\n",
+ "rho = 1.73e-08 ohm-m\n",
+ "l = 100.00 m\n",
+ "R = rho*l/A = 3.32 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5-pg38"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Ex1.5\n",
+ "#calculate resistance wire\n",
+ "import math\n",
+ "A=0.2588*10**-6##wire cross-sectional area\n",
+ "rho=1.725*10**-8##resistivity\n",
+ "l=100 ##wire length\n",
+ "print\"%s %.2e %s\"%(\"A =\",A,\"merer square\")\n",
+ "print\"%s %.2e %s\"%(\"rho =\",rho,\"ohm-m\")\n",
+ "print\"%s %.2f %s\"%(\"l =\",l,\"m\")\n",
+ "print\"%s %.2f %s\"%(\"R = rho*l/A = \",rho*l/A,\"ohm\") ##resistance of wire\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "A = 2.59e-07 merer square\n",
+ "rho = 1.73e-08 ohm-m\n",
+ "l = 100.00 m\n",
+ "R = rho*l/A = 6.67 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6-pg39"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Ex1.6\n",
+ "#calculate resistance at temperature at T2\n",
+ "R1 = 14##resistance at temperature T1 \n",
+ "alpha=0.005\n",
+ "T1=20;##initial temperature\n",
+ "T2=120 ##final temperature\n",
+ "print\"%s %.2f %s %.2f %s %.2f %s%.2f %s \"%(\"R1 = \",R1, \"ohm\"and\" alpha = \",alpha,\"\"and \" T1 = \",T1,\"degreeC\"and \"T2 = \",T2,\"degreeC\")\n",
+ "print\"%s %.2f %s\"%(\"R2 = R1(1+(alpha*(T1-T2))) = \",R1*(1+(alpha*(T2-T1))),\"ohm\") ##resistance at temperature T2\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "R1 = 14.00 alpha = 0.01 20.00 T2 = 120.00 degreeC \n",
+ "R2 = R1(1+(alpha*(T1-T2))) = 21.00 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7-pg40"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##EX1.7\n",
+ "#calculate force of electron charge\n",
+ "import math\n",
+ "Ex=3;Ey=4;Ez=2##electric field\n",
+ "e=1.6*10**-19 ##electorn charge\n",
+ "print(\"E = 3ax + 4ay + 2az k V/m\")\n",
+ "print(\"e = 1.6*10**-19 C\")\n",
+ "print\"%s %.2e %s %.2e %s %.2e %s \"%(\" F=eE = \",Ex*e*1000,\"ax + \",Ey*e*1000,\"ay + \",Ez*e*1000,\"az N\") ##force\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "E = 3ax + 4ay + 2az k V/m\n",
+ "e = 1.6*10**-19 C\n",
+ " F=eE = 4.80e-16 ax + 6.40e-16 ay + 3.20e-16 az N \n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex8-pg40"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Ex1.8\n",
+ "#calculate elctric field\n",
+ "import math\n",
+ "F=0.1*10**-12##force applied\n",
+ "e = 1.6*10**-19##electron charge\n",
+ "print\"%s %.2e %s %.2e %s \"%(\"F= \",F,\"N \"and \" e = \",e,\"C\")\n",
+ "print\"%s %.2f %s\"%(\"E = F/e =\",F/e,\"V/m\")##electric field\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "F= 1.00e-13 e = 1.60e-19 C \n",
+ "E = F/e = 625000.00 V/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex9-pg41"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Ex1.9\n",
+ "#calculate charge of electron\n",
+ "import math\n",
+ "F = 3*(10**-12) ##force applied\n",
+ "E = 5*(10**-6) ##electric field\n",
+ "print\"%s %.2e %s\"%(\"F = \",F,\"N\")\n",
+ "print\"%s %.2e %s\"%(\"E = \",E,\"V/m\")\n",
+ "print\"%s %.2e %s\"%(\"Q= F/E = \",F/E,\"C\") ##chage\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "F = 3.00e-12 N\n",
+ "E = 5.00e-06 V/m\n",
+ "Q= F/E = 6.00e-07 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex10-pg44"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Ex1.10\n",
+ "#calculate force \n",
+ "import math\n",
+ "B = 2*10**-6 ##magnetic flux density\n",
+ "V = 4*10**6 ##electron velocity\n",
+ "e= 1.6*10**-19##elcetron charge\n",
+ "print\"%s %.2e %s\"%(\"B =\",B,\"ax wb/m.sq\")\n",
+ "print\"%s %.2f %s\"%(\"V =\",V,\"az m/s\")\n",
+ "print\"%s %.3e %s\"%(\"e = \",e, \"C\")\n",
+ "print\"%s %.2e %s\"%(\"F = e[VxB] =\",e*V*B,\"ay N\")##force\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "B = 2.00e-06 ax wb/m.sq\n",
+ "V = 4000000.00 az m/s\n",
+ "e = 1.600e-19 C\n",
+ "F = e[VxB] = 1.28e-18 ay N\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Ex11-pg44"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Ex1.11\n",
+ "#calculate force on electron due to field\n",
+ "import math\n",
+ "Hx = 1*10**-3 ##magnetic field in x-axis\n",
+ "Hy = 2*10**-3 ##magnetic field in y-axis\n",
+ "V = (4*10**6) ##electron velocity\n",
+ "micro_not=(4*math.pi*(10**-7)) ##permitivity in vaccum\n",
+ "e=1.6*10**-19 ##charge of electorn\n",
+ "print\"%s %.2e %s %.2e %s \"%(\" H = \",Hx,\"ax + \",Hy,\"ay A/m\")\n",
+ "print\"%s %.2f %s\"%(\"V = \",V,\"ay m/s\")\n",
+ "Bx = micro_not*Hx; By = micro_not*Hy ##magnetic flux density\n",
+ "print\"%s %.2e %s %.2e %s \"%(\"B = micro_not*H = \",Bx,\"ax + \",By,\"ay wb/m.sq\")\n",
+ "print\"%s %.2e %s \"%(\"F = e[VxB] = \",e*V*Bx,\"az N\") ##force on electron due to field\n",
+ "\n",
+ "\n",
+ "## note : there is a misprint in the textbook for the above problem\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " H = 1.00e-03 ax + 2.00e-03 ay A/m \n",
+ "V = 4000000.00 ay m/s\n",
+ "B = micro_not*H = 1.26e-09 ax + 2.51e-09 ay wb/m.sq \n",
+ "F = e[VxB] = 8.04e-22 az N \n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/sample_notebooks/prashanthkumar/Chapter2.ipynb b/sample_notebooks/prashanthkumar/Chapter2.ipynb new file mode 100755 index 00000000..69ffbced --- /dev/null +++ b/sample_notebooks/prashanthkumar/Chapter2.ipynb @@ -0,0 +1,380 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:65e0b3e473f1ff9e1fb88bbe82db5b1910d224d981154e6bf073ba0169001ee9"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter2-Analysis of Stress(Equlibrium) "
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg54"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#find the new stress tensor tau\n",
+ "import numpy.linalg\n",
+ "## initialization of variables\n",
+ "\n",
+ "tau=([[200, 100, 0],\n",
+ " [100, 0, 0],\n",
+ " [0 ,0, 500]]) ## some units\n",
+ "theta=60. ## degrees\n",
+ "##calculations\n",
+ "theta1=theta/57.3\n",
+ "a=([[math.cos(theta1), math.sin(theta1), 0],\n",
+ " [-math.sin(theta1), math.cos(theta1), 0],\n",
+ " [0, 0, 1]])\n",
+ "b=numpy.transpose(a)\n",
+ "tau_new=numpy.dot(a,tau)\n",
+ "tau_new1=numpy.dot(tau_new,b)\n",
+ "## Results\n",
+ "print('The new stress tensor is')\n",
+ "print tau_new1"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The new stress tensor is\n",
+ "[[ 136.62361289 -136.59689227 0. ]\n",
+ " [-136.59689227 63.37638711 0. ]\n",
+ " [ 0. 0. 500. ]]\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5-pg61"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "find the octahedral at this point\n",
+ "## initialization of variables\n",
+ "import math\n",
+ "sigma_1=100. ##kg*f/cm^2\n",
+ "sigma_2=100. ##kg*f/cm^2\n",
+ "sigma_3=-200. ##kg*f/cm^2\n",
+ "## calculations\n",
+ "tau_oct=1/3.*math.sqrt((sigma_1-sigma_2)**2+(sigma_2-sigma_3)**2+(sigma_3-sigma_1)**2)\n",
+ "## Results\n",
+ "print'%s %.2f %s '%('Octahedra shear stress at the point is=',tau_oct,' kgf/cm^2')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Octahedra shear stress at the point is= 141.42 kgf/cm^2 \n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7-pg61"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#check whether the invariants of stress sensor\n",
+ "import numpy.linalg\n",
+ "## initialization of variable\n",
+ "tau=numpy.matrix([[200, 100, 0],\n",
+ " [100, 0, 0],\n",
+ " [0, 0, 500]]) ## some units\n",
+ "theta=60. ## degrees\n",
+ "##calculations\n",
+ "theta=theta*math.pi/180.\n",
+ "a=numpy.matrix([[math.cos(theta), math.sin(theta), 0],\n",
+ " [-math.sin(theta), math.cos(theta), 0],\n",
+ " [0, 0, 1]])\n",
+ "b=numpy.transpose(a)\n",
+ "tau_new=numpy.dot(a,tau)\n",
+ "tau_new1=numpy.dot(tau_new,b)\n",
+ "\n",
+ "## stress invariants :old \n",
+ "I1=tau[0,0]+tau[1,1]+tau[2,2]\n",
+ "I2=tau[0,0]*tau[1,1]+tau[1,1]*tau[2,2]+tau[2,2]*tau[0,0]-(tau[0,1]**2+tau[1,2]**2+tau[2,0]**2)\n",
+ "I3=tau[0,0]*tau[1,1]*tau[2,2]+2*tau[0,1]*tau[1,2]*tau[2,0]-(tau[0,0]*tau[1,2]**2+tau[1,1]*tau[2,0]**2+tau[2,2]*tau[0,1]**2)\n",
+ "\n",
+ "## stress invariants :new\n",
+ "I11=tau_new1[0,0]+tau_new1[0,0]+tau_new1[1,1]\n",
+ "I22=tau_new1[0,0]*tau_new1[1,1]+tau_new1[1,1]*tau_new1[2,2]+tau_new1[1,1]*tau_new1[0,0]-[tau_new1[0,1]**2+tau_new1[1,2]**2+tau_new1[1,0]**2]\n",
+ "I33=tau_new1[0,0]*tau_new1[1,1]*tau_new1[2,2]+2*tau_new1[0,1]*tau_new1[1,2]*tau_new1[2,0]-[tau_new1[0,0]*tau_new1[1,2]**2+tau_new1[1,1]*tau_new1[2,0]**2+tau_new1[2,2]*tau_new1[0,1]**2]\n",
+ "\n",
+ "## Results\n",
+ "print'%s %.2f %s %.2f %s %.2f %s %.2f %s %.2f %s %.2f' %('The invariants of old stress tensor are I1=',I1,' I2=',I2,' I3=',I3,' \\n and that of the new stress tensor are I1=',I11,' I2=',I22,' I3=',I33)\n",
+ "\n",
+ "print('\\n Hence the same stress tensor invariants')\n",
+ "\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The invariants of old stress tensor are I1= 700.00 I2= 90000.00 I3= -5000000.00 \n",
+ " and that of the new stress tensor are I1= 336.60 I2= 11698.73 I3= -5000000.00\n",
+ "\n",
+ " Hence the same stress tensor invariants\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex8-pg67"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "## initialization of variables\n",
+ "#find the value of sigma 1 and sigma2 at biaxial yeilding and unaxial\n",
+ "sigma_3=0. ## kgf/cm**2\n",
+ "tau_oct=1500. ## kgf/cm**2\n",
+ "n=2 ## given that sigma_1=n*sigma_2\n",
+ "## calculations\n",
+ "sigma_2=1500.*3./(math.sqrt(2*n**2-2*n+2)) ## ## kgf/cm**2\n",
+ "sigma_1=n*sigma_2 ## kgf/cm**2 \n",
+ "sigma_0=4500./math.sqrt(2.) ## kgf/cm**2\n",
+ "## Results\n",
+ "print'%s %.2f %s %.2f %s %.2f %s '%('The necessary stresses sigma_1, sigma_2 for biaxial yielding are \\n ',sigma_2,' kgf/cm^2' '',sigma_1,' kgf/cm^2' and 'for uniaxial yielding sigma_0 ',sigma_0,'kgf/cm^2.')\n",
+ " \n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The necessary stresses sigma_1, sigma_2 for biaxial yielding are \n",
+ " 1837.12 kgf/cm^2 3674.23 for uniaxial yielding sigma_0 3181.98 kgf/cm^2. \n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex9-pg68"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "##initialization of variables\n",
+ "#find the magnitude and direction of principal stress for the a b c\n",
+ "## part (a)\n",
+ "tau_xx=300 ## kgf/cm**2\n",
+ "tau_yy=0 ## kgf/cm**2\n",
+ "tau_xy=600 ## kgf/cm**2\n",
+ "##calculations\n",
+ "sigma_1=(tau_xx+tau_yy)/2.+math.sqrt((1./2.*(tau_xx-tau_yy))**2+tau_xy**2)\n",
+ "sigma_2=(tau_xx+tau_yy)/2-math.sqrt((1/2.*(tau_xx-tau_yy))**2+tau_xy**2)\n",
+ "Beta=math.atan(2*tau_xy/(tau_xx-tau_yy))\n",
+ "Beta=Beta*180/math.pi\n",
+ "##Results\n",
+ "print'%s %.2f%s %.2f %s %.2f %s'%('\\n Part (a) \\n The magnitude of principal stresses are',sigma_1,''and '',sigma_2,'kgf/cm^2' and' \\n the direction is given by 2*beta=',Beta,'')\n",
+ "\n",
+ "\n",
+ "##part (b)\n",
+ "tau_xx=1000 ## kgf/cm**2\n",
+ "tau_yy=150 ## kgf/cm**2\n",
+ "tau_xy=450 ## kgf/cm**2\n",
+ "## calculations\n",
+ "sigma_1=(tau_xx+tau_yy)/2+math.sqrt((1/2*(tau_xx-tau_yy))**2+tau_xy**2)\n",
+ "sigma_2=(tau_xx+tau_yy)/2-math.sqrt((1/2*(tau_xx-tau_yy))**2+tau_xy**2)\n",
+ "Beta=math.atan(2*tau_xy/(tau_xx-tau_yy))\n",
+ "Beta1=Beta*180./math.pi\n",
+ "## Results\n",
+ "print'%s %.2f %s %.2f %s %.2f %s '%('\\n Part (b) \\n The magnitude of principal stresses are',sigma_1,''and '',sigma_2,'kgf/cm^2' and' \\n the direction is given by 2*beta=',Beta1,'')\n",
+ "\n",
+ "## part (c)\n",
+ "tau_xx=-850 ## kgf/cm**2\n",
+ "tau_yy=350 ## kgf/cm**2\n",
+ "tau_xy=700 ## kgf/cm**2\n",
+ "## calculations\n",
+ "sigma_1=(tau_xx+tau_yy)/2+math.sqrt((1/2*(tau_xx-tau_yy))**2+tau_xy**2)\n",
+ "sigma_2=(tau_xx+tau_yy)/2-math.sqrt((1/2*(tau_xx-tau_yy))**2+tau_xy**2)\n",
+ "Beta=math.atan(2*tau_xy/(tau_xx-tau_yy))\n",
+ "Beta=Beta*57.3\n",
+ "## Results\n",
+ "print'%s %.2f %s %.2f %s %.2f %s '%('\\n Part (c) \\n The magnitude of principal stresses are',sigma_1,''and '',sigma_2,'kgf/cm^2' and' \\n the direction is given by 2*beta=',-Beta,'')\n",
+ " \n",
+ "\n",
+ "## wrong answers were given in textbook for part (b)\n",
+ "\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " Part (a) \n",
+ " The magnitude of principal stresses are 768.47 -468.47 \n",
+ " the direction is given by 2*beta= 75.96 \n",
+ "\n",
+ " Part (b) \n",
+ " The magnitude of principal stresses are 1025.00 125.00 \n",
+ " the direction is given by 2*beta= 45.00 \n",
+ "\n",
+ " Part (c) \n",
+ " The magnitude of principal stresses are 450.00 -950.00 \n",
+ " the direction is given by 2*beta= 63.44 \n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex10-pg70"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "# initialization of variables\n",
+ "#find the intensity of diagonal tension\n",
+ "tau_xx= -1 # kgf/cm^2\n",
+ "tau_yy= 0 # kgf/cm^2\n",
+ "tau_xy= 7 # kgf/cm^2\n",
+ "# calculations \n",
+ "sigma_1=(tau_xx+tau_yy)/2.+math.sqrt((1/2.*(tau_xx-tau_yy))**2+tau_xy**2)\n",
+ "sigma_2=(tau_xx+tau_yy)/2.-math.sqrt((1/2.*(tau_xx-tau_yy))**2+tau_xy**2)\n",
+ "x=sigma_1 # positive one is tension\n",
+ "if(sigma_2>sigma_1):\n",
+ " x=sigma_2\n",
+ "\n",
+ "# Results\n",
+ "print'%s %.2f %s'%('The diagonal tension is ',x,' kgf/cm^2')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The diagonal tension is 6.52 kgf/cm^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex11-pg70"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "# initialization of variables\n",
+ "#find the state of stress at the joint\n",
+ "d=2 # m\n",
+ "l=10 # m\n",
+ "t=1 # cm\n",
+ "p=15 # kgf/cm^2\n",
+ "pitch= 2*math.pi #m\n",
+ "##calculations\n",
+ "w=2*math.pi*d/2. # m\n",
+ "theta=math.atan(w/(2*math.pi))\n",
+ "sigma_z=p*d*100./(4.*t)\n",
+ "sigma_th=p*d*100./(2.*t)\n",
+ "sigma_th_new=(sigma_th+sigma_z)/2.+(sigma_th-sigma_z)/2.*math.cos(2*theta)\n",
+ "tau_thz=(sigma_z-sigma_th)*math.sin(2.*theta)/2\n",
+ "# results\n",
+ "print'%s %.2f %s %.2f %s '%('At the junction, the normal and shear stresses are',sigma_th_new,'' and '',-tau_thz,' kgf/cm^2 \\n respectively, and the rivets must be designed for this')"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "At the junction, the normal and shear stresses are 1125.00 375.00 kgf/cm^2 \n",
+ " respectively, and the rivets must be designed for this \n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/sample_notebooks/rohitmahadev/Chapter1.ipynb b/sample_notebooks/rohitmahadev/Chapter1.ipynb new file mode 100755 index 00000000..2349fbd8 --- /dev/null +++ b/sample_notebooks/rohitmahadev/Chapter1.ipynb @@ -0,0 +1,274 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:85e9fe66492d8e2bf21b397989dbba9327240cd1300820fe26869c1390e3cf15"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter1-Introduction fluid mechanics"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg13"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "##initialization of new variables\n",
+ "#calculate density \n",
+ "M=29. ## Molecular weight of air\n",
+ "R=8314.3 ## J/mol K Gas constant\n",
+ "T=300. ##K Temperature\n",
+ "P=1. ##kg/cm^2 Pressure\n",
+ "g=9.8 ##m/s^2 Acceleration due to gravity\n",
+ "##calculations\n",
+ "R=R/M\n",
+ "P=P*g*10**4\n",
+ "rho=P/(R*T)\n",
+ "##result\n",
+ "print'%s %.2f %s'%(' Density = ',rho,' kg/m^3 ')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Density = 1.14 kg/m^3 \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg13"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "##initialization of new variables\n",
+ "#calculate shear stress\n",
+ "t=2. ##cm thickness\n",
+ "U=3. ##m/s Velocity\n",
+ "mu=0.29 ##kg/m s Coefficient of Viscocity\n",
+ "##calculations\n",
+ "tau=mu*U/(t*10**-2)\n",
+ "##results\n",
+ "print'%s %.2f %s'%(' Shear = ',tau,' N/m^2')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Shear = 43.50 N/m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg13"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "##initialization of new variables\n",
+ "#calculate pressure differnce\n",
+ "sigma=2.5*10**-2 ##N/m\n",
+ "D=10 ##cm\n",
+ "##calculations\n",
+ "R=D/2.\n",
+ "dP=2.*sigma/(R*10**-2)\n",
+ "##result\n",
+ "print'%s %.2f %s'%('The pressure difference is = ',dP,' N/m^2')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The pressure difference is = 1.00 N/m^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg15"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "##initialization of new variables\n",
+ "#calculate rise of water and rise of mercury\n",
+ "R=1. ##mm\n",
+ "sigma=0.073 ##N/m\n",
+ "theta=0. ##degrees\n",
+ "rho=1000. ##kg/m^3\n",
+ "g=9.8 ##m/s^2\n",
+ "##calculations\n",
+ "theta=theta*math.pi/180 ##radians\n",
+ "h=2*sigma*math.cos(theta)/(rho*g*R*10**-3)\n",
+ "##result\n",
+ "print'%s %.2f %s'%('The rise of water = ',h,' m')\n",
+ "R=1. ##mm\n",
+ "sigma=0.48 ##N/m\n",
+ "theta=130. ##degrees\n",
+ "rho=13600. ##kg/m^3\n",
+ "g=9.8 ##m/s^2\n",
+ "##calculations\n",
+ "theta=theta*math.pi/180 ##radians\n",
+ "h=2*sigma*math.cos(theta)/(rho*g*R*10**-3)\n",
+ "##result\n",
+ "print'%s %.2e %s'%('\\n The rise of mercury = ',h,' m')\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The rise of water = 0.01 m\n",
+ "\n",
+ " The rise of mercury = -4.63e-03 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5-pg15"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "##initialization of new variables\n",
+ "#calculate chenge in pressure and change in volume\n",
+ "E=2.34*10**9 ##N/m^2 Modulus of Elasticity\n",
+ "d=1 ##km depth\n",
+ "rho=1000. ##kg/m^3 density\n",
+ "g=9.8 ##m/s^2 Acceleration due to gravity\n",
+ "##calculations\n",
+ "d=d*1000. \n",
+ "dp=rho*g*d\n",
+ "dVV=dp/E\n",
+ "##result\n",
+ "print'%s %.2e %s'%('The change in pressure is ',dp,' N/m^2 ')\n",
+ "print'%s %.3e %s'%('\\n Change in volume is ',dVV,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The change in pressure is 9.80e+06 N/m^2 \n",
+ "\n",
+ " Change in volume is 4.188e-03 \n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6-pg16"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "##initialization of new variables\n",
+ "#calculate speed of sound in air and speed of sound in sea water\n",
+ "T=300. ##K\n",
+ "gama=1.4\n",
+ "R=286.6\n",
+ "##calculation\n",
+ "## for air\n",
+ "a=math.sqrt(gama*R*T)\n",
+ "##result\n",
+ "print'%s %.2f %s'%('The speed of sound in air is ',a,' m/s ')\n",
+ "## for sea water\n",
+ "E=2.34*10**9 ## N/m^2\n",
+ "rho=1000. ##kg/cm^2\n",
+ "a=math.sqrt(E/rho)\n",
+ "##result\n",
+ "print'%s %.2f %s'%(' \\n The speed of sound in sea waer is ',a,' m/s ')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The speed of sound in air is 346.95 m/s \n",
+ " \n",
+ " The speed of sound in sea waer is 1529.71 m/s \n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/sample_notebooks/srinivasparupalli/CHAPTER_1.ipynb b/sample_notebooks/srinivasparupalli/CHAPTER_1.ipynb new file mode 100755 index 00000000..1f882de6 --- /dev/null +++ b/sample_notebooks/srinivasparupalli/CHAPTER_1.ipynb @@ -0,0 +1,347 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:80f88a972947f3f07c0690a368a00c796fad1cccb9df59741b4a8c03cd1e434e"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER 1- FUNDAMENTAL CONCEPTS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 1.1- PG NO:4"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 1.1#\n",
+ "#clears the screen#\n",
+ "#clears the existing variables#\n",
+ "print('the locker door (Y) can be opened using one key (A) which is with you and the other key (B) which is with the bank executive. When both the keys are used, the locker door opens, i.e. the locker door can be opened (Y=1) only when both the keys are applied(A=B=1).Thus, this can be expressed as an AND operation')\n",
+ "print('Y=A*B')"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the locker door (Y) can be opened using one key (A) which is with you and the other key (B) which is with the bank executive. When both the keys are used, the locker door opens, i.e. the locker door can be opened (Y=1) only when both the keys are applied(A=B=1).Thus, this can be expressed as an AND operation\n",
+ "Y=A*B\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 1.3 - PG NO.6"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 1.3#\n",
+ "#clears the screen#\n",
+ "#clears already existing variables#\n",
+ "print('Let the temperature and pressure be converted into electrical signals and T=1 if temperature exceeds the specified limit and P=1 if pressure exceeds the specified limit. If T=1 or P=1 or both T and P are 1 then the alarm is required to be activated, i.e., the signal applied to the alarm Y=1. This operation can be expressed as an or operation.')\n",
+ "print('Y=T or P')\n",
+ "print('Y=T+P')"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Let the temperature and pressure be converted into electrical signals and T=1 if temperature exceeds the specified limit and P=1 if pressure exceeds the specified limit. If T=1 or P=1 or both T and P are 1 then the alarm is required to be activated, i.e., the signal applied to the alarm Y=1. This operation can be expressed as an or operation.\n",
+ "Y=T or P\n",
+ "Y=T+P\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 1.7.a - PG NO:10"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 1.7(a)#\n",
+ "#clears the screen#\n",
+ "#clears already existing variables#\n",
+ "print('when one of the logic input of 2-input NAND gate is 0, then irrespective of the other input, the output comes out to be 1. In fact, a NAND gate is disabled or inhibited if one of its inputs is connected to logic 0')\n",
+ "print('Y=1')"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "when one of the logic input of 2-input NAND gate is 0, then irrespective of the other input, the output comes out to be 1. In fact, a NAND gate is disabled or inhibited if one of its inputs is connected to logic 0\n",
+ "Y=1\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 1.7.b - PG NO:11"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 1.7(b)#\n",
+ "#clears the screen#\n",
+ "#clears already existing variables#\n",
+ "print('when one of the logic input of 2-input NAND gate is 1, then when A=1, Y=0 and if A=0, Y=1')\n",
+ "print('Y= ~A')"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "when one of the logic input of 2-input NAND gate is 1, then when A=1, Y=0 and if A=0, Y=1\n",
+ "Y= ~A\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 1.9.a - PG NO:12"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 1.9(a)#\n",
+ "#clears the screen#\n",
+ "#clears already existing variables#\n",
+ "print('when one of the logic input of 2-input NOR gate is 0, then when A=1, Y=0 and if A=0, Y=1')\n",
+ "print('Y= ~A')"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "when one of the logic input of 2-input NOR gate is 0, then when A=1, Y=0 and if A=0, Y=1\n",
+ "Y= ~A\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 1.9.b - PG NO:12"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 1.9(b)#\n",
+ "#clears the screen#\n",
+ "#clears already existing variables#\n",
+ "print('when one of the logic input of 2-input NOR gate is 1, then irrespective of the other input, the output comes out to be 0. In fact, a NAND gate is disabled or inhibited if one of its inputs is connected to logic 1')\n",
+ "print('Y=0')\n",
+ "print('here the output of Y is 0 irrespective of input of A')"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "when one of the logic input of 2-input NOR gate is 1, then irrespective of the other input, the output comes out to be 0. In fact, a NAND gate is disabled or inhibited if one of its inputs is connected to logic 1\n",
+ "Y=0\n",
+ "here the output of Y is 0 irrespective of input of A\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 1.11.a - PG NO:14"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 1.11(a)#\n",
+ "#clears the screen#\n",
+ "#clears already existing variables#\n",
+ "print('If we connect one input of EX-OR gate to 0 permanently, we observe that Y=A*0+A*0')\n",
+ "print('thus, Y=A')"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "If we connect one input of EX-OR gate to 0 permanently, we observe that Y=A*0+A*0\n",
+ "thus, Y=A\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 1.11.b- PG NO:14"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 1.11(b)#\n",
+ "#clears the screen#\n",
+ "#clears already existing variables#\n",
+ "print('If we connect one input of EX-OR gate to 1 permanently, we observe that Y=A*1+A*1')\n",
+ "print('thus, Y= ~A')"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "If we connect one input of EX-OR gate to 1 permanently, we observe that Y=A*1+A*1\n",
+ "thus, Y= ~A\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 1.13.a - PG NO:15"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 1.13(a)#\n",
+ "#clears the screen#\n",
+ "#clears already existing variables#\n",
+ "print('If we connect one input of EX-NOR gate to 0 permanently, we observe that Y=A*0+A*0')\n",
+ "print('thus, Y= ~A')"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "If we connect one input of EX-NOR gate to 0 permanently, we observe that Y=A*0+A*0\n",
+ "thus, Y= ~A\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 1.13.b- PG NO:15"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 1.13(b)#\n",
+ "#clears the screen#\n",
+ "#clears already existing variables#\n",
+ "print('If we connect one input of EX-NOR gate to 1 permanently, we observe that Y=A*1+A*1')\n",
+ "print('thus, Y=A')"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "If we connect one input of EX-NOR gate to 1 permanently, we observe that Y=A*1+A*1\n",
+ "thus, Y=A\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/sample_notebooks/srinivasparupalli/CHAPTER_3.ipynb b/sample_notebooks/srinivasparupalli/CHAPTER_3.ipynb new file mode 100755 index 00000000..b5416e8b --- /dev/null +++ b/sample_notebooks/srinivasparupalli/CHAPTER_3.ipynb @@ -0,0 +1,310 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:f24ed387c9c220910a22c3b53359904a6b96b4e1c0307b247f6eff7ab0a91f27"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER 3 - Semiconductor devices switching mode operation"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 3.3 -PG NO.88"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#page no.88\n",
+ "#example 3.3#\n",
+ "#clears the screen#\n",
+ "#clears already existing varibales#\n",
+ "a=10.#\n",
+ "#input voltage (in volts)#\n",
+ "b=.7#\n",
+ "#transistor voltage(saturation voltage)#\n",
+ "c=5.#\n",
+ "#resistor b/w input voltage and the transistor#\n",
+ "d=10.#\n",
+ "#input voltage from collector side#\n",
+ "e=0.1#\n",
+ "#transistor voltage(saturation voltage from collector side)#\n",
+ "f=2.#\n",
+ "#resistor in kilo-ohm#\n",
+ "g=30.#\n",
+ "h=-10.#\n",
+ "#input voltage from emitter side#\n",
+ "I=(a-b)/c#\n",
+ "#base current of transistor from given figure#\n",
+ "print('the base current of given circuit is (in mA):')\n",
+ "print(I)\n",
+ "#base current is in mA#\n",
+ "K=(d-e)/f\n",
+ "#collector current of transistor from given figure#\n",
+ "print('the collector current of given circuit is (in mA):')\n",
+ "print(round(K))\n",
+ "#collector current in mA(saturation current)#\n",
+ "L=K/g\n",
+ "print('base current required for the transistor to be in saturation is (in mA):')\n",
+ "print(L)\n",
+ "#current in mA#\n",
+ "M=(h-b)/c\n",
+ "print('the base current is (in mA):')\n",
+ "print(M)\n",
+ "#base current in mA#"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the base current of given circuit is (in mA):\n",
+ "1.86\n",
+ "the collector current of given circuit is (in mA):\n",
+ "5.0\n",
+ "base current required for the transistor to be in saturation is (in mA):\n",
+ "0.165\n",
+ "the base current is (in mA):\n",
+ "-2.14\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 3.4.a- PG NO.95"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#page no. 95\n",
+ "#example 3.4(a)#\n",
+ "#clears the screen#\n",
+ "#clears already existing variables#\n",
+ "print('when the input voltage V(i)= -5V, the JFET is opening at point A, where I(D)=0 and V(0)=V(DD)=20V')\n",
+ "print('this corresponds to the switch in OFF state')"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "when the input voltage V(i)= -5V, the JFET is opening at point A, where I(D)=0 and V(0)=V(DD)=20V\n",
+ "this corresponds to the switch in OFF state\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 3.4.b- PG NO. 95"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#page no. 95\n",
+ "#example 3.4(b)#\n",
+ "#clears the screen#\n",
+ "#clears the command window#\n",
+ "print('when V(i)=0V, the JFET is operating at point B, where I(D)=3.8mA and V(0)=1V')\n",
+ "print('this corresponds to the switch in ON state')\n",
+ "#the answers have been taken directly from the figure#"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "when V(i)=0V, the JFET is operating at point B, where I(D)=3.8mA and V(0)=1V\n",
+ "this corresponds to the switch in ON state\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 3.5.a - PG NO.96"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#page no. 96\n",
+ "#example 3.5(a)#\n",
+ "#clears the window#\n",
+ "#clears already existing variables#\n",
+ "print('when V(i)=0, the transistor is cutoff because the voltage between the gate and the source is below the threshold voltage. Correspondingly the output voltage V(0)=5V(point (N) as in figure)')\n",
+ "#answer according to the cuts of load line#"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "when V(i)=0, the transistor is cutoff because the voltage between the gate and the source is below the threshold voltage. Correspondingly the output voltage V(0)=5V(point (N) as in figure)\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 3.5.b -PG NO.96"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#page 96\n",
+ "#example 3.5(b)#\n",
+ "#clears the window#\n",
+ "#clears already existing variables#\n",
+ "print('when V(i)=5V, the transistor is operating at point M and V(0)=0')\n",
+ "print('this corresponds to ON state!')"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "when V(i)=5V, the transistor is operating at point M and V(0)=0\n",
+ "this corresponds to ON state!\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 3.7.a - PG NO. 97"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#page no. 97\n",
+ "#example 3.7(a)#\n",
+ "#clears the screen#\n",
+ "#clears existing variables#\n",
+ "print('when V(i)=0, the transistor T(1) is operating at point B')\n",
+ "t=5.#\n",
+ "#input voltage as given in question#\n",
+ "x=0.#\n",
+ "V=t-x#\n",
+ "#output voltage in volts#\n",
+ "print('here V(0)(in volts)=')\n",
+ "print(V)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "when V(i)=0, the transistor T(1) is operating at point B\n",
+ "here V(0)(in volts)=\n",
+ "5.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 3.7.b - PG NO. 97"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#page no.97\n",
+ "#example 3.7(b)#\n",
+ "#clears the screen#\n",
+ "#clears already existing variables#\n",
+ "print('when V(i)=5V, the transistor T(1) is operating at point C')\n",
+ "V=0#\n",
+ "print('output voltage in volts=')\n",
+ "print(V)\n",
+ "#all the outcomes are as per the diagram#"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "when V(i)=5V, the transistor T(1) is operating at point C\n",
+ "output voltage in volts=\n",
+ "0\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/sample_notebooks/vivekkumargupta/Chapter1.ipynb b/sample_notebooks/vivekkumargupta/Chapter1.ipynb new file mode 100755 index 00000000..7cc7b973 --- /dev/null +++ b/sample_notebooks/vivekkumargupta/Chapter1.ipynb @@ -0,0 +1,561 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:04b8728a2a112ab03efb0f888eacfe0c6847d92d7043fbf038fc0d7708b1bf9e"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter1-Introduction of Electronic Device"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg34"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Ex1.1\n",
+ "#calcualte fusing current for given values\n",
+ "import math\n",
+ "print(\"I = K(d^1.5)\") ##formula used for fusing current\n",
+ "d=0.0031\n",
+ "print\"%s %.3f %s\"%(\"d = \",d,\"inches\") ##initializing values of diameter\n",
+ "I1=10244*(d**1.5);\n",
+ "I2=7585*(d**1.5);\n",
+ "I3=5320*(d**1.5); \n",
+ "I4=3148*(d**1.5); I5=1642*(d**1.5) ##calculation for fusing current\n",
+ "print\"%s %.2f %s\"%(\"for Copper, I = 10244*(d^1.5) = \",I1,\"Amp.\")\n",
+ "print\"%s %.2f %s\"%(\"for Aluminum, I = 7585*(d^1.5) = \",I2,\"Amp.\")\n",
+ "print\"%s %.2f %s\"%(\"for Silver, I = 5320*(d^1.5) = \",I3,\"Amp.\")\n",
+ "print\"%s %.2f %s\"%(\"for Iron, I = 3148*(d^1.5) = \",I4,\"Amp.\")\n",
+ "print\"%s %.2f %s\"%(\"for Tin, I = 1642*(d^1.5) = \",I5,\"Amp.\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "I = K(d^1.5)\n",
+ "d = 0.003 inches\n",
+ "for Copper, I = 10244*(d^1.5) = 1.77 Amp.\n",
+ "for Aluminum, I = 7585*(d^1.5) = 1.31 Amp.\n",
+ "for Silver, I = 5320*(d^1.5) = 0.92 Amp.\n",
+ "for Iron, I = 3148*(d^1.5) = 0.54 Amp.\n",
+ "for Tin, I = 1642*(d^1.5) = 0.28 Amp.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg34"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Ex1.2\n",
+ "#calculate fusing current for given values\n",
+ "print(\"fusing current, I = K(d**1.5) Amp.\")##formula used for fusing current\n",
+ "d=0.0201\n",
+ "print\"%s %.2f %s\"%(\"d = \",d,\"inches\") ##initializing value of diameter\n",
+ "I1=10244*(d**1.5);I2=7585*(d**1.5); I3=5320*(d**1.5); I4=3148*(d**1.5); I5=1642*(d**1.5) ##calculation for fusing current\n",
+ "print\"%s %.2f %s\"%(\"for Copper, I = 10244*(d**1.5) = \",I1,\"Amp.\")\n",
+ "print\"%s %.2f %s\"%(\"for Aluminum, I = 7585*(d**1.5) = \",I2,\"Amp.\")\n",
+ "print\"%s %.2f %s\"%(\"for Silver, I = 5320*(d**1.5) = \",I3,\"Amp.\")\n",
+ "print\"%s %.2f %s\"%(\"for Iron, I = 3148*(d**1.5) = \",I4,\"Amp.\")\n",
+ "print\"%s %.2f %s\"%(\"for Tin, I = 1642*(d**1.5) = \",I5,\"Amp.\")\n",
+ "\n",
+ "\n",
+ "## note : calculation for fusing current of Iron is wrong.\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "fusing current, I = K(d**1.5) Amp.\n",
+ "d = 0.02 inches\n",
+ "for Copper, I = 10244*(d**1.5) = 29.19 Amp.\n",
+ "for Aluminum, I = 7585*(d**1.5) = 21.61 Amp.\n",
+ "for Silver, I = 5320*(d**1.5) = 15.16 Amp.\n",
+ "for Iron, I = 3148*(d**1.5) = 8.97 Amp.\n",
+ "for Tin, I = 1642*(d**1.5) = 4.68 Amp.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg35"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Ex1.3\n",
+ "#calculate for fusing current in all four cases\n",
+ "import math\n",
+ "print(\"fusing current, I = K(d**1.5) Amp.\") ##formula used for fusing current\n",
+ "print(\"(a)\") \n",
+ "d=0.0159\n",
+ "print\"%s %.2f %s\"%(\"d = \",d,\"inches\") ##initializing value of diameter\n",
+ "I1=10244*(d**1.5);I2=7585*(d**1.5); I3=5320*(d**1.5); I4=3148*(d**1.5); I5=1642*(d**1.5) ##calculation for fusing current\n",
+ "print\"%s %.2f %s\"%(\"for Copper, I = 10244*(d**1.5) = \",I1,\"Amp.\")\n",
+ "print\"%s %.2f %s\"%(\"for Aluminum, I = 7585*(d**1.5) = \",I2,\"Amp.\")\n",
+ "print\"%s %.2f %s\"%(\"for Silver, I = 5320*(d**1.5) = \",I3,\"Amp.\")\n",
+ "print\"%s %.2f %s\"%(\"for Iron, I = 3148*(d**1.5) = \",I4,\"Amp.\")\n",
+ "print\"%s %.2f %s\"%(\"for Tin, I = 1642*(d**1.5) = \",I5,\"Amp.\")\n",
+ "\n",
+ "\n",
+ "print(\"(b)\")\n",
+ "d=0.0063\n",
+ "print\"%s %.2f %s\"%(\"d = \",d,\"inches\") ##initializing value of diameter\n",
+ "I1=10244*(d**1.5);I2=7585*(d**1.5); I3=5320*(d**1.5); I4=3148*(d**1.5); I5=1642*(d**1.5) ##calculation for fusing current\n",
+ "print\"%s %.2f %s\"%(\"for Copper, I = 10244*(d**1.5) = \",I1,\"Amp.\")\n",
+ "print\"%s %.2f %s\"%(\"for Aluminum, I = 7585*(d**1.5) = \",I2,\"Amp.\")\n",
+ "print\"%s %.2f %s\"%(\"for Silver, I = 5320*(d**1.5) = \",I3,\"Amp.\")\n",
+ "print\"%s %.2f %s\"%(\"for Iron, I = 3148*(d**1.5) = \",I4,\"Amp.\")\n",
+ "print\"%s %.2f %s\"%(\"for Tin, I = 1642*(d**1.5) = \",I5,\"Amp.\")\n",
+ "\n",
+ "\n",
+ "print(\"(c)\")\n",
+ "d=0.0403\n",
+ "print\"%s %.2f %s\"%(\"d = \",d,\"inches\") ##initializing value of diameter\n",
+ "I1=10244*(d**1.5);I2=7585*(d**1.5); I3=5320*(d**1.5); I4=3148*(d**1.5); I5=1642*(d**1.5) ##calculation for fusing current\n",
+ "print\"%s %.2f %s\"%(\"for Copper, I = 10244*(d**1.5) = \",I1,\"Amp.\")\n",
+ "print\"%s %.2f %s\"%(\"for Aluminum, I = 7585*(d**1.5) = \",I2,\"Amp.\")\n",
+ "print\"%s %.2f %s\"%(\"for Silver, I = 5320*(d**1.5) = \",I3,\"Amp.\")\n",
+ "print\"%s %.2f %s\"%(\"for Iron, I = 3148*(d**1.5) = \",I4,\"Amp.\")\n",
+ "print\"%s %.2f %s\"%(\"for Tin, I = 1642*(d**1.5) = \",I5,\"Amp.\")\n",
+ "\n",
+ "\n",
+ "print(\"(d)\")\n",
+ "d=0.0452\n",
+ "print\"%s %.2f %s\"%(\"d = \",d,\"inches\") ##initializing value of diameter\n",
+ "I1=10244*(d**1.5);I2=7585*(d**1.5); I3=5320*(d**1.5); I4=3148*(d**1.5); I5=1642*(d**1.5) ##calculation for fusing current\n",
+ "print\"%s %.2f %s\"%(\"for Copper, I = 10244*(d**1.5) = \",I1,\"Amp.\")\n",
+ "print\"%s %.2f %s\"%(\"for Aluminum, I = 7585*(d**1.5) = \",I2,\"Amp.\")\n",
+ "print\"%s %.2f %s\"%(\"for Silver, I = 5320*(d**1.5) = \",I3,\"Amp.\")\n",
+ "print\"%s %.2f %s\"%(\"for Iron, I = 3148*(d**1.5) = \",I4,\"Amp.\")\n",
+ "print\"%s %.2f %s\"%(\"for Tin, I = 1642*(d**1.5) = \",I5,\"Amp.\")\n",
+ "\n",
+ "\n",
+ "print(\"(e)\")\n",
+ "d=0.0508\n",
+ "print\"%s %.2f %s\"%(\"d = \",d,\"inches\") ##initializing value of diameter\n",
+ "I1=10244*(d**1.5);I2=7585*(d**1.5); I3=5320*(d**1.5); I4=3148*(d**1.5); I5=1642*(d**1.5) ##calculation for fusing current\n",
+ "print\"%s %.2f %s\"%(\"for Copper, I = 10244*(d**1.5) = \",I1,\"Amp.\")\n",
+ "print\"%s %.2f %s\"%(\"for Aluminum, I = 7585*(d**1.5) = \",I2,\"Amp.\")\n",
+ "print\"%s %.2f %s\"%(\"for Silver, I = 5320*(d**1.5) = \",I3,\"Amp.\")\n",
+ "print\"%s %.2f %s\"%(\"for Iron, I = 3148*(d**1.5) = \",I4,\"Amp.\")\n",
+ "print\"%s %.2f %s\"%(\"for Tin, I = 1642*(d**1.5) = \",I5,\"Amp.\")\n",
+ "\n",
+ "\n",
+ "print(\"(f)\")\n",
+ "d=0.162\n",
+ "print\"%s %.2f %s\"%(\"d = \",d,\"inches\") ##initializing value of diameter\n",
+ "I1=10244*(d**1.5);I2=7585*(d**1.5); I3=5320*(d**1.5); I4=3148*(d**1.5); I5=1642*(d**1.5) ##calculation for fusing current\n",
+ "print\"%s %.2f %s\"%(\"for Copper, I = 10244*(d**1.5) = \",I1,\"Amp.\")\n",
+ "print\"%s %.2f %s\"%(\"for Aluminum, I = 7585*(d**1.5) = \",I2,\"Amp.\")\n",
+ "print\"%s %.2f %s\"%(\"for Silver, I = 5320*(d**1.5) = \",I3,\"Amp.\")\n",
+ "print\"%s %.2f %s\"%(\"for Iron, I = 3148*(d**1.5) = \",I4,\"Amp.\")\n",
+ "print\"%s %.2f %s\"%(\"for Tin, I = 1642*(d**1.5) = \",I5,\"Amp.\")\n",
+ "\n",
+ "\n",
+ "\n",
+ "## note : in part (e) ... calculation for fusing current of silver is wrong.\n",
+ "## note : in part (f) ... calculation for fusing current of Iron is wrong.\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "fusing current, I = K(d**1.5) Amp.\n",
+ "(a)\n",
+ "d = 0.02 inches\n",
+ "for Copper, I = 10244*(d**1.5) = 20.54 Amp.\n",
+ "for Aluminum, I = 7585*(d**1.5) = 15.21 Amp.\n",
+ "for Silver, I = 5320*(d**1.5) = 10.67 Amp.\n",
+ "for Iron, I = 3148*(d**1.5) = 6.31 Amp.\n",
+ "for Tin, I = 1642*(d**1.5) = 3.29 Amp.\n",
+ "(b)\n",
+ "d = 0.01 inches\n",
+ "for Copper, I = 10244*(d**1.5) = 5.12 Amp.\n",
+ "for Aluminum, I = 7585*(d**1.5) = 3.79 Amp.\n",
+ "for Silver, I = 5320*(d**1.5) = 2.66 Amp.\n",
+ "for Iron, I = 3148*(d**1.5) = 1.57 Amp.\n",
+ "for Tin, I = 1642*(d**1.5) = 0.82 Amp.\n",
+ "(c)\n",
+ "d = 0.04 inches\n",
+ "for Copper, I = 10244*(d**1.5) = 82.88 Amp.\n",
+ "for Aluminum, I = 7585*(d**1.5) = 61.36 Amp.\n",
+ "for Silver, I = 5320*(d**1.5) = 43.04 Amp.\n",
+ "for Iron, I = 3148*(d**1.5) = 25.47 Amp.\n",
+ "for Tin, I = 1642*(d**1.5) = 13.28 Amp.\n",
+ "(d)\n",
+ "d = 0.05 inches\n",
+ "for Copper, I = 10244*(d**1.5) = 98.44 Amp.\n",
+ "for Aluminum, I = 7585*(d**1.5) = 72.89 Amp.\n",
+ "for Silver, I = 5320*(d**1.5) = 51.12 Amp.\n",
+ "for Iron, I = 3148*(d**1.5) = 30.25 Amp.\n",
+ "for Tin, I = 1642*(d**1.5) = 15.78 Amp.\n",
+ "(e)\n",
+ "d = 0.05 inches\n",
+ "for Copper, I = 10244*(d**1.5) = 117.29 Amp.\n",
+ "for Aluminum, I = 7585*(d**1.5) = 86.85 Amp.\n",
+ "for Silver, I = 5320*(d**1.5) = 60.91 Amp.\n",
+ "for Iron, I = 3148*(d**1.5) = 36.04 Amp.\n",
+ "for Tin, I = 1642*(d**1.5) = 18.80 Amp.\n",
+ "(f)\n",
+ "d = 0.16 inches\n",
+ "for Copper, I = 10244*(d**1.5) = 667.95 Amp.\n",
+ "for Aluminum, I = 7585*(d**1.5) = 494.57 Amp.\n",
+ "for Silver, I = 5320*(d**1.5) = 346.88 Amp.\n",
+ "for Iron, I = 3148*(d**1.5) = 205.26 Amp.\n",
+ "for Tin, I = 1642*(d**1.5) = 107.06 Amp.\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg37"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Ex1.4\n",
+ "#calculate resistance for given resistivity\n",
+ "import math\n",
+ "A=0.5189*10**-6##wire cross sectional area\n",
+ "rho=1.725*10**-8##resistivity\n",
+ "l=100 ##wire length\n",
+ "print\"%s %.3e %s\"%(\"A =\",A,\"merer square\") \n",
+ "print\"%s %.2e %s\"%(\"rho =\",rho,\"ohm-m\")\n",
+ "print\"%s %.2f %s\"%(\"l =\",l,\"m\")\n",
+ "print\"%s %.2f %s\"%(\"R = rho*l/A = \",rho*l/A,\"ohm\") ##resistance\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "A = 5.189e-07 merer square\n",
+ "rho = 1.73e-08 ohm-m\n",
+ "l = 100.00 m\n",
+ "R = rho*l/A = 3.32 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5-pg38"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Ex1.5\n",
+ "#calculate resistance wire\n",
+ "import math\n",
+ "A=0.2588*10**-6##wire cross-sectional area\n",
+ "rho=1.725*10**-8##resistivity\n",
+ "l=100 ##wire length\n",
+ "print\"%s %.2e %s\"%(\"A =\",A,\"merer square\")\n",
+ "print\"%s %.2e %s\"%(\"rho =\",rho,\"ohm-m\")\n",
+ "print\"%s %.2f %s\"%(\"l =\",l,\"m\")\n",
+ "print\"%s %.2f %s\"%(\"R = rho*l/A = \",rho*l/A,\"ohm\") ##resistance of wire\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "A = 2.59e-07 merer square\n",
+ "rho = 1.73e-08 ohm-m\n",
+ "l = 100.00 m\n",
+ "R = rho*l/A = 6.67 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6-pg39"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Ex1.6\n",
+ "#calculate resistance at temperature at T2\n",
+ "R1 = 14##resistance at temperature T1 \n",
+ "alpha=0.005\n",
+ "T1=20;##initial temperature\n",
+ "T2=120 ##final temperature\n",
+ "print\"%s %.2f %s %.2f %s %.2f %s%.2f %s \"%(\"R1 = \",R1, \"ohm\"and\" alpha = \",alpha,\"\"and \" T1 = \",T1,\"degreeC\"and \"T2 = \",T2,\"degreeC\")\n",
+ "print\"%s %.2f %s\"%(\"R2 = R1(1+(alpha*(T1-T2))) = \",R1*(1+(alpha*(T2-T1))),\"ohm\") ##resistance at temperature T2\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "R1 = 14.00 alpha = 0.01 20.00 T2 = 120.00 degreeC \n",
+ "R2 = R1(1+(alpha*(T1-T2))) = 21.00 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7-pg40"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##EX1.7\n",
+ "#calculate force of electron charge\n",
+ "import math\n",
+ "Ex=3;Ey=4;Ez=2##electric field\n",
+ "e=1.6*10**-19 ##electorn charge\n",
+ "print(\"E = 3ax + 4ay + 2az k V/m\")\n",
+ "print(\"e = 1.6*10**-19 C\")\n",
+ "print\"%s %.2e %s %.2e %s %.2e %s \"%(\" F=eE = \",Ex*e*1000,\"ax + \",Ey*e*1000,\"ay + \",Ez*e*1000,\"az N\") ##force\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "E = 3ax + 4ay + 2az k V/m\n",
+ "e = 1.6*10**-19 C\n",
+ " F=eE = 4.80e-16 ax + 6.40e-16 ay + 3.20e-16 az N \n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex8-pg40"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Ex1.8\n",
+ "#calculate elctric field\n",
+ "import math\n",
+ "F=0.1*10**-12##force applied\n",
+ "e = 1.6*10**-19##electron charge\n",
+ "print\"%s %.2e %s %.2e %s \"%(\"F= \",F,\"N \"and \" e = \",e,\"C\")\n",
+ "print\"%s %.2f %s\"%(\"E = F/e =\",F/e,\"V/m\")##electric field\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "F= 1.00e-13 e = 1.60e-19 C \n",
+ "E = F/e = 625000.00 V/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex9-pg41"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Ex1.9\n",
+ "#calculate charge of electron\n",
+ "import math\n",
+ "F = 3*(10**-12) ##force applied\n",
+ "E = 5*(10**-6) ##electric field\n",
+ "print\"%s %.2e %s\"%(\"F = \",F,\"N\")\n",
+ "print\"%s %.2e %s\"%(\"E = \",E,\"V/m\")\n",
+ "print\"%s %.2e %s\"%(\"Q= F/E = \",F/E,\"C\") ##chage\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "F = 3.00e-12 N\n",
+ "E = 5.00e-06 V/m\n",
+ "Q= F/E = 6.00e-07 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex10-pg44"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Ex1.10\n",
+ "#calculate force \n",
+ "import math\n",
+ "B = 2*10**-6 ##magnetic flux density\n",
+ "V = 4*10**6 ##electron velocity\n",
+ "e= 1.6*10**-19##elcetron charge\n",
+ "print\"%s %.2e %s\"%(\"B =\",B,\"ax wb/m.sq\")\n",
+ "print\"%s %.2f %s\"%(\"V =\",V,\"az m/s\")\n",
+ "print\"%s %.3e %s\"%(\"e = \",e, \"C\")\n",
+ "print\"%s %.2e %s\"%(\"F = e[VxB] =\",e*V*B,\"ay N\")##force\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "B = 2.00e-06 ax wb/m.sq\n",
+ "V = 4000000.00 az m/s\n",
+ "e = 1.600e-19 C\n",
+ "F = e[VxB] = 1.28e-18 ay N\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Ex11-pg44"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Ex1.11\n",
+ "#calculate force on electron due to field\n",
+ "import math\n",
+ "Hx = 1*10**-3 ##magnetic field in x-axis\n",
+ "Hy = 2*10**-3 ##magnetic field in y-axis\n",
+ "V = (4*10**6) ##electron velocity\n",
+ "micro_not=(4*math.pi*(10**-7)) ##permitivity in vaccum\n",
+ "e=1.6*10**-19 ##charge of electorn\n",
+ "print\"%s %.2e %s %.2e %s \"%(\" H = \",Hx,\"ax + \",Hy,\"ay A/m\")\n",
+ "print\"%s %.2f %s\"%(\"V = \",V,\"ay m/s\")\n",
+ "Bx = micro_not*Hx; By = micro_not*Hy ##magnetic flux density\n",
+ "print\"%s %.2e %s %.2e %s \"%(\"B = micro_not*H = \",Bx,\"ax + \",By,\"ay wb/m.sq\")\n",
+ "print\"%s %.2e %s \"%(\"F = e[VxB] = \",e*V*Bx,\"az N\") ##force on electron due to field\n",
+ "\n",
+ "\n",
+ "## note : there is a misprint in the textbook for the above problem\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " H = 1.00e-03 ax + 2.00e-03 ay A/m \n",
+ "V = 4000000.00 ay m/s\n",
+ "B = micro_not*H = 1.26e-09 ax + 2.51e-09 ay wb/m.sq \n",
+ "F = e[VxB] = 8.04e-22 az N \n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file |